Cryptography
How secrets are kept and proved: classical ciphers and how they break, AES and its modes, RSA and Diffie-Hellman with small numbers, and the signatures and certificates behind the browser's lock.
About 12 hours of study
Learning objectives
- Break classical ciphers and state the rules modern ciphers follow
- Choose a safe mode for symmetric encryption
- Build toy RSA keys and run a Diffie-Hellman exchange
- Sign and verify data and walk a certificate chain
Lessons
- 1
Classical ciphers and how they break
The Caesar and Vigenère ciphers, broken by brute force, frequency analysis and repeated patterns, and the rules those breaks taught every modern cipher.
- 2
Symmetric encryption and AES
One key to lock and unlock: what AES does inside a round, why ECB leaks patterns while CBC and GCM do not, and the key-sharing problem symmetric encryption leaves open.
- 3
Public-key encryption with toy RSA
Two keys instead of one: building RSA keys from two primes, encrypting with mᵉ mod n and decrypting with cᵈ mod n, step by step with small numbers, and why real RSA needs huge keys and padding.
- 4
Agreeing on a key: Diffie-Hellman
How two people agree on a secret key over a channel everyone can read, why the discrete logarithm keeps it safe, and why the exchange still needs signatures to stop a man in the middle.
- 5
Digital signatures and certificates
Signing with a private key and checking with the public one, what a signature proves, and how certificates and a chain of trust tell your browser that a public key really belongs to a website.
Module practice
- Caesar shiftEasy
- Vigenère, both waysMedium
- Crack a Caesar cipherHard
- XOR with a key byteEasy
- Spot ECB modeMedium
- A toy cipher in CBC modeHard
- Fast modular powersEasy
- Modular inverseMedium
- Toy RSA, end to endHard
- A Diffie-Hellman exchangeEasy
- Eavesdrop on a tiny exchangeMedium
- A man in the middleHard
- Check signaturesEasy
- Sign messagesMedium
- Walk a certificate chainHard