Advanced Swiss Army knife for solving cryptography challenges in CTFs and cybersecurity competitions
- Auto-detection of encodings and ciphers
- Intelligent scoring for English text detection
- Extended cipher support (AES, DES, Vigenere with auto-key detection)
- Enhanced RSA toolkit with automatic factoring
- Hash cracking with wordlist support
- Multiple encoding formats (URL, HTML, Binary, Morse)
- Improved error handling and user feedback
- Better performance with optimized algorithms
# Clone the repository
git clone https://github.com/satellacodes/CTF-Crypto-Toolkit.git
cd CTF-Crypto-Toolkit
# Install dependencies
pip3 install pycryptodome
# Make executable
chmod +x ctf_crypto_tool.py# Build Docker image
docker build -t ctf-crypto-toolkit .
# Run in Docker
docker run -it ctf-crypto-toolkit caesar --auto --input "Khoor"./ctf_crypto_tool.py caesar --auto --input "Khoor Zruog"
# Output: Best matches sorted by English probability./ctf_crypto_tool.py xor --auto --input "1a2b3c4d5e"
# Automatically finds the most likely XOR key./ctf_crypto_tool.py rsa --n 3233 --e 17 --c 855 --auto-factor
# Attempts to factor n and decrypt automatically./ctf_crypto_tool.py hash --alg md5 --crack --input "5d41402abc4b2a76b9719d911017c592" --wordlist rockyou.txt./ctf_crypto_tool.py detect --input "SGVsbG8gd29ybGQ="
# Output: Detected encoding: base64- Base Family: Base64 (standard & URL-safe), Base32, Base16, Base85, ASCII85
- Binary Encoding: Text β Binary conversion
- URL Encoding: Percent-encoding/decoding
- HTML Entities: HTML special characters
- Morse Code: International Morse code
- Caesar Cipher: With bruteforce and auto-detection
- ROT Family: ROT-n transformations
- Vigenère Cipher: With Kasiski examination for key detection
- Affine Cipher: Automatic parameter solving
- Substitution Cipher: Frequency analysis
- XOR Operations: Single-byte and multi-byte XOR
- AES: ECB, CBC, CTR modes
- DES: ECB, CBC modes
- RSA Toolkit: Complete parameter handling
- Hash Generation: MD5, SHA1, SHA256, SHA512, SHA3, BLAKE2
- Hash Cracking: Dictionary attacks with wordlists
- Rainbow Tables: Built-in common hash lookup
- Frequency Analysis: Character and bigram analysis
- Entropy Calculation: Measure randomness
- Pattern Detection: Identify cipher types
- Encoding Detection: Auto-detect encoding formats
# Multiple operations in sequence
echo "Hello" | ./ctf_crypto_tool.py base --type b64 | ./ctf_crypto_tool.py caesar --shift 3# Process files directly
./ctf_crypto_tool.py xor --bruteforce --input file:encrypted.bin# JSON output for programmatic use
./ctf_crypto_tool.py caesar --auto --input "Khoor" --json# Encoded message: V2VsY29tZSB0byBDVEY=
./ctf_crypto_tool.py detect --input "V2VsY29tZSB0byBDVEY="
./ctf_crypto_tool.py base --decode --type b64 --input "V2VsY29tZSB0byBDVEY="# Hex data: 1e3b2a4c5d6e
./ctf_crypto_tool.py xor --auto --input "1e3b2a4c5d6e"# Given: n=3233, e=17, c=855
./ctf_crypto_tool.py rsa --n 3233 --e 17 --c 855 --auto-factor- Multi-threading for brute force operations
- Caching of common computations
- Progress indicators for long operations
- Memory-efficient large file handling
- Batch processing support
The toolkit can also be used as a Python library:
from ctf_crypto_tool import solve_caesar, solve_xor, english_score
# Use functions directly
results = solve_caesar("Khoor", auto=True)
best_result = max(results, key=lambda x: x[2])
print(f"Best match: Shift {best_result[0]}, Text: {best_result[1]}")CTF-Crypto-Toolkit/
βββ ctf_crypto_tool.py # Main tool
βββ README.md # Updated documentation
βββ CONTRIBUTING.md # Contribution guidelines
βββ requirements.txt # Dependencies
βββ setup.py # Installation script
βββ .gitignore # Git ignore file
βββ LICENSE # MIT License
βββ examples/ # Challenge examples
β βββ caesar_challenge.txt
β βββ rsa_challenge.txt
β βββ xor_challenge.txt
βββ wordlists/ # Dictionary files
β βββ common_passwords.txt
β βββ rockyou_sample.txt
βββ tests/ # Unit tests
βββ test_caesar.py
βββ test_xor.py
βββ test_integration.py
See CONTRIBUTING.md for guidelines on contributing to this project.
This tool is for:
- CTF competitions and challenges
- Educational purposes
- Security research with proper authorization
Not for:
- Unauthorized access to systems
- Illegal activities
- Production cryptography
All cryptographic implementations are for educational purposes only. Use industry-standard libraries for production systems.
MIT License - See LICENSE for details.
- CyberChef - Web-based cyber operations
- Cryptohack - Cryptography challenges
- CTFtime - CTF competitions calendar
- Awesome CTF - CTF resource collection
Dimas Aris Pangestu - Cybersecurity researcher and CTF enthusiast
Happy Hacking! May your flags be captured and your ciphers broken! π©π
If this tool helped you solve a challenge, consider giving it a star! β
