# One-Photon-Interference Quantum Secure Direct Communication
## Appendix A Details of Encoding and Decoding  
To ensure the security of QSDC, it is essential to establish the channel's security before loading information. To achieve this, in the OPI-QSDC protocol, the message to be transmitted is divided into multiple frames, with each frame containing several bits. The security of each frame is guaranteed by using the estimation results of the previous frame parameters. The first frame is used for transmitting random numbers. The schematic diagram of the OPI-QSDC protocol in \(i\)-th frame, including the complete encoding and decoding process, is illustrated in Figure 11. We use the dynamic joint encoding proposed in [36]. Here, \(M\in\{0,1\}^{m}\) represents the plaintext message that [PERSON] wants to send to [PERSON]. \(S\in\{0,1\}^{m}\) is a shared secure transmission sequence (SSTS) extracted from the SSTS pool, which is used for encoding. \(Y\) is the encrypted message, where \(Y=M\oplus S\). \(X\in\{0,1\}^{k}\) is a \(k\)-length \((k,kR_{p})\) LDPC codeword obtained by performing LDPC encoding on \(Y\), resulting in an output rate of \(kR_{p}=m\). Sequence \(X_{i}\in\{0,1\}^{k_{i}}\) is a part of X or a randomly generated bit sequence, serving as the input to the secure encoding module in the \(i\)-th frame. \(r_{i}\) is the rate of secure encoding in the \(i\)-th frame. \(Z_{i}\in\{0,1\}^{n_{ci}}\) is the encoded text generated from sequence \(X_{i}\) with a length of \(n_{ci}\). \(L_{i}\in\{0,1\}^{n_{ci}}\) represents locally generated random numbers used for INCUM encryption, \(C_{i}=Z_{i}\oplus L_{i}\). After transmitting \(C_{i}\), [PERSON] and [PERSON] can infer the mutual information between [PERSON] and [PERSON] \(I(A:B)_{i}\), and [PERSON] and [PERSON] \(I(A:E)_{i}\). Based on these, they can obtain the secrecy rate \(R_{i}\) for the \(i\)-th frame. The above parameters must satisfy the condition of  
\[ \begin{split}\frac{k_{i}}{n_{ci}}&\leq r_{i}-I(A:E )_{i-1},\\ r_{i}&<I(A:B)_{i-1},\end{split}  \tag{11}\]where \(I(A:E)_{i-1}=q\cdot Q_{u}^{i-1}\cdot h(E_{u}^{Zj-1})\) and \(I(A:B)_{i-1}=q\cdot Q_{u}^{i-1}\cdot[1-f\cdot h(E_{u}^{X,i-1})]\), based on Section 3. These two conditions ensure the security and reliability of information transmission, respectively. The detailed steps of \(i\)-th frame are as follows. **Step 1: encoding. ** [PERSON] encodes the message \(M\) to be transmitted as follows. (1). [PERSON] uses SSTS \(S\) to encrypt plaintext message \(M\) and obtains \(Y\), where \(Y=M\oplus K\). Note that in the first round of communication, the SSTS pool is empty. At this point, [PERSON] can generate \(X_{i}\) using random numbers and transmit it to [PERSON]. Then, they can estimate \(I(A:B)_{1}\) and \(I(A:E)_{1}\), and extract the same SSTS that satisfies Equation (A1). They can then add it to the SSTS pool. From this point onward, there will be sufficient SSTS available for further communication. (2). [PERSON] encodes \(Y\) into X and then places it in the cache. **Step 2: mode preparation. ** [PERSON] and [PERSON] randomly select the coding mode with a probability of \(1-p\) and the multi-intensity mode with a probability of \(p\), where \(0<p<<1\). The quantum states sent in each mode are as follows. Coding mode: If [PERSON] chooses this mode, she continues the encoding process:  
(1). [PERSON] selects \(k_{i}\) bits from the cache to perform secure encoding, resulting in \(Z_{i}\). (2). [PERSON] generates a local random bit string \(L_{i}\) and encrypts \(Z_{i}\) using it to obtain \(C_{i}\), where \(C_{i}=Z_{i}\oplus L_{i}\). (3). [PERSON] maps each bit of \(C_{i}\) into a quantum state. She prepares the quantum state \(\ket{\alpha}\) to represent logical bit 0, and quantum state \(\ket{-\alpha}\) to represent logical bit 1. (4). [PERSON] sends the quantum states to [PERSON]. If [PERSON] chooses this mode, he randomly chooses to send state \(\ket{\alpha}\) or \(\ket{-\alpha}\).