I am trying to solve the exercise 5.3 from the book "A Gentle Introduction to Quantum Computing". The exercise reads as follows:

Suppose Eve attacks the BB84 quantum key distribution of Section 2.4 as follows. For each qubit she intercepts, she prepares a second qubit in state $|0\rangle$, applies a $C_{\text{not}}$ from the transmitted qubit to her prepared qubit, sends the first qubit on to Bob, and measures her qubit. How much information can she gain, on average, in this way? What is the probability that she is detected by Alice and Bob when they compare s bits? How do these quantities compare to those of the direct measure-and-transmit strategy discussed in Section 2.4?

First of all, there is a solution in this link. I am going to explain my conclusions and you will see how they differ from this solution.


We have to analize two cases:

  1. Alice codifies in the standard basis. In this case we see that: $$ \begin{align} C_{NOT}(|0\rangle_A|0\rangle_E) &=|0\rangle_A|0\rangle_E \\ C_{NOT}(|1\rangle_A|0\rangle_E) &=|1\rangle_A|1\rangle_E \end{align} $$ Now, if Eve reads in standard basis (std) and Bob does the same, Eve would obtain the bit of the shared chain and she would be undetected. If she uses the Hadamard basis (Had) she would not obtain any information, but, because his qubit is unentangled with respect to Bob's qubit, she would stay undetected. Either way, Eve would be undetected 100% of the time and would obtain info 50% of the time. This in absolute probabilities translates into: $$ \begin{align} \mathbb{P}_1(\text{Eve gets info}) &= \mathbb{P}(\text{Alice uses std}) \cdot \mathbb{P}(\text{Eve reads in std}) \cdot \mathbb{P}(\text{Bob reads in std}) \\ &= \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8}\ \end{align} $$

  2. Alice codifies in Had. In this case we see that: $$ \begin{align} C_{NOT}(|+\rangle_A|0\rangle_E) &=|\Phi^{+}\rangle = \frac{1}{\sqrt{2}}(|0\rangle_A|0\rangle_E + |1\rangle_A|1\rangle_E) \\ C_{NOT}(|-\rangle_A|0\rangle_E) &=|\Phi^{-}\rangle = \frac{1}{\sqrt{2}}(|0\rangle_A|0\rangle_E - |1\rangle_A|1\rangle_E) \end{align} $$ In this case, Eve's and Bob's qubits are entangled (Bell states). It is clear that we can read $|0\rangle$ or $|1\rangle$ with equal probability when we use std. But if we rewrite the states as: $$ \begin{align} |\Phi^{+}\rangle &= \frac{1}{\sqrt{2}}(|+\rangle_A|-\rangle_E + |-\rangle_A|+\rangle_E) \\ |\Phi^{-}\rangle &= \frac{1}{\sqrt{2}}(|+\rangle_A|-\rangle_E - |-\rangle_A|+\rangle_E) \end{align} $$ it becomes as clear that if we read with Had we also have equal probability of reading $|+\rangle$ or $|-\rangle$. Now, there are various combinations that we have to have into account:

    • Eve reads with std and Bob with Had. In this case Eve won't obtain a valid value of the chain and Bob and Alice will detect Eve 50% of the times. $$ \begin{align} \mathbb{P}_1 &(\text{Eve gets detected}) \\ &= \mathbb{P}(\text{Alice uses Had}) \cdot \mathbb{P}(\text{Eve reads in std}) \cdot \mathbb{P}(\text{Bob reads in Had}) \cdot \mathbb{P}(\text{Bob dif value}) \\ &= \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{16}\ \end{align} $$
    • Eve reads with Had and Bob with Had. The results will be oposite but, because Eve knows this, she knows the chain value. Bob and Alice will detect Eve 50% of the times. $$ \begin{align} \mathbb{P}_2(\text{Eve gets info}) &= \mathbb{P}(\text{Alice uses Had}) \cdot \mathbb{P}(\text{Eve reads in Had}) \cdot \mathbb{P}(\text{Bob reads in Had}) \\ &= \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8}\ \end{align} $$ The probability of Eve getting detected is the same as in the previous point $\mathbb{P}_2(\text{Eve gets detected}) = \mathbb{P}_1(\text{Eve gets detected})$.
    • Bob reads with std. It doesn't matter what Eve does because the value will be discarded.

So, we can conclude that:

$$ \mathbb{P}(\text{Eve gets detected}) = \mathbb{P}_1(\text{Eve gets detected}) +\mathbb{P}_2(\text{Eve gets detected}) = \frac{1}{16} + \frac{1}{16} = \frac{1}{8}, $$

so, if they compare $s$ bits, the probability of Eve getting detected should be $1 - \left(\frac{7}{8}\right)^{s}$. And $$ \mathbb{P}(\text{Eve gets info}) = \mathbb{P}_1(\text{Eve gets info}) +\mathbb{P}_2(\text{Eve gets info}) = \frac{1}{8} + \frac{1}{8} = \frac{1}{4}. $$

I hope someone will be able to confirm that my solution is right or, otherwise, where it is wrong. Both would be equally great!

  • 1
    $\begingroup$ Welcome to QCSE. I’m pretty sure this is right, but it’s not clear how to answer this without simply saying “It’s right, good job.” Can you consider editing your posting to ask a question whose answer is not just “Yes that’s correct”? For example, is there a particular aspect of Eve’s attack that you’d like to know more about? $\endgroup$
    – Mark S
    Sep 27 at 23:49
  • $\begingroup$ @MarkS Sorry, I am not used to ask questions, even though I have read a lot of them over the years! I just wanted to make sure that my solution and my understanding of the attack was right, because I'm trying to build my foundations correctly. But now that you asked, can you tell me if there is a more effective Eve's attack? Thank you very much. $\endgroup$ Sep 28 at 15:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy