Alice sends one qubit at a time. Bob chooses how to measure it. Together, they compare bases, test for errors, and find the bits they can keep.
Start here
Choose how to play
Solo · Learn both roles
Play Alice, then Bob, for each qubit. The same experiment, all on one screen.
Live · Two people
Alice creates a room and sends the link to Bob on Zoom.
Try without Eve first, then run another experiment with Eve.
Live mode uses public classroom messages, not real qubits or secure communication. No account needed. Share room links only with classmates.
Pick a mode to begin.
Invite Bob
Send this link to your partner:
Keep Alice's tab open. Bob opens the link in a different browser or an incognito window.
Send and measureAliceQubit 1 of 8
Progress: 0 / 8
Step 1 · Alice prepares
Choose the bit and basis
Choose a bit and a basis. Bob must not know either choice yet.
Secret bit
Preparation basis
+ makes |0⟩ or |1⟩. × makes |+⟩ or |−⟩.
Bob has measured. Prepare the next qubit after Bob presses Continue.
Step 2 · Bob measures
Pick a measurement basis
Alice
?
→
Bob
+
Waiting for a qubit.
Step 3 · Public discussion
Compare bases, not bits
Alice and Bob may now say which bases they used. Only rounds with matching bases can contribute to their key.
Step 4 · Check for Eve
Reveal a sample of bits
To look for errors, Alice reveals selected bits from matching-basis rounds. These tested bits must be discarded.
An error may signal Eve or noise. No observed errors does not prove Eve was absent.
Finish · Candidate key
Keep the untested, matching-basis bits
This short simulation does not create a secure key. Real BB84 requires authenticated classical communication, error correction, privacy amplification, and physical quantum states.
State reference
Four states, two bases
|0⟩+ basis · bit 0
|1⟩+ basis · bit 1
|+⟩× basis · bit 0
|−⟩× basis · bit 1
Same basis: Bob gets Alice's encoded bit in the ideal case. Different basis: Bob's result is random.
What does Eve change?
When Eve measures in a random basis and resends a replacement, she can disturb the state. For an ideal intercept-resend attack, about 25% of matching-basis bits are wrong on average. Small samples vary.