CTF思路
点击放大


<p align="center" id="top"><img src="
<h1 align="center">CodExt <a href=" src=" alt="Tweet" height="20"/></a></h1>
<h3 align="center">Encode/decode anything.</h3>
![PyPi]()
![Read The Docs]()
![Build Status]()

![Python ]()
![Known ]()
![DOI]()
![License]()
CodExt is a (Python2-3 compatible) library that extends the native codecs library (namely for adding new custom encodings and character mappings) and provides 120+ new codecs, hence its name combining *CODecs EXTension*. It also features a guess mode for decoding multiple layers of encoding and CLI tools for con.
Want to contribute a new codec ? | Want to contribute a new macro ?
:----------------------------------:|:------------------------------------:
Check the documentation first<br>Then PR your new codec | PR your updated of macros.json
<p align="center"><img src=" alt="Using CodExt from the command line"></p>
<p align="center"><img src=" alt="Using base tools from the command line"></p>
<p align="center"><img src=" alt="Using the unbase command line tool"></p>
baseXX CLI tools) <a href=" src=")--lightgrey?logo=twitter&style=social" alt="Tweet on unbase" height="20"/></a>
Playing with base encodings.
Listing codecs.
Finding a codec based on a name.
Encoding a string.
Encoding a file.
Chaining codecs.
Iteratively guessing decodings.
Getting the list of a codecs.
python
>>> codext.encode("this is a test", "base58-bitcoin")
'jo91waLQA1NNeBmZKUF'
>>> codext.encode("this is a test", "base58-ripple")
'jo9rA2LQwr44eBmZK7E'
>>> codext.encode("this is a test", "base58-url")
'JN91Wzkpa1nnDbLyjtf'
>>> codecs.encode("this is a test", "base100")
'👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫'
>>> codecs.decode("👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫", "base100")
'this is a test'
python
>>> codext.encode("This is a test !", "")
'Ffaw kj e mowm !'
>>> codext.encode("This is a test !", "autocla")
'Llkj ml t amkb !'
python
>>> for i in range(8):
print(codext.encode("this is a test", "dna-%d" % (i + 1)))
GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA
CTCACGGACGGCCTATAGAACGGCCTATAGAACGACAGAACTCACGCCCTATCTCA
ACAGATTGATTAACGCGTGGATTAACGCGTGGATGAGTGGACAGATAAACGCACAG
AGACATTCATTAAGCGCTCCATTAAGCGCTCCATCACTCCAGACATAAAGCGAGAC
TCTGTAAGTAATTCGCGAGGTAATTCGCGAGGTAGTGAGGTCTGTATTTCGCTCTG
TGTCTAACTAATTGCGCACCTAATTGCGCACCTACTCACCTGTCTATTTGCGTGTC
GAGTGCCTGCCGGATATCTTGCCGGATATCTTGCTGTCTTGAGTGCGGGATAGAGT
CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
>>> codext.decode("GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA", "dna-1")
'this is a test'
>>> codecs.encode("this is a test", "morse")
'- .... .. ... / .. ... / .- / - . ... -'
>>> codecs.decode("- .... .. ... / .. ... / .- / - . ... -", "morse")
'this is a test'
>>> with open("morse.txt", 'w', encoding="morse") as f:
f.write("this is a test")
14
>>> with open("morse.txt",encoding="morse") as f:
f.read()
'this is a test'
>>> print(codext.encode("An example test string", "baudot-tape"))
*.
. *
***.*
* .
.*
* .*
. *
** .*
*.
.
.*
* .
* *. *
.*
* *.
* *. *
* .
* *.
* *. *
***.
*.*
***.*
* .*
``
#### BaseXX
: useless, but for the sake of completeness
: simple con to binary (with a with a re alphabet)
: con to ternary (with a with a re alphabet)
: con to quarternary (with a with a re alphabet)
: simple con to octal (with a with a re alphabet)
: simple con to decimal
: con to digits with a "*a*"
: simple con to hexadecimal (with a holding an alphabet with digits and letters in)
: con to alphabet letters
: classical con according to the RFC4648 with all its (zbase32, extended hexadecimal, geohash, Crockford)
: Base36 con to letters and digits (with a in both groups)
: Base45 DRAFT algorithm (with a in letters and digits)
: multiple of Base58 (bitcoin, flickr, ripple)
: Base62 con to lower- and uppercase letters and digits (with a with letters and digits in)
: similar to base62 with the "_" added
: classical con according to RFC4648 with its URL (or *file*) (it also holds a with letters and digits in)
: custom con using some more special characters (also with a with letters and digits in)
: all of Base85 (Ascii85, z85, Adobe, (x)btoa, RFC1924, XML)
: Base91 custom con
(or *emoji*): Base100 custom con
: Base100 custom con
: see base encodings ; supports any possible base
This category also contains ascii85, adobe, [x]btoa, zeromq with the base85 codec.
#### Binary
: supports CCITT-1, CCITT-2, EU/FR, ITA1, ITA2, MTK-2 (Python3 only), UK, ...
: of baudot ; groups of 5 bits are whitespace-separated
: of baudot ; outputs a string that looks like a perforated tape
: _Binary Coded Decimal_, encodes characters from their (zero-left-padded) ordinals
: of bcd ; encodes characters from their (zero-left-padded) ordinals using prefix bits 0000
: of bcd ; encodes characters from their (zero-left-padded) ordinals using prefix bits 1111
: uses Excess-3 (aka Stibitz code) binary encoding to convert characters from their ordinals
: aka reflected binary code
: XORes each bit of the input with 01
: of manchester ; XORes each bit of the input with 10
: rotates characters by the specified number of bits (*N* belongs to [1, 7] ; Python 3 only)
#### Checksums
: Adler32 algorithm (relies on zlib)
: CRC of lengths 8, 10-17, 21, 24, 30-32, 40, 64, 82 with a of polynoms
: Luhn mod N algorithm
#### Common
: keeps words whitespace-separated and uses a custom character separator
: set of case-related encodings (including camel-, kebab-, lower-, pascal-, upper-, snake- and swap-case, slugify, capitalize, title)
: set of simple encodings (including integer, replace, reverse, word-reverse, substite and strip-spaces)
: dummy octal con (converts to 3-digits groups)
: of octal ; dummy octal con, handling whitespace separators
: dummy character ordinals con (converts to 3-digits groups)
: of ordinal ; dummy character ordinals con, handling whitespace separators
#### Compression
: standard Gzip compression/decompression
: compresses the given data with the algorithm of Lempel and Ziv of 1977
: compresses the given data with the algorithm of Lempel and Ziv of 1978
: standard Zip-deflate compression/decompression
: standard BZip2 compression/decompression
: standard LZMA compression/decompression
> :warning: Compression functions are of course definitely NOT encoding functions ; they are implemented for le the .encode(...) API from codecs.
#### Cryptography
: aka Affine Cipher
: aka Atbash Cipher
: aka Autocla Cipher ( of Cipher)
: aka Baconian Cipher
: aka Barbie Typewriter (*N* belongs to [1, 4])
: aka Beaufort Cipher ( of Cipher)
: aka Citrix CTX1 password encoding
: aka Playfair Cipher
: aka Phillips Cipher (polyalphabetic block cipher with 8 key squares)
: aka Polybius Square Cipher
: aka Rail Fence Cipher
: aka Caesar cipher (*N* belongs to [1,25])
: encrypts using the number of letters on the rod (*N* belongs to [1,[)
: shift ordinals (*N* belongs to [1,255])
: aka Trithemius Cipher ( of Cipher)
: aka
: aka Cipher
: XOR with a single byte (*N* belongs to [1,255])
> :warning: Crypto functions are of course definitely NOT encoding functions ; they are implemented for le the .encode(...) API from codecs.
#### Hashing
: includes BLAKE2b and BLAKE2s (Python 3 only ; relies on hashlib)
: Unix's crypt hash for passwords (Python 3 and Unix only ; relies on crypt)
: aka Message Digest ; includes MD4 and MD5 (relies on hashlib)
: aka Secure Hash Algorithms ; includes SHA1, 224, 256, 384, 512 (Python2/3) but also SHA3-224, -256, -384 and -512 (Python 3 only ; relies on hashlib)
: aka SHAKE hashing (Python 3 only ; relies on hashlib)
> :warning: Hash functions are of course definitely NOT encoding functions ; they are implemented for con with the .encode(...) API from codecs and useful for chaning codecs.
#### Languages
: well-known braille language (Python 3 only)
: aka lorem ipsum
: aka galactic alphabet or Minecraft enchantment language (Python 3 only)
: based on minimalistic elite speaking rules
: uses whitespace as a separator
: only handles letters (not full words from the Navajo dictionary)
: aka NATO or radio phonetic alphabet
: converts letters to Kenny's language from Southpark (whitespace is also handled)
: case insensiti of southpark
: converts text to tap/knock code, commonly used by prisoners
: similar to morse, using slashes and backslashes
#### Others
: implements the 8 rules of DNA sequences (N belongs to [1,8])
: encodes consonants and/or with their corresponding indices
: unidirectional encoding from Markdown to HTML
#### Steganography
: uses Base64 and encodes the result to a charset of I Ching hexagrams (as implemented here)
: aka Klopf code ; Polybius square with trivial alphabetical distribution
: aka resistor color codes
: aka Rick cipher (in reference to Rick Astley's song "*Ne give you up*")
: also called _T9 code_ ; uses "-" as a separator for encoding, "-" or "_" or whitespace for decoding
: replaces bits with whitespaces and tabs
: of whitespace ; encodes characters as new characters with whitespaces before and after according to an equation described in the codec name (e.g. "whitespace+2*after-3*before")
#### Web
: implements entities according to this reference
![Stargazers repo roster for /python-codext]()
![Forkers repo roster for /python-codext]()
<p align="center"><a href="#top"><img src=" alt="Back to top" height="20"/></a></p>
开发语言:Python
Star 数:304
该项目属于CTF思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Python codecs extension featuring CLI tools for encoding/decoding anything展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | python-codext - Python codecs extension featuring CLI tools for en |
| 所属分类 | CTF思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 23:43:56 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 373 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |