# Two-Party Quantum Private Comparison Protocol Based on Rotational Encryption
## 3 The Proposed Two-Party QPC Protocol  
The QPC protocol involves three key entities:  
**Semi-Honest Third Party (TP)**: This entity is responsible for generating and distributing the necessary quantum resources to the participants, [PERSON] and [PERSON]. TP processes the comparison results without accessing the private data of either participant. The assumption that TP is semi-honest implies that it will adhere to the protocol and will not intentionally mislead, although it may attempt to extract additional information from the data it processes. **[PERSON] and [PERSON]**: [PERSON] and [PERSON] play analogous roles in the protocol, characterized as being honest but curious. This means that while they will follow the protocol and act honestly during the comparison process, they may still seek to gain additional information about each other's private inputs beyond the outcome of the comparison. The objective of the QPC protocol is to ascertain whether the secrets \(X\) and \(Y\) held by [PERSON] and [PERSON] are equal. This is accomplished without either party disclosing any information about their respective secrets to the other, TP, or any external observers. The protocol ensures the following key properties:  
**Privacy**: Each participant's secret remains confidential throughout the process. **Correctness**: The comparison result of the protocol accurately reflects whether the secrets are equal. **Fairness**: Both parties receive the comparison result simultaneously, ensuring that no participant has an advantage over the other. The protocol assumes the existence of a noise-free and lossless quantum channel, enabling the transmission of quantum states without degradation. Additionally, it is assumed that the classical channel used for communication between the parties is authenticated. The specific steps of the QPC protocol are outlined as follows:  
**Step 1**. [PERSON] and [PERSON] make their secret \(X\) and \(Y\) covert in binary as \(X=(x_{L-1},x_{L-2},\cdots,x_{0})\) and \(Y=(y_{L-1},y_{L-2},\cdots,y_{0})\), respectively, where \(x_{i},y_{i}\in\{0,1\}\) for \(i=0,1,\cdots,L-1\). **Step 2**. [PERSON] and [PERSON] utilize a QKD protocol to share a secret key sequence \(K_{AB}=(k_{L-1},\ k_{L-2},\cdots,k_{0})\), where \(k_{i}\in\{0,1\}\) for \(i=0,1,\cdots,L-1\). **Step 3**. [PERSON] ([PERSON]) calculates the value of \(x_{i}\oplus k_{i}\) (\(y_{i}\oplus k_{i}\)) and then prepares the corresponding single-photon state \(|0\rangle\) or \(|1\rangle\) based on the value of \(x_{i}\oplus k_{i}\) (\(y_{i}\oplus k_{i}\)). Specifically, if \(x_{i}\oplus k_{i}=0\) (\(y_{i}\oplus k_{i}=0\)), the prepared single-photon state is \(|0\rangle\); otherwise, the prepared single-photon state is \(|1\rangle\). All single-photon states that comprise the quantum sequence are denoted as \(S_{A}\) (\(S_{B}\)). **Step 4**. [PERSON] ([PERSON]) generates her (his) secret key \(K_{A}=(a_{L-1},a_{L-2},\cdots,a_{0})\) (\(K_{B}=(b_{L-1},b_{L-2},\cdots,b_{0})\)), where \(a_{i},b_{i}\in[0,2\pi)\) for \(i=0,1,\cdots,L-1\), and encrypts each single-photon state in \(S_{A}\) (\(S_{B}\)) with \(K_{A}(K_{B})\) using the rotational encryption methods. Specifically, each single-photon state in \(S_{A}\) (\(S_{B}\)) is rotated by an angle \(a_{i}(b_{i})\). The encrypted quantum sequence is denoted as \(SE_{A}\) (\(SE_{B}\)). **Step 5**. To detect eavesdropping, [PERSON] ([PERSON]) prepares a decoy-photon sequence \(D_{A}\) (\(D_{B}\)) randomly selected from four nonorthogonal states \(\{|0\rangle,|1\rangle,|+\rangle,|-\rangle\}\). She (he) inserts \(D_{A}\) into \(SE_{A}\) ( \(D_{B}\) into \(SE_{B}\)) at random positions to generate a new sequence denoted as \(SE_{A}\) (\(SE_{B}\)) and records the states and locations of decoy photons. After that, [PERSON] ([PERSON]) sends \(SE_{A}\) (\(SE_{B}\)) to TP via a quantum channel. **Step 6**.