Substitution ciphers substitute each letter with another letter. They can be cracked by frequency analysis.
Guess cipher: http://quipqiup.com/index.php
View n-grams to help guess letters: subst.py and https://ehsandev.com/pico2014/cryptography/substitution.html
Simple XOR CBC key finding script: bricks_of_gold_csaw_2015.py
Use this script to install a few useful utilities for working with RSA problems. You will need git, python, pip, and virtualenv already installed on your system.
- Small public modulus n - use https://factordb.com/index.php to find p and q.
- Given multiple keys - see if any of the keys have common factors using the Euclidean Algorithm.
- p and q are close to each other - use YAFU or https://www.alpertron.com.ar/ECM.HTM
- Two ciphertexts use the same modulus n but different exponents e - use: same_modulus.py
- Small p or q - use YAFU or https://www.alpertron.com.ar/ECM.HTM
- Large e or d - Wiener’s attack. Use attackrsa tool.
- Same m and e for multiple messages - Hastad’s Broadcast Attack. Use attackrsa tool.
- If num_ciphertexts >= e then you can use Chinese Remainder Theorem to calculate the message (but gcd of all n’s must be 1 - if the gcd between any two n’s is not 1, then you can just find a common factor between them).
- If c < n, just take the eth root of c to get the plaintext.
If you can easily find p and q or d, then you can use this script to decrypt a ciphertext to ASCII.
Here are some commands to transform and work with keys.
python rsatool.py -n 13826123222358393307 -d 9793706120266356337
# cd rsatool
# cd rsatool
./yafu "factor(0xD8E24C12B7B99EFE0A9BC04A6A3DF58A2A944269B492B7376DF129023F2061B9)" -threads 5