First of all, sorry if the title is not that clear, I'll provide an in-depth explanation behind my question.
So, basically I was reading about quantum cryptography and came across BB84. The protocol uses photon pulses composed of polarized photons, which spin in a specified direction. That may be rectilinear spin (i.e. horizontal/vertical) or diagonal spin (i.e. left-diagonal/right-diagonal).
If performed correctly, this is in theory, unbreakable. Because quantum mechanics laws don't allow measurements to be done without damaging the photons used in the communication.
Here's how it works:
- Alice sends Bob a sequence of photon pulses, each one randomly polarized in one of the four possible direction (listed above).
- Bob measures the pulses by setting his polarization detector in one of the two possible spin types (rectilinear or diagonal), randomly. He cannot measure both, because quantum mechanics doesn't allow this. If the detector is not correctly set, he will get a random measurement. (Note: Remember that the rectilinear polarization detector will detect both horizontal and vertical spinning photons, and vice versa the diagonal detector will detect both left-diagonal and right diagonal spinning photons).
- After the measurement is done, Bob will send Alice the detectors configuration he used (ex. first photon was measured with a diagonal detector, second was measured with a rectilinear, etc.) over a public channel.
- Alice responds, in the public channel, to Bob. By saying which of the configurations were correctly set. (ex. the first was diagonal, and correct, the second rectilinear and incorrect, etc.)
- Bob and Alice then take the correct configurations, and they convert those to a prearranged code, which could be, as an example, that a correctly guessed diagonal detector is 0, and a correctly guessed rectilinear detector is 1. This way an encryption key will be composed.
This is how I understood the algorithm, so it may very probably be not entirely correct. Please correct me in any point if needed!
Anyway, after explaining how I see the algorithm, my question is: does this basically rely on a shared secret? I mean, the prearranged code to convert the polarization measurements to bits should be, as the name says, prearranged. If Eve listens on the public channel, and gets both Bob's measurements and Alice response, which lists the correct polarizations, and she know that a diagonal pol. converts to a 0 while a rectilinear pol. converts to a 1, she can reconstruct the key without interfering with the quantum channel.
If this is true, why would we go for quantum key distribution? If we need a secretly prearranged code to make it work? That would have to be kept secret to prevent keys recovering right?