07_Public_Key — Public-key cryptography — the secret you never send¶
Level: 201 → 301 · working knowledge
The idea that made the modern internet possible: two mathematically linked keys, one of which you can publish. Two parties who have never met, over a wire an attacker is reading in full, end up with a shared secret the attacker does not have.
It is worth doing by hand once with small numbers, because the mechanism is genuinely simple — pow(base, exponent, modulus), which Python has built in — and because the asymmetry it depends on becomes obvious only when you compute both directions yourself.
The pages¶
| # | Page | The question it answers | Status |
|---|---|---|---|
| 1 | Diffie–Hellman by hand | How do two strangers agree on a secret in public? | planned |
| 2 | RSA by hand, and why textbook RSA is broken | How does one key undo the other — and why is textbook RSA broken? | planned |
Every page above is a plan until its row says written; see ROADMAP.md.
The through-line¶
Public-key is slow and is almost never used on your data. It moves a key; the data is encrypted symmetrically. Nearly every protocol in 09 is that sentence.