@@ -43,7 +43,7 @@ $ echo -en "test" | codext encode base100
4343👫👜👪👫
4444```
4545
46- ### Chaining codecs
46+ ### : chains : Chaining codecs
4747
4848``` sh
4949$ echo -en " Test string" | codext encode reverse
@@ -62,7 +62,7 @@ $ echo -en "AGTCAGTCAGTGAGAAAGTCAGTGAGAAAGTGAGTGAGAAAGTGAGTCAGTGAGAAAGTCAGAAAGTG
6262test string
6363```
6464
65- ### Using macros
65+ ### : twisted_rightwards_arrows : Using macros
6666
6767``` sh
6868$ codext add-macro my-encoding-chain gzip base63 lzma base64
@@ -79,7 +79,9 @@ $ codext list macros
7979example-macro
8080```
8181
82- ## :computer : Usage (base CLI tool) <a href =" https://twitter.com/intent/tweet?text=UnBase%20-%20Decode%20any%20multi-layer%20base-encoded%20string.%0D%0APython%20tool%20for%20decoding%20any%20base-encoded%20string,%20even%20when%20encoded%20with%20multiple%20layers.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdhondta%2fpython-codext%0D%0A&hashtags=python,base,encodings,codecs,cryptography,stegano,steganography,ctftools " ><img src =" https://img.shields.io/badge/Tweet%20(unbase)--lightgrey?logo=twitter&style=social " alt =" Tweet on unbase " height =" 20 " /></a >
82+ ## :desktop_computer : Usage (` baseXX ` CLI tools) <a href =" https://twitter.com/intent/tweet?text=UnBase%20-%20Decode%20any%20multi-layer%20base-encoded%20string.%0D%0APython%20tool%20for%20decoding%20any%20base-encoded%20string,%20even%20when%20encoded%20with%20multiple%20layers.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdhondta%2fpython-codext%0D%0A&hashtags=python,base,encodings,codecs,cryptography,stegano,steganography,ctftools " ><img src =" https://img.shields.io/badge/Tweet%20(unbase)--lightgrey?logo=twitter&style=social " alt =" Tweet on unbase " height =" 20 " /></a >
83+
84+ Playing with base encodings.
8385
8486``` session
8587$ echo "Test string !" | base122
@@ -106,16 +108,73 @@ $ echo "Test string !" | base91 | base85 | base36 | base58-flickr | unbase -f Te
106108Test string !
107109```
108110
109- ## :computer : Usage (Python)
111+ ## :computer : Usage (CLI)
112+
113+ Listing codecs.
114+
115+ ``` session
116+ $ codext list encodings
117+ a1z26 adler32 affine alternative-rot ascii
118+ atbash autoclave bacon barbie base
119+ base1 base2 base3 base4 base8
120+ <<snipped>>
121+ ```
122+
123+ Finding a codec based on a name.
124+
125+ ``` session
126+ $ codext search bitcoin
127+ base58
128+ ```
129+
130+ Encoding a string.
110131
111- Getting the list of available codecs:
132+ ``` sesssion
133+ $ echo -en "This is a test" | codext encode polybius
134+ 44232443 2443 11 44154344
135+ ```
136+
137+ Encoding a file.
138+
139+ ``` session
140+ $ echo -en "this is a test" > to_be_encoded.txt
141+ $ codext encode base64 < to_be_encoded.txt > text.b64
142+ $ cat text.b64
143+ dGhpcyBpcyBhIHRlc3Q=
144+ ```
145+
146+ Chaining codecs.
147+
148+ ``` session
149+ $ echo -en "mrdvm6teie6t2cq=" | codext encode upper | codext decode base32 | codext decode base64
150+ test
151+ ```
152+
153+ Iteratively guessing decodings.
154+
155+ ``` session
156+ $ echo -en "test" | codext encode base64 gzip | codext guess
157+ Codecs: gzip
158+ dGVzdA==
159+ $ echo -en "test" | codext encode base64 gzip | codext guess gzip -i base
160+ Codecs: gzip, base64
161+ test
162+ ```
163+
164+
165+ ## :snake : Usage (Python)
166+
167+ Getting the list of available codecs.
112168
113169``` python
114170>> > import codext
115171
116172>> > codext.list()
117173[' ascii85' , ' base85' , ' base100' , ' base122' , ... , ' tomtom' , ' dna' , ' html' , ' markdown' , ' url' , ' resistor' , ' sms' , ' whitespace' , ' whitespace-after-before' ]
118174
175+ Playing with some base encodings.
176+
177+ ```python
119178>> > codext.encode(" this is a test" , " base58-bitcoin" )
120179' jo91waLQA1NNeBmZKUF'
121180
@@ -130,7 +189,21 @@ Getting the list of available codecs:
130189
131190>> > codecs.decode(" 👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫" , " base100" )
132191' this is a test'
192+ ```
193+
194+ Playing with some cryptography-based codecs.
133195
196+ ``` python
197+ >> > codext.encode(" This is a test !" , " vigenere-MYSECRETKET" )
198+ ' Ffaw kj e mowm !'
199+
200+ >> > codext.encode(" This is a test !" , " autoclave-SECRET" )
201+ ' Llkj ml t amkb !'
202+ ```
203+
204+ Encoding/decoding with various other codecs.
205+
206+ ``` python
134207>> > for i in range (8 ):
135208 print (codext.encode(" this is a test" , " dna-%d " % (i + 1 )))
136209GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA
@@ -158,30 +231,6 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
158231 f.read()
159232' this is a test'
160233
161- >> > codext.decode("""
162- =
163- X
164- :
165- x
166- n
167- r
168- y
169- Y
170- y
171- p
172- a
173- `
174- n
175- |
176- a
177- o
178- h
179- `
180- g
181- o
182- z """ , " whitespace-after+before" )
183- ' CSC{not_so_invisible}'
184-
185234>> > print (codext.encode(" An example test string" , " baudot-tape" ))
186235*** .**
187236 . *
0 commit comments