## 2 Methods
### Basic Principle of Encryption Method  
There are a variety of encryption algorithms. In this study, many encryption algorithms were investigated. The SM2 algorithm was selected to verify the feasibility of the encryption algorithm. However, the encryption algorithm is not limited to this. The SM2 algorithm is a reliable, small amount calculation encryption algorithm, which can be combined with optical fiber time transfer characteristics. The public key of the SM2 algorithm can be used to encrypt, and the private key can be used to decrypt. Moreover, the public key is public, and the secret key is kept by the user. Compared with the traditional symmetric encryption algorithm, the SM2 algorithm does not need to synchronize the secret key through a reliable channel in advance. The longer the key length, the harder it is to crack. The time difference information of the optical fiber time transfer to the remote site by the local site of safety is \(T_{LR}\). Kl is the data length of the \(T_{LR}\). The plaintext \(T_{LR}\) is executed to encrypt following the operation step at the local site. Firstly, the SM2 encryption algorithm generates a random number K. Then, the elliptic curve point (x\({}_{1}\), y\({}_{1}\)) is obtained by performing a point doubling operation on K. At the same time, the elliptic curve point S is obtained by using the public key to perform the point doubling operation. If S is an infinite point, an alarm is given and quit. If S is not a point at infinity, the elliptic curve point (x\({}_{2}\), y\({}_{2}\)) is obtained by performing a point doubling operation using the public key. A value of t is obtained by operating that coordinate value with the key derived function (KDF). If the value of t is all 0, the step of generating the random number k is performed again. If t is not 0, the value C\({}_{2}\) will be calculated by the time difference value \(T_{LR}\) and t based on XOR operation. The value C\({}_{3}\) is computed through the cryptographic Hash () function. The ciphertext C_out is obtained by C\({}_{1}\), C\({}_{2}\), and C\({}_{3}\). The flowchart of the encryption algorithm is shown in Figure 2.  
After the encryption process is completed, the information is transmitted and decrypted to the secure optical fiber time transfer equipment at the remote site. The decryption algorithm flow is shown in Figure 3. In order to decrypt the ciphertext Cout, the following steps should be performed as a remote side decryption unit. First, the string C\({}_{1}\) is taken out from Cout. Additionally, C\({}_{1}\) is used to verify whether it conforms to the elliptic curve equation. If not, it sends an alarm and exits. If it conforms, the curve point S is computed using C\({}_{1}\). After the calculation is completed, S is judged as to whether it is an infinite point. If S is an infinite point, an alarm is given, and the system exits. If S is not a point at infinity, then C\({}_{1}\) is used to calculate the coordinate point (x\({}_{2}\), y\({}_{2}\)). Additionally, it calculates that coordinate point by using KDF to obtain the string t. If the bit string t is all 0, it sends an alarm and exits. If not, the corresponding value C\({}_{2}\) is obtained from Cout. T\({}_{LR}\)' is obtained by performing XOR operation on C\({}_{2}\) and t. Finally, a cryptographic hash function is used to compute the value of V. The C\({}_{3}\) is taken from Cout. If V is equal to C\({}_{3}\), the desired plaintext T\({}_{LR}\)' is output. As shown in Table 1, the SM2 algorithm has advantages in both security and speed performance. The 256-bit SM2 password strength is equivalent to the 3072-bit RSA password strength. The security period is 2040 years. Stronger keys take longer to crack. They also take longer to encrypt and decrypt between devices. Therefore, in this study, we chose the encryption algorithm with the key strength of 256 of the SM2 algorithm. While ensuring the security of the system, it can quickly complete the process of information encryption or decryption and the task of transfer.