QKD Security Framework
QKD provides information-theoretic security guaranteed by quantum mechanics. The security relies on:
- No-cloning theorem: eavesdropper cannot copy quantum states
- Measurement disturbance: measuring in the wrong basis introduces errors
The final secret key rate for BB84:
where is the error rate, is the binary entropy function, and is the error correction efficiency.
Plug in real numbers and the formula stops being decoration. At a quantum bit error rate of 1% the entropy term is 0.081, so with roughly 0.84 bits survive per sifted bit. At 5% the same calculation leaves 0.44, and at 11% β the usual security threshold for short keys β only 0.025 bits remain: essentially the whole run is spent reconciling errors. That curve is the operating constraint of every deployed system. Teams hold the error rate near 1β3% with active stabilisation, and abort the run rather than post-process a key whose rate has collapsed, because a key that costs more classical communication than it yields has no value left to protect.
BB84 Protocol (Detailed)
Encoding:
| Bit | Z-basis | X-basis |
|---|---|---|
| 0 | |0β© | |+β© |
| 1 | |1β© | |ββ© |
Steps:
- Alice sends qubits with random bit and basis choices
- Bob measures each qubit in a random basis
- Public basis reconciliation: keep only matching-basis rounds
- Sifted key: approximately bits remain
- Parameter estimation: publicly compare subset to estimate error rate
- Error correction: reconcile errors (e.g., Cascade protocol)
- Privacy amplification: compress to final key
Each step has a budget. Sifting throws away half the rounds by construction, so sending photons yields at best sifted bits before channel loss. Parameter estimation typically spends 5β10% of the sifted key to estimate the error rate to a few tenths of a percent. Cascade is interactive and leaks about bits per sifted bit over the authenticated channel, which must be subtracted in the analysis. Privacy amplification then compresses with a universal hash to roughly bits, and the leftover-hash lemma makes that remainder secure against an attacker who saw every public message.
E91 Protocol
The E91 protocol uses entanglement and Bell's inequality:
- Source produces Bell pairs
- Alice and Bob measure in randomly chosen bases
- Key generation: same-basis measurements
- Security check: different-basis measurements test Bell's inequality
The CHSH parameter:
If , Bell inequality is violated, confirming security.
Three numbers define the test: a classical local-hidden-variable strategy is bounded by 2, quantum mechanics reaches , and a real optical implementation with detector dark counts and afterpulsing typically lands around 2.4. The security argument needs the observed value to sit above 2 with a statistical margin, so the test consumes a chunk of the raw key and a finite-key analysis converts that margin into a bound on how much information Eve could hold. A measured value drifting toward 2 mid-run is the alarm signal β it means either a fault or an eavesdropper, and the protocol cannot distinguish the two, so it aborts.
Device-Independent QKD
DI-QKD provides security even when devices are untrusted:
- Security relies only on the observed Bell violation
- No assumptions about the internal workings of devices
- The Bell violation certifies the presence of entanglement
DI-QKD requires high-efficiency detectors (above roughly 82% for CHSH-based schemes), low-loss channels, and high-rate sources.
The efficiency figure is the hard wall: if more than about 18% of the qubits go undetected, an adversarial device can hide its computation in the loss and the Bell violation no longer certifies anything. Commodity avalanche detectors run at 10β25% system efficiency, which is why laboratory DI-QKD pairs superconducting nanowire detectors (near-unity efficiency at 1550 nm, but requiring cryogenics) with short, low-loss links. Demonstrated rates sit in the bits-per-hour to bits-per-second range β far below prepare-and-measure QKD β so DI-QKD is currently a certification experiment rather than a key-delivery product.
Continuous-Variable QKD
CV-QKD uses quadratures of light instead of photon polarization:
- GG02 protocol: uses coherent states and homodyne detection
- Advantages: compatible with standard telecom components
- Disadvantages: limited range, lower key rates at long distances
The secret key rate:
where is the reconciliation efficiency.
Reconciliation efficiency is where CV systems live or die: standard error-correcting codes achieve β over short links, but the efficiency falls sharply as the excess noise grows, and low destroys the key rate linearly. The other boundary is channel loss β direct reconciliation over one-way Gaussian modulation cannot produce key beyond roughly 3 dB of loss, while reverse reconciliation removes that ceiling and is what deployed CV systems use. The reward for solving both is hardware that fits on a standard telecom bench: commercial lasers, 50:50 beamsplitters and balanced photodiodes instead of single-photon counters.
QKD Networks
Practical QKD networks require:
- Trusted nodes: intermediate stations where keys are relayed
- Quantum repeaters: enable long-distance entanglement (not yet practical)
- Key management: key storage, distribution, and refresh
The Tokyo QKD Network and Beijing-Shanghai backbone demonstrate metropolitan and inter-city QKD.
The trust assumption is what makes long links work today. The BeijingβShanghai backbone runs about 2000 km through 32 trusted relay sites: the quantum link never spans the full distance, so each intermediate station can read the key in the clear, and security reduces to guarding those rooms. Metropolitan deployments such as the Tokyo QKD Network and city-scale fibre rings show the same pattern at smaller scale β key rates of kilobits per second over tens of kilometres, enough to feed a one-time-pad for a limited stream or, more commonly, to refresh a symmetric key for an AES link. Twin-field and measurement-device-independent protocols push the direct span past 400 km, but they do not remove the need for a network layer that manages key buffers, expiry and rekey intervals.
Python: QKD Security Analysis
import numpy as np
def bb84_key_rate(n, error_rate, efficiency=0.95):
def h(x):
if x <= 0 or x >= 1: return 0
return -x * np.log2(x) - (1-x) * np.log2(1-x)
e = error_rate
rate = 1 - h(e) - efficiency * h(e)
return max(0, rate) * n
n = 1000000
for e in [0.01, 0.05, 0.11, 0.15]:
rate = bb84_key_rate(n, e)
print(f"QBER={e:.2f}: {rate:.0f} bits ({100*rate/n:.1f}%)")
correlations = [1, -1, -1, 1]
S = abs(correlations[0] - correlations[1] + correlations[2] + correlations[3])
print(f"CHSH: S = {S:.3f} (max = {2*np.sqrt(2):.3f})")
The rate column is the one to watch: 84% at 1% error, 44% at 5%, and 2.5% at 11% β a factor of 34 between a healthy link and one sitting on the abort threshold, from a single parameter. The CHSH line prints 2.000 for the correlation signs listed above, which is exactly the classical bound: that assignment is one a local model can reproduce, so it certifies nothing. Security comes from pushing into the gap between 2 and the quantum maximum of 2.828, and the whole margin a real system has to work with lives in that sliver.
Python: Link Budget
Estimating how many secure bits a real fibre run produces, including loss and the composable finite-key penalty:
import numpy as np
def h2(x):
if x <= 0.0 or x >= 1.0:
return 0.0
return -x * np.log2(x) - (1 - x) * np.log2(1 - x)
def link_budget(n_sent, length_km, qber, f_ec=0.95, eta_det=0.10, eps=1e-10):
alpha = 0.2 # dB/km at 1550 nm
channel = 10 ** (-alpha * length_km / 10)
sifted = 0.5 * n_sent * channel * eta_det # basis match x loss x detector
leaked = f_ec * sifted * h2(qber) # error-correction leakage
finite = 2 * np.log2(1 / eps) # composable security penalty
secure = sifted * (1 - h2(qber)) - leaked - finite
return sifted, leaked, max(0.0, secure)
for km in (10, 40, 80, 120):
sifted, leaked, key = link_budget(1e8, km, qber=0.03)
print(f"{km:3d} km sifted={sifted:10.0f} leaked={leaked:9.0f} secure={key:9.0f}")
Doubling the distance costs a factor of in sifted bits: going from 40 km to 80 km keeps only 16% of the detections, and 120 km leaves under 1% of what 10 km produced. The finite-key penalty in this model is a flat 66 bits β invisible against sent photons, but a visible share of a run that only sends a few thousand, which is where composable terms actually bite.
What Breaks a Deployed QKD Link
Failure modes and the countermeasures that operators actually run:
| Failure mode | Observed symptom | Countermeasure |
|---|---|---|
| Detector afterpulsing and dead time | Error rate climbs as count rate rises | Attenuate the source, gate the detectors, search the plateau rather than the peak |
| Photon-number splitting on weak pulses | Eve samples multi-photon pulses losslessly | Decoy states at two or three intensities to bound the single-photon yield |
| Polarisation drift in buried fibre | Sifting rate drifts over hours | Daily or hourly basis alignment, stabilised reference pulses |
| Stray light and dark counts | Elevated baseline error floor | Narrow spectral filtering, cooled detectors, night-time measurement windows |
| Compromised trusted relay | Key exposed in the clear at the node | Physical access control plus end-to-end encryption above the QKD layer |
| Authentication key exhaustion | Session authentication fails after long uptime | Refresh the initial hash key from the generated key material |
Every one of these appears in field reports rather than in protocol papers, and all of them move the effective error rate β the single quantity the secret-key formula reacts to. Monitoring that number continuously, with an abort threshold agreed before deployment, is the operational discipline that separates a lab demonstration from a link that carries traffic.
QKD Protocol Comparison
| Protocol | Basis | Key Generation | Security Proof |
|---|---|---|---|
| BB84 | Discrete | Sifting + error correction | Individual attacks |
| E91 | Entanglement | Bell inequality | Collective attacks |
| B92 | 2 states | Direct | Individual attacks |
| SARG04 | Discrete | Improved sifting | Collective attacks |
| CV-QKD | Continuous | Homodyne detection | Collective attacks |
| MDI-QKD | Discrete | Bell measurement at untrusted relay | Measurement-device-independent |
Common Mistakes
Treating a 11% error rate as a normal operating point
Fix: Hold the error rate near 1β3% and abort above the agreed threshold β at 11% only about 2.5% of sifted bits survive, which is below the cost of running the link
Assuming a trusted node keeps the link quantum-safe end to end
Fix: Each relay holds the key in the clear, so protect the nodes physically and keep application-layer encryption above the QKD layer
Comparing CV-QKD key rates without stating reconciliation efficiency
Fix: Report beta with the rate β standard codes reach 0.95 at short range and collapse as excess noise grows, and the key rate scales linearly with it
Ignoring finite-key terms because the run looks long
Fix: Subtract the composable penalty of two log-squared of one over epsilon β on short runs it consumes a visible share of the output
Key Takeaways
- The secret-key formula is an operating budget: 1% error keeps 84% of sifted bits, 5% keeps 44%, and 11% keeps 2.5%, which is why links are stabilised to 1β3% and aborted rather than pushed through
- BB84 spends half its rounds on sifting, 5β10% on parameter estimation and f times H of e on error correction, so a billion sent photons produce a much smaller usable key before privacy amplification
- E91 security rests on a measured CHSH value above 2 against a quantum maximum of 2.83, and real setups sit near 2.4 with a finite statistical margin
- Deployed long-haul QKD today runs through trusted relays or twin-field links, with field failures dominated by drift, afterpulsing and loss rather than by attacks on the protocol