The Key Exchange Problem, and Public Key Encryption
Send a secret to someone you’ve never met, over a channel everyone can watch. Symmetric encryption can’t do it. The fix — two keys instead of one — is what makes every secure website possible.
Big Idea 5 — Impact of ComputingCED 5.6 · the most-missed idea in the unit
Security. Yesterday’s cipher works only if both people already share the key. On the internet, you almost never have.
2
The Hook
Send me a secret. Go.
Rules: you can’t meet me, call me, or use any channel that isn’t being watched. Everything you send,
the whole class can read. Encrypt it? Fine — how do I get the key without the class seeing it too?
Take the full two minutes to fail. The failure is the lesson.
3
The Idea
The key exchange problem: symmetric encryption needs both people to share a secret key
first. Sending the key over the network means anyone watching gets it too. With a stranger — a website
you’ve never visited — there’s no safe way to share it.
Public key encryption (also called asymmetric encryption) uses a
pair of keys. Think of a padlock:
Bob hands out open padlocks to anyone who asks. That’s his public key.
Only Bob has the key that opens them. That’s his private key.
Alice puts her message in a box and snaps Bob’s padlock shut. Now not even Alice can open it — only Bob.
The pairing rule. To send a secret to Bob: encrypt with Bob’s public key; Bob
decrypts with Bob’s private key. Publishing the public key is safe because it can only lock, never
unlock.
Run it backward and you get a digital signature. If Alice locks something with her
private key, anyone can open it with her public key — so it isn’t secret. But it
proves Alice locked it, because only she has her private key.
Goal
Lock with
Open with
Only Bob can read it (secrecy)
Bob’s public key
Bob’s private key
Prove Alice sent it (signature)
Alice’s private key
Alice’s public key
4
Try It — Two Key Pairs
Alice is sending a message. Pick the key she locks it with, then pick who tries to open it. Eve is
watching the network and has every public key — they’re public.
1. Alice locks with:
2. Who tries to open it:
5
Vocabulary
public key encryption Security
Encryption that uses a pair of keys: a public key anyone can have, and a private key only the owner has. Also called asymmetric encryption.
asymmetric encryption Security
Encryption where the key that encrypts is different from the key that decrypts.
public key Security
The key you share with everyone. Anyone can use it to encrypt a message to you.
private key Security
The key only you have. It decrypts messages encrypted with your public key.
digital signature Security
Data encrypted with the sender’s private key, which anyone can check with the sender’s public key — proving who sent it and that it wasn’t changed.
6
Check
Five questions. Say the pairing rule out loud before each one.
0 of 5 answered
7
Impact Check
Why this matters every day
Every time you visit a secure website for the first time, your browser and a server
that have never met agree on a secret — in public, with the whole internet able to watch. Public key
encryption is what makes that possible. Without it, online banking, shopping, and private messaging
wouldn’t work.
8
Connections
Came from 7.3 — symmetric encryption — fast and simple, but stuck on how to share the key.
Came from 6.4 — every packet passes through other people’s routers. Anything sent is public unless encrypted.
Next in 7.5 — a public key proves you can encrypt to someone. How do you know that someone is who they claim?
Returns on the exam — “which key encrypts, which decrypts” is the highest-value item in this unit.