{'fraction_non_alphanumeric': 0.035163588671085745, 'fraction_numerical': 0.012796426925667292, 'mean_word_length': 4.408742331288344, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Strong light illumination on gain-switched semiconductor lasers helps the eavesdropper in practical quantum key distribution systems

The temperature of the semiconductor diode increases under strong light illumination whether thermoelectric cooler is installed or not, which changes the output wavelength of the laser (Lee M. S. et al., 2017). However, other characteristics also vary as temperature increases. These variations may help the eavesdropper in practical quantum key distribution systems. We study the effects of temperature increase on gain-switched semiconductor lasers by simulating temperature dependent rate equations. The results show that temperature increase may cause large intensity fluctuation, decrease the output intensity and lead the signal state and decoy state distinguishable. We also propose a modified photon number splitting attack by exploiting the effects of temperature increase. Countermeasures are also proposed.

The sources of practical QKD systems also suffer from some imperfections. Attenuated laser pulses are always used as the "single photon source" in practical QKD systems due to technique limitation. However, the attenuated pulses may contain more than one photons, which can be attacked by photon number splitting (PNS) attack 4 . To against PNS attack on weak coherent source, decoy state method is proposed [22][23][24] . In the "weak + vacuum" decoy state method 25 , a sender (Alice) needs to transmit pluses of three intensities (signal state, decoy state and vacuum state) to a receiver (Bob). Usually, the intensity of signal state is higher than that of the decoy state.
Gain-switched semiconductor laser is widely used in practical QKD systems as the transmitter, because it simplifies the construction of the source and sends phase randomized pulses 26 . The phase randomness of the pulses is assumed in most security proofs. A gain-switched semiconductor laser is driven from the initial carrier density, which is below the threshold, by a strong AC injection current pulse with the level of J AC for each photon pulse generation in QKD systems. The initial carrier density is determined by a DC bias current, J DC . Short pulses are generated by injection of short current pulses into a semiconductor laser. The shape of the output photon pulses are directly defined by J AC and J DC . Actually, the carrier density and photon density vary fast and acutely in the gain-switched operation. A rate equation description is used to efficiently and accurately simulate the performance of gain-switched semiconductor lasers with proper choice of model parameters. The output performance of a semiconductor laser is sensitive to temperature variation 27 . So most semiconductor lasers work with thermoelectric coolers to keep the temperature of semiconductor diode stable.
In Ref. [28], Lee et al. experimentally show that the temperatures of semiconductor diodes can be increased by strong light illumination, even when the lasers are installed with thermoelectric coolers. Due to the limit power of the thermoelectric cooler, the temperature of the diode increases as long as the illumination is strong enough. Temperature increase leads to output wavelength variation which makes pulses from different lasers distinguishable 28 . However, the wavelength variation do not impact the security of QKD systems with only one laser, such as phase encoding systems. Besides, other characteristics of the semiconductor lasers also change with temperature 27,29 . The variations of other characteristics also deviate the behavior of semiconductor lasers from ideal models in security proofs. And the eavesdropper may exploit these variations to steal information about the final key. So it is urgently needed to study the effects of temperature increase on important characteristics of gain-switched semiconductor lasers.
In the following, we mainly focus on the effects of temperature increase on gain-switched semiconductor diodes in QKD systems. This article is constructed as follows: we briefly introduce the temperature dependent single mode rate equation of semiconductor lasers and the model parameters for a gain-switched semiconductor laser used in this paper in Sec. II. Then numerical simulation of the efficient and accurate single mode temperature dependent rate equation is performed in Sec. III. The effects of temperature increase on three characteristics are studied in detail, which include the recovery time of carrier density, the intensity of output pulses and the time interval between signal state and decoy state pulses. In Sec. IV, we propose a modified PNS attack strategy which exploits the effects of temperature increase. We also give out the hacking strategy using side channels in time dimension. Finally, we conclude the paper and discuss countermeasures in Sec. V.

Temperature dependent single mode rate equation of semiconductor laser
Temperature variations effect the output characteristics of semiconductor lasers significantly. Recent research shows the eavesdropper can elevate the working temperature of a semiconductor laser diode by strong light illumination even when thermoelectric cooler is installed. So the effects of temperature increase on the output performance of semiconductor lasers should be taken into consideration in practical QKD systems.
The dynamics of semiconductor laser at different temperatures can be described efficiently and accurately with the following single mode rate equations covering temperature [29][30][31] where t represents time, T is temperature, q is electrical charge, N(t) is the time-variation carrier density and S(t) represents the time-variation photon density. J(t) is the overall injection current and J(t) = J AC (t) + J DC . Others are material parameters of semiconductor lasers, which are explained in detail in Table. 1. Note that N 0 (T ), τ n (T ) and g 0 (T ) are three main temperature related parameters and others can be treated as constants, which are temperature independent. Experiment observations give the following relationship between the threshold current density and the the temperature J th (T ) = J c exp(T /T 0 ) 32 , where T 0 is the characteristic temperature of the diode and J c is the current density constant. Therefore we have By solving Eqs. (1) and (2), the threshold current density of the diode can also be approximately given out by where N th (T ) is the threshold value of carrier density. Here we use the same models as the ones in Ref. [29] to describe g 0 (T ) and N 0 (T ), as shown in Eqs. (5) and (6). The models fit the experiment results very well.
where g 0c is the differential gain coefficient constant, N 0c is the transparent carrier density constant and T 0a is the characteristic temperature of the active region. So we have g 0 (T + ∆T ) = g 0 (T )exp(−∆T /T 0a ), N 0 (T + ∆T ) = N 0 (T )exp(∆T /T 0a ) and By combining Eqs. (3) and (7), we can get Until now, all the three temperature dependent parameters can be calculated at different temperatures. And we can perform numeral simulation of the rate equations (Eqs. (1) and (2)) at different temperatures.

The effects of temperature increase on several characteristics of semiconductor lasers in decoy state QKD systems
As we stated before, Eve can increase the temperature of the semiconductor lasers by strong light illumination 28 . And the temperature increase will impact the output performance of semiconductor lasers. In QKD systems, any deviations from ideal models in security proofs will reduce the amount of final key. Thus, it is very important to study the effects of temperature increase on several characteristics of semiconductor lasers. Here by performing numerical simulation with the temperature dependent single mode rate equations (Eqs. (1) and (2)), we mainly study the effects of temperature increase on three characteristics which include the recovery time of the carrier density, the intensity of output pulses and the time interval between signal state and decoy state pulses.

Recovery time of carriers density
First, we briefly describe the variety of carrier density via time in the gain-switched mode. In the beginning, the carrier density N(t) increases when large current is injected. Then when N(t) reaches the temperature dependent transparent carrier density N 0 (T ), the stimulated radiation process starts. Output laser is generated when N(t) reaches the temperature dependent threshold carrier density N th (T ). Then N(t) falls quickly because of the disappearance of injected current and large amount consumptions of stimulated radiation. When N(t) falls under N 0 (T ), Eq. (1) can be simplified to dN(t)/dt = N(t)/τ n (T ), which means N(t) follows the exponential decay after that.
Normally, N(t) should return to temperature dependent initial carrier density N DC (T ) before the next injection current comes. Otherwise, the initial carrier density of the next pulse is higher than that of the first one, which results a stronger photon pulse. The time needed for N(t) to decay from N 0 (T ) to N DC (T ) is t ed = τ n (T )ln(N 0 (T )/N DC (T )). Note that N DC (T ) = J DC τ n (T )/(qd) 33 and N DC (T ) decreases as the temperature increases. We call the time needed for N(t) to return back to N DC (T ) the recovery time, denoted as t re . The maximal repetition rate of the output photon pulses is 1/t re in practical QKD systems. t ed contributes most of t re . The temperature increase leads to the elevation of N 0 (T ) and the decrease of N DC (T ), which prolongs t ed as well as t re . To reduce the recovery time of carrier density, J DC should be set close to J th (T ) 31,34 . However, the spontaneous emission under high J DC causes high dark counts, which definitely increases the quantum bit error rate and decreases the secure key rate 34 . So the value of J DC should be carefully considered in practical QKD systems. Here we set J DC = 4.8 × 10 2 A · cm −2 as shown in Table.  We can see that N DC (T ) decreases as the temperature increases. N(t) reaches N th (T ) earlier for lower temperature, which leads the maximal value of N(t) smaller for lower temperature. N(t) follows the exponential decay after N 0 (T ) and N 0 (15 • C) <N 0 (35 • C) <N 0 (45 • C). Therefore, the lower the temperature seems to be the lower the carrier density after about 0.1ns.
To simulate the variation of N(t), we excite the semiconductor diode with a single current pulse. The initial carrier density is set to N DC (T ) for different temperatures. The single injection current pulse is rectangular shape and it starts at 0ps and disappears at 100ps. The value of the single injection current pulse is J AC . Other parameters can be found in Table. 1. Fig. 1 shows the numerical simulation results of t re of carrier density at different temperatures. It is obvious that t re extends as the temperature increases. Specifically, t re = 1.24ns at 15 • C and t re = 1.60ns at 45 • C in our simulation, which leads the maximal repetition rate decreases from 806.5MHz to 625.0MHz. In this case, the initial carrier density at 15 • C is N DC (15 • C) = 3.69 × 10 23 m −3 and the carrier density at 45 If the semiconductor laser simulated above works at a frequency of 800MHz and the thermoelectric cooler stabilizes the temperature at 15 • C. N(t) can always returns to N DC (15 • C) before next current pulse comes. However, as we stated before, Eve is able to increase the temperature of the semiconductor diode to T ′ by strong light illumination. As the temperature increases, t re prolongs and N(t) may not return to N DC (T ′ ) before the next injection current applied anymore, which makes the initial carrier density of the second pulse higher than that of the first pulse. So the second photon pulse is stronger than the first one and large photon intensity fluctuation is induced 31,34 . Fig. 2(a) (Fig. 2(b)) shows the numerical simulation results of the time-variation carrier density and photon density of the laser working at 800MHz when the temperature is 15 • C (45 • C). The duration of the injected current, T duration , is also 100ps. The output light intensity is always assumed to be stable in QKD security proofs. However, the numerical simulation results above show that the temperature increase, which is able to be achieved by Eve using strong light illumination or microwave radiation, may strongly effect the output light intensity stability of the semiconductor lasers, especially the output light intensity stability of the lasers which work at the frequency near the maximal repetition rate. More specifically, if a laser works at a frequency of f and 625MHz< f ≤ 806.5MHz, the laser works well at 15 • C and the effect like the one in Fig. 2(b) 4/12 appears when temperature increases to 45 • C. However, when f <625MHz which means the working frequency of the laser at 45 • C is still lower than the maximal repetition rate of 45 • C (625MHz), the effect like the one in Fig. 2(b) will no longer appears.

Intensity of output pulses
The photon density reaches the maximum when N(t) falls back to N th (T ). The number of photons created by stimulated radiation is proportional to the number of carriers consumed in the active region. The initial carrier density is N DC (T ). The carrier density injected in one cycle is J AC T duration /(qd). So the maximal photon density is given by Note that N th (T ) = N 0 (T ) + 1/[g 0 (T )Γτ p ] and N th (T ) increases when the temperature increases. N DC (T ) decreases as the temperature increases. Other parameters in Eq. (9) can be treated as constant. So S max decreases as the temperature increases. Similarly, the stimulated radiation stops when N(t) drops back to N 0 (T ). Therefore, the intensity of the output photon pulse is So the output intensity also drops as the temperature increase. Fig. 3 gives out the numerical simulation results of photon density at different temperatures. By the method of simulating the rate equations (Eqs. (1) and (2)), we can also find the fact that temperature increase leads to the decrease of S max (see Table. 2 for detail). Similar results are founded in experiment in Ref. [35].
The output light intensity is supposed to be constant in most QKD security proofs. However, our analysis and numerical simulation results show that the temperature increase in the laser decreases the output light intensity of semiconductor lasers. So Eve can break the security assumption by strong light illumination (or other tricks to heat the diode) to increase the temperature of the diode. Besides, we can also find that the time of the peak of the output photon pulse prolongs as temperature increases, which also impacts the security of practical QKD with multiple semiconductor lasers 34 .

Time interval between signal state and decoy state pulses
In QKD systems with "weak + vacuum" decoy state method 25 , the signal state pulses and decoy state pulses can be produced by different lasers or by the same laser. The decoy state pulses are excited by a lower AC injection current. In our simulation, we suppose the value of AC injection current of decoy state pulses is 2.0 × 10 4 A · cm −2 and the duration is also 100ps. Two time dependent parameters of the semiconductor lasers should be taken into consideration in QKD systems, which includes the turn on time delay and the peak time delay. The turn on time delay is the interval from the AC injection current applied to the lasing power going out from the laser diode. Note that the laser turns on when N(t) arises to N th (T ). And the interval from the time when AC injection current applied to the time when S(t) reaching maximum value is called the peak time delay. The turn on time delay of signal (decoy) state is denoted as t on (signal(decoy) state). And the peak time delay of signal (decoy) is represented by t peak (signal(decoy) state).  Table 2. Simulation results of S max , t on and t peak of signal state and decoy state at different temperatures. N th (T ) is also given out.
Simulation results of S max , t on , t peak , N DC (T ) and N th (T ) at different temperatures are given out in Table. 2. As we can see, t on (signal state) (t peak (signal state)) is always earlier than t on (decoy state) (t peak (decoy state)). If the time of the injection current applied in the decoy state pulses is the same with that in the signals state pulses, i.e., the signal state pulses and the decoy state pulses are driven by the same clock without adjustment of individual delay, the signal state pulses are always transmitted earlier than the decoy state pulses. This phenomenon is observed in experiment in Ref. [36]. So legitimate users should postpone the time to apply the injection current in signal state pulses, which aligns the peaks of decoy state pulses and signal state pulses in time frame. However, we find that the peaks of the signal state pulses and decoy state pulses are not aligned in time frame anymore when the temperature of the laser diode increases.
Let ∆t on = t on (decoy state) − t on (signal state) and ∆t peak = t peak (decoy state) − t peak (signal state). Fig. 4 shows ∆t on and ∆t peak at different temperatures in our simulation. As we can see, ∆t on varies little. However, ∆t peak rises obviously as the temperature increases. Specifically, ∆t peak increases from 15.1ps at 15 • C to 45.0ps at 45 • C. If the peak of signal state pulses and the peak of decoy state pulses are accurately adjusted to coincide at 15 • C, they will mismatch with a time interval of 29.9ps which is comparable with the light pulse width used in practical QKD systems.
The simulation results show that temperature increase in the diode of a semiconductor laser leads to a distinct raise of ∆t peak . Eve is able to take advantage of this temperature dependent imperfections to enlarge time dependent side channels. That is the signal state can be shifted from the decoy state by increasing the temperature. And the well-aligned signal state and decoy state pulses become distinguishable in time frame as temperature rises, which break the basic assumption of decoy 6/12 state method. Then Eve can launch an improved PNS attack to steal the final key, as explained in Ref. [36]. Moreover, the ratio of signal state intensity and decoy state intensity also rises quickly from 1.61 at 15 • C to 14.56 at 45 • C.

Quantum hacking strategies
We have demonstrated that three main characteristics vary with temperature increase. These variations may effect the security of practical QKD systems. In this section, we will discuss quantum hacking strategies which exploit the variations of three main characteristics.

Hacking with side channels in time dimension
Normally, the carrier density decreases down to the steady level of N DC after a period of time much longer than the carrier life. If the next AC injection occurs after the carrier density becomes back to N DC , output pulse will be identical with the previous one. However, the recovery time of carrier density increases with temperature. As shown in Fig. 2(b), temperature increase may lead the initial carrier density of the pulse higher than that of the previous one when the semiconductor lasers are operated near the maximal repetition rate. So the intensity of the output pulse is relatively stronger than the previous one. And it takes shorter time for carrier density to reach N th (T ) than that in the previous pulse, which leads the pulse emits earlier than the previous one. Such correlation between consecutive pulses destroys randomness whether Alice generates quantum states with true randomness or not. So Eve may take advantage of the side channels in time dimension to steal information 34 . For example, in a polarization based QKD system, Eve detects that one pulse emits earlier in time dimension, she knows that the same laser also fires in the previous cycle and the consecutive pulses contain the same bit information. Temperature increase also decreases the output pulse intensity and prolongs the output timing of the photon pulse, which can also be exploited by Eve. For example, Eve sends strong H-polarized light to the source of a passive-basis-choice polarization based QKD system. Therefore, the temperatures of four lasers have the following relationship, where T H (T + , T − , T V ) represents the temperature of laser H (+, -, V). So the output timing of four lasers are shifted, which also enlarges side channels in time dimension.

Modified PNS attack on decoy state QKD systems
As stated before, the signal state and decoy state may become distinguishable when the temperature increases. Besides, the intensity of output pulse decreases and the ratio of signal state intensity to decoy state intensity also rises as temperature increases. By combining these phenomena, we propose a modified PNS attack on decoy state QKD systems. We grant Eve with quantum nondemolition (QND) measurement ability.
The modified PNS attack strategy is shown in Fig. 5. First, Eve increases the temperature of semiconductor laser by some methods, such as strong light illumination. Then, because the signal state may partially overlap the decoy state, Eve can determine the state of a photon pulse (signal state or decoy state) with a probability denoted as p dis by exploiting side channels in time dimension, which can be achieved by using QND measurement ability and operating the optical switch precisely. For the certain decoy state pulses, Eve blocks single photon pulses with a probability of p block and lets other pulses pass without  disturbing. And the uncertain state pulses are all blocked by Eve. Moreover, for the certain signal state pulses, Eve mounts PNS attack and splits n − 1 photons from n-photon pulses when n ≥ 2, i.e., Eve only lets one photon pass for pulses with multiple photons. And she blocks all single photon signal state pluses. To compensate the count rates of signal state and decoy state pulses, Eve also replaces the quantum channel with a lower loss one. So Eve can obtain all the information about the key. Indeed, the increase of the time interval between the signal state and decoy state pulses with temperature gives Eve the possibility to distinguish the signal state and decoy state pulses. Besides, the decrease of the output pulse intensity and the increase of the ratio of signal state intensity and decoy state intensity provide the convenience for Eve to mount our modified PNS attack on the signal state pulses. Note that no additional errors are induced in the modified PNS attack. So Eve only needs to keep the count rates of the signal state and decoy state pulses the same with the ones without attack. Next we will theoretically show that this modified PNS attack is feasible in long transmission distance. Let us consider the QKD systems with "weak + vacuum" decoy state method. Suppose the average photon number of signal state is µ and the average photon number of decoy state is ν without attack. When the temperature increases, the average photon number of signal state (decoy state) becomes µ ′ = α µ (ν ′ = β ν), where 1>α>β >0. According to Ref. [25], the count rate of signal state without attack is where Y n = 1 − (1 − η) n + Y 0 is the yield of an n-photon state pulse, η is the overall transmittance without attack and Y 0 is dark count rate. Similar, the count rate of decoy state without attack is After our attack, the count rate of decoy state is where Y ′ n = 1 − (1 − η ′ ) n + Y 0 is the yield of an n-photon state pulse under attack and η ′ is the overall transmittance under attack. The count rate of signal state after our modified PNS attack is To keep the count rates of signal state and decoy state the same with those without attack, we have Q µ = Q µ ′ and Q ν = Q ν ′ . Therefore, we can get 8/12 so we can calculate η ′ and p block . The numerical simulations use some GY S experiment parameters, including including the loss coefficient in the quantum channel δ = 0.21 dB/km; the dark count probability Y 0 = 1.7 × 10 −6 ; the average photon number of the signal state µ = 0.48; the average number of the decoy state ν = 0.05; and η = 0.045 × 10 −δ L/10 , where L is the transmittance distance. We also suppose that α = 0.8, β = 0.4, p dis = 0.8 and η ′ = 0.045 × 10 −δ ′ L/10 , where δ ′ is the loss coefficient of the new replaced quantum channel and 0 ≤ δ ′ ≤ δ . So η ′ ≤ 0.045. Moreover, in practice, Eve can only block a part of signal state pulses containing only one photon and 0<p block <1 is also needed to be satisfied.   6 shows the simulation result of the relationship between η (η ′ ) and L. To keep η ′ ≤ 0.045, we have L ≥ 48.6km. That is to say, when the transmission distance L is longer than 48.6km, Eve can always find proper overall transmittance to keep the count rate of signal state the same with the one without attack. So we can treat 48.6km as the secure transmission distance in our analysis. The simulation result in the inset figure shows the range of η ′ /η and 10.456<η ′ /η<10.47, which indicates that Eve is able to attack successfully by replacing the quantum channel with a lower loss one in practice. For simplicity, we use η ′ /η = 10 to estimate δ ′ . Suppose the transmission distance is 100km and η ′ /η = 10 (δ −δ ′ )L/10 = 10. So we have δ − δ ′ = 0.1dB/km and δ ′ = 0.11dB/km which may be achievable with modern technology. Fig. 7 gives out the relationship between p block and L. We can find that 0.7149<p block <0.7157 and p block almost stays invariable, which means that Eve can always keep the count rate of decoy state identical with that without attack by blocking a part of single photon decoy state pulses. All the calculation results above indicate that, by exploiting the effects of temperature increase in the semiconductor lasers, Eve can mount a modified PNS attack successfully.

Conclusion and discussion
In this paper, we study the effects of temperature increase on several key characteristics of gain-switched semiconductor lasers by performing numerical simulation on the single mode temperature dependent rate equation. The results show that temperature increase helps Eve in practical QKD systems. First, the recovery time of carrier density increases with temperature, which makes the maximal repetition rate of semiconductor lasers decrease. Second, the intensity of the output photon pulse decreases as the temperature rises. That is to say, Eve can break the security assumption of stable intensities by strong light illumination or microwave radiation. Third, the interval between the peaks of signal state and decoy state pulses increases with temperature. And Eve may distinguish signal state and decoy state pulses by raising the temperature of semiconductor lasers with proper tricks. We also propose a modified PNS attack by exploiting the effects of temperature increase in the semiconductor laser. The simulation results show that Eve can always keep the count rates of signal and decoy state the same with the ones without attack. Therefore, she can steal information about the key and stay hidden.
To defend such temperature dependent attacks on the semiconductor lasers, real-time monitoring on the characteristics of the output light may be helpful to detect the temperature variation in the laser. However, it is not rigorous to calculate the final key with the monitoring results on only one dimension, because temperature increase enlarges side channels in multiple dimensions, such as wavelength, time, intensity and intensity fluctuation. Besides, real-time monitoring on the intensity of the incoming light, installing isolator and band-pass filter may also help to detect or prevent Eve's strong light illumination. However, some researches showed that band-pass filter can be damaged by strong light 37,38 . Moreover, these methods can not defeat microwave radiation from other directions in free space and other unknown tricks to increase the temperature of the semiconductor laser. So legitimate users should better monitor the temperature of the laser diodes in real time. Once the temperature increases above the threshold values, QKD systems should alarm and abort the key.