# Secure Control of Linear Controllers Using Fully Homomorphic Encryption
## 5 Numerical Example
### Numerical Results  
The BFV encryption was implemented through Microsoft's Simple Encrypted Arithmetic Library (SEAL). The following diagram was obtained by calling SEAL to simulate the encryption of a specific number of cases.  
Figure 6 shows the simulation results corresponding to the time of input \(y\) and output \(u\). The control input response shows some minor quantization errors, but such quantization errors are so small that they can be ignored. As can be seen from Figure 6, the closed-loop system's control performance and stability can be realized with the help of the BFV encryption controller.  
Figure 7 depicts the time change for computing the iterations of the controlled system following the BFV encryption of the controller. Figure 7a represents the calculation time of each iteration of the control system without BFV encryption using precomputation, with an average time of 32.40 ms; Figure 7b represents the time after precomputation, with an average time of 23.99 ms. As can be seen from the comparison of the two pictures, it is estimated that about 35% of the time will be saved, which is still considerable.  
\begin{table}
\begin{tabular}{c c c c} \hline  & **Data Security** & **Homomorphic Operation** & **Average Processing Time 1** \\ \hline With RSA encryption & Only the data inside the controller & Many times & \((10+a)\)2 ms \\ With Paillier encryption & Only the data in the channel & Many times & 16 ms \\ With BGN encryption & All data are secure & Add multiple times and multiply once & 96 ms \\ With BFV encryption & All data are secure & Many times & 24 ms \\ \hline \end{tabular}  
* The data are obtained with a key length of 512 bits; 2 \"\(a\)\" represents the additional communication time required.  
\end{table}
Table 1: Analysis of three control systems.  
The study in this paper has the following implications. First, in terms of security, our scheme ensures that both the data in the controller and in the channel are not eavesdropped on, so the data security in the whole network control system is improved. This compensates for the lack of security in previous homomorphic encrypted controller schemes [5,13,16]. Second, in terms of efficiency, we use precomputation to alleviate the latency problem caused by fully homomorphic encryption, which reduces the iteration time of the control system and also improves the response time of the networked control system with encrypted controllers. Finally, our scheme has a simple control system and does not require more encrypted controllers compared to the scheme proposed by [PERSON] et al. [13].  
This paper also suffers from the following limitations. On the one hand, our scheme places some demands on the computational power of the device, as it requires constant computation to generate tables for encrypted access. On the other hand, homomorphic encryption, especially fully homomorphic encryption, is still difficult to apply in realistic scenarios. Only simulation results are considered in this paper to validate the scheme, which may be problematic in further practical applications specifically. Related issues will be further investigated in future work.