# Quantum Key Distribution in the Presence of the Intercept-Resend with Faked States Attack
## Appendix A The Gain of Detection Events  
In Table 1 (upper part), the symbol \(Q_{(+)}\) represents the gain of the single detection events. According to [15], the gain of detection events is obtained from two parts: the photon source and the quantum channel. The photon source has an expected photon number \(\mu\), and it follows a Poisson distribution. On the other hand, the quantum channel presents a distribution that is computed for each \(i\) photons' state (where \(i\) is the number of photons in each pulse) that is called yield. The gain \(Q_{i}\) of \(i\) photons' state is the product of the probability of [PERSON] sending an \(i\) photons' state (that follows a Poisson distribution) and the yield of \(i\) photons' state (and background states). It will produce a gain at [PERSON]'s side caused by the detection of events according to the relation \(Q_{i}=Y_{i}\frac{\mu^{i}}{i!}e^{-\mu}\) where \(Y_{i}\) is the yield of \(i\) photons' state.  
The yield \(Y_{i}\) is computed across the following steps:  
1. The fiber channel transmittance between [PERSON] and [PERSON] is written as \(T_{AB}=10^{-\frac{\mu I}{10}}\) where \(\alpha\) is the loss coefficient measured in dB/km, and the length \(l\) is measured in km. Furthermore, the local transmittance at [PERSON]'s side \(\eta_{B}\) is written as \(t_{B}\cdot\eta_{D}\) where \(t_{B}\) is the internal transmittance of optical components and \(\eta_{D}\) is the quantum efficiency of [PERSON]'s detectors. Then, the overall transmission and detection efficiency at [PERSON]'s side \(\eta_{BT}\) is computed as \(\eta_{BT}=t_{B}\cdot\eta_{D}\cdot\tau_{AB}\) and typically \(\eta_{BT}\) ranges \(10^{-3}\)[15];
2. The transmittance \(\eta_{i}\) of \(i\) photons' state at [PERSON]'s, that is \(\eta_{BTi}=1-(1-\eta_{BT})^{i}\) for \(i=0,1,...\), assuming independence between the \(i\) photons of the \(i\) photons' state;3. The yield \(Y_{i}\) of the \(i\) photons' state is obtained from two sources, the background noise (\(Y_{0}\)) and the true signal. Assuming that the background counts are independent from the signal photon detection, \(Y_{i}\) is given by \(Y_{i}=Y_{0}+\eta_{BTi}-Y_{0}\eta_{BTi}\). However, assuming \(Y_{0}\) small (around \(10^{-5}\)) and \(\eta_{BT}\sim 10^{-3}\), the above equation can be reduced to \(Y_{i}\sim Y_{0}+\eta_{BTi}\).  
The overall gain \(Q_{(+)}\) is the summation of each \(Q_{i}\) contribution, thus \(Q_{(+)}=\sum_{i=1}^{\infty}Q_{i}=\sum_{i=1}^{\infty}Y_{i}\frac{u^{i}}{u!}e^{-\mu}\), which leads to the relation \(Y_{0}+1-e^{-\mu\eta_{BT}}\). Finally, the Quantum Bit Error Rate (\(QBER\)) between [PERSON] and [PERSON] has been derived in [15] through the relation \(QBER_{AB}=\frac{0.5Y_{0}+\epsilon_{d}(1-e^{-\mu\eta_{BT}})}{Y_{0}+1-e^{-\mu \eta_{BT}}}\), where \(\epsilon_{d}\) is the error probability of the detector (\(e_{d}\sim 10^{-2}\)).  
In order to obtain the gain of double detection events \(Q_{(-,-)}\), \(Q_{(\pm,\mp)}\) and \(Q_{(+,+)}\), we assume that each gain is independent of the other, that is \(Q_{(-,-)}=Q_{(-)}\times Q_{(-)}\), \(Q_{(+,-)}=Q_{(+)}\times Q_{(-)}\), \(Q_{(+,-)}\sim Q_{(-,+)}\) and \(Q_{(+,+)}=Q_{(+)}\times Q_{(+)}\). From the previous discussion, we have that the gain of the double detection events decreases quadratically \(Q_{(+,+)}\sim Q_{(+)}^{2}\). In practical implementations of \(QKD\), the single-matching events have the order of \(10^{-5}\), while the double matching events reach the order of \(10^{-10}\).