Hacking coherent-one-way quantum key distribution with present-day technology

Recent results have shown that the secret-key rate of coherent-one-way (COW) quantum key distribution (QKD) scales quadratically with the system’s transmittance, thus rendering this protocol unsuitable for long-distance transmission. This was proven by using a so-called zero-error attack, which relies on an unambiguous state discrimination (USD) measurement. This type of attack allows the eavesdropper to learn the whole secret key without introducing any error. Here, we investigate the feasibility and effectiveness of zero-error attacks against COW QKD with present-day technology. For this, we introduce two practical USD receivers that can be realized with linear passive optical elements, phase-space displacement operations and threshold single-photon detectors. The first receiver is optimal with respect to its success probability, while the second one can impose stronger restrictions on the protocol’s performance with faulty eavesdropping equipment. Our findings suggest that zero-error attacks could break the security of COW QKD even assuming realistic experimental conditions.


I. INTRODUCTION
Quantum key distribution (QKD) [1][2][3] has emerged as a cornerstone of quantum cryptography, enabling two remote parties, commonly referred to as Alice and Bob, to share an information-theoretically secure cryptographic key.While QKD networks are currently being deployed worldwide [4][5][6][7], QKD still faces certain inherent limitations such as channel loss, which fundamentally restricts the secret-key rate in point-to-point configurations [8,9], as well as device imperfections that jeopardize the security of practical implementations [2,10,11].
Crucially, González-Payo et al. [37] showed very recently that indeed the key rate of COW-QKD scales at most quadratically with the system's transmittance, rendering all long-distance demonstrations of this scheme performed so far insecure against general attacks.This was achieved using a class of intercept-and-resend attacks known as sequential attacks [38][39][40][41].Intercept-andresend attacks effectively transform the quantum channel into an entanglement-breaking channel, thus preventing the possibility of secret-key generation [42].Trényi et al. [43] further refined this strategy by introducing a sequential attack that does not introduce errors in the system.Notably, this latter so-called zero-error attack -which is based on the use of unambiguous state discrimination (USD) measurements [44,45]-is essentially optimal, in the sense that no other zero-error attack [46] can further limit the maximum achievable distance of COW-QKD.
Importantly, the works in [37,43] assume an idealised eavesdropper (Eve) with technological capabilities only limited by quantum mechanics.Indeed, this is the standard scenario considered when proving the security of QKD.However, this could be overconservative in certain cases, as the technology required by Eve to implement her attack might not be available in the mid-term future.For instance, the noisy-storage model [47][48][49][50] considers the physical assumption that Eve does not have a large reliable quantum memory.
Similarly, in this work we assume that Eve is restricted to use present-day technology and cannot perform perfect quantum operations but employs faulty devices.In this framework, we investigate the practical feasibility of the optimal zero-error attack against COW-QKD proposed in [43].For this, we introduce two USD receivers that only require off-the-shelf linear passive optical elements, phase-space displacement operations and threshold single-photon detectors (SPDs).Remarkably, the first receiver corresponds to an optimal USD measurement, in the sense that it maximizes the probability of obtaining a conclusive measurement result when distinguishing Alice's signals, but it can only discriminate data signals.The second USD receiver has a lower success probability but can discriminate both data and decoy signals.This latter condition translates into stringent restrictions on the performance of COW QKD with flawed eavesdropping equipment.For both receivers, we derive analytical expressions for the expected values of the key metrics that characterize the COW protocol as a function of the parameters that describe the noise and inefficiencies of Eve's apparatuses.In doing so, we provide a comprehensive framework for evaluating the security of COW-QKD in realistic scenarios.We find that the most critical experimental parameter for the success of Eve's attack seems to be the quality of interference between Alice's weak coherent pulses and her strong light during the displacement operation.Importantly, our results suggest that zero-error attacks are not only a great threat against COW-QKD, but they could break its security with present-day technology.The paper is structured as follows.In Section II we introduce the COW-QKD protocol.Next, in Section III, we present the zero-error attack studied in [43].Then, in Section IV we introduce the first USD receiver, which is able to implement the optimal USD measurement considered in [43].Besides, in this section we provide a model to incorporate its most relevant imperfections in a practical setting.Next, in Section V we derive analytical expressions for the expected values of the relevant metrics required to evaluate the security and performance of COW QKD as a function of Eve's faulty equipment, and we investigate the feasibility of the zero-error attack in [43] with present-day technology in Section VI.Finally, in Section VII we present our conclusions.The paper also includes several Appendices with additional calculations, which includes the analysis associated to a second USD receiver.

LASER IM
FIG. 1. Schematic illustration of the original COW system [26,27].Alice sends Bob a random sequence of signals |φi⟩, with i ∈ {0, 1, 2}.In the figure, we represent coherent (vacuum) states with a grey (white) pulse.Temporal sequences of states or signals are represented from right (earlier time) to left (latter time).Bob uses a beamsplitter with transmittance tB to distribute the received signals between the data line and the monitoring line.The former is used for key generation, while the latter implements a Mach-Zehnder (MZ) interferometer that measures the coherence between adjacent coherent pulses.This is used to detect eavesdropping.IM refers to the intensity modulator; ∆τ is the time delay between consecutive pulses; DD, DM1, and DM2 are Bob's SPDs.
values 0 and 1, respectively, and are generated with an equal a priori probability p A0 = p A1 = (1−f )/2, whereas the decoy signal |φ 2 ⟩ = |α⟩|α⟩ is prepared with probability p A2 = f .Here, temporal sequences of states or signals are represented from right (earlier time) to left (later time).
At Bob's side, an asymmetric beamsplitter with transmittance t B distributes the incoming signals between the data line and the monitoring line.The former consists of an SPD D D and is used for raw key generation.Specifically, Bob assigns the bit value 0 (1) to a round if D D clicks in the first (second) time slot of that round, and a random bit is assigned in the case of a double click.On the other hand, the monitoring line consists of a Mach-Zehnder interferometer followed by two SPDs D M1 and D M2 , for constructive and destructive interference, respectively.This line monitors the coherence between adjacent pulses.In particular, the interference is such that two consecutive coherent states |α⟩ cannot trigger D M2 , but only D M1 (see Fig. 1).
Once the quantum communication phase of the protocol ends, Bob publicly announces in which rounds he observed at least one detection click at D D .Then, Alice announces in which of these rounds she prepared a data signal.The bits assigned to this set constitute the sifted key.
Three parameters are specially relevant in COW-QKD.The gain, G, which is the probability that a signal sent by Alice produces at least one detection click in Bob's data line; the quantum bit error rate (QBER) of Alice and Bob's sifted keys; and the visibilities V s , which quantify the coherence between adjacent coherent pulses, and are computed from the click probabilities in the monitoring line.Specifically, these visibilities are defined as where s ∈ {2, 01, 02, where p Mi = s p s p Mi|s , being p s the probability that Alice prepares the sequence s.

III. ZERO-ERROR ATTACKS AGAINST COW-QKD
In a zero-error attack Eve intercepts all of Alice's signals and performs a USD measurement on each of them [37,43].We denote by p Ej |Ai the probability that Eve obtains the result E j , given that Alice emits the signal |φ i ⟩.Here, E 0 , E 1 and E 2 identify the signals |φ 0 ⟩, |φ 1 ⟩ and |φ 2 ⟩, respectively, and E 3 represents an inconclusive outcome.Obviously, in the ideal scenario in which the USD measurement is implemented perfectly, we have by definition that p Ej |Ai = 0 ∀i ̸ = j, with i, j < 3.
Next, Eve groups the measured outcomes into blocks for processing them before she sends Bob a regenerated sequence of signals.Precisely, a block of (k + 1) signals corresponds to k ∈ { 0, 1, . . ., M max } consecutive conclusive measurement outcomes, followed by an inconclusive measurement result.For example, when k = 0 the block corresponds to one inconclusive measurement outcome, and Eve sends Bob two vacuum pulses, |φ vac ⟩ = |0⟩|0⟩.If k = 1, the block has one conclusive measurement outcome, say |φ i ⟩, followed by an inconclusive one for which Eve sends Bob the vacuum signal |φ vac ⟩.For all cases where 1 < k < M max , the interpretation is similar.Finally, if Eve obtains M max consecutive conclusive measurement outcomes, she ignores the next signal from Alice, and simply treats it as an inconclusive result.The parameter M max allows Eve to cap the block length, thereby limiting the maximum delay she introduces in the channel.Throughout this paper, we shall use the term block to denote the k conclusively measured signals together with the inconclusive measurement outcome, and the term conclusive-block when ignoring the latter.
For each conclusive-block, Eve searches for the first and last instances of a vacuum pulse within the block.She then resends to Bob all the optical pulses situated between these two, exactly as she identified them -i.e., if the measurement result with respect to a particular signal is E j , she resends |φ j ⟩-but substitutes the coherent pulses |α⟩ by |γ⟩, with |γ| 2 ≫ |α| 2 , to increase the detection probability at Bob's side.The remaining pulses within the block that are outside this interval are resent to Bob as vacuum pulses.As already mentioned, the last signal of a block, which corresponds to an inconclusive measurement outcome, is resent as |φ vac ⟩.For a more detailed description of the attack, we refer the reader to [43].
Notably, if Eve's equipment is flawless -as considered in [43]-the attack described above introduces no errors on Bob's side, while it reveals Eve full information about the key.This is because Eve's USD measurement ensures that she never misidentifies Alice's signals, while the block processing strategy takes advantage of the fact that vacuum pulses do not introduce errors in the monitoring line.

IV. IMPLEMENTATION OF ZERO-ERROR ATTACKS
In this section, we now introduce a linear optics circuit to implement Eve's optimal USD measurement for the zero-error attack described above.It is illustrated in Fig. 2a.The input state |χ⟩, with χ ∈ {0, α}, corresponds to each of the two optical pulses sent by Alice within a signal.That is, for each signal, Eve uses the same scheme in Fig. 2a twice, once per pulse.Precisely, each pulse is displaced according to the transformation |χ⟩ → D(−α) |χ⟩ = |χ − α⟩, where D(x) := e xâ † −x * â is the displacement operator, and â † and â are the creation and annihilation operators, respectively.Finally, the resulting signal is measured with a SPD.
If D E clicks only in the first (second) time slot, the signal is identified as |φ 1 ⟩ (|φ 0 ⟩); in all other cases, the result is inconclusive.This is so because after the optical displacement, the data signals |φ 0 ⟩ and |φ 1 ⟩ are transformed into |−α⟩ |0⟩ and |0⟩ |−α⟩, respectively, while the decoy signal is turned into a vacuum signal |φ vac ⟩.Consequently, a single click uniquely identifies a data signal, which occurs with probability 1 − e −|α| 2 , thus matching the optimal probability obtained in [43].Indeed, this measurement is unable to identify decoy signals, effectively removing E 2 from the POVM set and making p E2|Ai = 0 ∀i.The displacement operation can be approximated in practice with an asymmetric beamsplitter of transmittance T ≈ 1, which has at one of its input ports a laser source that emits coherent pulses with amplitude β.
In practice, it is well-known that a displacement operation can be approximated with a highly asymmetric beamsplitter of transmittance T ≈ 1 [51], which has at one of its input ports a coherent state |β⟩, as shown in Fig. 2b.This scheme transforms |χ⟩ into | √ T χ + √ 1 − T β⟩, so the displacement D(−α) can be approximated by setting Indeed, with this choice, the states |0⟩ and |α⟩ are transformed, respectively, into |− √ T α⟩ and |0⟩.This means that the detection probability at D E decreases slightly when Alice transmits |0⟩ (when compared to the case where Eve can use an ideal displacement).However, it remains zero when Alice sends |α⟩.That is, the approximated displacement does not introduce errors.

A. Effect of device imperfections
Now, we investigate the performance of the setup above in a realistic setting, in which we accommodate the most relevant device imperfections.For this, we allow the optical phase of the incoming pulses |χ⟩ to the beamsplitter in Fig. 2b to be slightly shifted with respect to the laser pulses |β⟩.We denote such phase shift by ϕ.Also, we allow for an imperfect mode overlap between the two interfering pulses |χe iϕ ⟩ and |β⟩ at the beamsplitter.To characterize this effect we use the model introduced in [52], which defines two parameters, t 1 and t 2 , to quantify, respectively, the fraction of each of Alice's and Eve's input pulses that is properly mode matched at the beamsplitter (see Appendix A).In addition, we allow for a non-ideal efficiency η E and a dark-count probability p E d in Eve's SPD D E .Finally, we also account for small intensity fluctuations.For this, we consider a simple model in which the amplitude of |β⟩ is slightly deviated from its ideal value (see Eq. ( 3)).In particular, we compute its amplitude, which we call now σ to distinguish it from the FIG. 3. Theoretical model of the setup illustrated in Fig. 2b, now incorporating the effect of the main experimental imperfections.|χ⟩ represents the state of Alice's transmitted pulse, and ϕ represents a phase shift.The beamsplitter transmittances t1 and t2 quantify the mode overlap between Alice's pulse and a coherent state |σ⟩, whose intensity deviates slightly from that of |β⟩, at the beamsplitter with transmittance T (see Fig. 2b).The three outputs of the circuit represent different optical modes in coherent states |κx⟩, with x ∈ {m, p, q}.The total intensity received in DE is calculated as the sum of the intensities in each of these modes.
ideal case, as where the parameter δ ∈ [−1, ∞) characterizes the deviation between the ideal and actual intensity.
The schematic of the model that incorporates these imperfections is illustrated in Fig. 3. First, the incoming pulse |χ⟩ is phase shifted by ϕ.Then, |χe iϕ ⟩ and |β⟩ are split into two modes each, according to the quantities t 1 and t 2 .Two of these optical modes contain the fraction of the input pulses that properly interfere at the beamsplitter with transmittance T .We use the label "m" to denote the optical mode associated with the output port of this latter beamsplitter that is connected to Eve's detector.The remaining output modes, namely those labelled "p" and "q" in Fig. 3, go through the beamsplitter without interfering.The total optical intensity at D E given that Alice sent the state |χ⟩, which we shall denote as µ E|χ , is thus the sum of the intensities from the three output modes.That is, , where |κ x ⟩ denotes a coherent state in the output mode x, with x ∈ {m, p, q}.We find, therefore, that Let p E|χ=0 (p E|χ=α ) denote the probability of a noclick event in D E , given that χ = 0 (χ = α) in that time slot.These probabilities can be computed as p This means, in particular, that the probabilities p Ej |Ai can be expressed as follows: V. PERFORMANCE EVALUATION To evaluate the performance of Eve's zero-error attack with current technology, here we derive analytical expressions for the expected values of the three metrics defined in Section II -namely the gain, the QBER, and the different visibilities V s -as a function of the parameters that characterize Eve's imperfect operation, as well as the parameters of the protocol.
In the calculations below, we shall consider that γ is sufficiently large to ensure that the signals Eve sends Bob always trigger his detectors unless she sends him a vacuum state, in which case Bob only records a click if a dark count occurs.The dark-count probabilities at Bob's detectors D D , D M1 , and D M2 are denoted as p D d , p M1 d , and p M2 d , respectively.First, we derive the expected gain G.Then, we present the expressions to compute the QBER and the visibilities V s .The full derivation of these latter parameters can be found in Appendix B.

A. Gain
The gain is defined as the probability that Bob observes at least one click in D D in a round.This quantity can be written as G = N clk /N sig , where N clk is the average number of signals within a block that produce a click -single or double-at Bob's side, and N sig is the average number of signals within a block.
Let p Ec be the probability that Eve's USD measurement is conclusive, computed as Also, let p cb (k) be the probability that Eve processes a conclusive-block of length k, which is given by [43] Then, we have that N sig = Mmax k=0 p cb (k)(k + 1), and therefore [43] The average N clk admits a similar decomposition in terms of the length of a block.In particular, where for k ∈ [0, M max ].Now, let p Ej |Ec be the probability that Eve obtains the outcome E j , given that her measurement was conclusive.Its value is given by Then, one can express where n clk (k|i) is defined as the average number of signals where a click occurs within a conclusive-block of length k, given that the first signal of the block was identified by Eve as |φ i ⟩.Importantly, we note that the quantities n clk (k|i) admit recursive formulations [43], which one can solve to compute n clk (k).
To illustrate this, let us focus on n clk (k|0), i.e., the case where the first signal of the block is identified by Eve as |φ 0 ⟩.According to her block-processing strategy, Eve translates this first signal into vacuum, since the first optical pulse of this signal is a coherent state |α⟩.Consequently, we can disregard it and consider the reduced conclusive-block of length (k − 1).Importantly, according to Eve's processing strategy, this also implies that the first signal in the resulting truncated conclusiveblock will be resent exactly as identified by her.This is so because it is preceded by a vacuum pulse, given by the second optical pulse of |φ 0 ⟩.Then, it only remains to find the last signal of the conclusive-block that is not resent as vacuum.
There are three possibilities, which depend on the last signal identified by Eve.If this signal is |φ 0 ⟩, then it directly becomes the last non-vacuum signal of the block, and thus (k − 1) non-vacuum signals will arrive at D D .If the last signal is |φ 1 ⟩, it is translated into vacuum, and the preceding (k − 2) non-vacuum signals will arrive at D D .Finally, if the last signal is |φ 2 ⟩, this signal is also translated into vacuum, and, by definition, Bob will observe, on average, n clk (k − 1|0) clicks in D D .Putting all this together, one can write n clk (k − 1|i) as Moreover, the starting points for the previous recursions are n clk (1|0) = n clk (1|1) = p clk|Bv and n clk (0) = 0.With this, one can solve the recursion and obtain where we have used R as a shorthand for the recursion factor, B. Quantum bit error rate Next, we analyse the QBER.This quantity can be written as QBER = p err /p key , where p key is the probability that Bob distills a key bit in a given round, and p err the probability that he distills an erroneous key bit.We have that, asymptotically, p key = N key /N sig and p err = N err /N sig , where N key (N err ) is the average number of key bits (erroneous key bits) distilled by Bob from a block sent by Eve.Therefore, one can rewrite the error rate as [43] To determine N key and N err we decompose them according to the length of the block processed by Eve.For this, we define n key (k) (n err (k)) as the average number of key bits (erroneous key bits) distilled from a conclusiveblock of length k, and p last key (k) (p last err (k)) as the probability that Bob distills a key bit (erroneous key bit) from the vacuum signal |φ vac ⟩ that is sent after a conclusive-block of length k, due to an inconclusive result.Then, we have that All that remains is to calculate the values of n key (k), n err (k), p last key (k) and p last err (k) that appear in the previous equations.For this, let us define p err|Bv as the probability that Bob obtains an incorrect bit from a vacuum signal sent by Eve, given that he distills a bit that round.Its value is given by Then, it can be shown (see Appendix B) that n key (k) has the form the parameter p last key is given by the parameter n err (k) has the form and the parameter p last err (k) can be expressed as C. Visibilities To calculate the resulting visibilities V s , we start by expressing the probabilities that appear in Eq. ( 1) as p MX|s = p MX,s /p s , with X ∈ {1, 2}.The joint probabilities p MX,s can be written as p MX,s = N MX,s /N sig .Here, N MX,s is the average number of times in which the sequence s appears within a block and a click is registered in D MX during the time slot associated with the interference of the two intermediate coherent pulses of the sequence.This means that V s can be expressed as Let us now start with the case s = 2, since this is the only one that considers interference between pulses within the same signal.By applying analogous reasoning to that used to derive Eqs. ( 11) and ( 19), it can be shown that N MX,2 can be expressed as where n MX,2 (k) represents the average number of signals within a conclusive block of length k in which Alice sends |φ 2 ⟩ and D MX clicks, and p last MX,2 (k) is the probability that this event occurs in the last signal of the full block.Precisely, it is shown in Appendix B that these quantities can be written as and where R is given by Eq. ( 17).We now consider the remaining visibilities, where we denote the two-signal interference sequence as s ≡ s meaning Alice first prepares |φ s1 ⟩ and subsequently prepares |φ s2 ⟩.Importantly, a subtle nuance must be considered in the definition of the averages N MX,s2s1 .Since we are dealing with the interference between adjacent pulses in consecutive rounds, these rounds may belong to different blocks.If this happens, we will consider that the observed clicks are attributed to the first block.This is an arbitrary decision, but it does not impact the final result.
Once again, we express the averages under analysis as a decomposition over the block length.For this, we define n MX,s2s1 (k) as the average number of times within a conclusive-block of length k where Alice sends s = s 2 s 1 and a click is registered in D MX in the time slot associated with the interference between the two signals.
Those events in which one of the signals of the sequence s does not belong to the considered conclusive-block are not accounted in n MX,s2s1 (k).Moreover, we denote as p last MX,s2s1 the probability that Alice prepares |φ s1 ⟩ in the last round of a conclusive-block of length k and |φ s2 ⟩ in the next round, and Bob observes a click in D MX in the time slot associated with the interference of these two signals.Similarly, we define p edge MX,s2s1 as the probability that Alice prepares |φ s1 ⟩ in the last round of the full block of k + 1 signals, |φ s2 ⟩ in the first round of the next block, and Bob observed a click in D MX in the time slot associated with the interference of these two signals.With these definitions, which are illustrated in Fig. 4, we can write N MX,s2s1 as Finally, let p Ai|Ec (p Ai|E3 ) be the probability that Alice sent the signal |φ i ⟩, given that Eve's measurement was conclusive (inconclusive).These values can be written as for i ∈ {0, 1, 2}.Then, Appendix B shows that and while the parameters p last MX,s2s1 (k) and p edge MX,s2s1 (k), for X ∈ { 1, 2 }, are given by Finally, we note that V ave , as defined in Eq. ( 2), can be directly obtained from the previous averages N MX,s as follows where the sums run for s ∈ {2, 01, 02, 21, 22}.

VI. SIMULATION RESULTS
In this section we now evaluate the feasibility of the zero-error attack analyzed above in realistic conditions.We shall denote the attack that uses the optimal USD measurement discussed in Section IV as USD1.Here, we shall include as well the results derived in Appendix C regarding an alternative, suboptimal USD measurement for Eve, which is able to discriminate not only data signals but also decoy signals, although its success probability is lower than that of USD1.We shall denote this second strategy as USD2.We refer the readers to Appendix C for more details.As it is shown below, USD2 can outperform USD1 in the presence of imperfections.
We consider that Eve's attack is successful if she can keep the resulting QBER and visibilities within certain acceptance intervals.For illustration purposes, we shall use QBER th = 0.05 and V th = 0.95 as the threshold values defining these acceptance intervals, i.e., the QBER and the visibilities V s must satisfy QBER ≤ QBER th and V s ≥ V th for the attack to be successful.We remark, however, that these values are just an example chosen for continuity with previous studies [37], which in turn selected them to reflect the metrics attainable by state-of-the-art experiments [28,29].In any case, our analysis can be applied to any other threshold values used to calculate the secret-key rate by considering a specific security proof.Importantly, some commercial systems only check the average visibility V ave out of all the visibilities [29,32].Below we show that this provides Eve a crucial advantage for her attack.Fig. 5 illustrates the resulting gain G and QBER as a function of an error parameter ε, which is directly related to the quality of the mode overlap at Eve's beamsplitters.Specifically, we set t 1 = t 2 = 1 − ε for USD1, and Here we focus on the mode overlap because our results suggest that this is the main limiting experimental factor in Eve's attack, while its effectiveness varies only slightly when the experimental parameters that model other imperfections are changed over realistic ranges of values (see Appendix D for further details).In particular, for the simulations in Fig. 5, we assign to other imperfections the values given in Table I.For simplicity, we consider the same dark-count probability p d for all detectors, i.e., Besides, we set the parameters of the COW protocol, namely α and f , to typical values, also shown in Table I, and we fix M max = 10, as we observe essentially no improvement of FIG. 5. Resulting gain G and QBER for a COW QKD system in the presence of Eve's attack as a function of the error parameter ε.This parameter models Eve's imperfect mode overlap in her measurement implementation.Solid lines correspond to USD1, while dashed lines correspond to USD2.For the simulations we considered the parameters given in Table I.
the metrics when increasing this value, given that the intensity of Alice's pulses is kept within practical margins (further details are discussed in Appendix D).
Remarkably, Fig. 5 shows that the gain G grows with ε.To understand this, we note that, for low values of |α| 2 and small imperfections, both USD measurements have a small probability of being conclusive.However, as imperfections escalate, the probability of a conclusive measurement increases slightly due to a slight rise in the click probability of Eve's detectors.As expected, USD1 allows for a higher gain than USD2, as the former has been designed to maximize the probability of identifying data signals.As for the QBER, the figure shows that Eve can keep it below the chosen threshold value of 0.05 for reasonably high values of ε.
The visibilities are illustrated in Fig. 6.We observe that those corresponding to sequences containing a decoy signal are well below the threshold V th , being this particularly evident for V 2 , which is in fact always zero for USD1.This is expected, as USD1 is unable to identify |φ 2 ⟩.Indeed, when receiving |φ 2 ⟩, Eve will mostly resend vacuum signals to Bob.Certainly, due to measurement errors, she could occasionally misidentify Alice's signal and resend Bob |φ 0 ⟩ or |φ 1 ⟩.However, these signals can trigger both detectors in Bob's monitoring line with equal probability, and consequently do not increase the visibility.Needless to say, dark counts cannot increase the expected visibility either, as they occur with equal probability in both detectors.Interestingly, even for USD2, the visibility V 2 is notably low.The reason for this behavior is twofold: first, the probability that Eve identifies |φ 2 ⟩ is relatively low.Second, the probability of obtaining a conclusive measurement outcome is also low for the FIG. 6. Resulting visibilities for a COW QKD system in the presence of Eve's attack as a function of the error parameter ε.This parameter models Eve's imperfect mode overlap in her measurement implementation.Solid lines correspond to USD1, while dashed lines correspond to USD2.For the simulations we consider the parameters given in Table I.
considered value of |α| 2 , so most blocks processed by Eve are expected to be short.Therefore, it is likely that those few |φ 2 ⟩ that are correctly identified are located at the edge of a block, where they are consequently erased due to Eve's block-processing strategy.
Similar arguments apply to V 22 , V 21 , and V 02 (which is equal to V 21 due to the symmetry of the setups).In these cases, however, the visibilities are non-zero even for USD1.This is because their corresponding sequences are occasionally translated by Eve to the sequence "01", which positively contributes to the visibility (see Appendix E for further details).Remarkably, we note that USD2 performs better than USD1 for most visibilities in this scenario.This is because the probability of erroneously identifying |φ 0 ⟩ as |φ 1 ⟩ (or viceversa), given that Eve's measurement is conclusive, is smaller in USD2.For the same reason, V 01 is also larger for USD2.This is relevant because Alice typically transmits the sequence "01" much more frequently than the other sequences, as f is usually set to a small value to increase the number of data rounds.As a consequence, V 01 , the highest visibility, is also the largest contributor to the average visibility V ave , which thus remains relatively high for reasonably small values of ε.
To compare the performance of Eve's attack with respect to prior studies [37,43], we compute here a simple upper bound on the secret-key rate.With this in mind, let us conveniently refer to Eve's attack as undetectable if the following two conditions are met.Firstly, both the QBER and the average visibility V ave observed for the attacked system must fall within their corresponding acceptance regions, i.e., QBER < QBER th and V ave > V th .Secondly, the gain G of the attacked system must equal or exceed that expected from a legitimate system, which we will denote as G ā to indicate that no attack is launched.In particular, in the simulations we consider a typical lossy channel model for which [43] where η B is the efficiency of Bob's detectors, t B is transmittance of the beamsplitter used by Bob to separate between data and monitoring line (see Fig. 1), η ch = 10 −α ch d/10 is the channel transmittance, d is the channel distance (in km), and α ch is the attenuation coefficient (in dB/km).Importantly, if for a given η ch Eve's attack meets the previous two conditions -i.e., if it is undetectable-it immediately follows that no secret key can be distilled by Alice and Bob based on the observed metrics.Indeed, the secret-key rate K can be simply upper bounded as [37,43] where µ max is the maximum value of µ for which Eve cannot perform an undetectable attack.We remark that, in general, µ max depends on η ch .For example, for long distances G ā is expected to be low, and so it is easier for Eve to guarantee the condition G ≥ G ā.However, one could compensate the low G ā by reducing µ to make Alice's signals harder to identify, thereby reducing G.That is, µ max typically decreases with the channel distance.
In particular, previous works [37,43] showed that µ max scales linearly with η ch when no technological constrains are placed on Eve.Since η ch already appears in Eq. ( 36), the resulting scaling of K max is quadratic with η ch .
To investigate if a technologically constrained eavesdropper can impose the same restrictive scaling, we plot µ max and K max against η ch in Fig. 7.We consider two scenarios, which we evaluate for two different values of ε each, and for both USD1 and USD2.In the first scenario, we assume that all of the devices used by Eve and the legitimate users are ideal, and the only imperfection is the mode mismatch characterized by ε.The second scenario considers the practical parameters introduced in Table I, and sets η B = η E = 0.6 (notice that this is a rather conservative assumption, since Eve's technological capabilities are expected to surpass those of the legitimate users).We set f = 0.155 and t B = 0.9 in both instances.In terms of imperfect mode overlap, we run the simulations for ε = 0.002, which is sufficiently low to guarantee that V ave > V th for both USD1 and USD2 and typical values of α (see Fig. 6), and for ε = 0.004, which results in a V ave slightly below V th .The results are plotted for a range of η ch that corresponds to channel lengths between 30 and 300 km when considering a typical fiber-loss coefficient α ch = 0.2 dB/km.
In line with [37,43], a quadratic scaling across the entire range of η ch is observed for both the USD1 and USD2 when considering the ideal parameters and ε = 0.002.FIG. 7. Maximum intensity that Alice can use while still being able to detect Eve's attack, µmax, and upper bound of the key rate, Kmax, for different channel transmittances.The lines labeled as ideal in the legend were computed by considering no imperfections in Eve's measurement besides the mode mismatch characterized by ε, while those labeled table used the parameters in Table I.The dotted (dashed) black line is added as a reference to show linear (quadratic) scaling with η ch .
However, this is no longer the case when considering the parameters from Table I, for which the quadratic scaling is only observed for up to η ch ≈ 10 −2.5 .When a smaller η ch -i.e., longer channel-is considered, µ max becomes so small that Eve's attack can no longer fulfill the condition V ave > V th .Therefore, as there is no need to reduce G to prevent Eve's attack from being undetectable, µ max remains constant from there on, and the scaling of K max turns from quadratic to linear over η ch .Interestingly, even though the upper bound imposed by the USD1 is stricter than that imposed for the USD2, the latter remains in the quadratic regime for longer.This is because the performance of the USD2 is worse in terms of gain, but better in terms of visibility (see Figs. 5 and 6).
Moving to ε = 0.004, we see that the USD2 barely allows to maintain the upper bound in the quadratic regime, and indeed the scaling is linear for η ch ⪆ 10 −1.5 .Naturally, larger errors in the implementation imply that Eve requires a higher value of µ to successfully attack the system.Therefore, by keeping µ below this level, it is guaranteed that Eve's attack is detectable.Moreover, the implementation using USD1 is completely unable to impose a bound on the secret-key rate at any distance.This is because the metrics under attack improve with µ, but only up to a certain optimal point.This point may appear at a different value of µ for each metric, and is a consequence of several factors (e.g., very high values of µ may result in lots of erroneous clicks at Eve's detectors, preventing her attack from remaining undetectable).This means that if for one of these optimal intensities the metrics do not all fall within their acceptance regions, then the attack will be unsuccessful at any other intensity, and so µ max → ∞ and K max → ∞.
It is clear that, according to our simple model, achieving a precise mode overlap within the beamsplitters is crucial to the success of Eve's attack.Nonetheless, an eavesdropper encountering challenges in this regard might still manage to extract some amount of information by launching a partial attack, in which she acts only on a reduced subset of the transmitted signals.Figure 8 illustrates, for different values of the channel distance d, the fraction τ a of the rounds that can be attacked by Eve while still maintaining her success with respect to the QBER and V ave , as well as the maximum percentage of sifted key that she can extract in this scenario (see Appendix F for details about how these quantities are computed).In particular, this means that both metrics are maintained within their corresponding acceptance ranges.Here, we assume a typical fiber-based channel with attenuation coefficient α ch = 0.2 dB/km.Fig. 8 shows that a shorter channel length results in a higher amount of rounds that can be attacked by Eve.This is to be expected, since the metrics are calculated from all the rounds, those intercepted by Eve and those that are not.Consequently, the better measurement statistics observed by Bob at short distances from the unattacked rounds favourably impact the overall value of the metrics.Moreover, Fig. 8 also shows that the number of rounds that Eve may attack falls very sharply for longer channel lengths once the metrics of her attack are outside of the acceptability ranges.Again, this is due to the degradation of the legitimate users' metrics, as it is clear that in the extreme case where the QBER and visibility obtained during the unattacked rounds are equal to the threshold values QBER th and V th , no additional error is permissible, and so Eve cannot attack any rounds without becoming detectable unless her metrics are an improvement over those of Alice and Bob.Nevertheless, the amount of sifted-key bits distilled during the unattacked rounds also increases at short distances, meaning that the ratio of sifted key known to Eve decreases.For the scenario described by the parameters in Table I, these two opposite effects result in very little variation of EXT K over the distance d, as can be seen at the right in Fig. 8. Crucially, the figure shows that Eve's attack has the potential to compromise the entire secret key at low values of ε.What is more, even for higher values of ε, Eve can still successfully attack an important fraction of the rounds and obtain part of the sifted key.
FIG. 8. Fraction τa (in percentage) of the rounds that can be attacked by Eve while maintaining QBER ≤ 0.05 and Vave ≥ 0.95, and percentage of sifted key EXTK that Eve can extract in such case, as a function of the error parameter ε and the transmission distance d between Alice and Bob.The parameter ε models Eve's imperfect mode overlap in her measurement implementation.For the simulations we set the attenuation coefficient of the channel to α ch = 0.2dB/km and consider the parameters given in Table I, as well as the efficiency of Bob's detectors to be equal to that of Eve's.Note that the plots for the cases d=30km and d=60km in the right graph are almost overlapped for both USD1 and USD2, with the plot for d=0km just above them with some amount of overlap too.

VII. CONCLUSIONS
Security proofs of quantum key distribution (QKD) typically consider that the eavesdropper's capabilities are only limited by the laws of quantum mechanics.Here, we have evaluated a less conservative scenario in which Eve is actually restricted by current technology.In particular, we have studied the feasibility of zero-error attacks against coherent-one-way (COW) QKD in this framework.To do so, we have introduced two practical receivers to perform an unambiguous state discrimination (USD) measurement of Alice's emitted signals, which is the essential step of this type of attack.
Both proposed USD receivers are rather simple, and employ only linear passive optics, phase-space displacement operations and threshold single-photon detectors.We have derived analytical expressions for the expected values of the main metrics (i.e., the gain, the quantum bit error rate and the visibilities) of a COW QKD protocol assuming realistic experimental conditions, i.e., as a function of the most relevant device imperfections of Eve's equipment.In doing so, we have found that the most critical experimental parameter seems to be the quality of interference between Alice's weak coherent pulses and Eve's strong light during her displacement operation.Overall, our results indicate that zeroerror attacks could break the security of COW QKD with present-day technology, particularly if Alice and Bob only consider the observed average visibility in their monitoring line, as it is done e.g. in commercial setups and long-distance implementations of this scheme.

VIII. ACKNOWLEDGEMENTS
This work was supported by Cisco Systems Inc., the Galician Regional Government (consolidation of Research Units: AtlantTIC), the Spanish Ministry of Economy and Competitiveness (MINECO), the Fondo Europeo de Desarrollo Regional (FEDER) through the grant No. PID2020-118178RB-C21, MICIN with funding from the European Union NextGenerationEU (PRTR-C17.I1) and the Galician Regional Government with own funding through the "Planes Complementarios de I+D+I con las Comunidades Autónomas" in Quantum Communication, the European Union's Horizon Europe Framework Programme under the Marie Sklodowska-Curie Grant No. 101072637 (Project QSI), as listed by the UKRI though the Engineering and Physical Sciences Research Council (EPSRC) with grant No. EP/X028313/1, and the project "Quantum Security Networks Partnership" (QSNP, grant agreement No. 101114043).P.v.L. acknowledges funding from the BMBF in Germany (QR.X and QuaPhySI) and from the EU/BMBF via QuantEra (ShoQC).

IX. DATA AVAILABILITY STATEMENT
All data that support the findings of this study are included within the article (and any supplementary files).

Appendix A: Model for the imperfect mode overlap
Let us consider a real beamsplitter with transmittance T in which the two input optical pulses are not perfectly mode-matched, and therefore do not interfere perfectly (see Fig. 9).This imperfect mode overlap can be simplistically modelled by splitting each of the two inputs into two modes [52].One of these modes from each pulse interferes as desired, while the two remaining modes do not interfere and only have their amplitudes diminished by the beamsplitter.The fraction of light from the first (second) input that is perfectly matched and therefore interferes in the beamsplitter is determined by the parameter t 1 (t 2 ), and the total degree of overlap in the beamsplitter is defined as M := t 1 t 2 [52].
FIG. 9. Simple model to characterize the imperfect mode overlap at one output of a beamsplitter with two coherent pulses |α⟩ and |β⟩ as inputs.The original (blue) beamsplitter of transmittance T at the left, where pulses |α⟩ and |β⟩ do not perfectly interfere, can be modelled as the network of perfectly mode-matched (orange) beamsplitters shown at the right.In this network, the input state |α⟩ (|β⟩) is first split into two optical modes, âm and âp ( bm and bq), according to the parameter t1 (t2) that describes the corresponding beamsplitter transmittance.Subsequently, the optical modes âm and bm interfere in a beamsplitter with transmittance T , while each of the modes âp and bq interferes with vacuum in a beamsplitter with transmittance also T , resulting in the final output modes of the network p, m and q.
In order to model the splitting of the first (second) input into two modes, namely one that is properly matched, say âm ( bm ), and one that does not interfere, say âp ( bq ), an ideal beamsplitter of transmittance t 1 (t 2 ) can be used, as illustrated in Fig. 9.After that, the modes that are properly matched (i.e., âm and bm ) interfere in an ideal beamsplitter with the original transmittance T , resulting in a new mode, say m, at one output of the beamsplitter.The other modes (i.e.âp and bq ) interfere with vacuum at ideal beamsplitters with transmittance T , resulting in new modes, say p and q, at one output of each beamsplitter.derivation of Eqs. ( 22) and ( 24) is straightforward.
First, we note that both n key (k) and n err (k) admit a decomposition similar to that used for n clk (k) in Eq. ( 14).That is, we can express where n key (k|i) (n err (k|i)) denotes the average number of key bits (erroneous key bits) distilled from a conclusiveblock of length k given that the first signal in the block is identified by Eve as |φ i ⟩.
Let A key represent the event in which Alice emits a data signal, i.e., A key = A 0 ∪A 1 .Then, it follows that p A key = p A0 + p A1 , p A key |Ej = p A0|Ej + p A1|Ej , and p A key |Ec = p A0|Ec + p A1|Ec .Additionally, let p err|Bi be the probability that Bob distills an incorrect key bit (i.e., a key bit different from the one sent by Alice), given that he receives |φ i ⟩ from Eve.Note that this implies that the result of Eve's measurement for that signal was E i and this signal was not discarded by her processing.Moreover, we define p err|Bc = 2 i=0 p err|Bi as the probability that Bob distills an erroneous bit given that he received a signal different from |φ vac ⟩.Then, we have that With this, we can express both n key (k|i) and n err (k|i) in a recursive form.Specifically, we have that

Visibilities
We focus first on the visibility V 2 .According to Eq. ( 1) and Eq. ( 26), this visibility can be computed from the values of n MX,2 (k) and p last MX,2 (k), with X ∈ {1, 2}.It is straightforward to obtain the value of p last MX,2 (k), shown in Eq. ( 28), so we will focus here on n MX,2 (k).
Let p Ei|Aj ,Ec denote the conditional probability that the outcome of Eve's USD measurement is E i , given that Alice prepared the signal |φ j ⟩ and Eve's measurement was conclusive.That is, for i, j ∈ {0, 1, 2}.Now, we express n MX,2 (k) in the form where n MX,2 (k|i) is the average number of signals sent by Alice as |φ 2 ⟩ that prompt a click in D MX within a conclusive-block of length k, given that the first signal of the block is |φ i ⟩.We can write recursive expressions to describe these quantities, such as and being the starting points of the recursions for X ∈ {1, 2} and i ∈ {0, 1}.By solving the recursions, one obtains Eq. ( 27).
Now we focus on the visibilities V s of sequences s = s 2 s 1 that contain two signals.From Eq. ( 29), we have that these visibilities can be computed from the quantities n MX,s2s1 (k), p last MX,s2s1 (k) and p edge MX,s2s1 (k), introduced in Section V C. The quantities p last MX,s2s1 (k) and p edge MX,s2s1 (k) are given in Eq. ( 33), and their derivation is straightforward.Thus we focus on the derivation of n MX,s2s1 (k).
Following a similar approach as with the previous metrics, first we write

(B13)
Putting all together, we have that the starting points of the recursions and the recursive expressions of the required quantities are given by and and Appendix C: Alternative USD measurement In this Appendix we introduce an alternative USD setup for Eve that, unlike the USD1, allows her to identify the decoy signals |φ 2 ⟩, but provides a lower overall success probability than USD1.We call this scheme USD2 and, as we did for the USD1, below we account for the most common imperfections in its model, and calculate its corresponding measurement statistics.
The idealized optical scheme is shown in Fig. 10a.First, an optical displacement D(−α/2) is applied to the pulses generated by Alice, transforming each pulse |χ⟩ into χ − α 2 .Subsequently, each displaced pulse enters a 50:50 beamsplitter, where it interferes with a coherent state |α/2⟩.The resulting state |χ/ √ 2⟩ (|(χ − α)/ √ 2⟩) at the output port of the beamsplitter associated with constructive (destructive) interference is then detected by D E+ (D E− ).Importantly, this means that, in the absence of imperfections, a click in D E+ (D E− ) can only occur when Alice prepares a coherent (vacuum) pulse.Since Alice's signals have two optical pulses, Eve has to implement this measurement twice, each time for a different pulse.The correspondence between each measurement result E i and the pattern of detections needed to prompt it is shown in Table II.
The experimental setup for USD2 is shown in Fig. 10b.As with USD1, in practice one can approximate the optical displacement D(−α/2) with a beamsplitter of transmittance T ≈ 1 together with an interfering offset coherent pulse |β⟩ satisfying Assignments between click patterns and measurement outcomes for USD2.DE1± (DE2±) refers to the DE± acting in the first (second) optical pulse of a signal.Symbols ' ✓ ', ' X ' and ' -' mean that, for each measurement result, the indicated detector clicks, does not click, or is irrelevant, respectively.
With this choice of β, Eve's approximated displacement operation performs the transformation |0⟩ → |− √ T α/2⟩ and |α⟩ → | √ T α/2⟩.Since this introduces some loss, we adjust the amplitude of the interfering signal |θ⟩ at the second beamsplitter to To fairly compare the performance of USD2 with that of USD1 in realistic scenarios, we consider the same imperfections in both setups.This includes the possibility of a small phase shift ϕ of the incoming pulses |χ⟩, the use of imperfect detectors with detection efficiency η E and dark-count probability p E d , intensity fluctuations in the coherent pulses |β⟩ and |θ⟩, and, lastly, a potentially imperfect mode overlap at each of the beamsplitters.To characterize this latter effect we use again the simple model from [52].Moreover, for simplicity, we assume that the percentage of deviation in intensity is equal for |β⟩ and |θ⟩, and modifies their values, respectively, by where δ ∈ [−1, ∞).
The complete model with imperfections is depicted in Fig. 11.Similar to the analysis of USD1, the parameter t 1 (t 2 ) denotes here the fraction of |χ⟩ (|σ⟩) that correctly interferes at the first beamsplitter.Similarly, for the 50:50 beamsplitter, t 3 (t 4 ) represents the fraction of light in the first (second) input port of this beamsplitter that correctly interferes.For simplicity, we disregard any interference effect in the second beamsplitter between those optical modes that did not correctly interfere in the first one.FIG.11.Model of the alternative USD measurement, USD2, including the main experimental imperfections.The beamsplitters depicted in orange (blue) are those related to the behaviour of the first (second) beamsplitter of the experimental setup.Each output mode of the scheme marked with a black (white) circle is received by the detector DE+ (DE−).That is, the total intensity received by each detector is the sum of the intensities in each of its corresponding input modes.
The total intensity received by D E+ (D E− ) given that Alice sends |χ⟩, namely µ E+|χ (µ E−|χ ), is the sum of the intensities at each independent optical mode within the constructive (destructive) output port of the second beamsplitter.That is, µ E±|χ = x |κ x± | 2 , where |κ x± ⟩ denotes the equivalent coherent state in the output mode x±, with x ∈ {p, q, mp, mm, mq} (see Fig. 11).Therefore, we have that Let p E±|χ=0 (p E±|χ=α ) be the probability that D E± does not click given that Alice prepares |0⟩ (|α⟩).This probabilities can be straightforwardly computed from Then, by particularizing Eq. (C4) to each possible input state, we obtain Finally, given the assignments presented in Table II, it is immediate to calculate the probabilities p Ei|Aj for the setup USD2 as p Ej |Ai for i ∈ {0, 1, 2}.

(C6)
Appendix D: Effect of other imperfections besides mode mismatch As mentioned in the main text, the crucial imperfection that determines the success of Eve's attack is the mode mismatch at her beamsplitters.To show this, we examine here how the remaining protocol and experimental parameters affect the expected value of the metrics in the presence of the attack.In particular, we fix all these parameters to the values used in the main text (see Table I) with the exception of the parameter we want to study in each particular case.Besides, as done in the main text, the parameters that quantify the quality of the mode overlap at Eve's beamsplitters are set to t 1 = t 2 = t 3 = t 4 = 1−ε, where here we pick ε = 2•10 −3 .This value of ε sufficiently low to ensure that both USD1 and USD2 succeed if all the other parameters are fixed to the values shown in Table I.Once again, for simplicity, we consider the same dark-count probability p d for all detectors, i.e., p

Effect of the intensity of Alice's pulses
First, we investigate the influence of the intensity µ = |α| 2 of Alice's pulses on Eve's attack performance.This is shown in Fig. 12, where the expected values of the metrics a function of the intensity µ are displayed.Not surprisingly, the gain rises in alignment with µ, as the probability of a conclusive measurement rises as well.The QBER and visibilities also improve as µ increases, as a higher gain reduces the impact of dark counts on Bob's detectors on these metrics.Notably, the QBER stays well below the critical threshold for all evaluated intensities.Concerning the visibilities, we note that those computed for USD2 show a continuous growth with µ accross the entire considered range.This is because this scheme can identify the three signals emitted by Alice, and the probability of a conclusive measurement increases with µ.However, for USD1, the visibility of sequences containing decoy signals only improves at low µ, stabilizing once the impact of the dark counts at Bob's detector becomes negligible.In particular, we note that the visibilities V 02 and V 21 reach this regime quicker than V 22 , as the sequence "22" is more frequently resent as a vacuum signal.

Effect of the maximum length of the conclusive block, Mmax
Next we focus on the maximum length of a conclusive block, M max , which serves Eve to cap the memory resources required to record all the measurement results, as well as the time delay she has to introduce in the channel to apply her block processing strategy.
Previous analysis in [37,43] asserted that the variation of the metrics with M max is negligible for values of M max > 10 when considering practical values of α.To confirm this, we plot in Fig. 13 the relative difference d m (M max ) with respect to each metric m ∈ { G, QBER, V s } for several values of M max , where and m(M max ) is defined as the value of the metric m if Eve's blocks are limited to M max pulses, while m(∞) represents the value of that metric when there is no limit to the length of Eve's blocks (we approximate this by setting M max = 10 6 ).The results shown in Fig. 13 are obtained considering µ = 1 (that is, |α| = 1), since this is close to the upper end of the practical values used in realistic COW implementations.It can be seen that the gain loses around a 35% of its value for USD1 when setting M max = 2, and around 25% for USD2.Nevertheless, the relative difference for values of M max > 8 is near zero, showing that M max = 10 indeed attains a similar performance as the asymptotic case, in terms of the gain.
On the other hand, the value of the QBER only varies up to ≈ 1% of its value when M max = 2, rapidly approaching zero difference when M max increases, which proves that this metric does not degrade a lot when using short blocks.This is to be expected, as the actual probability of Eve introducing errors does not change for longer blocks, so the variation comes only from a lower significance of the effect of dark counts in Bob.
Lastly, we see that the change in the visibilities over M max is quite small for USD1, and indeed the scale of this variation is similar to the one observed for the QBER.This is because this variation stems, once again, from an increase of dark counts in Bob when Eve sends only short blocks.However, the visibilities in USD2 do degrade significantly when the length of the blocks is more limited.In particular, the visibilities that deal with the decoy signal are the most affected, with V 2 degrading up to 100% when M max = 2.The reason is that shorter blocks impose an artificial bias against the retransmission of decoy signals by Eve, even when properly identified, due to her processing strategy.In the limit of M max = 2, in fact, Eve never resends |φ 2 ⟩, as this signal is translated into |φ vac ⟩ when it is placed at the edge of a block.Thus, the decreased probability of resending a decoy signal makes the behaviour of the USD2 similar to that observed in previous sections, where the blocks were short due to the small intensity, and therefore most of the signals sent to Bob when Alice sends |φ 2 ⟩ correspond to Eve's misidentification of |φ 2 ⟩ by one of the data signals, which naturally leads to poor visibility results.
In any case, it can be highlighted from Fig. 13 that all metrics are very close to their asymptotic value when setting M max = 10, even when Alice sends pulses with a relatively high intensity, and therefore it is sufficient for Eve to use this configuration in practical scenarios.

Effect of the transmittance of the asymmetric beamsplitter, T
Now we investigate the performance of Eve's attack as a function of the transmittance T of her asymmetric beamsplitter, which she uses to approximates an optical displacement in both USD measurement schemes.While this approximation is only accurate when T ≈ 1, the simulations indicate that the value of T has a minimal impact on the attack's feasibility.This is illustrated in Figs.14a and 14b, where the metrics are plotted against 1 − T , within the range (1 − T ) ∈ [10 −3 , 0.5].The simulations indicate that, as T decreases, so does the expected gain in both schemes, which is attributed to the small loss introduced by the approximate displacement.Importantly, however, the QBER and visibilities are largely unaffected by changes in T within a reasonable range, and both the QBER and V ave remain acceptable even at T = 0.5.This stability is due to our specific choice of β.
Indeed, one could alternatively set 1−T ) for USD1 (USD2), and the resulting scheme would still approximate the desired displacement for T ≈ 1.For instance, for USD1, this leads to the transformation |0⟩ → |−α⟩ and |α⟩ → |( √ T − 1)α⟩.This choice avoids incurring into additional losses (thus resulting in a higher gain).However, this comes at the cost of increasing the probability of erroneous clicks in Eve's detector, making it a less convenient option for her.This is illustrated in Fig. 15, where we consider these alternative values of β, and call the resulting schemes as USD1* and USD2*.ϕ only has an impact when Alice transmits a coherent pulse, the decoy signal will be clearly influenced the most.In fact, the probability of misidentifying |φ 2 ⟩ as a data signal increases with ϕ.As a consequence, signals that are never (in USD1) or rarely (in USD2) identified for low ϕ, result in conclusive measurements when this parameter increases, which in turn increases the gain.Of course, the probability of misidentifying a data signal also grows, which leads to an increment of the QBER, as shown in Fig. 16.Nevertheless, we note that the QBER remains relatively low even for phase shifts of several degrees.
Similarly, the visibilities generally decrease with ϕ, and in this case V ave does fall bellow the acceptance threshold when ϕ ⪆ 2.5 • .Interestingly, V 22 grows with ϕ until it reaches a certain point at which it stabilizes.This is again due to the increasing probability of misidentifying |φ 2 ⟩ as one of the data signals.Note that, since the sequence "01" is favoured by Eve's processing, the visibility of any two-signal sequence is expected to be nonzero even if the outcome of the USD measurements are totally random.In particular, in that extreme scenario, the sequence "22" could be identified as any other possible sequence by Eve, but the only two-signal block that she resends to Bob is "01", which always triggers the correct detector in the monitoring line, and hence increases V 22 .

Effect of the intensity deviation, δ
Fig. 17 illustrates the impact of small deviations in the intensities of Eve's pulses, quantified with the parameter FIG. 15.Gain, QBER and visibilities vs the transmittance of Eve's asymmetric beamsplitter, T , for the alternative schemes USD1* and USD2*.In particular, we consider that δ, on the protocol metrics.Since δ can take both negative and positive values, as expressed in Eqs. ( 4) and (C3), we plot it here in the range [−0.3, 0.3], which corresponds to a deviation of ±30% over the intensity of the pulses.
Interestingly, the effects of positive or negative deviations are relatively distinct.In particular, the gain increases with δ through the entire depicted range.This is because higher intensities of |σ⟩ and |ς⟩ result in larger click probabilities, especially in the case where Alice sends vacuum, since then Eve's signals are the only source of energy in the circuit.Notably, the QBER remains below its corresponding threshold even for significantly high deviations, although the results are worse for negative values of δ.This is because the probability of Eve observing a click when she is not supposed to (i.e., when a precise interference is intended to cancel the signal out) increases roughly as much for both positive and negative deviations.On the other hand, the same probability given that Eve is indeed supposed to observe a click grows with larger intensities, so the effect is relatively worse for negative deviations.Finally, Fig. 17 shows that the visibilities are more sensitive to δ.They exhibit a behaviour similar to that shown in Figs. 6 and 16, with a sharper decrease in the value of the average visibility V ave obtained for negative deviations, for similar reasons as for the QBER.In particular, V ave is above the proposed acceptance threshold for deviations in the approximate range δ ∈ (−0.08, 0.1), which is still a relatively large margin.

Effect of the parameters of Eve's detectors
As expected, when η E approaches zero, all metrics exhibit a degradation.This is because, in this scenario, Eve is sending a reduced number of signals to Bob, leading to a predominance of dark counts in Bob's system.This is FIG.18. Gain, QBER and visibilities vs the efficiency of Eve's detectors, ηE.illustrated in Fig. 18.The remaining conclusions drawn from this figure align with those inferred from Fig. 12.This is because the loss introduced by the nonideal detection efficiency of Eve's detector can be practically translated into an effective change in the intensity of Alice's signals to η E µ.
The dependence of the metrics on the dark-count rate p E d of Eve's detectors is shown in Fig. 19.The gain slightly increases for high values of p E d , as more erroneous clicks in the detectors lead to more conclusive measurements.Naturally, this comes with a degradation of the QBER and visibilities, although this degradation is quite gentle.In fact, the average visibility exhibits notable resilience to practical values of p E d , only falling below V th = 0.95 in the approximate range p E d ⪆ 5 • 10 −5 .As for the remaining visibilities, their behaviour is relatively similar to the variation with ε, explained more in depth in Appendix E, albeit much more mild in magnitude.

Effect of the parameters of Bob's detectors
Regarding Bob's detectors, we disregard the effect of their detection efficiency, as Eve can always make them click by resending him pulses with sufficiently high intensity.Thus, we focus on the impact of the dark counts.
Fig. 20a shows the variation of the gain and QBER with the dark-count probability p D d at D D .Naturally, the gain rises with p D d , as it directly increases the number of clicks at Bob's data line.Moreover, the QBER also grows, as more random clicks lead to more errors.Unsurprisingly, this dependence is stronger than that observed Finally, we investigate the effect of the decoy probability f on the metrics.As shown in Fig. 21, the gain decreases to nearly zero for large values of f .This is not only because Eve finds it more challenging to conclusively measure the decoy signal, but also and more importantly, because Eve's processing needs data signals to be located at the edges of the blocks.Thus, a small number of data signals sent by Alice means that most conclusive measurements come from decoy signals, which cannot be resent on their own.On the other hand, a smaller p Ec also leads to a greater effect of clicks due to dark counts in Bob over the metrics, and indeed the QBER slightly grows for large values of f .
Regarding the visibilities, Fig. 21 showcases how the average visibility falls towards 0 for increasing values of f .This is because the probability of sending sequences that involve a decoy increases, which makes visibilities observing these sequences to have more weight over the final result of V ave .On the other hand, the values of the individual visibilities do not decrease as significantly, and in fact, they remain essentially constant for the case of USD1.For USD2, however, those visibilities that depend on Alice sending a decoy signal slightly decrease with f .The reason for this is somewhat counter-intuitive.As more decoy signals are sent, blocks processed by Eve become smaller, so relatively more of the decoy signals that are not turned to vacuum come from erroneously measuring them as data signals, thus leading to a decreased visibility.
In any case, selecting a high value of f also severely decreases the secret-key rate of the protocol, as less data signals are emitted.Indeed, typical experiments of COW-QKD use a value of f quite low, around 0.15.
Appendix E: Behaviour of the visibilities V22, V21, and V02 When ε is very small, most instances of |φ 2 ⟩ (all of them if we consider the strategy USD1) are resent to Bob as vacuum signals, so the dark counts of Bob's detectors bring the visibilities down to zero.
As ε increases, so does the probability of conclusively (albeit erroneously) identifying a decoy signal |φ 2 ⟩ as |φ 0 ⟩ or |φ 1 ⟩.In this scenario, Eve sends Bob more non- vacuum pulses, and relatively less clicks in the monitoring line are attributed to the dark counts.In the regime where dark counts are, comparatively to signal clicks, very low, the vacuum pulses sent by Eve -outside and at the edges of conclusive-blocks-can be ignored.Since USD1 never returns E 2 , and USD2 has a significantly higher probability of misidentifying |φ 2 ⟩ as a data signal than correctly identifying |φ 2 ⟩ for sufficiently high ε, we can analyze the visibilities, in this regime, by focusing on the four possible sequences of data signals that Eve can erroneously identify: "00", "01", "10" and "11".In particular, when Bob receives "01", only D M1 can click due to the interference of two coherent pulses.The sequence "10" contains two vacuum pulses in the intermediate time slots, so no clicks can be observed at Bob (aside from those from dark counts).Finally, both "00" and "11" interfere |0⟩ and |γ⟩, resulting in a click in both D M1 and D M2 with very high probability.
Let us focus now in V 22 .We notice that, whenever Alice sends "22", Eve misidentifies this sequence as one of the four previous sequences with equal probability, due again to the symmetry of the setup.This means that D M1 clicks with probability 3/4, while D M2 clicks with probability 2/4 (including possible double clicks in both detectors).Therefore, by using the definition of the visibility, we find that V 22 ≈ 0.2 for large values of ε.
Similar arguments apply to V 02 .When Alice sends the sequence "02", we can distinguish between two different scenarios.If ε is high enough such that the dark counts are not the main source of clicks in the monitoring line, but the probability of mistaking one data signal for another is still sufficiently low, then Eve mostly misidentifies the original sequence as "00" or "01" with equal probability, and therefore V 02 ≈ 1/3.When ε increases, misidentifications of the data signal |φ 0 ⟩ of the sequence "02" happen more often, and thus also the sequences "10" and "11", which implies that the visibility decreases.Analogous reasoning applies to V 21 .
In addition, from Fig. 6 we observe that the range of values of ε where dark counts are relevant is larger for USD2 than for USD1, due to the fact that USD1 offers a larger p Ec , and therefore more non-vacuum pulses are resent.Moreover, this range is also considerably larger for V 22 than for V 02 , since two consecutive decoy signals are less likely to yield a conclusive measurement outcome than a single one.We also notice that USD2 performs better than USD1 for large values of ε.The reason for this behavior is that the probability of erroneously identifying |φ 0 ⟩ as |φ 1 ⟩ (or viceversa), given that the measurement is conclusive, is slightly smaller in USD2.

Appendix F: Partial attack
As shown in Section VI, the average visibility V ave in the presence of Eve's attack is above the acceptance threshold only for rather low values of the parameter ε.Nevertheless, it is still possible for Eve to remain undetected while obtaining partial information about the secret key.To this end, she can perform her attack on only a fraction of the rounds, so that the statistics from the unattacked rounds enhance the expected values of the protocol metrics, compensating for the errors introduced by her attack.Here we explain how we evaluate the expected value of the metrics when Eve executes the attack on a fraction τ a of the rounds.
We assume that the rounds under attack are consistently clustered in large groups of consecutive rounds, allowing us to disregard any possible border effects between the unattacked and attacked signals.Then we have that the gain is simply given by G = τ a G a + (1 − τ a )G ā, where the superscript 'a' indicates that it is calculated for the system that is being attacked all the protocol rounds, as described in Section V, while 'ā' indicates that the metric is calculated in the absence of Eve.The result of G ā can be computed from Eq. (35)

LASERFIG. 2 .
FIG. 2. Scheme to implement Eve's optimal USD measurement.a) Ideal theoretical setup: Eve applies a displacement operator D(−α) on each pulse |χ⟩ of the signal, and subsequently measures the outcome pulses with a threshold detector DE. b) Experimental implementation of the ideal setup:The displacement operation can be approximated in practice with an asymmetric beamsplitter of transmittance T ≈ 1, which has at one of its input ports a laser source that emits coherent pulses with amplitude β.

FIG. 10 .
FIG. 10.Alternative USD measurement setup for Eve, which we refer to as USD2.a) Ideal optical model.b) Proposed experimental realization.The values of θ and β are given in the text.

FIG. 13 .
FIG.13.Relative difference of the gain (dG), QBER (dQBER) and visibilities (dV s ), in percentage, for different values of Mmax when compared to the same metrics with Mmax → ∞, computed as in Eq. (D1).The intensity has been set to µ = 1 and the case Mmax → ∞ is approximated by Mmax = 10 6 .

4 .
Fig.16 shows the dependency of the expected values of the metrics on the phase shift ϕ.Since the phase shift

FIG. 20 .
FIG. 20.Gain, QBER and visibilities vs the probability of dark counts in Bob's corresponding detectors (p D d = p B d for the gain and QBER, p M1 d = p M2 d = p B d for the visibilities).

2 ,
To calculate the QBER, on the other hand, we have to find the values of N key and N err .Precisely, we can express these as N key = τ a N a key + (1 − τ a )N sig p ā key and N err = τ a N a err + (1 − τ a )N sig p ā err , wherep ā key = (1 − f ) 1 − 1 − p D d 2 e −η B η ch t B |α| 2 , p ā err = (1 − f ) 1 + 1 − p D d e −η B η ch t B |α| 2 p D d (F1)are the probabilities of these events in the absence of Eve.Similarly, we can modify the values of the visibilities by making N MX,s = τ a N a MX,s + (1 − τ a )N sig p ā MX,s , wherep ā M1,2 f = p ā M1,s2s1 p As 1 p As 2 = 1 − 1 − p M1 d e −2η B η ch (1−t B )|α| 2 , p ā M2,2 f = p ā M2,s2s1 p As 1 p As 2 = p M2 d ,(F2)are the probabilities corresponding to the relevant clicks when Eve does not act on the channel.In order to compute the ratio of sifted key, EXT K , that Eve can extract by enabling her attack during a fraction τ a of all the communication rounds, one can observe that EXT K = τ a N a key τ a N a key + (1 − τ a )N sig p ā key .(F3) [29,37] represents a sequence of COW signals that contains two adjacent coherent states |α⟩, and p Mi|s is the conditional probability that detector D Mi clicks when such two coherent pulses interfere, given that Alice prepared the sequence s.For example, V 2 characterises the visibility between the two coherent pulses contained in a decoy signal |φ 2 ⟩, whereas V 02 characterises the visibility between the second optical pulse of |φ 2 ⟩ and the first one of |φ 0 ⟩, both of them in the state |α⟩.The other visibilities are interpreted in a similar way.Finally, it is convenient to consider the average visibility, which is given by[29,37] n clk (k) is the average number of signals within a conclusive-block of length k in which Bob observes at least one click in D D , and p last clk (k) is the probability that a click occurs in the last vacuum signal |φ vac ⟩ of the block, corresponding to the inconclusive measurement outcome that happened after a conclusive-block of length k.If we define p clk|Bv as the probability that Bob observes at least one click in a round where he receives a vacuum signal from Eve, then it is clear that . 4. Schematic illustration of the different interference events at Bob's side considered within a block, and the quantities involved in the computation of NMX,s 2 s 1 (see Eq. (29)).For simplicity, this figure shows a block with k = 3. White pulses represent vacuum states, |0⟩, sent to Bob by Eve, whereas the stripped pulses may be either |0⟩ or |α⟩.Being a valid block, it has two vacuum pulses at the conclusive-block's surrounding borders, as well as a vacuum signal |φvac⟩ at the end of the block.

TABLE I .
Protocol and experimental parameters used in the simulations.We consider the same dark-count probability p d for all detectors, i.e., p E d = p D d = p MX d = p d .
B11)and then we focus on finding the quantities n MX,s2s1 (k|i).Now, let p MX,s2s1|Bc denote the conditional probability that Alice originally prepares the sequence s 2 s 1 and D MX registers a click in the time slot associated with the interference between the last pulse of s 1 and the first pulse of s 2 , given that Bob received a non-vacuum signal in both rounds.This implies that Eve measured both signals conclusively and they were not discarded during her processing.Then we have that p M1,s2s1|Bc = p As 1 |Ec p As 2 |Ec 1 − p E0|As 1 ,Ec p E1|As 2 ,Ec 1 − p M1 As 1 |Ec p As 2 |Ec p M2 d + p E0|As 1 ,Ec + p E1|As 2 ,Ec − 2p E0|As 1 ,Ec p E1|As 2 ,Ec 1 − p M2 d .
19G.19.Gain, QBER and visibilities vs the dark-count probability of Eve's detectors, p E d .For simplicity, here we assume the same dark-count probability for all of them.