Introduction

Almost every secret you send online today is protected by a bet: that factoring a huge number, or some cousin of that problem, is too slow for any attacker. It is a good bet. But it is still a bet — and a fast enough computer would win it.

In 1984, Charles Bennett and Gilles Brassard proposed a completely different idea. Instead of hiding a key behind a hard computation, BB84 lets two people — call them Alice and Bob — build a shared secret key out of single particles of light, where the secrecy is enforced by a law of nature: you cannot measure a quantum state without disturbing it.

The consequence is startling. Any eavesdropper who tries to read the key on its way across necessarily leaves errors behind. Alice and Bob just compare a few bits, see the damage, and throw the key away. Security stops being a guess about an algorithm and becomes a measurement.

Try It

Alice sends a stream of qubits, each polarized in one of two random bases (rectilinear + or diagonal ×). Bob measures each one in a basis he also picks at random. Whenever their bases happen to match, they keep the bit — that becomes the shared key.

<p class="hint">{{hint}}</p>
<div class="controls">
  <label><input type="checkbox" id="eve"> {{eve_label}}</label>
  <label>{{qubits_label}} <input type="range" id="n" min="8" max="40" value="20"></label>
</div>
<div class="btns">
  <button id="send" type="button">{{send_btn}}</button>
  <button id="reset" type="button" class="ghost">{{clear_btn}}</button>
</div>
<div id="stream" class="stream"></div>
<div class="status" id="status">{{initial_status}}</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .7rem; line-height: 1.45; }
.controls { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center;
            font-size: .9rem; margin: .3rem 0 .6rem; }
.controls input[type=range] { vertical-align: middle; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
         background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
.stream { display: flex; flex-wrap: wrap; gap: 4px; margin: .4rem 0; }
.q { width: 30px; text-align: center; font: 700 13px ui-monospace, monospace;
     border-radius: 6px; padding: 4px 0; border: 1px solid #cdd9e3; background: #e8eef3; color: #1d3557; }
.q.drop { opacity: .35; }
.q.keep { background: #d4ead9; border-color: #9fcead; }
.q.err { background: #f6cdd2; border-color: #e29aa3; color: #9b1c2a; }
.status { font-size: 1rem; font-weight: 600; margin: .5rem 0; min-height: 1.4em; }
.status.ok { color: #0a7d33; }
.status.bad { color: #c92f3c; }
// Code not found

Run it once with no spy: the bits Alice and Bob keep agree perfectly. Now flip on Eve. Because she has to guess each basis before measuring, she gets it wrong half the time, and every wrong guess randomizes the qubit. The result is unmistakable: about 25% of the shared bits flip. That error rate is the eavesdropper's fingerprint — there is no way to listen without leaving it.

The Real Complexity

What makes BB84 different is where its security comes from.

  • Classical cryptography is computational. RSA and its relatives are safe only as long as factoring (or a related problem) stays hard. Nobody has proven it is — that safety leans on the open P vs NP question and would collapse against a large quantum computer running Shor's algorithm.
  • BB84 is information-theoretic. Its security does not assume the attacker is slow. It assumes only that quantum mechanics is correct — specifically the no-cloning theorem: an unknown quantum state cannot be copied. Eve cannot keep a perfect copy to measure later; she must disturb the original now.
  • It is proven, not conjectured. Unlike most of cryptography, BB84 has a rigorous security proof — first by Dominic Mayers (2001), with an elegant version by Peter Shor and John Preskill (2000). Given an honest error budget, the probability that an eavesdropper learns the key can be driven arbitrarily close to zero.

So BB84 sidesteps the entire complexity-theory gamble. There is no hard problem to solve faster — there is a physical fact to violate, and you cannot.

Where It Matters

"A key that a future computer can't break" is not a thought experiment — BB84 and its descendants are already running:

  • Metro fiber links: banks and data centers exchange QKD keys over dedicated optical fiber for high-value traffic.
  • Satellite QKD: China's Micius satellite distributed entangled and BB84-style keys between ground stations thousands of kilometers apart.
  • Government and defense networks: long-term secrets that must stay safe for decades cannot rely on math that a quantum computer might one day undo.
  • Hybrid post-quantum systems: QKD is often paired with classical algorithms to hedge against both today's and tomorrow's attackers.

The same threat that motivates BB84 — a quantum computer breaking classical schemes via Shor's algorithm — is what makes physics-based keys worth the hardware.

Conclusion

BB84 carries a quietly radical message: secrecy does not have to rest on a problem being hard. It can rest on the universe refusing to be copied. Alice and Bob never need to assume their adversary is slow — they only need to count a few errors and trust that measurement disturbs.

So while the rest of cryptography watches nervously for the day a quantum computer cracks Shor's algorithm against it, BB84 simply shrugs. Its security was never a wager on P vs NP. It was a wager on physics — and that is one bet we have never seen the universe lose.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/bb84/Content licensed under CC BY-NC 4.0.