Rectilinear basis (+) Diagonal basis (×) Intercepted by Eve

Quantum Key Distribution: BB84 Protocol & Eavesdropper Detection (2D)

This 2D companion runs the real BB84 quantum-key-distribution protocol instead of decorating a 3D scene: every photon Alice sends gets a genuine random bit and random basis, Bob measures in his own random basis, and the sifting step keeps only the photons where their bases happened to match. Dial up Eve's intercept-resend probability and watch the Quantum Bit Error Rate climb toward the ~25% signature of a fully tapped channel — cross the abort threshold and the session key gets discarded, exactly like a real BB84 receiver would refuse a compromised channel.