Skip to main content

Quantum information · institution-dependent · Interactive lesson

Quantum cryptography: BB84 and E91

BB84 and E91 are where the course's linear algebra turns into a guarantee. Learn to write each protocol as states, projectors and a sifting rule, to convert a measured error rate into a secret-key rate, and to name the assumptions — single photons, an authenticated classical channel, honest devices — the guarantee silently rests on.

UPV-20.08 · Lesson 8 of 9 in this unit. Position is not a completion score.
Starting model: Quantum cryptography: BB84 and E91Secret-key rate against QBER. Solid: BB84 with trusted devices, r = 1 − (1 + c)h(Q). Dashed: the device-independent rate for depolarising noise, |S| = 2√2(1 − 2Q). The markers sit at the operating point Q = 6.8%, where Eve intercepts a fraction 0.20 of the photons on a channel whose own error rate is 2.0%.key rate r per sifted bit1.00.5011%25%QBER QBB84, trusted devices (solid)device-independent (dashed)below the axis: r ≤ 0, abort
Start with a picture. Change the model in the lab below.

Quantum information · institution-dependent. Your university determines the required depth of these quantum topics, including the use of operators, differential equations and computation. Institution-dependent does not automatically mean optional.

1

Build the model

A key is secure because non-orthogonal states cannot be read without being disturbed.

The key idea

Quantum key distribution grows a shared secret key between two parties over a public quantum channel, because an eavesdropper who measures the non-orthogonal signal states necessarily raises an error rate the parties can detect and bound.

Example. An eavesdropper who intercepts every BB84 photon and measures σz or σₓ at random guesses the wrong operator half the time, and each wrong guess errs at Bob with probability 1/2, so the sifted key shows Q = 1/2 × 1/2 = 25%.

The complete physical model and assumptions

Quantum key distribution rests on one fact of Hilbert space: a set of non-orthogonal states can be neither copied nor identified without being disturbed. BB84 exploits it with two mutually unbiased bases, the eigenbases of σz and σₓ, chosen so that the ensemble Eve sees is I/2 whichever basis Alice used — the basis is invisible to any operator she can apply, and any measurement that gains her information about the bit must disturb some of the states and leave a trace. That trace is the quantum bit error rate Q, estimated on a sacrificed sample of the sifted key, and the Shor–Preskill argument turns it into a rate: r = 1 − 2h(Q) secret bits per sifted bit, positive only below Q ≈ 11%. E91 keeps the same logic but replaces trust in the source with a CHSH test on a shared singlet, and device-independent protocols go further, trusting nothing but the Bell violation. None of this is free. Sifting discards half the rounds, error correction and privacy amplification shrink what remains, and the theorem holds only under its hypotheses: one photon per pulse, a classical channel that cannot be impersonated, and hardware that measures the operators the model says it measures. Break an assumption and the proof says nothing — the history of attacks on QKD is the history of those breaks.

1Encode the bit in an operator Eve cannot identify

BB84 picks one of two Hermitian operators, σz or σₓ, and sends the eigenstate whose eigenvalue +1 or −1 carries the bit: |0⟩ or |1⟩ in the σz basis, |+⟩ = (|0⟩ + |1⟩)/√2 or |−⟩ = (|0⟩ − |1⟩)/√2 in the σₓ basis. The bases are mutually unbiased — every cross overlap satisfies |⟨i|j⟩|² = 1/2 — and that is the whole design. Average over the bit Alice might have sent and the density operator is (|0⟩⟨0| + |1⟩⟨1|)/2 = I/2 in one basis and (|+⟩⟨+| + |−⟩⟨−|)/2 = I/2 in the other: the two ensembles are the same operator, so no measurement, POVM or unitary Eve applies can tell her which basis is in play. She cannot copy the photon either: a unitary that cloned both |0⟩ and |+⟩ would have to preserve their inner product, ⟨0|+⟩ = ⟨0|+⟩², which fails because ⟨0|+⟩ = 1/√2 is neither 0 nor 1. Her only move is to measure something, and measuring σₓ on a σz eigenstate returns ±1 with probability 1/2 each and projects the state onto |±⟩. The information she gains and the disturbance she causes are the same event.

2Sift on the announced bases, then sacrifice a sample

Run N rounds. In each, Alice draws a random bit and a random basis and sends the matching state; Bob draws his own random basis and measures σz or σₓ. Afterwards, over a public but authenticated classical channel, both announce which basis they used — never the outcome — and keep only the rounds where the bases agree. That is the sifted key, about N/2 bits long, and on it Bob's result equals Alice's bit whenever nothing intervened. Now they publish a random subset, say a tenth of it, compare bit by bit and count disagreements: the fraction is the quantum bit error rate Q. The revealed bits are discarded. With N = 10⁶ pulses, ideal detectors and no loss, that leaves 4.5 × 10⁵ candidate bits and an estimate of Q good to about ±0.1%. Real links add detector inefficiency and fibre loss of about 0.2 dB km⁻¹, so the sifted length falls as 10(−0.02 L/km) and a 100 km link delivers roughly 1% of the photons sent — distance attacks the rate, not the security.

3The intercept-resend arithmetic, and why 25% is a description

Let Eve intercept a fraction f of the photons, measure each in a random basis and resend the eigenstate she found. Half the time she picks Alice's operator, learns the bit exactly and passes it on unchanged. Otherwise she gets ±1 at random and resends a state with overlap 1/2 against each of Alice's basis states, so Bob, in Alice's basis, errs with probability 1/2. Hence Q = f × ½ × ½ = f/4, and Eve knows a fraction f/2 of the sifted key with certainty: 25% and one half at full interception. That describes one crude attack, not a bound. Let her instead measure the Breidbart operator (σz + σₓ)/√2, whose eigenstates sit at Bloch angle 45° between the two bases. For an incoming |0⟩ she obtains the +1 eigenstate with probability cos²(π/8) = 0.854 and resends it; Bob then reads 0 with probability cos⁴(π/8) + sin⁴(π/8) = 3/4. Same 25% disturbance, but she now guesses every sifted bit correctly with probability 0.854 instead of 0.75. Q measures how much Eve disturbed the key, not how much she knows; a security claim needs a bound that holds for every attack.

4Turn Q into a key rate: 1 − 2h(Q) and the 11% line

The bound that holds for every attack is Shor and Preskill's. Picture the sifted key as if it had been made by measuring shared Bell pairs: an error in the σz record is a bit flip, and Eve's information about the key is bounded by the rate of phase flips, the errors the σₓ record reveals. Correcting the bit flips costs h(Qbit) bits per sifted bit; removing the phase flips — which is what privacy amplification does — costs h(Qₚₕₐₛₑ). BB84's basis symmetry makes the two equal, so r = 1 − 2h(Q) with h(Q) = −Q log₂Q − (1 − Q) log₂(1 − Q). At Q = 2%, h = 0.141 and r = 0.717; at Q = 5%, h = 0.286 and r = 0.427; at Q = 11.0%, h = 1/2 and r = 0. Above that, one-way post-processing yields nothing and the run is aborted, even though 11% is far below the 25% of naive interception — the gap between one attack and all attacks. Real error correction leaks more than the Shannon minimum: a Cascade-type protocol costs about c = 1.1 to 1.2 times h(Q), so r = 1 − (1 + c)h(Q) and the threshold falls to about 9.5% at c = 1.2. A finite key pays a further statistical penalty for estimating Q from a sample.

5E91: let a CHSH test certify the source

Ekert's protocol starts from a source of singlets |Ψ⁻⟩ = (|01⟩ − |10⟩)/√2, with Alice measuring along 0°, 45° or 90° and Bob along 45°, 90° or 135°. For the singlet E(a, b) = ⟨Ψ⁻|(a⋅σ ⊗ b⋅σ)|Ψ⁻⟩ = −cos(a − b), so coinciding directions give perfect anticorrelation: Bob flips his outcome and the pair is a key bit. The rounds with mismatched directions are published, and those with Alice at a = 0° or a′ = 90° and Bob at b = 45° or b′ = 135° are assembled into S = E(a, b) − E(a, b′) + E(a′, b) + E(a′, b′), 2√2 in magnitude for a clean singlet and at most 2 for any local hidden-variable description, including any record Eve kept. A noisy or tampered source is a Werner state ρ = V|Ψ⁻⟩⟨Ψ⁻| + (1 − V)I/4, and since every Pauli matrix is traceless the noise term drops out: E = −V cos(a − b), |S| = 2√2 V, and the matched-basis error rate is Q = (1 − V)/2. The violation disappears at V = 1/√2, where Q = 14.6%, yet a positive key needs Q < 11%, that is V > 0.78 and |S| > 2.2: here a Bell violation is necessary for a key and not sufficient. Device independence, trusting only the observed S, gives r ≥ 1 − h(Q) − h[(1 + √(S²/4 − 1))/2], positive for depolarising noise only below Q ≈ 7.1%.

6Name the assumptions, because each one has been broken

Each proof is a theorem with hypotheses. First, one photon per pulse. An attenuated laser is Poissonian: at mean μ = 0.1 the chance of two or more photons is 1 − e(−μ)(1 + μ) ≈ μ²/2 = 0.5%, and there Eve keeps one photon, waits for the basis announcement and reads the bit undisturbed: photon-number splitting. Decoy states, pulses at randomly varied μ, expose it and restore a proof at a lower rate. Second, an authenticated classical channel. Forgeable announcements let Eve play Bob to Alice and Alice to Bob; Wegman–Carter authentication stops that but spends a pre-shared key, so QKD expands a secret rather than creating one. Third, honest devices. The proof assumes the source emits the four stated states and the detectors implement the σz and σₓ projectors; bright-light blinding turned real avalanche photodiodes into classical switches and stole full keys. Device independence keeps only the Bell violation, yet still assumes no leakage from the laboratory, free setting choices and correct quantum mechanics. A distilled key is only a key; encrypting the message is a separate step.

2

Key equations

Read the units, assumptions and limits before substituting.

The four BB84 states

|0⟩, |1⟩ eigenstates of σz|±⟩ = (|0⟩ ± |1⟩)/√2 eigenstates of σₓ

Averaged over the bit, either basis sends ρ = I/2: no measurement Eve can make distinguishes which basis Alice used.

|⟨0|±⟩|² = |⟨1|±⟩|² = 1/2, so the bases are mutually unbiased; the bit is the eigenvalue ±1 of the chosen operator

Intercept-resend disturbance

Q = f × ½ × ½ = f/4IE = f/2

Wrong operator half the time, and a wrong-basis resend errs at Bob half the time: full interception gives Q = 25% and Eve learns half the key.

f is the fraction of photons Eve intercepts (0 to 1), Q the error rate on the sifted key, IE her certain knowledge per sifted bit

Binary entropy

h(Q) = −Q log₂Q − (1 − Q) log₂(1 − Q)

The cost of correcting one bit that is wrong with probability Q, and the privacy amplification a phase-error rate Q demands.

Q dimensionless; h in bits per bit — 0 at Q = 0, 0.286 at Q = 0.05, exactly 1/2 at Q = 0.110, 1 at Q = 1/2

Secret-key rate for BB84

r = 1 − h(Qbit) − h(Qₚₕₐₛₑ) = 1 − 2h(Q)

Shor–Preskill: error correction pays h(Q), privacy amplification pays h(Q) again, and the sum reaches 1 at Q ≈ 11.0%, where the key vanishes.

secret bits per sifted bit; basis symmetry makes Qₚₕₐₛₑ = Qbit; with error-correction inefficiency c ≥ 1, r = 1 − (1 + c)h(Q)

E91 correlation and CHSH

E(a, b) = Tr[ρ (a⋅σ ⊗ b⋅σ)] = −V cos(a − b)|S| = 2√2 V

Pauli matrices are traceless, so the white-noise part contributes nothing to the trace: the CHSH value reads the singlet weight V directly.

Werner source ρ = V|Ψ⁻⟩⟨Ψ⁻| + (1 − V)I/4 with visibility V; local realism needs |S| ≤ 2; matched-basis error Q = (1 − V)/2

Device-independent rate

r ≥ 1 − h(Q) − h[(1 + √(S²/4 − 1))/2]

Trust moves from the devices to the Bell violation; the price is a tolerable error rate of about 7% instead of 11%.

S the observed CHSH value, positive only for |S| > 2; with depolarising noise |S| = 2√2(1 − 2Q) and the rate reaches zero at Q ≈ 7.1%
3

Interactive lab

Predict first. Explore the model. Compare the result.

Explore the model

0.20
0 to 1; steps of 0.05.
2.0 %
0 to 8 %; steps of 0.5.
1.00 × h(Q)
1 to 1.5 × h(Q); steps of 0.05.

Try this. Drag the intercept fraction up and watch the filled marker slide down the solid curve: the rate reaches zero near Q = 11%, long before the 25% that full interception produces. Then raise the error-correction cost c and watch both curves meet the axis sooner.

Live results

QBER Q
6.8 %
KEY RATE r (BB84)
0.283 per sifted bit
CHSH |S| (DEPOLARISING NOISE)
2.44
EVE KNOWS (INTERCEPT-RESEND)
0.10 per sifted bit

Results follow this lesson’s model and assumptions. Displayed values are rounded.

Interactive Physics V modelSecret-key rate against QBER. Solid: BB84 with trusted devices, r = 1 − (1 + c)h(Q). Dashed: the device-independent rate for depolarising noise, |S| = 2√2(1 − 2Q). The markers sit at the operating point Q = 6.8%, where Eve intercepts a fraction 0.20 of the photons on a channel whose own error rate is 2.0%.key rate r per sifted bit1.00.5011%25%QBER QBB84, trusted devices (solid)device-independent (dashed)below the axis: r ≤ 0, abort
Secret-key rate against QBER. Solid: BB84 with trusted devices, r = 1 − (1 + c)h(Q). Dashed: the device-independent rate for depolarising noise, |S| = 2√2(1 − 2Q). The markers sit at the operating point Q = 6.8%, where Eve intercepts a fraction 0.20 of the photons on a channel whose own error rate is 2.0%.

Predict → change one variable → check

Plan a change before running it. Every other input stays at the saved baseline.

Saved baseline. Fraction intercepted by Eve: 0.20; Channel's own error rate: 2.0 %; Error-correction cost c: 1.00 × h(Q)

Baseline 0.20; choose 0 to 1, in steps of 0.05.
4. Compared with the saved baseline, this result will…

This experiment is kept only while this page is open. It does not change saved course progress.

4

Catch the common trap

The 25% error rate is not the threshold at which BB84 becomes insecure, and treating it as one is the standard error. Twenty-five per cent is what one crude attack — intercept every photon, measure at random, resend — happens to produce, and it comes with Eve knowing only half the key. A cleverer eavesdropper intercepts a fraction f and causes only f/4, or measures in the Breidbart basis and keeps the same 25% while guessing 85% of the bits, or attacks coherently and does better still. The proof does not ask what caused the errors; it assumes every one is Eve's and bounds her information by the phase-error rate, giving r = 1 − 2h(Q), zero at Q ≈ 11%. Between 11% and 25% the parties can see that something is wrong but cannot distil a single secret bit by one-way post-processing, and channel noise earns no discount: the proof cannot tell honest noise from a quiet adversary, so it charges for both.

5

Practice & worked examples

3 authored examples. Make an attempt, then reveal the reasoning one step at a time.

EasyExample 1

Alice sends 8000 BB84 photons over an ideal, lossless link. Eve intercepts every one, measures σz or σₓ at random and resends the eigenstate she finds. How long is the sifted key, how many errors does it contain, and how many of its bits does Eve know with certainty? Repeat for Eve intercepting only one photon in five.

Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.

0 of 5 steps revealed.

MediumExample 2

A BB84 run leaves 5000 sifted bits after the test sample is removed. Find the secret-key length for a measured QBER of 4.0% with ideal error correction, then with a Cascade-type protocol that leaks c = 1.2 times the Shannon minimum, and finally decide what happens at a QBER of 12%.

Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.

0 of 5 steps revealed.

HardExample 3

An E91 source is meant to emit singlets but delivers the Werner state ρ = V|Ψ⁻⟩⟨Ψ⁻| + (1 − V)I/4 with V = 0.85. Alice measures spin along a = 0° or a′ = 90°, Bob along b = 45° or b′ = 135°. Find E(a, b), the CHSH value S, the matched-basis error rate, the trusted-device key rate 1 − 2h(Q) and the device-independent rate, then the visibility below which the CHSH test itself fails.

Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.

0 of 6 steps revealed.

6

Quick check

Select an answer and explain it before checking.

Alice and Bob run BB84 with an ideal single-photon source and estimate a QBER of 15% on their sifted key. What does the security analysis tell them to do?
7

Review & continue

Quantum key distribution grows a shared secret key between two parties over a public quantum channel, because an eavesdropper who measures the non-orthogonal signal states necessarily raises an error rate the parties can detect and bound.

  • Explain the relationship without looking at the equation.
  • Check a sign, a unit and a model assumption in your working.
  • Return to the lab or worked example if a step is still unclear.

Extra challenging questions

Connect several ideas, explore supplied data, and compare your reasoning with a worked solution.