## 5 Conclusions  
In this paper, we study the influence of weak randomness on the security of SNS TF-QKD in the asymptotic and the finite-key size case. Our simulation results indicate that in both cases, SNS TF-QKD can still have the prominent performance under the weak random condition: the secret key rate can exceed the PLOB bound and achieve long secure transmission distances. Moreover, the fluctuation of the final key rate with the finite-key size is greater than that in asymptotic cases, and because of Eve's attenuation operation, the greater the number of total pulses, the more reduced the secure transmission distance. Additionally, the impact of the weak randomness on the final security key rate is greater than that with the finite total numbers of transmitting signals when \(p_{1}=p_{2}\geq 10^{-4}\), and weaker when \(p_{1}=p_{2}\leq 10^{-5}\). Under the weak randomness condition, SNS TF-QKD and MDI-QKD perform differently. The secret key rate of SNS TF-QKD still can surpass the PLOB bound when \(p_{1}(p_{2})\leq 10^{-6}\) with the finite-key size, and it cannot surpass the PLOB bound when \(p_{1}(p_{2})\geq 10^{-5}\) in the asymptotic case. MDI-QKD cannot generate a secure key when \(p_{1}(p_{2})\geq 10^{-3}\), while SNS TF-QKD has an advantage of tolerating the weak randomness (up to \(10^{-2}\)).  
We conclude that to avoid such an attack in the actual QKD systems, two aspects can be taken into account: (1) to make sure that the random numbers we use to encode, select bases, select time windows, and send or not send quantum states are as perfect as possible. We are supposed to use a better random number generator or random number generation algorithm, and (2) at the source side, we should ensure the reduction of the risk of the side channels, so as to avoid the distinguishability of the quantum states preparation in all degrees of freedom, such as the distinguishability between signal states and decoy states, and the distinguishability between perfect random states and weak random states. We can use two independent laser sources so that [PERSON] and [PERSON] have no incidental light,  
Figure 5: (Color online)The optimal key rate (bits per pulse) in logarithmic scale versus transmission distance between [PERSON] and [PERSON] with weak randomness in the BB84 protocol, the MDI-QKD and the SNS TF-QKD. The blue lines are results weak randomness parameters, and the solid lines are the results of \(N=10^{15}\) with different weak randomness parameters.  
and hence there is no need to monitor the incident light as the implementations directly use seed light from [PERSON]. The imperfect IM will also produce the states distinguishability in the frequency domain. We can use more than one IM in the actual QKD systems. Furthermore, the narrow spectral filter and wavelength filter can also be used to the reduce states distinguishability and the threat of side channels.  
Conceptualization, X.-L.J.; methodology, X.-L.J. and Y.W.; software, X.-L.J. and Y.W.; validation, X.-L.J.; formal analysis, X.-L.J., Y.W. and Y.-F.L.; investigation, X.-L.J.; writing--original draft preparation, X.-L.J. and Y.W.; writing--review and editing, C.Z., J.-J.L. and W.-S.B.; supervision, W.-S.B.; project administration, W.-S.B.; funding acquisition, W.-S.B. and Y.W. All authors have read and agreed to the published version of the manuscript.  
This research was funded by the National Natural Science Foundation of China (Grant No. 62101597), the National Key Research and Development Program of China (Grant No. 2020 YFA0309702), the China Postdoctoral Science Foundation (Grant No. 2021M691536), the Natural Science Foundation of Henan (Grant No. 202300410534) and the Anhui Initiative in Quantum Information Technologies.  
Not applicable.  
The authors declare no conflict of interest.