Aletheia is a command-line tool designed to perform decode or brute-force attacks on common ciphers. It helps you quickly test and decode encrypted text using several classical cryptographic techniques.
The name Aletheia comes from the Greek word meaning truth or unconcealment. The tool aims to reveal hidden messages and uncover the truth behind encrypted text.
- Brute force decryption for multiple classical ciphers
- Simple and intuitive CLI interface
- Useful for CTF's, cryptography learning, and quick cipher analysis
Supported ciphers:
- xor
- atbash
- vigenere
- rail fence
- xor brute force (based on key length)
- rot13 brute force
- rot47 brute force
- affine brute force
- vigenere brute force (based on key length)
- rail fence brute force
- Python3
- pyinstaller (if you need a binary)
Clone the repository and create a binary:
sudo apt-get install python3 pyinstaller
git clone https://github.com/1r0nx/aletheia.git
cd aletheia
chmod +x build.sh
./build.sh
sudo cp dist/aletheia /usr/bin/You can now use it as a simple linux commands!
Or
Clone the repository and make the script executable:
git clone https://github.com/1r0nx/aletheia.git
cd aletheia/src
chmod +x aletheia.py
./aletheia.py❯ aletheia
##
:##: #### ## ##
## #### ## ## ##
#### ## ## ##
#### ## .####: ####### ##.#### .####: #### :####
:# #: ## .######: ####### ####### .######: #### ######
#::# ## ##: :## ## ### :## ##: :## ## #: :##
## ## ## ######## ## ## ## ######## ## :#####
###### ## ######## ## ## ## ######## ## .#######
.######. ## ## ## ## ## ## ## ## . ##
:## ##: ##: ###. :# ##. ## ## ###. :# ## ##: ###
### ### ##### .####### ##### ## ## .####### ######## ########
##: :## .#### .#####: .#### ## ## .#####: ######## ###.##
usage: aletheia [-h] {xor,atbash,vigenere,rail_fence,xor_brute,rot13_brute,rot47_brute,affine_brute,vigenere_brute,rail_fence_brute} ...
decode or brute force some substitution ciphers
positional arguments:
{xor,atbash,vigenere,rail_fence,xor_brute,rot13_brute,rot47_brute,affine_brute,vigenere_brute,rail_fence_brute}
xor decode xor cipher
atbash decode atbash cipher
vigenere decode vigenere cipher
rail_fence decode rail fence cipher
xor_brute brute force xor cipher
rot13_brute brute force rot13 cipher
rot47_brute brute force rot47 cipher
affine_brute brute force affine cipher
vigenere_brute brute force vigenere cipher
rail_fence_brute brute force rail fence cipher
options:
-h, --help show this help message and exit
❯ aletheia xor -s "1f0d10183a10183a1834111c1811" -k key
XOR Result: this_is_a_test❯ aletheia xor -s "1f0d10183a10183a1834111c1811" -k 6B6579
XOR Result: this_is_a_test❯ ./aletheia.py xor -s "1f0d10183a10183a1834111c1811" -k '[107, 101, 121]'
XOR Result: this_is_a_testNote: "[107, 101, 121]" is "key" in ascii
❯ aletheia xor -s "1f0d10183a10183a1834111c1811" -k "011010110110010101111001"
XOR Result: this_is_a_test❯ aletheia atbash -s "gsrh rh zgyzhs xrksvi" Output:
this is atbash cipher❯ aletheia vigenere -s "dlgc mq fmeorcbi astfov" -k keyOutput:
this is vigenere cipher❯ aletheia rail_fence -s "li afre nscie sciirhpeth" -k 12 -o 11Output:
this is rail fence cipherBrute force xor based on key length

❯ aletheia xor_brute -s "1f0d10183a10183a1834111c1811" -l 3 | grep keyOutput:
[+] Total keys to test: 1,000,000
[+] Bruteforcing XOR keys of length 3...
101530 KEY = b'afu' -> b'~key\\ey\\mUwiyw'
...
201434 KEY = b'key' -> b'this_is_a_test'
....
923890 KEY = b'}C{' -> b'bNkeykeycIRgeR'Brute force ROT13 substitution.
./aletheia.py rot13_brute -s "Uryyb Jbeyq"Output:
0: Uryyb Jbeyq
...
...
13: Hello World
...
...
25: Tqxxa Iadxp
Brute force ROT47 transformation.
./aletheia.py rot47_brute -s "w6==@ (@C=5P"Output:
0: w6==@ (@C=5P
...
...
47: Hello World!
...
...
93: v5<<? '?B<4O
Attempts all valid affine key combinations.

./aletheia.py affine_brute -t "Fwrra Yajrt"Output:
a = 1, b = 0 -> Fwrra Yajrt
a = 1, b = 1 -> Evqqz Xziqs
...
...
a = 9, b = 10 -> Hello World
...
...
a = 25, b = 24 -> Tchhy Ayphf
a = 25, b = 25 -> Udiiz Bzqig
Bruteforces possible keys based on length provided. 1 < len(key) < 5.

./aletheia.py vigenere_brute -s "Rijvs Uyvjn" -l 3Output:
[+] Test of 17576 possible keys...
[possible_key=aaa] Rijvs Uyvjn
[possible_key=aab] Riivs Tyvin
...
...
[possible_key=key] Hello World
...
...
[possible_key=zzy] Sjlwt Wzwlo
[possible_key=zzz] Sjkwt VzwkoTests various rail counts and offset.

aletheia rail_fence_brute -s "li afre nscie sciirhpeth"Output:
key = 002 | period = 000 || output = l i sacfirier hnpsectihe
key = 002 | period = 001 || output = el i sacfirier hnpsectih
...
...
key = 012 | period = 011 || output = this is rail fence cipher
...
...
key = 024 | period = 044 || output = ail fre nscie sciirhpeth
key = 024 | period = 045 || output = il afre nscie sciirhpeth
MIT License.
Contributions or suggestions are welcome! Feel free to submit issues or pull requests.

