About this course
A break-it-then-build-it course: no memorizing definitions, no proof-grinding. In every
session an AI mentor walks you through writing an attack, running it, and watching ciphertext
shatter into plaintext in front of you. We start by cracking the weakest toy ciphers —
single-byte XOR falls to frequency analysis in a blink, a repeating key gives away its length
to Hamming distance, a padding oracle decrypts without ever holding the key — so your intuition
grows out of the thrill of breaking things. Once you've broken enough, you turn around and build:
a toy RSA from scratch, a Diffie-Hellman handshake, hashing and HMAC, plus faithful re-creations
of real-world attacks like the e=3 cube root, length extension, and CBC bit-flipping. Everything
is pure-Python stdlib, offline, sub-second, and deterministic — every line you run is one you wrote.
By the end you'll finally know what's inside the box of the HTTPS, JWT, and signatures you use daily.
What you'll learn
- Auto-crack single-byte and repeating-key XOR with frequency analysis, and see why a small key space always falls
- Implement a toy RSA from scratch (fast modular exponentiation + extended Euclid modular inverse) and reproduce the e=3 cube-root attack
- Hand-build a Diffie-Hellman handshake, then stage a man-in-the-middle attack to see why authentication is mandatory
- Write a toy hash and HMAC, reproduce a length-extension forgery, and explain why HMAC stops it
- Open the box on the HTTPS/JWT/digital signatures you use daily and explain how the pieces fit together
Syllabus
1Attack-Driven: from Cracking to Public-Key Crypto4 sessions
2Modular Magic: Key Exchange and the Man in the Middle3 sessions
3Hashing & Integrity: Fingerprints, MACs, and Length Extension3 sessions
4Block Ciphers & Modes: ECB in the Nude and the Padding Oracle0 sessions
Sessions are on the way.
5The Illusion of Randomness: Cracking PRNGs and Weak Seeds0 sessions
Sessions are on the way.
6Opening the Box: the Signatures, JWTs, and Handshakes You Use Daily0 sessions
Sessions are on the way.
Same series · 计算机科学与工程探索
CS & Engineering Explorations
Build from scratch the systems you usually treat as black boxes — and understand them to the core.
◎ Modeled on Princeton’s Bitcoin and Cryptocurrency Technologies + Nakamoto’s whitepaper
Blockchain & Bitcoin: From Hashes to Nakamoto Consensus, Build a Chain YourselfHash-pointer chains, Merkle proofs, PoW nonce search, the whitepaper's own attack probability — all in stdlib hashlib, offline and deterministicView course →◎ Modeled on the University of Michigan’s Model Thinking (Scott Page)
Model Thinking: See the World Like a Many-Model ThinkerSchelling segregation, percolation phase transitions, Solow steady states, replicator dynamics — simulate and prove every model yourself in pure numpyView course →