Unveil

The cryptography of computers: hashes, AES and HMAC, RSA and its weak keys, Diffie–Hellman, Shor and Grover on a quantum computer, ML-KEM, BB84, Shamir’s shares, time locks, passwords.

BB84

Simulates BB84, the quantum key distribution of Bennett and Brassard (1984): photons polarised in one of two bases at random, measured in one at random, the bases compared in public and a third of the agreeing bits too. An eavesdropper who measures leaves errors, a quarter where she measures every photon; the rest is a one-time pad. Their printed example is replayed; the photons here are pseudo-random numbers.

Terms

About this tool

History

Stephen Wiesner’s “Conjugate coding”, printed in 1983, first coded information in two conjugate bases, so that reading it one way destroys it the other; Bennett and Brassard call it the first quantum coding. In Bangalore in December 1984 Charles Bennett and Gilles Brassard turned it into a way for two people who share no secret to agree on one, since called BB84. In 1992 they and three colleagues described a working apparatus.

How it works

Alice sends single photons, each a random bit in a random basis: rectilinear, horizontal for 0 and vertical for 1, or diagonal, 45° for 0 and 135° for 1. Bob measures each in a basis of his own. A photon at angle α passes a polariser at β with probability cos²(α − β), the paper says, and leaves polarised as the polariser is: measured in its own basis a photon gives its bit, in the other 0 or 1 at even odds. Over a public line they compare bases, keeping the photons measured as sent, about half, then a random third of those bits. An eavesdropper who measures and sends on cannot know the basis in time: where she guesses wrong, Bob reads the wrong bit half the time, a quarter of the bits she touched. Any error, and they start again; none, and the rest is a one-time pad.

How it was checked

The tool replays the paper’s example from its printed bits, bases and Bob’s readings: the bases marked correct, the shared bits, the two revealed and the key 1011 come out as on the page. In the tests 30,000 photons give no errors with no one on the line, 12.4% with Eve on half the photons and 25.3% with her on every one, the bases agreeing for 49.9%; the same seed gives the same photons with or without her.

Limits

Nothing here is quantum: the photons are pseudo-random numbers drawn with the probabilities quantum mechanics gives, so the key is only as secret as the browser’s generator. The simulated line loses no photons and adds no noise, so every error is Eve’s; real systems lose photons and see errors with no one listening, and must correct them and shorten the key; this simulation does not. Eve measures and sends on, the attack the paper weighs; there are others. The public line is taken to be one no one can alter, as the paper assumes.