The BB84 or Bennett-Brassard 1984 protocol is a quantum key distribution (QKD) protocol, whose purpose is to securely transmit a string of random bits over a quantum channel for later use as a one-time pad. It is provably information-secure, thanks to the fact that quantum channels cannot be eavesdropped without interfering with the signal.
Alice wants to send a secret key to Bob. Between them, they have one quantum channel and one classical channel. Both channels may have eavesdroppers without compromising the security of the BB84 protocol, as long as Alice and Bob authenticate all data sent over the classical channel.
First, Alice securely generates a sequence of random (classical) bits. Note that the BB84 protocol is only suitable for random (high-entropy) data, because the later stages of the protocol involve revealing parts of the data over the (insecure) classical channel.
For each bit, Alice randomly chooses a qubit basis, either (eigenstates of the -spin ) or (eigenstates of the -spin ). Using the basis she chose, she then transmits the bits to Bob over the quantum channel, encoding them as follows:
Crucially, Bob has no idea which basis Alice used for any of the bits. For every bit, he chooses or at random, and makes a measurement of the qubit, yielding 0 or 1. If he guessed the basis correctly, he gets the bit value intended by Alice, but if he guessed incorrectly, he randomly gets 0 or 1 with a 50-50 probability:
After Alice has sent all her qubits, the next step is basis reconciliation: over the classical channel, Bob announces, for each bit, which basis he chose, and Alice tells him if he was right or wrong. Bob discards all bits where he guessed wrongly. If their quantum channel did not have any noise or eavesdroppers, Alice and Bob now have a perfectly correlated secret string of bits.
But what if there is actually an eavesdropper? Consider a third party, Eve, who wants to intercept Alice’ secret string. The main advantage of using QKD compared to classical protocols is that such an eavesdropper can be detected.
Suppose that Eve is performing an intercept-resend attack (not very effective, but simple), where she listens on the quantum channel. For each qubit received from Alice, Eve chooses or at random and measures it. She records her results and resends the qubits to Bob using the basis she chose, which may or may not be what Alice intended.
If Eve guesses Alice’ basis correctly, her presence is not revealed, and the protocol proceeds as normal. However, if she guesses wrongly (which has a probability of 50%), her bit value might be incorrect, and she will resend whatever she measured to Bob encoded in the wrong basis.
If we assume that Eve chose wrongly, Bob might measure using Eve’s basis, which will yield a 50% error rate due to Eve’s mistake. Otherwise, Bob might measure using Alice’ basis, which will also yield a 50% error rate due to the disagreement with Eve.
In the end, the probability is 0.5 that Eve chose correctly, which, multiplied by the 0.5 error rate from Bob’s choice, will result in a 0.25 error rate due to Eve’s presence. To detect this, after basis reconciliation, Bob reveals a part of his secret string as a sacrifice, which allows Alice to estimate the error rate. If the rate is too high, Eve is detected, and the protocol can be aborted, although that is not mandatory.
This was an intercept-resend attack. There exist other attacks, but similar logic holds. It has been proven by Shor and Preskill in 2000 that as long as the error rate is below 11%, the BB84 protocol is fully secure, i.e. there cannot be any eavesdroppers.
In practice, even without Eve, quantum channels are imperfect, and will introduce some errors in the qubits received by Bob. Suppose that after basis reconciliation, Alice and Bob have the strings and , respectively. We define as the probability that Alice and Bob agree on the th bit, which we assume to be greater than 50%:
Ideally, . To improve , the following simple scheme can be used: starting at , Alice and Bob reveal and over the classical channel, where is an XOR:
If , then and are discarded to prevent a listener on the classical channel from learning anything about the string. If , all of , , and are discarded, and then Alice and Bob move on to , etc.
Given that , the probability that , which is what we want, is given by:
We use the definition of to get the following inequality, which can be verified by plotting:
Alice and Bob can repeat this error correction scheme multiple times, until their estimate of is satisfactory. This involves discarding many bits, so the length of the string they end up with after one iteration is given by:
More efficient schemes exist, which do not consume so many bits.
Suppose that after the error correction step, , so Alice and Bob fully agree on the random string. However, in the meantime, Eve has been listening, and has been doing a good job building up her own string , such that she knows more that 50% of the bits:
Privacy amplification is an optional final step of the BB84 protocol which aims to reduce Eve’s . Alice and Bob use their existing strings to generate a new one :
Note that this halves the string’s length; more efficient schemes exist, which consume less.
To see why this improves Alice and Bob’s privacy, suppose that Eve is following along, and creates a new string where . The probability that Eve’s result agrees with Alice and Bob’s string is given by:
Recognizing ‘s definition, we find the following inequality, which can be verified by plotting:
After repeating this step several times, will be close to 1/2, which is the ideal value: for 0.5, Eve would only know 50% of the bits, which is equivalent to her guessing at random.
- N. Brunner, Quantum information theory: lecture notes, 2019, unpublished.
- J.B. Brask, Quantum information: lecture notes, 2021, unpublished.