← Thomay Lab Outreach

BB84 Quantum Key Distribution

Buffalo Astronomical Association · Hands-on outreach worksheet
Instructions

This packet lets two players (Alice and Bob) run the BB84 protocol with dice and pen-and-paper. After enough rounds, they encrypt a short message with their shared secret key.

What you need

Dice conventions

Red d6 (basis)odd (1,3,5) → + basiseven (2,4,6) → × basis
Black d8 (bit)1–4 → bit 05–8 → bit 1

What Alice and Bob each do (per round)

Alice (sender)

  1. Roll red d6 → record basis (+ or ×)
  2. Roll black d8 → record bit (0 or 1)
  3. Look up the λ/2 angle below and set the waveplate
  4. Fire the laser. Bob takes his reading.

Bob (receiver)

  1. Roll red d6 → record basis (+ or ×)
  2. Set his λ/2 to the angle for that basis
  3. Watch which detector fires:
    det 0 → bit 0 · det 1 → bit 1
  4. Record the bit on his sheet

λ/2 plate angles to set

Alice

BasisBitOutput polarizationλ/2 physical angle
+00° (horizontal)
+190° (vertical)45°
×0−45°−22.5°
×1+45°+22.5°

A λ/2 plate rotates polarization by 2× its physical angle, which is why each setting is half of the target.

Bob

Basisλ/2 physical angleEffect
+PBS already analyzes H vs V — no rotation
×22.5°Rotates ±45° back to 0°/90° so PBS reads it

Bob doesn't choose a bit — the detectors decide. det 0 fires → bit 0, det 1 fires → bit 1.

Polarization quick reference

+ · bit 0
+ · bit 1
90°
× · bit 0
−45°
× · bit 1
+45°

5-bit alphabet (for encryption)

A00000 B00001 C00010 D00011 E00100 F00101 G00110
H00111 I01000 J01001 K01010 L01011 M01100 N01101
O01110 P01111 Q10000 R10001 S10010 T10011 U10100
V10101 W10110 X10111 Y11000 Z11001

After the rounds: sifting & encryption

  1. Alice and Bob compare their bases publicly (round by round). Keep rounds where the bases match; cross out rounds where they differ.
  2. The kept bits form the sifted key — Alice's and Bob's should agree (in a clean channel they do).
  3. Encode the message in 5-bit binary using the alphabet table.
  4. XOR (binary add) the message with the key, bit by bit: 0+0=0, 0+1=1, 1+0=1, 1+1=0.
  5. Bob decrypts the same way: ciphertext XOR key → original message.

Binary XOR rules: 0⊕0=0 · 0⊕1=1 · 1⊕0=1 · 1⊕1=0

Alice's worksheet

Record your dice rolls, set the λ/2 angle, fire the laser.
ALICE

Reminder. Roll the red d6 to pick a basis (odd → +, even → ×). Roll the black d8 to pick a bit (1–4 → 0, 5–8 → 1). Set your λ/2 to the angle in the rightmost column, then signal Bob.

# Red d6
(1–6)
Basis
+ or ×
Black d8
(1–8)
Bit
0 or 1
λ/2 angle
0° / 45° / −22.5° / +22.5°
Notes
13+7145°(example row)
24×20−22.5°(example row)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Quick reference: +·0 → 0° · +·1 → 45° · ×·0 → −22.5° · ×·1 → +22.5°

Bob's worksheet

Roll for a basis, set your λ/2, see which detector fires.
BOB

Reminder. Roll the red d6 to pick a basis (odd → +, even → ×). Set your λ/2 to for +, or 22.5° for ×. When Alice fires the laser, see which detector goes off: det 0 → bit 0, det 1 → bit 1.

# Red d6
(1–6)
Basis
+ or ×
λ/2 angle
0° or 22.5°
Detector
det 0 or det 1
Bit
0 or 1
Notes
12×22.5°det 11(example row)
25+det 00(example row)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Reminder: + basis → λ/2 at 0° · × basis → λ/2 at 22.5°. The detector that fires tells you the bit.

Sifting & encryption

Compare bases publicly, build the sifted key, encrypt the message.
BOTH

Step 1 — Public basis comparison

Copy each round's basis and bit from Alice's and Bob's worksheets. Mark "keep" (✓) if Alice and Bob used the same basis, "discard" (✗) otherwise.

# Alice
basis
Alice
bit
Bob
basis
Bob
bit
Same?
✓ / ✗
# Alice
basis
Alice
bit
Bob
basis
Bob
bit
Same?
✓ / ✗
1+1+116
2×0+117
318
419
520
621
722
823
924
1025
1126
1227
1328
1429
1530

Step 2 — Sifted key

Write Alice's bits from the kept (✓) rounds, in order, in the cells below. This is the shared secret key (Bob's bits in those same rounds should match).

Sifted key

Step 3 — Encode the message

Write the message letter-by-letter, then encode each letter in 5 bits using the alphabet table.

Letter
Data bit
Key bit (⊕)
Ciphertext

XOR rules: 0⊕0=0 · 0⊕1=1 · 1⊕0=1 · 1⊕1=0

Step 4 — Decrypt (Bob)

Bob XORs the ciphertext with his copy of the key, then looks up each 5-bit chunk in the alphabet table.

Ciphertext
Key bit (⊕)
Decoded bit
Letter

If Alice and Bob used a clean channel, the decoded message should match the original. If an eavesdropper was intercepting, ~25% of same-basis bits will disagree → the decoded message will be garbled.