Read this lesson as text
Real World: Encryption & Security
Math for CS · Axiom Academy
REAL WORLD Encryption & Security Every "padlock" icon in your browser is a tower of modular arithmetic. Here's what the math is actually doing. 1. The HTTPS Handshake — what actually happens When your browser connects to bank.com , here is the dance that happens before a single byte of your password leaves the device. Hello. Browser sends a list of cipher suites it supports plus a random 32-byte nonce. Certificate. Server returns its TLS certificate — a public key signed by a Certificate Authority. The browser verifies the CA's signature using public-key crypto (RSA or ECDSA). Key exchange. Both sides perform an Elliptic Curve Diffie–Hellman exchange to compute a shared secret. The server's contribution is signed with the certificate's key, defeating man-in-the-middle. Key derivation. The shared secret is fed into HKDF (a hash-based key-derivation function) to produce four keys: one for each direction, plus IV material. Bulk encryption. All further traffic is encrypted with AES-256-GCM (or ChaCha20-Poly1305 on mobile). Modern cryptography uses two very different families together, and understanding the split is the single most important thing you can take away from this lesson. Symmetric (AES) — same key both ways
This is the written version of the interactive lesson above. See the full Math for CS course.