# Two-Party Quantum Private Comparison Protocol Based on Rotational Encryption
## 5 Security Analysis  
### Outsider Attacks  
There are four types of attack strategies that [PERSON] may employ to extract information about the participants' qubits to the fullest extent possible. Case 1. The intercept-resend attack  
The eavesdropper, often referred to as \"[PERSON]\", may intercept \(SE\prime_{A}\) and \(SE\prime_{B}\) during its transmission in quantum channel, measure the intercepted sequence, and then resend a fake sequence replacement of the original sequence to TP. However, both \(SE\prime_{A}\) and \(SE\prime_{B}\) consist of the decoy photons that are randomly chosen from four nonorthogonal states \(\{|0\rangle,|1\rangle,|+\rangle,|-\rangle\}\) in a random position. [PERSON] has no opportunity to know the precise positions of the decoy photons, which leads to an inability to distinguish between the decoy photons and the encoded qubits. The probability of detecting this attack for \(\delta\) decoy photons is [43]:  
\[p_{\text{detected}}=1-(0.75)^{\delta} \tag{8}\]  
where 0.75 represents the probability that [PERSON] passes the eavesdropping detection by performing this attack. As \(\delta\) increases sufficiently, the probability approaches 1. This indicates that this attack does not work, and [PERSON]'s ([PERSON]'s) encoded qubits remain confidential. Case 2. The entangle-measure attack  
The entangle-measure attack involves [PERSON] intercepting the transmitted qubits and applying a unitary operation \(U^{*}\) to entangle the prepared ancilla qubits in the state \(|E_{i}\rangle\) with the intercepted qubits [44]. The specific form of the unitary operation \(U^{*}\) is given by the following:  
\[U^{*}(|0\rangle|E_{i}\rangle)=a_{0}|0\rangle|e_{00}\rangle+b_{0}|1\rangle|e_{01}\rangle \tag{9}\]  
\[U^{*}(|1\rangle|E_{i}\rangle)=a_{1}|0\rangle|e_{10}\rangle+b_{1}|1\rangle|e_{1 1}\rangle \tag{10}\]  
\[ \begin{array}{l}U^{*}|+\rangle|E_{i}\rangle=\frac{1}{\sqrt{2}}(U^{*}|0 \rangle|E_{i}\rangle+U^{*}|1\rangle|E_{i}\rangle)\\ =\frac{1}{\sqrt{2}}(a_{0}|0\rangle|e_{00}\rangle+b_{0}|1\rangle|e_{01}\rangle +a_{1}|0\rangle|e_{10}\rangle+b_{1}|1\rangle|e_{11}\rangle)\\ =\frac{1}{2}[|+\rangle(a_{0}|e_{00}\rangle+b_{0}|e_{01}\rangle+a_{1}|e_{10} \rangle+b_{1}|e_{11}\rangle)]\\ +\frac{1}{2}[|-\rangle(a_{0}|e_{00}\rangle-b_{0}|e_{01}\rangle+a_{1}|e_{10} \rangle-b_{1}|e_{11}\rangle)]\end{array}  \tag{11}\]  
Figure 2: The measurement result. \[ \begin{array}{c}U^{*}|-\rangle|E_{i}\rangle=\frac{1}{\sqrt{2}}(U^{*}|0\rangle|E_{i }\rangle-U^{*}|1\rangle|E_{i}\rangle)\\ \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad=\frac{1}{ \sqrt{2}}(a_{0}|0\rangle|e_{00}\rangle+b_{0}|1\rangle|e_{01}\rangle-a_{1}|0 \rangle|e_{10}\rangle-b_{1}|1\rangle|e_{11}\rangle)\\ \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad=\frac{1}{2}[|+ \rangle(a_{0}|e_{00}\rangle+b_{0}|e_{01}\rangle-a_{1}|e_{10}\rangle-b_{1}|e_{ 11}\rangle)]\\ \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad+\frac{1}{2}[|- \rangle(a_{0}|e_{00}\rangle-b_{0}|e_{01}\rangle-a_{1}|e_{10}\rangle+b_{1}|e_{ 11}\rangle)]\end{array}  \tag{12}\]  
where \(\{|e_{00}\rangle,|e_{01}\rangle,|e_{10}\rangle,|e_{11}\rangle\}\) are pure states uniquely determined by the unitary operation \(U^{*}\), with the coefficients satisfying the conditions \(|a_{0}|^{2}+|b_{0}|^{2}=1\) and \(|a_{1}|^{2}+|b_{1}|^{2}=1\). Specifically, we have \(|a_{0}|^{2}=|b_{1}|^{2}=F\) and \(|b_{0}|^{2}=|a_{1}|^{2}=D\), where \(F\) represents the fidelity, and \(D\) denotes the quantum bit error rate (QBER). When the decoy photon is in the states \(\{|0\rangle,|1\rangle\}\), the probability of obtaining the correct result is \(F\). Conversely, for the decoy photon in the states \(\{|+\rangle,|-\rangle\}\), the probability of obtaining the correct result is \(1/2\).