Keywords

1 Introduction

In recent years, quantum cryptography has been widely concerned in many studies, especially the first quantum key distribution protocol proposed by Bennett and Brassard in 1984 [1]. From then on, there are existing more and more exciting applications about quantum secure protocols and experimental researches [2,3,4,5].

Secure multiparty computation (SMC) is that many users cooperate in obtaining the result of a function without leaking their secret information in a distributed trustless network. As Yao first proposed the concept of SMC, which was widely used to implement the following tasks [6, 7]: electronic voting, joint decryption, geometric calculation and digital signature. Therefore, many SMC protocols have been proposed, which play an essential role in classical information security. However, the SMC protocols’ security is still based on the classical mathematical difficulty assumption, and Shor [8] pointed out that it can be solved by models based on the quantum setting with higher efficiency. Therefore, designing an SMC protocol by the quantum method should be a significant way to resist quantum attacks along with the development of quantum Shor, Grover, and other deformation algorithms [8,9,10]. Since then, more and more special SMC problems have been solved in a quantum setting, such as quantum protocol for anonymous voting [11], quantum homomorphic encryption [12, 13], quantum private comparison [14,15,16], the quantum secret sharing [17], and so on.

Quantum private comparison (QPC) is one important branch of SMC, which mainly can compare the equality of the private information of the distrustful parties by quantum methods. In general, there is also a semi-honest third party (TP) in the QPC protocol, who has the ability to help the participants to compare their secret inputs. However, he cannot obtain anything about the comparison results and the participants’ private information. In 2009, Yang [18] proposed the first QPC protocol based on two-particle entangled state, and she also used the classical Hash function to realize private comparison. From then on, a new chapter of the private comparison by the quantum method has been started. Then, the design and analysis of QPC protocols have attracted much interest and attention in recent years. As a consequence, lots of QPC protocols based on different entangled states have been presented, such as Bell state, GHZ state, W state, and cluster state, etc. [19,20,21,22,23,24,25,26,27,28,29,30,31,32].

As we all know, the cluster states have been thought to have a strong violation of local reality and shown to be robust against decoherence [33, 34]. The two-particle and three-particle cluster state are the Bell state and GHZ state respectively, which are popular to us. Then, the formal definition of an N-particle cluster state was proposed in Reference [35]:

$$\left| {C_{N} } \right\rangle = \frac{1}{{2^{N/2} }} \otimes_{a = 1}^{N} (\left| 0 \right\rangle_{a} \delta_{z}^{(a + 1)} + \left| 1 \right\rangle )$$
(1)

Note that \(\delta_{z}^{(N + 1)} = 1\). Then, there are many QPC protocol based on 4-particle or five-particle cluster state. In this paper, we proposed an efficient QPC protocol based on the entanglement swapping of the 4-particle cluster state and Bell state. Comparing with some previous similar protocols, the 4-particle cluster state \(\left| {C_{4} } \right\rangle\) is different in that it is hard to destroy the entanglement than that of the 4-particle W-state by local operations [36]. It also shows a strong violation of local reality and is shown to be robust against decoherence. Therefore, taking the entanglement swapping of the 4-particle cluster state and Bell state as the information carrier can preferably perform the QPC protocol. Then, for better implementing the scheme, a semi-honest TP is introduced in the proposed QPC protocol, who only can obey the duty to perform the rules of the protocol without knowing the comparison results and participants’ secret information. Furthermore, with the decoy photons and pre-shared random sequence, it can detect the malicious eavesdropper Eve and forbid him knowing the actual comparison results and the length of the secret inputs.

2 The Proposed QPC Protocol

In this section, we present a detailed description of the proposed QPC protocol. Meanwhile, the 4-particle cluster state is described as following, where N = 4 in Eq. (1):

$$\left| {C_{4} } \right\rangle_{1234} = \frac{1}{2}(\left| {0000} \right\rangle + \left| {0110} \right\rangle + \left| {1001} \right\rangle - \left| {1111} \right\rangle )$$

Here, we choose the Bell state \(\left| {\phi^{ + } } \right\rangle_{56} = {{(\left| {00} \right\rangle + \left| {11} \right\rangle )} \mathord{\left/ {\vphantom {{(\left| {00} \right\rangle + \left| {11} \right\rangle )} {\sqrt 2 }}} \right. \kern-\nulldelimiterspace} {\sqrt 2 }}\) to construct the entangled state. The Bell basis is {\(\left| {\phi^{ \pm } } \right\rangle = {{(\left| {00} \right\rangle + \left| {11} \right\rangle )} \mathord{\left/ {\vphantom {{(\left| {00} \right\rangle + \left| {11} \right\rangle )} {\sqrt 2 }}} \right. \kern-\nulldelimiterspace} {\sqrt 2 }}\), \(\left| {\psi^{ \pm } } \right\rangle = {{(\left| {01} \right\rangle + \left| {10} \right\rangle )} \mathord{\left/ {\vphantom {{(\left| {01} \right\rangle + \left| {10} \right\rangle )} {\sqrt 2 }}} \right. \kern-\nulldelimiterspace} {\sqrt 2 }}\)}, which was used for measuring the 2-qubit system. Then, the entanglement swapping of the 4-particle cluster state \(\left| {C_{4} } \right\rangle_{1234}\) and the Bell state \(\left| {\phi^{ + } } \right\rangle_{56}\) is given in Eq. (2):

$$\begin{aligned} & \left| {C_{4} } \right\rangle_{1234} \otimes \left| {\phi^{ + } } \right\rangle_{56} \\ & = \,\frac{1}{2}(\left| {0000} \right\rangle + \left| {0110} \right\rangle + \left| {1001} \right\rangle - \left| {1111} \right\rangle ) \otimes \frac{1}{\sqrt 2 }(\left| {00} \right\rangle + \left| {11} \right\rangle ) \\ & = \,\frac{1}{4}(\left| {\phi^{ + } } \right\rangle_{12} (\left| {\phi^{ + } } \right\rangle_{35} \left| {\phi^{ - } } \right\rangle_{46} + \left| {\phi^{ - } } \right\rangle_{35} \left| {\phi^{ + } } \right\rangle_{46} + \left| {\psi^{ + } } \right\rangle_{35} \left| {\psi^{ - } } \right\rangle_{46} + \left| {\psi^{ - } } \right\rangle_{35} \left| {\psi^{ + } } \right\rangle_{46} ) \\ & \quad + \,\left| {\phi^{ - } } \right\rangle_{12} (\left| {\phi^{ + } } \right\rangle_{35} \left| {\phi^{ + } } \right\rangle_{46} + \left| {\phi^{ - } } \right\rangle_{35} \left| {\phi^{ - } } \right\rangle_{46} + \left| {\psi^{ + } } \right\rangle_{35} \left| {\psi^{ + } } \right\rangle_{46} + \left| {\psi^{ - } } \right\rangle_{35} \left| {\psi^{ - } } \right\rangle_{46} ) \\ & \quad + \,\left| {\psi^{ + } } \right\rangle_{12} (\left| {\psi^{ + } } \right\rangle_{35} \left| {\phi^{ + } } \right\rangle_{46} - \left| {\psi^{ - } } \right\rangle_{35} \left| {\phi^{ - } } \right\rangle_{46} + \left| {\phi^{ + } } \right\rangle_{35} \left| {\psi^{ + } } \right\rangle_{46} - \left| {\phi^{ - } } \right\rangle_{35} \left| {\psi^{ - } } \right\rangle_{46} ) \\ & \quad + \,\left| {\psi^{ - } } \right\rangle_{12} (\left| {\psi^{ + } } \right\rangle_{35} \left| {\phi^{ - } } \right\rangle_{46} - \left| {\psi^{ - } } \right\rangle_{35} \left| {\phi^{ + } } \right\rangle_{46} + \left| {\phi^{ + } } \right\rangle_{35} \left| {\psi^{ - } } \right\rangle_{46} - \left| {\phi^{ - } } \right\rangle_{35} \left| {\psi^{ + } } \right\rangle_{46} ) \\ \end{aligned}$$
(2)

The proposed QPC protocol can be described with the input: Given Alice’s private integer \(X\) and Bob’s private integer \(X\). Then, the binary representation of the two participants’ private information \(X\) and \(Y\) in \(F_{{2^{L} }}\) can be written as: \(X = (x_{0} ,x_{1} ,...,x_{N - 1} )\), \(Y = (y_{0} ,y_{1} ,...,y_{N - 1} )\), where \(x_{i} ,y_{i} < 2^{L}\). They also can be described as \(X = \sum\nolimits_{i = 0}^{L - 1} {x_{i} 2^{i} }\), \(Y = \sum\nolimits_{i = 0}^{L - 1} {y_{i} 2^{i} }\), \(2^{L} - 1 < \max \{ X,Y\} < 2^{L}\). Meanwhile, it is with the output \(X = Y\) or \(X \ne Y\).

Additionally, there also needs a semi-honest third party (TP) Charlie, who only can help the two participants Alice and Bob compare their secrets without obtaining anything about the secrets of Alice and Bob through the protocol. Beforehand, Alice (Bob) and Charlie should share a common secret key \(K_{AC} (K_{BC} )\) by a secure QKD protocol. The two participants, Alice and Bob, share a secret key sequence \(K:(k_{0} ,k_{1} ,...,k_{L - 1} )\), where \(k_{i} \in \{ 0,1\}\), \(i = 0,1,...,(L - 1)\) through a secure QKD protocol.

2.1 Preparing Step

In order to accurately compare the two secrets of Alice and Bob, the \(N\)-bit binary string \(X(Y)\) has been divided into \(\left\lceil {N/2L} \right\rceil\) groups, and each group has \(2L\) bits. If \(N\bmod 2 \ne 1\), Alice (Bob) always adds \(2L - (N\bmod 2L)\) 0 at the end of last group. Then, the two \(N\)-bit binary strings \(X\) and \(Y\) will be denoted as \(X = A_{{\left\lceil {N/2L} \right\rceil - 1}} ..A_{1} A_{0}\) and \(Y = B_{{\left\lceil {N/2L} \right\rceil - 1}} ..B_{1} B_{0}\), where \(A_{j}\) and \(B_{j}\) (\(j = 0,1,...,\left\lceil {N/2L} \right\rceil - 1\)) are

$$\left\{ \begin{gathered} A_{j} = (x_{j}^{2L - 1} ,...,x_{j}^{1} ,x_{j}^{0} ) \hfill \\ B_{j} = (y_{j}^{2L - 1} ,...,y_{j}^{1} ,y_{j}^{0} ) \hfill \\ \end{gathered} \right.$$

For each group \(A_{j} (B_{j} )\), the \(2L\) bits will be divided into \(L\) pairs with every two adjacent bits composing a pair, such as \(Q_{A}^{i} = (x_{j}^{2i} ,x_{j}^{2i + 1} ),\;Q_{B}^{i} = (y_{j}^{2i} ,y_{j}^{2i + 1} )\). Then, the group \(A_{j} (B_{j} )\) can be denoted as

$$\left\{ \begin{gathered} A_{j} = (Q_{A}^{L - 1} ,...,Q_{A}^{1} ,Q_{A}^{0} ) \hfill \\ B_{j} = (Q_{B}^{L - 1} ,...,Q_{B}^{1} ,Q_{B}^{0} ) \hfill \\ \end{gathered} \right.$$

Charlie prepares \(N\) ordered states \(\left| {C_{4} } \right\rangle_{1234}\) and \(\left| {\phi^{ + } } \right\rangle_{56}\) for the \(j\)-th round comparison, by which he constructs two ordered sequences \(S_{1}\) and \(S_{2}\) as following:

$$\left\{ {\begin{array}{*{20}l} {S_{1} :[P_{1}^{0} P_{2}^{0} P_{3}^{0} P_{4}^{0} ,P_{1}^{1} P_{2}^{1} P_{3}^{1} P_{4}^{1} ,...,P_{1}^{{L - 1}} P_{2}^{{L - 1}} P_{3}^{{L - 1}} P_{4}^{{L - 1}} ]} \hfill \\ {S_{2} :[P_{5}^{0} P_{6}^{0} ,P_{5}^{1} P_{6}^{1} ,...,P_{5}^{{L - 1}} P_{6}^{{L - 1}} ]} \hfill \\ \end{array} } \right.$$

where the subscripts {1, 2, 3, 4 (5, 6)} denote the different particle in each quantum sequence \(S_{1} \left( {S_{2} } \right)\), and the superscripts \(\{ 0,1,...,L - 1\}\) denote the \(i\)-th entangle quantum state which was prepared by Charlie.

In this step, Charlie will divide sequences \(S_{1}\) and \(S_{2}\) into three parts, and send different parts to different parties. The first two particles of all \(\left| {C_{4} } \right\rangle_{1234}\) states in \(S_{1}\) will be formed into sequence \(S_{C}\) owned by himself, and the third particles of all \(\left| {C_{4} } \right\rangle_{1234}\) states in \(S_{1}\) and the first particle of all \(\left| {\phi^{ + } } \right\rangle_{56}\) states in \(S_{2}\) will be formed into sequence \(S_{A}\) and sent to Alice, while the fourth particles of all \(\left| {C_{4} } \right\rangle_{1234}\) states in \(S_{1}\) and the second particle of all \(\left| {\phi^{ + } } \right\rangle_{56}\) states in \(S_{2}\) will be formed into sequence \(S_{B}\) and sent to Bob. Then, the sequences \(S_{C} ,S_{A} ,S_{B}\) are depicted as following:

$$\left\{ \begin{gathered} S_{C} :[P_{1}^{0} P_{2}^{0} ,P_{1}^{1} P_{2}^{1} ,...,P_{1}^{L - 1} P_{2}^{L - 1} ] \hfill \\ S_{A} :[P_{3}^{0} P_{5}^{0} ,P_{3}^{1} P_{5}^{1} ,...,P_{3}^{L - 1} P_{5}^{L - 1} ] \hfill \\ S_{B} :[P_{4}^{0} P_{6}^{0} ,P_{4}^{1} P_{6}^{1} ,...,P_{4}^{L - 1} P_{6}^{L - 1} ] \hfill \\ \end{gathered} \right.$$

Before sending \(S_{A} (S_{B} )\) to Alice (Bob), the sequence should be pre-processed for the anti-eavesdrop. Here two bunches of decoy photons \(D_{A}\) and \(D_{B}\) will be mixed into the sequences \(S_{A}\) and \(S_{B}\), which randomly chosen from states \(\{ \left| 0 \right\rangle ,\left| 1 \right\rangle ,\left| + \right\rangle ,\left| - \right\rangle \}\). Then, the new sequences \(S^{\prime}_{A}\) and \(S^{\prime}_{B}\) will be sent to Alice and Bob, respectively.

2.2 Checking Step

For the eavesdropper checking, Charlie should announce the positions and measuring basis of \(D_{A} (D_{B} )\) after that Alice (Bob) has received the sequence \(S^{\prime}_{A} (S^{\prime}_{B} )\).

Then, the participant Alice (Bob) picks out the decoy particles \(D_{A} (D_{B} )\) from sequence \(S^{\prime}_{A} (S^{\prime}_{B} )\), and measures them with the announced corresponding basis by Charlie.

Next, Alice (Bob) sends the measuring results to Charlie, and Charlie compares them with his initial decoy photons states. If the error rate exceeds a suitable threshold, Charlie will terminate this communication and restart one new communication from the preparing step. Otherwise, the protocol will continue.

2.3 Coding Step

After passing the eavesdropping detection, the decoy photons will be discarded, and the veritable sequence \(S_{A} (S_{B} )\) will be recovered by Alice (Bob).

Alice (Bob) measures the \(i\)-th pair \(P_{3}^{i} P_{5}^{i} (P_{4}^{i} P_{6}^{i} )\) in \(S_{A} (S_{B} )\) with the basis \(\{ \left| {\phi^{ \pm } } \right\rangle ,\left| {\psi^{ \pm } } \right\rangle \}\), and the measurement results can be denoted by \(M_{A}^{i} (M_{B}^{i} )\). According to the measurement results, Alice(Bob) will obtain a two-bit value by the following corresponding relation: \(C_{A}^{i} (C_{B}^{i} ) = 00\) with \(M_{A}^{i} (M_{B}^{i} ) = \left| {\phi^{ + } } \right\rangle\), \(C_{A}^{i} (C_{B}^{i} ) = 01\) with \(M_{A}^{i} (M_{B}^{i} ) = \left| {\phi^{ - } } \right\rangle\), \(C_{A}^{i} (C_{B}^{i} ) = 10\) with \(M_{A}^{i} (M_{B}^{i} ) = \left| {\psi^{ + } } \right\rangle\) and \(C_{A}^{i} (C_{B}^{i} ) = 11\) with \(M_{A}^{i} (M_{B}^{i} ) = \left| {\psi^{ - } } \right\rangle\).

Alice (Bob) encodes her(his) secrets \(Q_{A}^{i} (Q_{B}^{i} )\) with \(C_{A}^{i} (C_{B}^{i} )\) and the pre-shared secret keys \(K_{i}\) by calculating

$$\left\{ {\begin{array}{*{20}l} {R_{A}^{i} = Q_{A}^{i} \oplus C_{A}^{i} \oplus K_{i} } \hfill \\ {R_{B}^{i} = Q_{B}^{i} \oplus C_{B}^{i} \oplus K_{i} } \hfill \\ \end{array} } \right.$$
(3)

Then, she(he) can get the sequence \(R_{A}^{0} ,R_{A}^{2} ,...,R_{A}^{l - 1} (R_{B}^{0} ,R_{B}^{2} ,...,R_{B}^{l - 1} )\).

After the former coding processes, the two sequences \(R_{A}^{0} ,R_{A}^{2} ,...,R_{A}^{l - 1}\) and \(R_{B}^{0} ,R_{B}^{2} ,...,R_{B}^{l - 1}\) will be encrypted with the pre-shared secret keys \(K_{AC}\) and \(K_{BC}\), respectively. Then, the two encrypted sequences \(E_{{K_{AC} }} (R_{A}^{0} ,R_{A}^{2} ,...,R_{A}^{l - 1} )\) and \(E_{{K_{BC} }} (R_{B}^{0} ,R_{B}^{2} ,...,R_{B}^{l - 1} )\) will be sent to Charlie through the quantum-one-time pad.

2.4 Decoding Step

When receives the two encrypted sequences from Alice and Bob, Charlie will use the corresponding secret keys \(K_{AC} ,\;K_{BC}\) to decrypt them. The two sequences \(R_{A}^{0} ,R_{A}^{2} ,...,R_{A}^{l - 1}\) and \(R_{B}^{0} ,R_{B}^{2} ,...,R_{B}^{l - 1}\) can be recovered from the two encrypted sequences. Then, Charlie calculates

$$R_{AB}^{i} = R_{A}^{i} \oplus R_{B}^{i}$$
(4)

The \(i\)-th pair in \(S_{C}\) also should be measured by Charlie with the same basis \(\{ \left| {\phi^{ \pm } } \right\rangle ,\left| {\psi^{ \pm } } \right\rangle \}\), and the measurement results can be denoted as \(M_{C}^{i}\). Through calculating and summarizing for all cases, the relations between \(Q_{A}^{i} ,\;Q_{B}^{i}\)’s value according to \(R_{AB}^{i}\) and \(M_{C}^{i}\) are shown in Table 1.

Table 1. Relations between \(Q_{A}^{i} ,\;Q_{B}^{i}\)’s value according to \(R_{AB}^{i}\) and \(M_{C}^{i}\).

As shown in Table 1, if \(R_{AB}^{i} = 01\) and \(M_{C}^{i} = \left| {\phi^{ + } } \right\rangle\), \(R_{AB}^{i} = 00\) and \(M_{C}^{i} = \left| {\phi^{ - } } \right\rangle\), \(R_{AB}^{i} = 10\) and \(M_{C}^{i} = \left| {\psi^{ + } } \right\rangle\) or \(R_{AB}^{i} = 11\) and \(M_{C}^{i} = \left| {\psi^{ - } } \right\rangle\), the relation \(Q_{A}^{i} = Q_{B}^{i}\) holds. Otherwise, \(Q_{A}^{i} \ne Q_{B}^{i}\). If all of the \(Q_{A}^{i} = Q_{B}^{i}\) holds, the relation \(Q_{A} = Q_{B}\) is valid. Once at least one data element \(Q_{A}^{i} \ne Q_{B}^{i}\), then \(Q_{A} \ne Q_{B}\). Moreover, Table 2 shows two cases of the detail results.

3 Security Analysis

Two primary attacks should be considered for the security analysis, the outside attack and the dishonest participant’s attack. They all attempt to steal the participants’ private information or the comparison results by all means.

3.1 Outside Attack

The outside attack is a vital scenario that should be paid more attention to, as there are many kinds of attacks that once grew in previous QPC protocols, such as the intercept-resend attack, the entanglement-measure attack, and the coordinated and the Trojan horse attack. However, the entanglement-measure attack and the coordinated attack will be detected with nonzero probability during the checking step. The Trojan horse attack also can be automatically prevented due to the one-way transmission.

Unfortunately, in the preparing step and coding step, the secret inputs may be quickly stolen by the intercept-resend attack through the transmission of \(S^{\prime}_{A} (S^{\prime}_{B} )\) and \(E_{{K_{A} }} (E_{{K_{B} }} )\). However, we will show Eve cannot obtain any information about the participants’ secrets \(X\) or \(Y\) even though he stole some results from these two steps, which are show in the following two cases.

Table 2. Two cases of \(Q_{A}^{i} ,\;Q_{B}^{i}\)’s value.

Case 1: In the Preparing Step.

Eve first intercepts the photon sequence \(S^{\prime}_{A}\) (from Charlie to Alice in the final step of preparing phase), then he measures \(S^{\prime}_{A}\) with the basis \(\{ \left| {\phi^{ \pm } } \right\rangle ,\left| {\psi^{ \pm } } \right\rangle \}\). Then, a measurement result \(M^{\prime}_{A}\) has been obtained by Eve. According to the measurement result sequence \(M^{\prime}_{A}\), Eve generates the new quantum sequence \(S^{\prime\prime}_{A}\) and resends it to Alice to preventing Charlie from perceiving the attack. Nevertheless, Eve does not know the position of the decoy photons in \(S^{\prime}_{A}\), and he cannot abandon the decoy photos when he measures the quantum sequence \(S^{\prime}_{A}\). Therefore, the decoy photons will destroy the correctness of the measurement results and Eve’s new quantum sequence \(S^{\prime\prime}_{A}\), so the sequence \(S^{\prime\prime}_{A}\) will be quite different from sequence \(S^{\prime}_{A}\). Once Alice starts the eavesdropping detection process when she received the photon sequence \(S^{\prime\prime}_{A}\), the attack will be easily detected for the states of the decoy photons that has been damaged.

Case 2: In the Decoding Step.

Alice (Bob) sends the sequence \(E_{{K_{A} }} (R_{A}^{0} ,R_{A}^{2} ,...,R_{A}^{l - 1} )(E_{{K_{B} }} (R_{B}^{0} ,R_{B}^{2} ,...,R_{B}^{l - 1} ))\) to Charlie. It cannot reveal any information about \(X\) and \(Y\) from \(R_{A}^{i}\) and \(R_{B}^{i}\), so the outside eavesdropper cannot get anything. In the decoding step, Charlie announces only one \(c\)-bit \(F\) to compare secret messages. From this one \(c\)-bit, outside eavesdropper cannot deduce any information about \(X\) and \(Y\).

In addition, if Eve can get the accurate particle pairs, he will serve as a malicious TP. Then, he attempts to steal the private information of the participants. As the participants’ secret information \(Q_{A}^{i} (Q_{B}^{i} )\) was encoded into the entanglement state by Eq. (3), Eve only can get the information of \(R_{A}^{i} (R_{B}^{i} )\) and \(C_{A}^{i} (C_{B}^{i} )\). However, since the sequence \((K_{0} ,K_{1} ,...,K_{L - 1} )\) between Alice and Bob was pre-shared by a secure QKD protocol, Eve cannot obtain anything about \(K_{i}\). Then, he can get nothing about the participants’ secret information \(Q_{A}^{i} (Q_{B}^{i} )\).

Hence, this proposed QPC protocol is secure against outside attack.

3.2 Participant Attack

The participant attack is another important scenario that should be paid more attention to. In general, the participants always have more opportunities and advantages to steal other participants’ private information than an outside eavesdropper. Now, we give three cases to prove that the proposed QPC protocol can resist the participant attack, and the adversary cannot obtain any information about \(X\) and \(Y\).

Case 1: Alice (Bob) Attempts to Obtain Bob (Alice)’s Secrets.

In the whole process of the proposed QPC protocol, the two participants do not transmit any information to each other except the pre-shared sequence \(K\). The \(K\) is the pre-shared secret key, and it is used to secure the encoding message against the malicious TP. As in the coding step, the private information is encoded in an entanglement state by Eq. (3). The \(R_{A}^{i} (R_{B}^{i} )\) was encrypted by a pre-shared secret key, and sent by a secure QKD protocol to Charlie. Thus, it cannot be obtained by the other participant. The \(C_{A}^{i} (C_{B}^{i} )\) was a classical bit corresponding to the measurement results. Since one participant cannot obtain anything about the other participant’s private information, no matter the entanglement state generated and distributed by Charlie or the measurement basis which the participants themselves selected. Therefore, the participant cannot derive any information about \(Q_{A}^{i} (Q_{B}^{i} )\) by the Eq. (3). Therefore, the two participants Alice and Bob, cannot infer any information about each other’s secrets.

Case 2: Charlie Attempts to Obtain Alice (Bob)’s Secrets.

The malicious TP is curious about the participants’ secret information, and he will try every means to obtain that. At the same time, the intermediate date \(R_{A}^{i}\) and \(R_{B}^{i}\), which relate to the participants’ secret information, can be easily used by Charlie. Here, TP can obtain the measurement results with the following probability.

$$\begin{aligned} & P(R_{A}^{i} (R_{B}^{i} ) = 00) = P(R_{A}^{i} (R_{B}^{i} ) = 01) = P(R_{A}^{i} (R_{B}^{i} ) = 10) = P(R_{A}^{i} (R_{B}^{i} ) = 11) = \frac{1}{4} \\ & P(M_{C}^{i} = \left| {\phi^{ + } } \right\rangle ) = P(M_{C}^{i} = \left| {\phi^{ - } } \right\rangle ) = P(M_{C}^{i} = \left| {\psi^{ + } } \right\rangle ) = P(M_{C}^{i} = \left| {\psi^{ - } } \right\rangle ) = \frac{1}{4} \\ \end{aligned}$$
(5)

Here, we know that TP cannot infer any information of the participants’ secret with the undistinguishable probability of the measurement results.

In addition, if TP obtains the \(C_{A}^{i} (C_{B}^{i} )\) by a fake single attack, he will derive the value of \(Q_{A}^{i} \oplus K_{i} (Q_{B}^{i} \oplus K_{i} )\) from Eq. (3). However, he cannot get any information about \(Q_{A}^{i} (Q_{B}^{i} )\) since that \(K_{i}\) is secretly pre-shared by a secure QKD protocol between Alice and Bob. Moreover, the secret input is divided into \(\left\lceil {N/2L} \right\rceil (L = 1,2,...)\) groups, while each group has \(2L\) bits. Alice (Bob) always adds \(2L - (N\bmod 2L)\) 0 at the end of the \(N\)-bit binary string \(X(Y)\). Therefore, although Charlie can infer the participants’ secret inputs, he cannot know the real length of their secret information.

Case 3: Charlie Attempts to Obtain the Comparison Results.

TP is a semi-honest participator, he only can help the two participants to compare their secret inputs, and he cannot obtain anything about their secret information, even the comparison results. As the comparison principle is secretly established between Alice and Bob, when Charlie announces the results \(R_{AB}^{i}\) and \(M_{C}^{i}\), Alice and Bob will know the comparison results according to Table 1. Charlie has no information about the relationship between the value of \(R_{AB}^{i}\) and \(M_{C}^{i}\) and the comparison results, and then he can obtain nothing about the comparison results.

Hence, this proposed QPC protocol is secure against participant attack.

4 Efficiency Comparison

Compared with similar QPC protocols, this protocol has many advantages for comparing private information by quantum methods. As the 4-particle cluster state \(\left| {C_{4} } \right\rangle_{1234}\), it is hard to destroy the entanglement by local operations, which is different from the 4-particle \(W\)-state, and has a strong violation of local reality and robust against decoherence. Therefore, this paper takes the entanglement swapping between the 4-particle cluster state and Bell state as the information carrier, which will make the QPC protocol more practical for private comparison. Then, the proposed QPC protocol has no unitary operations and Hash functions and compares two bits of private information simultaneously, which shows better performance on operability, efficiency, and security as details of the comparison results have been shown in the Table 3.

Table 3. Efficiency comparison of the similar schemes.

In addition, we compare the computational costs in this scheme with other kinds of literature. Here, we mainly consider the classical bit-wise exclusive-OR \(\oplus\) operations, the quantum measurement, and unitary operations involved in the protocol. In one group comparison, there need \(3L\) classical operations. In the whole scheme, there needs \(3L*\left\lceil {N/2L} \right\rceil\) classical operations with \(\left\lceil {N/2L} \right\rceil\) groups. As the classical operations of the pre-shared sequence in the coding step can be calculated in the spare time, it does affect the time complexity. Then, there need \(D + 3L*\left\lceil {N/2L} \right\rceil\) quantum measurements operated by the three participants, where \(D\) denotes the measurement of decoy photons. The detailed comparison results in Table 4 have shown that our scheme is more efficient than other protocols.

5 Conclusion

This paper proposed an efficient QPC protocol based on the entanglement swapping of the 4-particle cluster state and Bell state. This cluster is more robust and practical than the other 4-particle clusters and W-state. With the help of semi-honest TP, two participants can compare the equality of their private information without leaking them. This scheme is secure against the outside and participants’ attacks with the decoy photons and pre-shared random sequence. Then, from the efficiency standpoint, our scheme is more efficient than other protocols by only using single particles, Bell states, and GHZ states since that it compares double bits at one time and uses less classical and quantum operations. Additionally, the quantum channel is vulnerable to noise, such as collective-dephasing noise and collective-rotation noise. So, it is more important to design a new noise-resisting QPC protocol in future work.

Table 4. Computational costs comparison.