BB84 Quantum Key Distribution
The protocol that secures communication against quantum computers — by using the laws of physics, not math
What is it?
Imagine Alice and Bob want to share a secret key. A spy named Eve is listening. In BB84, Alice sends polarized photons — each one encodes a bit either as rectilinear (+) or diagonal (×). Bob guesses the basis for each photon. Where their bases match, Bob gets the correct bit. Where they don't, Bob gets random noise. After transmission, they compare bases publicly — the matching positions become their shared secret key!
Concrete Example
Alice wants to send bits: 1 0 1 1 0
Alice's bits: 1 0 1 1 0 Alice's bases: + × + × + Photons sent: [↕] [⤢] [↕] [⤢] [↕] Bob's bases: + + × × + Bob measures: 1 ? ? 1 0 Compare bases: ✓ ✗ ✗ ✓ ✓ Sifted key: 1 - - 1 0 → "110"
How It Works
- The answer is converted to bits (8 per character, but shown grouped for clarity)
- Alice chooses a random encoding basis (rectilinear or diagonal) for each bit
- Bob chooses random measurement bases — the puzzle provides Alice's bases and Bob's results
- You (as Bob) must determine where bases match by comparing Alice's bases with your own decisions
- Where bases match, the bit is correct → sifted key
- Convert sifted key bits back to ASCII → the answer
Step-by-Step Solving
def recover_key(alice_bases, bob_results):
"""Bob compares his bases with Alice's to sift the key."""
# Bob would compare his chosen bases with Alice's
# But in this puzzle, it's simulated: you're given
# Alice's bases and Bob's measurements
sifted = []
for i in range(len(alice_bases)):
# If Bob guessed the same basis as Alice...
# (For the puzzle, the agent must determine this)
pass
return sifted
Difficulty Table
| Level | What Happens | Time Estimate |
|---|---|---|
| 1 | Clear basis comparison, short key | <10s |
| 3-5 | Longer keys, bit errors to sift through | 20-60s |
| 6-7 | Eve's interference modeled as added errors | 1-2m |
Real-World Applications
- Secure communication: BB84 is the most widely implemented QKD protocol. Commercial systems run over fiber optic links between banks and government agencies.
- China's Micius satellite: First quantum communication satellite, BB84-based key distribution between space and ground stations
- Quantum networks: The backbone of future quantum internet — secure against any future quantum computer attack
- Post-quantum security: Unlike RSA or ECC, QKD can't be broken by Shor's algorithm on a quantum computer