# Multi-Wavelength Quantum Key Distribution Emulation with Physical Unclonable Function
## 2 Multi-Wavelength QKD with a PUF
### QKD with PUF
#### 2.2.3 Obscuring and Unobscuring Bitstreams with Addition  
This section provides clarification of the use of addition for obscurement and later retrieval of the original input, as described in Section 2.2.2, and gives working examples thereof.  
To obscure the input bitstream (\(B_{1}\)), simply add another random bitstream to it, then modulo the output by the base of those streams. To then retrieve that input bitstream, perform addition modulo base with the second bitstream (\(B_{2}\)) a total of base times: in base 2, we add modulo 2 (ADD\({}_{2}\), +\({}_{2}\)) with the second bitstream two times to get back to the original bitstream, and in base 3, we add modulo 3 (ADD\({}_{3}\), +\({}_{3}\)) with the second bitstream  
\begin{table}
\begin{tabular}{p{28.5 pt} p{28.5 pt}} \hline
1. & [PERSON] generates a random stream of bits. \\
2. & She converts these bits to incomplete trits (e.g., 110001. \(\rightarrow\) ++...+) \\
3. & She gets the ternary response from the image of the PUF. \\
4. & She performs ADD\({}_{3}\) with her incomplete trits and the PUF ternary message \\
5. & QKD. \\  & (a) & For each trit in her resulting stream, she randomly chooses between rectilinear (+) and diagonal (\(\times\)) basis. \\  & (b) & She encodes each trit by polarizing the photon according to a pre-specified scheme (see Figure 1a,b). \\  & (c) & She sends the photon stream to [PERSON] via the quantum channel (e.g., fiber optic or free space). \\  & (d) & For each trit, [PERSON] randomly chooses a basis. \\  & (e) & He measures each photon and decodes each trit based on the same encoding chart that [PERSON] used. \\  & (f) & [PERSON] and [PERSON] communicate via a classical channel (e.g., internet) which basis they used for each trit. \\
6. & [PERSON] calculates the PUF ternary message ADD\({}_{3}\) with itself. \\
7. & [PERSON] performs ADD\({}_{3}\) with his final key and the PUF ternary message ternary ADD\({}_{3}\) with itself (from the previous step). \\
8. & [PERSON] and [PERSON] discard all trits in positions with mismatching basis choices. \\
9. & [PERSON] converts the resulting trits to bits. \\
10. & [PERSON]’s stream of bits should match [PERSON]’s stream of bits, assuming no eavesdropper or error. \\ \hline \end{tabular}
\end{table}
Table 1: Multi-Wavelength QKD Protocol with PUF.  
Figure 2: Implementation of a ReRAM PUF with QKD using ternary data.  
three times to get back to the original bitstream. This concept is illustrated below in base 2 on the left, and base 3 on the right, and accompanied by a respective truth table:  
\[\begin{array}{c}B_{1}:01201201\\ \begin{array}{c}B_{1}:01010101\\ +_{2}B_{2}:00100100\\ \hline O:01110001\\ +_{2}B_{2}:00100100\\ \hline B_{1}:01010101\\ \end{array}&\begin{array}{c}B_{1}:01201201\\ +_{3}B_{2}:21011012\\ \hline O_{1}:22212210\\ +_{3}B_{2}:21011012\\ \hline O_{2}:10220222\\ +_{3}B_{2}:21011012\\ \hline B_{1}:01201201\\ \end{array}&\begin{array}{c}B_{1}:01201201\\ +_{3}B_{2}:21011012\\ \hline O_{1}:22212210\\ +_{3}B_{2}:21011012\\ \hline O_{2}:10220222\\ +_{3}B_{2}:21011012\\ \hline B_{1}:01201201\\ \end{array}&\begin{array}{c}B_{1}:01201201\\ +_{3}B_{2}:21011012\\ \hline O_{1}:22212210\\ \hline O:10220222\\ +_{3}B_{2}:21011012\\ \hline B_{1}:01201201\\ \end{array}\\ \end{array} \tag{1}\]  
\[\begin{array}{c}B_{1}\\ B_{2}\\ B_{1}\\ B_{2}\\ B_{2}+_{3}B_{2}\\ \hline