## 3 Security Analysis
### Parameter Estimation in the Asymptotic Case  
As discussed above, the effective events that [PERSON] decides to send and [PERSON] decides not to send, or [PERSON] decides not to send and [PERSON] decides to send, in \(Z\) windows could generate the secret key. As a matter of fact, the selection of signal windows and decoy windows can be considered as the basis selection. In the decoy windows or the signal windows, sending or not sending a phase-randomized coherent state can be considered as the bit encoding. This assumption is reasonable by considering two cases. The first one is that the random numbers may be leaked to [PERSON] because of the imperfection of the random number generator devices. The other one is that the imperfect state modulation may be prepared by different laser diodes from [PERSON] and [PERSON], and they can be partly distinguished through observing the properties of the spectrum and timing sequence. Therefore, the weak randomness attack model which is used in the BB84 protocol and the MDI-QKD protocol is still appropriate to the SNS TF-QKD protocol. Under the weak randomness model, we suppose that the quantum states prepared by [PERSON] and [PERSON] can be considered as the set \(S\) and \(T\), and \(|S|\) and \(|T|\) represent the number of elements of the set \(S\) and \(T\). For the set of quantum states prepared by [PERSON] ([PERSON]), \(S_{1}(T_{1})\) is the random part and \(S_{2}(T_{2})\) is the non-random part. At this time, the probability of a non-random parameter at [PERSON] could be defined as \(p_{1}=\frac{|S_{2}|}{|S|}\), and the probability of non-random parameter at [PERSON] could be defined as \(p_{2}=\frac{|T_{2}|}{|T|}\). Under the practical QKD system, although we can assume the quantum devices at [PERSON] and [PERSON] are identical, the attack capabilities of [PERSON] against [PERSON] and [PERSON] cannot be guaranteed same. That is, \(p_{1}=p_{2}\) is not necessary. In the model, we can re-describe the quantum states prepared by [PERSON] and [PERSON] in the practical system:  
\[\rho^{\prime}_{[PERSON]}=\frac{p_{1}}{2}\sum\limits_{a=0,1}|a\rangle\langle a|_{ [PERSON]}\otimes|a\rangle\langle a|_{[PERSON]}+(1-p_{1})\rho_{[PERSON]}\otimes|2\rangle \langle 2|_{[PERSON]}, \tag{3}\]  
\[\rho^{\prime}_{[PERSON]}=\frac{p_{2}}{2}\sum\limits_{b=0,1}|b\rangle\langle b|_{ [PERSON]}\otimes|b\rangle\langle b|_{[PERSON]}+(1-p_{2})\rho_{[PERSON]}\otimes|2\rangle\langle 2|_{[PERSON]}. \tag{4}\]  
where the quantum states prepared by [PERSON] and [PERSON] can be divided into two parts: the first part is prepared by a non-random set, and the second part is prepared by a random set. In the case in which the quantum states are in the first part, the assistant quantum states of [PERSON] are related to [PERSON]'s ([PERSON]'s) system. More precisely, if the auxiliary quantum state of [PERSON] is \(|a\rangle\langle a|_{[PERSON]}\) [PERSON] can obtain the secret key \(a\) of [PERSON]; if the auxiliary quantum state of [PERSON] is \(|b\rangle\langle b|_{[PERSON]}\) [PERSON] can obtain the secret key \(b\) of [PERSON]. In the case in which the quantum state is prepared in the second part, if the auxiliary quantum state of [PERSON] is \(|2\rangle\langle 2|_{[PERSON]}\) it indicates that [PERSON] and [PERSON] prepared the phase-randomized coherent states, which is equivalent to a probabilistic mixture of different photon-number states \(\rho_{[PERSON]}=\sum\limits_{k=0}^{\infty}\frac{e^{-p_{k}}\mu_{k}}{k! }|k\rangle \langle k|\) and \(\rho_{[PERSON]}=\sum\limits_{k=0}^{\infty}\frac{e^{-p_{k}}\mu_{k}}{k! }|k\rangle \langle k|\) and [PERSON] can not distinguish encoding states. Therefore, [PERSON] can distinguish the random part and non-random part states of [PERSON] and [PERSON] by observing auxiliary quantum states. The practical QKD systems require perfect random numbers for preparing quantum states. Unfortunately, the weak randomness of state preparation in practical QKD systems is universal because of the imperfections of quantum devices.