1 Introduction

The rapid development of quantum computing poses a severe threat to traditional cryptography; however, the advances in quantum cryptography also bring promising opportunities [1, 2]. Unlike conventional cryptography, quantum cryptography is based on the principles of quantum mechanics rather than mathematical problems. It is unconditionally secure over insecure channels; moreover, the laws of quantum mechanics, such as the Heisenberg uncertainty principle and the no-cloning theorem, ensure its security. Therefore, it has additional advantages in terms of security. Over the past three decades, quantum cryptography has evolved rapidly, resulting in several new disciplines; for example, quantum key distribution (QKD) [3, 4], quantum secure direct communication (QSDC) [5,6,7] and quantum secret sharing (QSS) [8, 9].

Because the first QKD scheme was proposed by Bennett and Brassard [10] in 1984, many scholars have conducted in-depth research on QKD. However, QKD only shares a key between the two communicating parties and cannot directly transmit secret information. The QSDC protocol addresses the problem of not sending secret messages directly and permits confidential communication without pre-distributed keys. In the QSDC protocol, one party can directly send a secret message to the other party without sharing a secret key beforehand. In 2002, Long and Liu proposed the first QSDC protocol [11], which sends confidential information from Alice to Bob using Bell states. Afterwards, an increasing number of QSDC protocols were presented. In 2003, Deng et al. proposed a two-step QSDC scheme based on entanglement [12]. In the same year, Deng and Long proposed a QSDC scheme [13]. This one-time pad scheme uses different polarisation directions of individual photons as carriers and specifies the conditions that must be fulfilled to ensure QSDC security. Next, Marco Lucamarini and Stefano Mancini proposed a QSDC scheme without entanglement [14]. Early studies of QSDC [15, 16] focused on using single photons and Bell states. Later, increasingly entangled states, Greenberger-Horne-Zeilinger (GHZ) states [17] and W states [18] were applied to QSDC. In 2005, Cao and Song proposed QSDC using four-qubit W states. In 2006, Wang et al. [19]. also suggested a QSDC scheme for W states, which uses two different sets of three-qubit W states for transmission.

In practice, the interaction between the environment and the particles in the quantum channel may generate noise in communication, affecting its correctness and efficiency. Even if the quantum channel is assumed to be noise-free, noise is inevitable due to the defects of the transmission medium in the quantum transmission process. In general, there are two types of noise in a quantum channel. The first category is collective dephasing noise, and the second is collective rotation noise. As a result, the transmitted quantum changes the original state; therefore, designing a QSDC protocol against collective noise holds great significance. There are many standard methods to overcome the noise of quantum channels, such as quantum error correction codes (QECCs) [20], entanglement purification [21] and decoherence-free subspaces (DFSs)[22]. A QECC requires at least five entangled quantum systems, which consume numerous quantum resources and are challenging to realise in practical applications. Entanglement purification also consumes numerous quantum resources and is unsuitable for practical applications. Although quantum error suppression consumes a few quantum resources, it is successful with probability. Therefore, an effective way to eliminate the adverse effects of collective noise is to use DFSs.

Subsequently, many scholars began to focus on and study collective noise in quantum transmission. Various anti-collective noise protocols have been proposed for different collective noises. To date, many different types of fault-tolerant quantum communication protocols have been proposed, such as the fault-tolerant QKD protocol [23, 24], fault-tolerant DSQC protocol [25, 26] and fault-tolerant QSDC protocol. Ge and Liu (2007) proposed a QSDC protocol against collective dephasing noise channels using DFS [27]. However, the proposed protocol cannot resist the Trojan horse attack. In 2011, Yang presented a two-step QSDC protocol against collective noise [28]. In 2012, Yang proposed a QSDC protocol [29] to enhance the Ge protocol. In 2014, Chang designed the EPR pair-based QSDC protocol against collective noise [30], which combined identity authentication into QSDC against collective noise. In 2017, He et al. [31]. forwarded a collective noise-resistant tripartite QSDC protocol based on six-particle state pairs. In 2020, Gao suggested the collective noise-resistant QSDC protocol [32] in free space, which uses a single photon to encode the polarisation and spatial mode degrees of freedom, thereby creating a decoherence-free space.

This paper proposes two QSDC protocols with logical quantum states, which are immune to collective dephasing noise and rotation noise, respectively. Secret information can be transmitted by different codes and measurements in these two QSDC protocols. There is no information leakage issue, and the two protocols are naturally immune to Trojan horse and teleportation attacks due to the unidirectional transmission mode. Moreover, the two collective noise-resistant QSDC protocols are secure against other active attacks. Finally, the quantum bit efficiency of the two collective noise-resistant QSDC protocols is analysed.

The rest of this paper is organised as follows. First, Section 2 introduces W entangled states, collective noise and QSDC to describe the theory. Section 3 describes two collective noise-resistant QSDC protocols. Sections 4 discuss their security and efficiency analysis, respectively. Finally, Section 5 provides the conclusions.

2 Preliminaries

This section primarily introduces the entanglement W state of quantum resources used in the protocol, the effects of collective noise on the channel and the principle of resistance to collective noise using DFSs. It also expounds the process from the definition of noise to the anti-noise of logical quantum bits.

2.1 W State

The entangled W state is an essential resource for quantum communication and can be expressed as follows:

$$\begin{aligned} \vert W\rangle =\frac{1}{\sqrt{3}}(\vert 100\rangle +\vert 010\rangle +\vert 001\rangle ) \end{aligned}$$
(1)

The most notable property of the W state is that entanglement remains between the remaining two particles even if one of the particles is lost. Unlike single particles, entangled quantum states have the critical property: measuring one of the particles in an entangled state affects the other entangled particles. Suppose a third particle is measured, and the result is \(\vert 1\rangle \). Then, the state of the other particles must be at \(\vert 00\rangle \).

2.2 Logical Qubits Resistant to Dephasing Noise

For dephasing noise, a qubit is subjected to noise in the same time window, which is defined as \(U_{dp}=\vert 0\rangle \langle 0\vert +e^{i\theta }\vert 1\rangle \langle 1\vert \) quantum states in the channel under the influence of dephasing noise. The change of quantum state \(\vert 0\rangle \) is expressed as follows:

$$\begin{aligned} U_{dp}\vert 0\rangle \rightarrow \vert 0\rangle \end{aligned}$$
(2)

The change of quantum state \(\vert 1\rangle \) is represented as follows:

$$\begin{aligned} U_{dp}\vert 1\rangle \rightarrow e^{i\theta }\vert 1\rangle \end{aligned}$$
(3)

where \(\theta \) is the time-varying noise parameter, \(\vert 0\rangle \) and \(\vert 1\rangle \) are the horizontal and vertical polarisation of the photon, respectively. Logical qubits are introduced to achieve the purpose of anti-dephasing noise.

$$\begin{aligned} \vert 0\rangle _L=\vert 10\rangle \qquad \vert 1\rangle _L=\vert 01\rangle \end{aligned}$$
(4)

2.3 Logic Qubits Resistant to Rotational Noise

For rotational noise, qubits in the window affected by noise are defined as \(U_{r}=\cos {\theta }\vert 0\rangle \langle 0\vert -\sin {\theta }\vert 0\rangle \langle 1\vert +\sin {\theta }\vert 1\rangle \langle 0\vert +\cos {\theta }\vert 1\rangle \langle 1\vert \), the quantum state in the channel under the influence of rotational noise. The change of quantum state \(\vert 0\rangle \) is defined as follows:

$$\begin{aligned} U_{r}\vert 0\rangle \rightarrow \cos \theta \vert 0\rangle +\sin \theta \vert 1\rangle \end{aligned}$$
(5)

The change of quantum state \(\vert 1\rangle \) is represented as follows:

$$\begin{aligned} U_{r}\vert 1\rangle \rightarrow -\sin \theta \vert 0\rangle +\cos \theta \vert 0\rangle \end{aligned}$$
(6)

The parameter \(\theta \) is related to time and fluctuates with it. Bell states \(\vert \phi ^+\rangle \) and \(\vert \psi ^-\rangle \) are resistant to interference when transmitted with this type of noise; therefore, the logical qubits can be selected as follows:

$$\begin{aligned} \vert 0\rangle _L=\vert \phi ^+\rangle \qquad \vert 1\rangle _L=\vert \psi ^-\rangle \end{aligned}$$
(7)

3 The Quantum Secure Direct Communication Protocol

Based on the above preparatory knowledge, this section proposes two quantum secure direct communication protocols for resisting two different types of collective noise. The protocol under collective dephasing noise and the protocol under collective rotational noise are proposed.

3.1 Quantum Secure Direct Communication Against Collective Dephasing Noise

This section proposes a secure direct communication protocol against collective dephasing noise. From the definition of logical states resistant to dephasing noise, it can be inferred that the Bell states \(\vert \Psi ^+\rangle \) and \(\vert \Psi ^-\rangle \) are resistant to noise. Here is how resistance works:

$$\begin{aligned} U_{dp}\vert \Psi ^{\pm }\rangle =U_{dp}^{\otimes 2}\frac{1}{\sqrt{2}}(\vert 01\rangle \pm \vert 10\rangle )=\frac{e^{i\theta }}{\sqrt{2}}(\vert 01\rangle \pm \vert 10\rangle ) \end{aligned}$$
(8)

Alice needs to share the coding scheme with Bob before the beginning of the protocol. Several Pauli matrices must be introduced before the coding scheme can be determined. The Pauli matrices are denoted as follows:

$$\begin{aligned} I=\vert 0\rangle \langle 0\vert +\vert 1\rangle \langle 1\vert \nonumber \\ X=\vert 0\rangle \langle 1\vert +\vert 1\rangle \langle 0\vert \\ Z=\vert 0\rangle \langle 0\vert -\vert 1\rangle \langle 1\vert \nonumber \end{aligned}$$
(9)

The foundation of the implementation of this protocol is the effect of resistance towards noise via the conversion of different bell states. The unitary operation is constructed from the tensor product of the above three Pauli matrices: \(U_{00}=I\otimes I\), \(U_{01}=Z\otimes I\), \(U_{10}=I\otimes X\) and \(U_{11}=Z\otimes X\). Table 1 shows the quantum circuit diagrams of these unitary operations. These unitary operations are performed on the logical qubits. Table 2 presents the transformations of the two logical states in defining unitary operations.

The corresponding unitary operations are also defined for logical qubits \(\vert 0\rangle _L\) and \(\vert 1\rangle _L\), which can convert two logical qubits into each other without affecting their noise-resistant properties. The unitary operations of the logic quantum bit under anti-dephase noise are defined as: \(U_{i}=I\otimes I\) and \(U_{z}=Z\otimes Z\). These unitary operations are performed on the logic quantum bit. Table 3 presents the transformations of the two logical states under defining unitary operations.

Table 1 Quantum circuit diagrams of these unitary operations
Table 2 Transitions of Bell states under defining unitary operations
Table 3 Transformations of logical states under defining unitary operations

The encoding rules shown in Table 4 can be determined by combining the operations of Tables 2 and 3. The encoding rules are a crucial step in message delivery. With Alice and Bob agreeing on the rules in advance, the protocol can finally decode the secret message sent by Alice.

Table 4 Transformations of logical states under defining unitary operations

The specific steps of the protocol are presented as follows:

Step 1: Alice prepares N pairs of W states \(\vert W\rangle _{ABC}=\frac{1}{\sqrt{3}}(\vert 100\rangle +\vert 010\rangle +\vert 001\rangle )_{ABC}\). These particles are in a maximally entangled state. To remove the phase noise, the third particle in each pair of W states is extracted to create a particle set C, \(C \in \left\{ \vert 0\rangle ,\vert 1\rangle \right\} \). After extracting the third particle, it is replaced by the logical state against collective dephasing, and the particle entanglement state becomes \(\vert W\rangle =\frac{1}{\sqrt{3}}((\vert 10\rangle +\vert 01\rangle )\vert 0\rangle _L+\vert 00\rangle \vert 1\rangle _L)_{ABC}\). After replacing the set of particles \(C_L\), \( C_L \in \left\{ \vert 0\rangle _L,\vert 1\rangle _L\right\} \), Alice encodes the third particle to avoid affecting its ability to resist the collective dephasing noise. Encodings can only be selected from \(U_i=I\otimes I\) and \(U_z=Z\otimes Z\). In a random insertion of set into the logic state \(S_{dp1}\), \(S_{dp1}\in \left\{ \vert 0\rangle _L,\vert 1\rangle _L,\vert +\rangle _L,\vert -\rangle _L\right\} \), a set \(C_L ^ {\prime } \) is formed. \(C_L ^ {\prime } \) is sent to Bob. Alice simultaneously sends the set of particles comprising AB to Bob and randomly inserts the decoy state \(S_{dp2}\) in the transmission sequence. The decoy state is in one of the two Bell states. The basis used is also at \(\left\{ \vert 0\rangle ,\vert 1\rangle ,\vert +\rangle ,\vert -\rangle \right\} \).

Step 2: After receiving the \(C_L ^ {\prime } \) sequence sent by Alice, Bob performs the first security detection. Next, Alice announces the location of the decoy state and the measurement basis of the decoy state. Bob measures the decoy state, and if the error threshold is within the trusted range, the protocol continues; otherwise, the protocol is interrupted.

Step 3: Alice will be in the hands of the remaining two groups of particles \(\vert 00\rangle _{AB}\) and \((\vert 10\rangle +\vert 01\rangle )_{AB}\), where \(\frac{1}{\sqrt{2}}(\vert \phi ^+\rangle +\vert \phi ^-\rangle )_{AB}\) is available to replace \(\vert 00\rangle _{AB}\). The Bell state comprising the first particle and the second particle can be regarded as a logical Bell state, namely, \((\vert \phi ^+\rangle +\vert \phi ^-\rangle )_{AB}\) and \(\vert \phi ^-\rangle _{AB}\) . These two groups of Bell state particles are resistant to collective dephasing phase noise. Following a unitary operation, they are transformed into noise-resistant Bell state, that is, \(\vert \phi ^+\rangle \) and \(\vert \phi ^-\rangle \). For \(\vert \phi ^-\rangle _{AB}\), only unitary operations \(U_{00}\) and \(U_{01}\) can be performed. For the other pair of Bell states \(\frac{1}{\sqrt{2}}(\vert \phi ^+\rangle +\vert \phi ^-\rangle )_{AB}\), only the unitary operations \(U_{10}\) and \(U_{11}\) can be performed. Alice sends a set of particles comprising AB to Bob simultaneously and randomly inserts the decoy state \(S_{dp2}\in \left\{ \vert \phi ^+\rangle , \vert \psi ^-\rangle \right\} \) in the transmission sequence. The decoy state is in one of the two Bell states. The basis used is also \(\left\{ \vert 0\rangle ,\vert 1\rangle ,\vert +\rangle ,\vert -\rangle \right\} \).

Step 4: Bob receives the logical Bell state transmitted by Alice and performs the second security detection. Alice announces the position of the decoy Bell state and the measurement basis. Bob performs Bell measurement on the decoy state, and the protocol is interrupted if the error rate exceeds the threshold. If the error rate is lower than the threshold, the protocol can continue; otherwise, the protocol is aborted.

Step 5: After receiving the logical quantum state and the logical Bell state, Bob reads out the corresponding secret message according to the encoding rules Alice agreed to in advance. A quantum direct communication protocol against collective dephasing noise is completed. Table 4 shows the encoding rules.

3.2 Quantum Secure Direct Communication Against Collective Rotational Noise

The procedure of anti-collective rotation noise is similar to the previous protocol, and only the W state and unitary operation underwent some changes. Table 5 presents the representations of the new quantum circuits.

The corresponding unitary operations are also defined for logical qubits \(\vert 0\rangle _L\) and \(\vert 1\rangle _L\), which can convert two logical qubits into each other without affecting their noise resistance properties. The unitary operations on a logical qubit under noise conditions are defined as \(U_{i}=I\otimes I\) and \(U_{z}=Z\otimes I\). These unitary operations are performed on logical qubits. Table 6 presents the transformation of two logical states defined by unitary operations.

Table 5 Quantum circuit diagrams of these unitary operations
Table 6 Transitions of Bell states under defining unitary operations

The specific steps of the protocol are as follows:

Step 1: Alice prepares N pairs of W states \(\vert W\rangle _{ABC}=\frac{1}{\sqrt{3}}(\vert -+0\rangle +\vert +-0\rangle +\vert ++1\rangle )_{ABC}\). Similar to the anti-collective dephasing noise step, the third particle in each pair of W states is extracted to form particle set C, \( C_L \in \left\{ \vert 0\rangle _L,\vert 1\rangle _L\right\} \) to immunise collective rotation noise. After extracting the third particle, it is replaced by the logical state against collective rotation, and the particle entanglement state becomes \(\vert W\rangle _{ABC}=\frac{1}{\sqrt{3}}((\vert -+\rangle +\vert +-\rangle )\vert 0\rangle _L+\vert ++\rangle \vert 1\rangle _L)_{ABC}\). Alice encodes the third particle to preserve its ability to resist the collective rotation noise. Encodings can only be selected from \(U_i=I\otimes I\) and \(U_y=Z\otimes I\). In the unitary operation, the transformation of the two logical Bell states against collective rotation is the same as in the dephasing noise protocol. Next, Alice randomly inserts logical Bell states as decoys. The decoy particles are selected from set \(S_{r1}\), \(S_{r1}\in \left\{ \vert 0\rangle _L,\vert 1\rangle _L,\vert +\rangle _L,\vert -\rangle _L\right\} \) to create a set \(C^{\prime } \), which is then sent to Bob.

Step 2: After receiving the \(C^{\prime } \) sequence sent by Alice, Bob performs the first security detection. Next, Alice announces the location of the decoy state and the measurement basis of the decoy state. Bob measures the deception state, and the protocol continues if the error threshold is within the trusted range; otherwise, the protocol is interrupted.

Step 3: Alice will be in the hands of the remaining two groups of particles \(\vert ++\rangle _{AB}\) and \((\vert -+\rangle +\vert +-\rangle )_{AB}\). As the ant-collective dephasing noise protocol, \(\vert ++\rangle _{AB}\) is replaced with \(\frac{1}{\sqrt{2}}(\vert \phi ^+\rangle +\vert \psi ^+\rangle )_{AB}\). The Bell state consisting the first particle and the second particle can be regarded as a logical Bell state, namely, \((\vert \phi ^+\rangle +\vert \psi ^+\rangle )_{AB}\) and \(\vert \phi ^-\rangle _{AB}\), respectively. These two groups of Bell state particles are resistant to collective rotational noise. After a unitary operation, they are transformed into noise-resistant Bell states, namely, \(\vert \phi ^+\rangle \) and \(\vert \psi ^-\rangle \). For \(\vert \psi ^-\rangle _{AB}\), only unitary operations \(U_{00}\) and \(U_{01}\) can be performed. For the other pair of Bell states \(\frac{1}{\sqrt{2}}(\vert \phi ^+\rangle +\vert \psi ^+\rangle )_{AB}\), only unitary operations \(U_{10}\) and \(U_{11}\) can be performed. Alice sends the set of particles comprising AB to Bob simultaneously, and randomly inserts the decoy state \(S_{r2}\), \(S_{r2}\in [\vert \phi ^+\rangle ,\vert \psi ^-\rangle ]\), into the transmission sequence. The decoy state is in one of the two Bell states. The basis used is also \({\left\{ \vert 0\rangle ,\vert 1\rangle ,\vert +\rangle ,\vert -\rangle \right\} }\).

Step 4: Bob receives the logical Bell state transmitted by Alice and performs the second security detection. Alice announces the position of the decoy Bell state and the measurement basis. Bob performs Bell measurement on the decoy state, and the protocol is interrupted if the error rate exceeds the threshold. If the error rate is lower than the threshold, the protocol can continue; otherwise, the protocol is aborted.

Step 5: After receiving the logical quantum state and the logical Bell state, Bob reads out the corresponding secret message according to the encoding rules Alice agreed to in advance. A quantum direct communication protocol against collective rotational noise is completed. Table 3 shows the encoding rules.

3.3 Example of Protocol

This subsection gives a specific example of the protocol in operation, focusing on the first and third steps since the key steps of the protocol are in these two parts. The first step of the protocol is shown in Fig. 1. The third step of the protocol is shown in Fig. 2. These figures depict the data transfer using particles, where information is sent from Alice to Bob after the particles have been operated on and measured by both communicating parties. The final step of Bob’s decoding of the message is also shown in Fig. 3.

The basic flow of both protocols can follow these flowcharts, the biggest difference between the two protocols is that the initial W-state and the defined unitary operations are different.

Fig. 1
figure 1

First step of the protocol

Fig. 2
figure 2

Third step of the protocol

Fig. 3
figure 3

Decoding

These diagrams contain only the important steps of the protocol, and the transmission and security check steps of the particles on the channel are streamlined in order to show the data transmission flow. In Fig. 1, Alice generates the W-state and separates the third particle to operate mainly on the third particle, and sends the particle to Bob after the operation. Figure 2 mainly depicts Alice’s operation on the remaining particles and sends them to Bob. Figure 3 depicts Bob’s measurement and decoding process.

The flow chart of the implementation of the two anti-noise protocols proposed in this paper is shown in Fig. 4.

Fig. 4
figure 4

Protocol execution flow chart

4 Protocol Analysis

The security of QSDC protocols is divided into several aspects. This paper first analyses the security of Eve with an eavesdropper. Then, it analyses the communication protocol against the Trojan horse attack. Finally, it investigates the information leakage problem.

  1. 1)

    Eavesdropping attack In both protocols, the qubits transmitted in the quantum channel are logical qubits unaffected by collective dephasing or rotation noise. Moreover, the qubits sent by Alice to Bob are high-fidelity. Therefore, Eve has no eavesdropping method that could possibly hide herself under noise, even if some particles are eavesdropped upon by Eve. Because the decoy states are randomly inserted in the communication process, Eve’s eavesdropping inevitably impacts the decoy states. Bob can detect eavesdropping in the communication process and interrupt communication in time by calculating the error threshold.

  2. 2)

    Trojan Horse attack In both proposed protocols, the qubit is transmitted from Alice to Bob. Bob infers Alice’s unitary operation via the measurement results to read the information in a preagreed encoding. The process is transferred only once in the quantum channel, which is a one-way transmission. A Trojan horse attack requires communication to be transmitted back and forth in the channel; as a result, the proposed protocol can successfully avoid Trojan horse attacks.

  3. 3)

    Intercept-resend attacks To steal the secret information of Alice and Bob, Eve can implement the intercept the resend attack during Alice’s transmission of the W state. In this attack, Eve intercepts all transmitted qubits, replaces them with some new qubits prepared by herself and sends them to the receiver. It is clear that Eve’s attack will fail. Because Eve cannot distinguish between checking qubits and decoy states prepared by Alice, Eve’s attack will be discovered with high probability when the first security check between Alice and Bob is discussed publicly. The formula \(P_d=1-(\frac{3}{4})^n\) can be used, where n is the number of qubits to be checked and \(P_d\) denotes the probability that eve is detected. For a large enough value of n, the probability will be arbitrarily close to 1. Therefore, if Eve tries to launch an intercept-resend attack, the detection qubits will be scrambled, and she will be detected eventually.

To evaluate the QSDC protocol efficiency, the qubit efficiency formula is defined as \(\eta =\frac{c}{q+b}\) [33], where c, q and b are the number of secret message bits, the number of qubits used and the number of classical bits exchanged, respectively. In the proposed protocol, a total of 3n information particles and 3m decoy state particles are used to transmit a secret message of length 3n. The proposed protocol does not require additional classical information bits because decoding the information only requires Bob to make measurements. For simplicity, it is assumed that the same number of decoy state particles and information particles is used as \(m=n\). First, the quantum bit efficiency of the QSDC protocol in the ideal case is analysed. If the user Alice wants to send a secret message of n bits, then N pairs of W states must be prepared and n bits of classical information are announced. Thus, the quantum bit efficiency of the QSDC protocol is \(\eta =\frac{3n}{3n+3n}\) in the ideal case. Because logical qubits are added in the noisy case, two qubits should create one logical bit during the calculation. Therefore, the two QSDC protocols resist collective noise quantum bit efficiency. They both have a quantum bit efficiency of \(\eta =\frac{3n}{4n+4n}=37.5\%\). The protocol proposed in this paper uses W states and suitable unitary operations. Each quantum state is fully utilised in the protocol process; therefore, it has certain advantages in terms of efficiency.

5 Conclusions

This paper proposes two anti-noise QSDC schemes for collective dephasing and rotation noise. Based on different unitary operation methods, the constructed QSDC protocol can resist collective noise and Trojan horse attacks, and detect intercept-resend attacks. The proposed protocol does not have the problem of information leakage. The protocol can be extended further to the quantum dialogue and multiparty QSDC protocols.