๐ก The Public/Private Key Breakthrough
The 1976 idea that made secure internet commerce possibleโฑ ~3 min
Imagine you want to receive secret messages. You put an unlocked padlock outside your door โ anyone can pick it up, snap it shut around their message box, and mail it to you. Only you have the key to open that padlock. You never gave anyone your key, yet they sent you something only you can open. The padlock is your public key. The key to open it is your private key.
The Revolutionary Idea: Two Mathematically Linked Keys
In 1976, Whitfield Diffie and Martin Hellman published 'New Directions in Cryptography,' introducing the concept of public-key cryptography. The insight: generate two mathematically related keys such that:
- โขWhat one key encrypts, only the other key can decrypt
- โขKnowing the public key makes it computationally infeasible to derive the private key
- โขThe public key can be broadcast to the world without compromising security
- โขNo prior shared secret is needed โ two strangers can communicate securely on first contact
Two Modes: Encryption vs Signing
| Operation | Who Uses Which Key | Purpose |
|---|---|---|
| Encryption | Sender uses recipient's PUBLIC key to encrypt; recipient uses their PRIVATE key to decrypt | Only the recipient can read the message |
| Digital Signature | Sender uses their own PRIVATE key to sign; anyone uses sender's PUBLIC key to verify | Proves the message came from the sender and wasn't modified |
The Mathematical Hard Problems
Asymmetric cryptography relies on mathematical problems that are easy to compute one way but computationally infeasible to reverse:
| Algorithm | Hard Problem | Easy Direction | Hard Direction |
|---|---|---|---|
| RSA | Integer factorization | Multiply two large primes: p ร q = n | Factor n back into p and q |
| Diffie-Hellman | Discrete logarithm | Compute g^x mod p given g, x, p | Find x given g, g^x mod p, p |
| ECC | Elliptic curve discrete log | Multiply a point P by integer k: kรP | Find k given P and kรP |
To send Bob a secret message, you encrypt withโฆ