# Two-Party Quantum Private Comparison Protocol Based on Rotational Encryption
## 4 Simulations  
Consider an example that [PERSON] has her secret integer \(X=5\) and [PERSON] has his secret integer \(Y=4\). They aim to ascertain whether \(X=Y\) without disclosing any information about \(X\) and \(Y\) to each other or to any external observers. As described in step 1, [PERSON] and [PERSON] make their secret \(X\) and \(Y\) covert in binary as \(X=(1,0,1)\) and \(Y=(1,0,0)\). Then, we assume that [PERSON] and [PERSON] utilize a QKD protocol to share a secret key sequence \(K_{AB}=(0,0,1)\). As stated in step 3, we can know that \(S_{A}=(|1\rangle,|0\rangle,|0\rangle)\) due to \(x_{i}\oplus k_{i}=(1,0,0)\) for \(i=0,1,2\), while \(S_{B}=(|1\rangle,|0\rangle,|1\rangle)\) due to \(y_{i}\oplus k_{i}=(1,0,1)\) for \(i=0,1,2\). Suppose that the secret key prepared by [PERSON] and [PERSON] is \(K_{A}=(\frac{\pi}{3},\frac{\pi}{4},\frac{5\pi}{6})\) and \(K_{B}=(\frac{3\pi}{4},\frac{6\pi}{5},\frac{5\pi}{9})\), respectively. When encrypting \(S_{A}\) (\(S_{B}\)) with \(K_{A}\) (\(K_{B}\)) using the rotational encryption methods, the resulting sequence can be expressed by \[SE_{A}=E_{K_{A}}(S_{A})=\left(R_{y}\Big{(}\frac{\pi}{3}\Big{)}\ket{1},R_{y}\Big{(} \frac{\pi}{4}\Big{)}\ket{0},R_{y}\Big{(}\frac{5\pi}{6}\Big{)}\ket{0}\right) \tag{4}\]  
\[SE_{B}=E_{K_{B}}(S_{B})=\left(R_{y}\Big{(}\frac{3\pi}{4}\Big{)}\ket{1},R_{y}\Big{(} \frac{6\pi}{5}\Big{)}\ket{0},R_{y}\Big{(}\frac{5\pi}{9}\Big{)}\ket{1}\right) \tag{5}\]  
This encryption process can be considered performing the rotational encryption operator on each state in \(S_{A}\) (\(S_{B}\)). Finally, \(SE_{A}(SE_{B})\) is sent to TP by [PERSON] ([PERSON]). We assume that no eavesdropper exists in quantum channel, and then [PERSON] and [PERSON] will announce \(K_{A}=\left(\frac{\pi}{3},\frac{\pi}{4},\frac{5\pi}{6}\right)\) and \(K_{B}=\left(\frac{3\pi}{4},\frac{6\pi}{5},\frac{5\pi}{9}\right)\) to TP who then decrypts \(SE_{A}\) and \(SE_{B}\) by rotating with an angle in the opposite direction. This decryption process can be regarded as rotating \(SE_{A}\) and \(SE_{B}\) with angles in \(K_{A}\) and \(K_{B}\) in the opposite direction. Therefore, \(S_{A}\) and \(S_{B}\) can be recovered as follows. \[S_{A}=D_{K_{A}}(SE_{A})=\left(R_{y}\Big{(}-\frac{\pi}{3}\Big{)}R_{y}\Big{(} \frac{\pi}{3}\Big{)}\ket{1},R_{y}\Big{(}-\frac{\pi}{4}\Big{)}R_{y}\Big{(} \frac{\pi}{4}\Big{)}\ket{0},R_{y}\Big{(}-\frac{5\pi}{6}\Big{)}R_{y}\Big{(} \frac{5\pi}{6}\Big{)}\ket{0}\right)=(\ket{1},\ket{0},\ket{0}) \tag{6}\]  
\[S_{B}=D_{K_{B}}(SE_{B})=\left(R_{y}\Big{(}-\frac{3\pi}{4}\Big{)}R_{y}\bigg{(} \frac{3\pi}{4}\Big{)}\ket{1},R_{y}\Big{(}-\frac{6\pi}{5}\Big{)}R_{y}\bigg{(} \frac{6\pi}{5}\Big{)}\ket{0},R_{y}\Big{(}-\frac{5\pi}{9}\Big{)}R_{y}\bigg{(} \frac{5\pi}{9}\Big{)}\ket{1}\right)=(\ket{1},\ket{0},\ket{1}) \tag{7}\]  
TP measures \(S_{A}\) and \(S_{B}\) with Z-basis to get \(M_{A}=(\ket{1},\ket{0},\ket{0})\) and \(M_{B}=(\ket{1},\ket{0},\ket{1})\). Additionally, TP can conclude that \(X\
eq Y\) due to \(M_{A}\
eq M_{B}\). The IBM Quantum Cloud Platform offers a limited number of quantum qubits for experimentation. In this case, we have access to a total of seven qubits. For the simulation of the proposed protocol, we allocate six of the available qubits. The proposed protocol is simulated using six qubits on the IBM Quantum Cloud Platform, making efficient use of the available quantum resources. We assume that the quantum registers q[0], q[1], and q[2] belong to [PERSON], while q[3], q[4], and q[5] belong to [PERSON]. The quantum circuit implemented on the IBM Quantum Cloud Platform, designed to compare whether \(X=Y\), excluding the eavesdropping detection process, which can be regarded as a separate procedure in quantum cryptography, is depicted in Figure 1. Furthermore, the measurement results are shown in Figure 2.  
From Figure 2, we observe the measurement results \(M_{A}=(\ket{1},\ket{0},\ket{0})\) and \(M_{B}=(\ket{1},\ket{0},\ket{1})\), which align with our previous calculations. This indicates that \(X\
eq Y\) since \(M_{A}\
eq M_{B}\).