The protocol that secures communication against quantum computers — by using the laws of physics, not math
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!
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"
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
| 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 |