Secrets & Trust
Ciphers and the number theory under them, then hashes, keys, signatures, certificates, and the handshake that puts them on the wire.
Security & Cryptography · Math Foundations
Before you start
Some lessons here build on lessons from other arcs: Entropy: Measuring Information, Counting with Switches, Hamming Codes: Fixing a Flipped Bit.
- 1
Ciphers and Perfect Secrecyin review
Security · Cryptography · ~20 minShift each letter by the key letter under it: one letter is Caesar, a word is Vigenere, a random key as long as the text is the one-time pad. Letter counts break the first; bit counts save the last.
- 2
Modular Arithmetic: The Clock and Fast Powersin review
Math · Number Theory · ~20 minEvery number lands on an hour of a clock with m hours, and sums, products, and powers stay there. Squaring takes a 300-bit power in 600 steps; Fermat's theorem tells a prime clock from a composite.
- 3
Euclid's Algorithm: GCD, Bezout, and the Inversein review
Math · Number Theory · ~20 minDivide the larger by the smaller, keep the remainder, repeat: the last divisor is the gcd. Run backwards, the divisions write it as ax + my, and when it is 1, x is the inverse of a on the clock.
- 4
Hash Functions: Avalanche and Integrityin review
Security · Cryptography · ~25 minPad a message, absorb it word by word in a state that is mixed and chained, and the final state is its fingerprint. Flip one bit and half the digest changes: so a receiver knows nothing moved.
- 5
Password Storage: Salt and Slow Hashesin review
Security · Foundations · ~20 minA server keeps a digest, not the password. Unsalted, every common password is already in the attacker's table; a salt makes each record its own puzzle, and stretching makes each guess cost a login.
- 6
Block Ciphers: Rounds and Modesin review
Security · Cryptography · ~25 minA block cipher is a keyed permutation of 16-bit blocks: round key, S-box, bit transpose, repeat. Encrypt a picture block by block and codebook mode leaves its shape showing; chaining takes it away.
- 7
Diffie-Hellman: A Secret over a Public Wirein review
Security · Cryptography · ~25 minAlice and Bob each raise a public generator to a private exponent and swap the results; raising what they got to their own exponent gives both one key. Eve saw it all and still needs an exponent.
- 8
RSA: A Lock Anyone Can Closein review
Security · Cryptography · ~25 minTwo primes make a public modulus and a secret totient; a public exponent gets a private inverse by Euclid. Anyone can raise a message to e, only the owner can undo it, and an attacker must factor n.
- 9
Digital Signatures: Hash, then Signin review
Security · Cryptography · ~20 minHash the message, raise the digest to the private exponent, send both. Anyone raises the signature to the public exponent and compares with a fresh digest; any changed letter, bit, or key fails.
- 10
Certificates: A Chain of Signaturesin review
Security · Trust & Protocols · ~20 minA certificate is a signature over a name, a key, and a validity window. A chain of them leads from a server's key to a root the verifier trusts, and one failed check anywhere breaks the chain.
- 11
The TLS Handshakein review
Security · Trust & Protocols · ~30 minHellos swap key shares, the certificate names the key, a signature over the transcript proves who is talking, and Finished proves the keys. Put Eve in the middle and watch where it stops.
- 12
Zero-Knowledge Proofsin review
Security · Cryptography · ~25 minCommit, take a coin, answer. A prover who knows x passes every round, a cheater is caught half the time per round, and rounds faked with no secret verify just the same.