Crypto 102: How to break crypto in practice
Batman’s Kitchen 2025 | Dhruv Ashok
“There are tens, probably hundreds, of obscure little things you can do to take a cryptosystem that should be secure even against an adversary with more CPU cores than there are atoms in the solar system, and make it solvable with a Perl script and 15 seconds.” - Cryptopals
Review/Preliminaries
Crypto 101 Recap
Trapdoor functions
Modular arithmetic
Asymmetric cryptosystems
RSA (keygen)
RSA ({en,de}cryption)
RSA (proof of correctness)
First, c^d = (m^e)^d = m^{e*d}. Now, consider that since e*d ≣ 1 (mod ɸ(N)), we have by modular arithmetic that e*d = 1 + k*ɸ(N) for some positive integer k. It follows that m^{e*d} = m^{1 + k*ɸ(N)} = m^1 * m^{k*ɸ(N)} = m * (m^{ɸ(N)})^k. Now, recall that by Fermat’s Little Theorem, since m is coprime to ɸ(N), it follows that m^{ɸ(N)} ≣ 1 (mod N). Hence, m * (m^{ɸ(N)})^k = m * 1^k = m, completing the proof.
RSA: CTF example 1 (small N)
RSA: CTF example 2 (bad prime selection)
RSA: further attacks
RSA: signature scheme
Diffie Hellman
ECDH
(EC)DSA (and a cool attack on it I did)
Symmetric cryptosystems
AES: ECB review
AES: CBC review
AES: PKCS7 Padding
AES: padding oracle attack on CBC
AES: bit flipping attack on CBC
Authenticated Encryption
Crypto, modulo this talk (i.e., all the stuff not in this talk)
Crypto 103 when?
Thank you!