Reminder: Test 3 (Module 3) is in class on Wednesday, October 28th. The syllabus on the Tests tab is now updated (elliptic curves, plus the quantum material through today: qubits, superposition, measurement, and quantum key distribution), along with review problems.
Today we finished Quantum Key Distribution (BB84)!
Lecture notes and video: my notes from today’s Zoom lecture are posted (also on the Notes/Videos page and the Archive). The link to the Zoom recording is on discord.
Relevant Textbook Sections:
Chapter 6 (Quantum): quantum key distribution.
To Do:
We use the encoding from lecture: in the basis, is the bit and is the bit ; in the basis, is the bit and is the bit .
-
Play Alice and Bob on paper. Alice sends eight photons and Bob measures them:
Photon 1 2 3 4 5 6 7 8 Alice’s basis Alice’s bit 1 0 1 1 0 0 1 0 Bob’s basis Bob’s measured bit 1 1 1 0 0 0 1 0 - Which photon (which arrow) did Alice send each time?
- After Alice and Bob announce their bases publicly, which photons do they keep? What is their shared secret key?
- For photon 2, Bob measured a but Alice sent a . Explain why this is not an error, and why photon 2 tells Bob nothing about Alice’s bit.
- Eve was listening to the public conversation. What does she learn?
-
Quantum Key Distribution in pairs! I think this will get confusing with everyone simultaneously on the #ciphertexts channel, so I want you to do this in pairs in the “QKD pairs” channel category of discord. There you will find plenty of text channels, so fill them up with two people each as you arrive, taking the first empty spot (the first person needing a partner or the first unused channel). Announce your arrival. The first person to arrive in a channel is Alice, the second person to arrive is Bob. Once two people are there, it’s full, so pick the next channel. You’ll do all communication on the channel so I can help you debug if it doesn’t work.
- Open up the QKD BB84 Tools. The first box contains some code to initialize; no need to read this, just run it. The second box is a spot where you can either create photons (in our instantiation, they are just mysterious looking integers), or measure existing photons. It just holds an example for now.
- Once you know if you are Alice or Bob, follow the protocol for your role.
- If playing the role of ALICE:
- Here’s a spreadsheet you might find useful (optional; view only but you can copy it).
- Choose a sequence of 16 random choices of basis: example V L V V etc. The best way to do this is with a random number generator (like
randint()in Sage). - Now choose a sequence of 16 bits: example 011001010101 etc. Again, true or good pseudo-randomness is best.
- Use your two sequences to generate photons using the command
generate_photonin the QKD BB84 Tools page. This will create 16 integers (the photons), which you should obtain and paste into the channel as your “outgoing photon stream”. - Wait until Bob harvests your photon stream and reports that they are done “measuring” the photons.
- Then, post to the channel the list of bases you used on your photons.
- Bob will also post their list of bases used on the channel.
- Then, determine the shared secret key from these two lists. Share it and see if Bob agrees.
- If playing the role of BOB:
- Here’s a spreadsheet you might find useful (optional; view only but you can copy it).
- Choose a sequence of 16 random choices of basis: example V L V V etc. The best way to do this is with a random number generator (like
randint()in Sage). Keep this secret for now. - Alice will create a stream of photons (integers). Harvest (cut-n-paste) Alice’s photon stream, and use the command
measure_photon()in the QKD BB84 Tools page to measure them using your list of bases (first basis to measure first photon etc.) Record the measurements and keep them secret. - Report to the channel you have finished measuring.
- Then, report to the channel your list of bases.
- When Alice also reports her list of bases, derive the shared secret.
- Then, post the shared secret you derived to check if it agrees with Alice’s.
- To Do: When you’re done, just post to canvas a screenshot or record of your experience; you can screenshot the channel or you can screenshot your spreadsheet or a text file you kept a record in; whatever, just to show you did it.
-
How long is the key?
- For each photon, what is the probability that Alice and Bob chose the same basis?
- In the pairs exercise above, you sent 16 photons. What is the expected length of the shared key? What is the probability that the key has exactly that length? How long was the key you actually got?
- If Alice and Bob need a 128-bit key, about how many photons should Alice send?
-
Eve intercepts. Alice sends . Eve intercepts it, measures it in the basis, and sends Bob a fresh photon in whatever state she measured. Bob measures in the basis.
- What are the possible outcomes of Eve’s measurement, and their probabilities? What photon does she send on to Bob in each case?
- What is the probability that Bob measures the bit , as Alice intended?
- What would have happened if Eve had guessed the basis instead?
-
Catching Eve. Now suppose Eve intercepts every photon, measures each in a randomly chosen basis, and resends what she measured.
- Consider a photon where Alice and Bob chose the same basis (so it goes into the key). Show that the probability Bob’s bit disagrees with Alice’s is .
- To check for Eve, Alice and Bob publicly compare 20 of their key bits (and then throw those bits away). If Eve intercepted every photon, what is the probability that all 20 bits agree anyway, so Eve goes undetected?
- Why is it safe for Alice and Bob to announce their bases publicly, but not their bits?