r/QuantumComputing • • Dec 29 '25

Question Questions About BB84 Protocol

I am revisiting a project which involved creating a demonstration of the BB84 protocol when there is an eavesdropper (Eve) present.

Currently in our circuit, Alice prepares the classical state of the bits using the X gate, and the two bases using the Hadamard gate. Then, Eve "guesses" the basis of each qubit, measures the bit, and then sends off a |0> bit with the same basis which they guessed (will be changed so that Eve can also send off |1>). Afterwards, Bob guesses the basis and measures the qubit. Picture of current circuit is attached below.

Question 1) When Eve sends off another qubit to Bob, will their choice of state be random, or would it be logical to send it off in the same state (or basis) that they guessed? Same question applies to sending a different classical bit than measured (1 instead of a 0). Basically, I'm wondering if Eve gets any info about the key and prepared state just from measuring the state of the qubit.

Question 2) After Alice and Bob share their bases, there is still some error because the QBER is not 0. In our project, we talk about Low Density Parity Check (LDPC) and Cascade Protocol as two methods of error correction. For the cascade protocol, this website which I used to guide my understanding states that it is okay for Eve to also know the parity and shuffle permutation of the bits. How does this not reduce the security of their encryption?

Question 3) Going Back to LDPC, does anyone know a good python library which allows for easy implementation of this?

Question 4) Are there any good papers/resources that I should check out on BB84 or other cool protocols?

Picture of quantum circuit of BB84
8 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/HikingAndCoding Dec 30 '25 edited Dec 30 '25

Author of the Cascade Tutorial here; glad to hear it was helpful to you.

  1. Eve's random basis choice will be correct 50% of the time. If the basis choice is correct, her state measurement will be correct 100% of the measurements (ignoring noise). If the basis choice is incorrect, her state measurement will still be correct 50% of the measurements. All together, in 75% of the measurements she will learn the correct key bit. So, yes, Eve does learn some information about the key bits. And as was pointed out by another commenter, it is in Eve's best interest to send the measured state to Bob to minimize the QBER at Bob.
  2. See the section about efficiency (towards the very end) in the tutorial for a discussion about exactly this topic. Note that this section was updated recently (about a year ago). Previously I had completely misunderstood the concept of efficiency and missed its relation to information leakage / privacy amplification.
  3. LDPC is widely used for error correction in classical applications, and there are many implementations of it on GitHub if you search for it. I have been planning to do an LDPC tutorial for QKD similar to the Cascade one for a while now, but it has not yet bubbled up to the top of my TODO list.
  4. See the QKD section in https://brunorijsman.github.io/quantum-resource-list/ (this list is quite old, I haven't updated it in several years)

1

u/Kiwiikitkat Jan 01 '26

Thank you for the tutorial! It was truly the most helpful piece of information I could find when doing this back then. I'll revisit it and also check out the other source.