# A Hybrid Encryption Scheme for Quantum Secure Video Conferencing Combined with Blockchain
## 4 Our Construction
### QKD Real-Time Monitoring
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:;
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
3 if\(quantum\_flag==TRUE\)then
4 if\(Quantum\_AES\_flag==FALSE\)then
5 for\(i=1\) to \(QT_{B1}.len()\)do
6\(M_{i}=De_{xor}(QT_{B1}^{i},C_{i})\);
7\(C_{i}=En_{xor}(QT_{B2}^{i_{i}},M_{i})\);
8 Send ciphertext \(User2\gets Server(C_{i})\);
9
10 end if
11 if\(Quantum\_AES\_flag==TRUE\)then
12\(i=1D_{AES}\);
13\(User2\gets Server(quantum\_AES\_flag,ID_{AES})\);
14\(M=De_{AES}(QT_{B1}^{i_{i}},C)\);
15\(C=En_{AES}(QT_{B2}^{i_{i}},M)\);
16 Send ciphertext \(User2\gets Server(C_{i})\);
17
18 end if
19
20 end if
21 if\(Quantum\_flag==FALSE\)then
22\(User2\gets Server(C)\);
23
24 end if
25 User2:;
26 if\(quantum\_flag==TRUE\)then
27 if\(Quantum\_AES\_flag==FALSE\)then
28\(i=1\) to \(QT_{A2}.len()\)do
29\(M_{i}=De_{xor}(QT_{A2}^{i_{i}},C_{i})\);
30
31 end if
32
33 end if
34 if\(Quantum\_flag==FALSE\)then
35\(M=De_{AES}(ck,C)\);
36
37 end if
38 return M;
```  
**Algorithm 2**Video decryption algorithm  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:;
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
39 if\(quantum\_flag==TRUE\)then
40 if\(Quantum\_AES\_flag==FALSE\)then
41 for\(i=1\) to \(QT_{B1}.len()\)do
42\(M_{i}=De_{xor}(QT_{B1}^{i_{i}},C_{i})\);
43\(C_{i}=En_{xor}(QT_{B2}^{i_{i}},M_{i})\);
44 Send ciphertext \(User2\gets Server(C_{i})\);
45
46 end if
47
48 end if
49 if\(Quantum\_flag==FALSE\)then
50\(M=De_{AES}(ck,C)\);
51
52 end if
53 return M;
```  
**Algorithm 3**Vector plaintext \(C\)  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:;
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
39 if\(quantum\_flag==TRUE\)then
42 if\(Quantum\_AES\_flag==FALSE\)then
43 for\(i=1\) to \(QT_{B1}.len()\)do
44\(M_{i}=De_{xor}(QT_{B1}^{i_{i}},C_{i})\);
45\(C_{i}=En_{xor}(QT_{B2}^{i_{i}},C_{i})\);
46 Send ciphertext \(User2\gets Server(C_{i})\);
57 end if
68
79 end if
80 return M;
```  
**Algorithm 4**Vector plaintext \(M\)  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
39 if\(quantum\_flag==TRUE\)then
40 if\(Quantum\_AES\_flag==FALSE\)then
41\(M=De_{AES}(QT_{A2}^{i_{i}},C)\);
42 end if
43
44 end if
45
46 end if
47
48 end if
49 if\(Quantum\_flag==FALSE\)then
42\(M=De_{AES}(ck,C)\);
43
44 end if
49 return M;
```  
**Algorithm 5**Vector plaintext \(M\)  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
39 if\(quantum\_flag==TRUE\)then
43\(M=De_{AES}(QT_{A2}^{i_{i}},C)\);
54
65 end if
76
87 end if
90
91 end if
920
93 end if
94 if\(Quantum\_flag==FALSE\)then
95\(M=De_{AES}(ck,C)\);
96
97 end if
98 return M;
```  
**Algorithm 6**Vector plaintext \(M\)  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
39 if\(quantum\_flag==TRUE\)then
44\(M=De_{AES}(QT_{A2}^{i_{i}},C)\);
45
66 end if
88
89 end if
99 if\(Quantum\_flag==FALSE\)then
90\(M=De_{AES}(ck,C)\);
91
92 end if
93 return M;
```  
**Algorithm 7**Vector plaintext \(M\)  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
1 Server:
2 User2\(\leftarrow\)Server\((quantum\_flag,quantum\_AES\_flag)\);
39 if\(quantum\_flag==TRUE\)then
44\(M=De_{AES}(QT_{A2}^{i_{i}},C)\);
45
67 end if
98
10 end if
110
12 end if
130
131 end if
132 return M;
```  
**Algorithm 8**Vector plaintext \(M\)  
```
Input: Video ciphertext \(C\) Output: Video plaintext \(M\)
``` Input: Video ciphertext \