# High-Dimensional and Multi-Intensity One-Photon-Interference Quantum Secure Direct Communication
## Appendix A Details of Encoding and Decoding Processes  
In coding modes, the messages to be transmitted are encoded into frames, and each frame contains the information bits and the raw keys that will be distilled later and used to encode future frames. This removes the need for quantum memory by immediately preparing and sending quantum states without storing them, and it is possible within QSDC because it can examine whether there is eavesdropping in the transmission. Here, we denote \(\mathcal{M}\in\{0,1\}^{m}\) as plaintext to be transferred from [PERSON] to [PERSON], \(\mathcal{K}\in\{0,1\}^{m}\) as keys extracted from a key pool to pre-encrypt the message \(\mathcal{M}\), and \(\mathcal{Y}=\mathcal{M}\oplus\mathcal{K}\) as the ciphertext. Then, a LDPC encoder of length \(k\) and rate \(\mathcal{R}_{p}\), satisfying \(k\mathcal{R}_{p}=m\), is applied for precoding, and it outputs \(\mathcal{X}\in\{0,1\}^{k}\) to a cache. From the cache a sequence \(\mathcal{X}_{i}\in\{0,1\}^{k_{i}}\) is retrieved, and it forms the input of the secure coding module in the \(i\)-th frame. However, in the special case that the cache becomes exhausted, \(\mathcal{X}_{i}\) comes from a random number generator (RNG). Let \(\mathcal{R}_{i}\) be the secure coding rate of the \(i\)-th frame and \(\mathcal{C}_{i}\in\{0,1\}^{nc_{i}}\) be the codeword of \(\mathcal{X}_{i}\), with length \(n_{\mathcal{C}_{i}}\). An xor operation is performed on \(\mathcal{C}_{i}\) with a random bit sequence \(\mathcal{L}_{i}\in\{0,1\}^{n_{\mathcal{C}_{i}}}\). This implements the INCUM method [50], namely by masking the ciphertext \(\mathcal{C}_{i}\) using local random numbers \(\mathcal{L}_{i}\), producing \(\mathcal{C}_{i}^{\prime}=\mathcal{C}_{i}\oplus\mathcal{L}_{i}\), which is then modulated onto quantum states. The encoded quantum state pulses are transmitted to Charlie for measurement. The main channel capacity of the \(i\)-th frame is denoted as \(C_{m_{i}}\equiv\max I_{i}(A:B)\), and the wiretap channel capacity is \(C_{m_{i}}\equiv\max I_{i}(A:E)\). The achievable secrecy channel capacity \(R_{i}\equiv C_{m_{i}}-C_{m_{i}}\) can then be calculated. These parameters must satisfy [37]  
\[\frac{k_{i}}{n_{\mathcal{C}_{i}}}\leq\mathcal{R}_{i}-C_{m_{i-1}},\quad \mathcal{R}_{i}<C_{m_{i-1}}, \tag{1}\]  
to ensure the security of the communication. A diagram of the detailed encoding and decoding process is illustrated in Figure 11, and its steps are as written below. To initialize a new round of communication, in which case \(i=1\), \(\mathcal{X}_{1}\) should be picked from an RNG. \(k_{1}\) and \(\mathcal{R}_{1}\) should be properly selected to meet the criteria in Equation (1). A usable shared key \(\mathcal{S}_{1}\) with length \(n_{\mathcal{C}_{1}}\cdot R_{1}\) can be distilled if \(C_{m_{1}}\) and \(C_{m_{1}}\) both fulfill Equation (1) as well. When \(i>1\) and \(\mathcal{K}\) is sufficient to use, [PERSON]'s encoding processes and [PERSON]'s decoding processes include the following steps:  
1. [PERSON] uses \(\mathcal{K}\in\{0,1\}^{m}\) to pre-encrypt \(\mathcal{M}\in\{0,1\}^{m}\) into the ciphertext \(\mathcal{Y}=\mathcal{M}\oplus\mathcal{K}\). 2. [PERSON] pre-encodes \(\mathcal{Y}\) into \(\mathcal{X}\), which is stored in a cache. 3. [PERSON] fetches the \(k_{i}\)-bit length of \(\mathcal{X}_{i}\in\{0,1\}^{k_{i}}\) from the cache to accomplish secure coding, where the parameters should satisfy Equation (1) and the output is \(\mathcal{C}_{i}\in\{0,1\}^{n_{\mathcal{C}_{i}}}\). 4. [PERSON] applies INCUM using a locally generated random bit string \(\mathcal{L}_{i}\), and obtains \(\mathcal{C}_{i}^{\prime}=\mathcal{C}_{i}\oplus\mathcal{L}_{i}\). 5. [PERSON] modulates \(\mathcal{C}_{i}^{\prime}\) into qubits if she selects the coding mode in **Step 2** of our protocol, otherwise she prepares the multi-intensity mode. 6. [PERSON] conducts **Step 3**. 7. Steps (5) to (6) are repeated until \(\mathcal{C}_{i}^{\prime}\) is entirely transmitted.