A secret shared. A measurement leaves a trace.
Can someone listen
without being noticed?
Alice sends quantum bits to Bob. Switch on Eve to see how listening can change what Bob receives.
The big picture
This diagram follows the Eve setting above. Run a new simulation to update the qubit results below.
Alice
Chooses a bit and a basis
Prepares a qubit
Eve
Guesses a basis and measures
Resends the measured state
Bob
Chooses his own basis
Measures the arriving qubit
Alice ↔ Bob: compare bases publicly
Same basis → keep the bit. Different bases → discard it.
Bob confirms receipt and measurement first. Eve can hear the bases, but they are announced after the qubits have been measured.
Preparing your first run…
- Alice prepares and sends qubits.
- Bob must confirm receipt and measurement before bases are revealed.
This models holding all signals without sending replacements, or requesting a perfect copier for any BB84 state. Real systems use receipt windows and can abort missing transmissions. Quantum memory and more advanced attacks exist; these two examples are not a full security proof.
01 / Follow one qubit
Pass through
Measure
02 / Compare bases, keep matching choices
Alice and Bob announce their bases. Only bits measured in the same basis are kept. These form the sifted keys.
See every qubit
Select a qubit number to explore its journey. “Discard” means the bases differ; it does not count as a key error.
| Qubit | Alice bit / basis | Eve basis / bit | Bob basis / bit | Decision | Key mismatch |
|---|
03 / Your keys at the end of this run
—Run a simulation to see the resulting keys.
——These are the bits left after basis comparison, in transmission order. Highlighted bits in Bob’s key disagree with Alice’s. This demonstration ends at sifting: error correction and privacy amplification are needed before a real protocol produces a final secret key.