# Multi-Stage Quantum Secure Direct Communication Using Secure Shared Authentication Key
## 5 Example of the Proposed Protocol
### Security Check Procedure  
After \(\varphi_{5}\) is delivered successfully, the process continues with the remaining qubits using the same procedure. [PERSON] and [PERSON] will check the authenticity between them by comparing [PERSON]'s and [PERSON]'s secret rotations using Equation (4). \[ \begin{array}{rcl}Auth_{AB}&=&\left[\begin{array}{cccc}1&0&0&0\\ 0&0.76604444&-0.64278761&0\\ 0&0.64278761&0.76604444&0\\ 0&0&0&1\end{array}\right]\times\left[\begin{array}{cccc}1&0&0&0\\ 0&0.76604444&0.64278761&0\\ 0&-0.64278761&0.76604444&0\\ 0&0&0&1\end{array}\right]\\ &=&\left[\begin{array}{cccc}1&0&0&0\\ 0&1&0&0\\ 0&0&1&0\\ 0&0&0&1\end{array}\right].\end{array}  \tag{18}\]```
1:Notation:
2:TimeStamp \(\leftarrow\) calibration using time synchronization/time stamp
3:\(\theta\leftarrow\) is the secret polarization angle
4:\(\{\text{f Pauli}\ -X\}\)\(\leftarrow\) is a function bit flip operator using Pauli-X gate
5:1.Initialization authentication procedure
6:\(\varphi_{l,a}\leftarrow\) is the random string message of (0,1)
7:\(R(\theta)\leftarrow\) is the rotation of HWP using Equation (6)
8:\(\big{|}\varphi_{l,a}\big{\rangle}\leftarrow\) is the photon associate with \(\varphi_{l,a}\)
9: [PERSON] prepares a photon using Equation (8)
10: [PERSON] converts the decimal of \(\theta\) into binary and does Pauli-X operation
11:\(\theta^{\prime}\leftarrow\) {P(Pauli-X)
12:[PERSON] initializes the authentication by sharing secret polarization
13:\(R(\theta_{A})\)\(\big{|}\varphi_{0}\big{\rangle}=\big{|}\varphi_{1}\)
14:TimeStamp=0
15:\(R(\theta_{A})\)\(\big{|}\varphi_{1}\big{\rangle}=\big{|}\varphi_{2}\)
16:TimeStamp =2
17:\(R(\theta_{A})\)\(\big{|}\varphi_{2}\big{\rangle}=\big{|}\varphi_{3}\)
18:TimeStamp =4
19:ifTimeStamp \(\
eq\)4 then
20: detect [PERSON] and terminate communication
21:elif
22:\(R(-\theta_{B})\)\(\big{|}\varphi_{3}\big{\rangle}=\big{|}\varphi_{0}\big{\rangle}\)
23:TimeStamp = 6
24:endif
25:[PERSON] analyzed the result
26:Determine the value of \(\theta_{A}\) using Equation (12) and the corresponding bit
27:\(\theta_{A}\)\({}^{\prime}\)\(\leftarrow\) {P(Pauli -X)
28:Generate new \(\theta_{B}\)
29:\(R(\theta_{B})\)\(\big{|}\varphi_{0}\big{\rangle}=\big{|}\varphi_{2}\big{\rangle}\)
30:[PERSON] compares and analyses new \(\theta_{B}\) according to her previous calculation, verifies [PERSON] and sends authentication key
31:Determine the new value of \(\theta_{B}\) using Equation (12) and the corresponding bit
32:if\(R(\theta_{A}\)\({}^{\prime}\)) \(\
eq\) {\(R(\theta_{B})\) then
33:detect [PERSON] and terminate communication
34:elif
35:[PERSON] sends authentication key
36:\(R(\theta_{B})\)\(\big{|}\varphi_{0}\big{\rangle}=\big{|}\varphi_{3}\big{\rangle}\)
37:endif
38:[PERSON] gets authentication key
39:\(R(-\theta_{B})\)\(\big{|}\varphi_{5}\big{\rangle}=\big{|}\varphi\big{\rangle}\)
40:\(\mathbf{2}\) Message sharing procedure of bit sequence, \(\mathbf{B}\)
41:\(\mathbf{B}\)\(\leftarrow\) A bit sequence
42:len(\(\mathbf{B}\)) \(\leftarrow\) is the length of bit sequence \(\mathbf{B}\) is set to \(\mathbf{B}\) photons per block
43:[PERSON] prepares photons based on Equation (8), encrypts it using \(\theta_{A}\) and \(\mathbf{\Phi}\).