Cryptography: CTF Tools
Tools and techniques for CTF cryptography challenges.
===============================================================================================================
CTF-SPECIFIC CRYPTO TOOLS
===============================================================================================================
POP tools
John the Ripper - Password cracking
Hashcat - Advanced password recovery
OpenSSL - Cryptography toolkit
CyberChef - Web-based crypto operationsInstallation#
sudo apt install johnUsage Examples:#
john --format=raw-md5 hash.txt # Crack MD5 hash
john --wordlist=rockyou.txt hash.txt # Use wordlist
john --show hash.txt # Show cracked passwordsWhat it does: Password cracker - kayt9leb 3la passwords using dictionary attacks, brute force.
RSA attacks#
git clone https://github.com/ius/rsatool.git (opens in a new tab) git clone https://github.com/Ganapati/RsaCtfTool.git (opens in a new tab) cd RsaCtfTool && pip3 install -r requirements.txt
Various crypto attacks#
git clone https://github.com/hellman/libnum.git (opens in a new tab) cd libnum && python3 setup.py install
ECC attacks#
git clone https://github.com/elliptic-shiho/ecctools.git (opens in a new tab)
Lattice attacks#
git clone https://github.com/jvdsn/crypto-attacks.git (opens in a new tab)
===============================================================================================================
MATHEMATICAL CRYPTO TOOLS
===============================================================================================================
Number theory and mathematics#
sudo apt install sage-mathematics pari-gp
Python mathematical libraries#
pip3 install numpy scipy gmpy2
Factorization tools#
sudo apt install yafu msieve git clone https://github.com/bbuhrow/msieve.git (opens in a new tab) git clone https://github.com/DarkenCode/yafu.git (opens in a new tab)
ENCODING/DECODING TOOLS
===============================================================================================================
Multi-encoding tools#
sudo apt install xxd base58
CyberChef (Swiss Army knife)#
git clone https://github.com/gchq/CyberChef.git (opens in a new tab)
Online version: https://gchq.github.io/CyberChef/ (opens in a new tab)#
Custom encoding scripts#
pip3 install ciphey
===============================================================================================================
PYTHON CRYPTO LIBRARIES
===============================================================================================================
Essential crypto libraries#
pip3 install pycryptodome cryptography
Additional crypto tools#
pip3 install gmpy2 sympy primefac
CTF-specific crypto#
pip3 install pwntools z3-solver angr
Encoding/decoding#
pip3 install base58 base64
Install ALL major crypto libraries#
pip3 install pycryptodome cryptography gmpy2 sympy primefac z3-solver angr pwntools base58
===============================================================================================================
CRACKING & RECOVERY TOOLS
===============================================================================================================
Password Cracking#
sudo apt install john hashcat hashid hash-identifier
Advanced Hash Cracking#
pip3 install hashrat hashcat
PDF Password Removal#
sudo apt install pdfcrack
Office Document Cracking#
sudo apt install office2john
Archive Cracking#
sudo apt install rarcrack pdf2john