A comprehensive, one-click tool for breaking RSA encryption using multiple attack vectors. Simply provide a ciphertext and minimal key information, and the tool will attempt all possible attacks to break the encryption.
- Automatic Attack Selection: Tries multiple attack strategies based on the provided parameters
- Key Format Support: Handles various key formats (PEM, certificates, SSH keys, numeric formats)
- Online Factorization: Optional integration with online factorization services
- Multiple Attack Vectors:
- Small prime factor attacks
- Small exponent attacks (cube root when e=3)
- Wiener's attack for small private exponents
- Hastad's broadcast attack
- Common modulus attack
- Franklin-Reiter related message attack
- Advanced factorization methods
- Python 3.6 or higher
- Basic dependencies: None required for core functionality
Install these for enhanced functionality:
pip install gmpy2 cryptography sympy pycryptodome factordb tqdmgmpy2: Faster mathematical operations and root findingcryptography: Better key parsing and handlingsympy: Additional attack implementationspycryptodome: Enhanced cryptographic operationsfactordb: API integration with FactorDBtqdm: Progress bars for long-running operations
The simplest way to use the tool is in auto mode, which requires minimal input:
python rsa_cracker.py --autoThis will prompt you for the necessary information and attempt all possible attacks.
For more control, specify parameters directly:
python rsa_cracker.py --ciphertext 12345... --n 98765... --e 65537Instead of specifying n and e directly, you can provide a key file:
python rsa_cracker.py --ciphertext 12345... --key-file public_key.pemWhen the same message is encrypted with the same small exponent to multiple recipients:
python rsa_cracker.py --multiple-ciphertexts "c1" "c2" "c3" --multiple-moduli "n1" "n2" "n3" --e 3When the same message is encrypted with different exponents but the same modulus:
python rsa_cracker.py --ciphertext "c1" --e "e1" --second-ciphertext "c2" --second-exponent "e2" --n "modulus"# Enable deep scan with more time-consuming attacks
python rsa_cracker.py --ciphertext 12345... --n 98765... --deep-scan
# Disable online factorization services
python rsa_cracker.py --ciphertext 12345... --n 98765... --no-online-lookup
# Set timeout for attack methods
python rsa_cracker.py --ciphertext 12345... --n 98765... --timeout 600
# Control parallel execution
python rsa_cracker.py --ciphertext 12345... --n 98765... --max-workers 8# Save results to a file
python rsa_cracker.py --ciphertext 12345... --n 98765... --output-file results.json
# Choose output format
python rsa_cracker.py --ciphertext 12345... --n 98765... --output-format text --output-file results.txt
# Enable verbose output
python rsa_cracker.py --ciphertext 12345... --n 98765... --verbosePerfect for CTF challenges involving RSA where you have limited information:
python rsa_cracker.py --ciphertext 12345... --n 98765... --e 3 --autoDemonstrates various RSA vulnerabilities for security education:
python rsa_cracker.py --key-file vulnerable_key.pem --ciphertext 12345... --verboseTest the security of RSA implementations:
python rsa_cracker.py --ciphertext 12345... --n 98765... --e 65537 --deep-scan --output-file audit_report.jsonThis tool is designed for educational purposes and security research. It demonstrates known weaknesses in RSA implementations and should not be used to attack systems without proper authorization.
This project is licensed under the MIT License - see the LICENSE file for details.