BB84 protocol works followingly:
- Alice generate $N$ random qubits $a_i$ in state either $|0\rangle$ or $|1\rangle$ . These will be a key. Then she prepares $N$ random bits $b_{i}$. If $b_i=0$, an identity gate is applied and qubit is left in either state $|0\rangle$ or $|1\rangle$. If $b_i=1$ then Hadamard gate is applied changing qubit $a_{i}$ to either state $|+\rangle$ or $|-\rangle$. After that qubits are sent to Bob.
- Bob generates $N$ random bits. According to the value of $b_{i}^{'}$ he applies either identity or Hadamard gate on received qubit $a_{i}$ and measure it, receiving either 0 or 1.
- Alice and Bob compare bits $b_i$ and $b_i^{'}$. If they are equal, now classical bit $a_i$ is preserved and become part of the key. About $N/2$ of $a_{i}$ bits are preserved on average.
- Alice and Bob send each other $N/4$ $a_{i}$ bits to analyze a noise level. In case the level is higher than some threshold (natural noise level of the channel used for a quantum communication), there is a high probability that Eve tried to catch communication between Alice and Bob. In such a case, the current key is dismissed and the process starts again.
- Alice and Bob reconcile the key obtained in step 4 to ensure that both have the same key, cleaned from noise. At the same time, they have to amplify privacy to hide the key from Eve because this communication is done via the classical channel.
So, my question is how step 5 is done in practice? To reconcile the key, they have to exchange some information about it. I found that a hash function can be used for concealing information about the key from Eve as much as possible. However, if the information is hidden, how can Alice and Bob repair the key to ensure they have the same one?