## 1 Introduction  
Quantum key distribution (QKD) is already a mature technology that can provide cryptographic systems with an unprecedented level of security [1,2]. It aims at the distribution of a secret key between two distant parties (typically called [PERSON] and [PERSON]) despite the technological power of an eavesdropper ([PERSON]) who interferes with the signals. This secret key is the essential ingredient of the one-time-pad or Vernam cipher [3], the only known encryption method that can offer information-theoretic secure communications. Most practical long-distance implementations of QKD are based on the so-called Bennett-Brassard 1984 (BB84) protocol, introduced by [PERSON] and [PERSON] in 1984 [4], in combination with the decoy-state method [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]. In a typical quantum optical implementation of this scheme, [PERSON] sends to [PERSON] phase-randomized weak coherent pulses (WCPs) with different mean photon numbers that are selected, independently and randomly, for each signal. These states can be generated using a standard semiconductor laser together with a variable optical attenuator that is controlled by a random number generator (RNG) [19, 20, 21, 22, 23]. Each light pulse may be prepared in a different polarization state, which is selected, again independently and randomly for each signal, between two mutually unbiased bases, e.g., either a linear (H [horizontal] or V [vertical]) or a circular (L [left] or R [right]) polarizations basis. For simplicity, we will first consider the case of polarization encoding. Later in this paper, we will also examine phase encoding. For that, two main experimental configurations are typically used. In the first one, [PERSON] employs four laser diodes, one for each possible BB84 signal [24, 25]. These lasers are controlled by a RNG that decides each given time which one of the four diodes is triggered. The second configuration utilizes only one laser diode in combination with a polarization modulator [26, 27, 28, 29, 30]. This modulator rotates the state of polarization of the signals depending on the output of a RNG. On the receiving side, [PERSON] measures each incoming signal by choosing at random between two polarization analyzers, one for each possible basis. Once the quantum communication phase of the protocol is completed, [PERSON] and [PERSON] use an authenticated public channel to process their data and obtain a secure secret key. Importantly, the security of decoy-state QKD has been obtained both in the asymptotic regime [6, 7] and in the case of finite-length keys [31, 32]. Alternatively to the active signal state preparation methods described above, [PERSON] may as well employ a passive transmitter to generate decoy-state BB84 signals. This last solution might be desirable in some scenarios; for instance, in those experimental setups operating at high transmission rates, since no RNGs are required in a passive device [33, 34, 35, 36, 37, 38, 39, 40, 41]. Passive schemes might also be more robust against certain side-channel attacks hidden in the imperfections of some optical components like, for example, optical modulators used in the active sources. If a polarization modulator (or an amplitude or phase modulator) is not properly designed, for example, it may distort some of the physical parameters of the pulses emitted by the sender depending on the particular value of the polarization setting selected. This fact could open a security loophole in the active schemes. The working principle of a passive transmitter is rather simple. For example, [PERSON] can use various light sources to produce different signal states that are sent through an optics network. Depending on the particular detection pattern observed in some properly located photodetectors, she can infer which signal states are actually generated.