# A TEE-Based Federated Privacy Protection Method: Proposal and Implementation
## 3 Method Introduction
### Introduction of the Privacy Protection Model
Confidentiality ensures that observation functions are only related to the public output of the Enclave, and the attacker can only obtain the information related to the public output of the Enclave from different processes (e.g., observation functions), and no other information. \[ \begin{split}(1)\text{Preconditions}:&\forall\pi_{1},\pi_{2 }.E_{e_{1}}(\pi_{1}[0])=E_{e_{2}}(\pi_{2}[0])\\ &\forall i.(curr(\pi_{1}[i])=curr(\pi_{2}[i]))\wedge I^{p}(\pi_{1}[ i])=I^{p}(\pi_{2}[i])\\ &\forall i.(curr(\pi_{1}[i])=e)\Rightarrow obs_{e_{1}}(\pi_{2}[i +1])=obs_{e_{2}}(\pi_{2}[i+1])\\ (2)\text{Result}:&\forall i.A_{e_{1}}(\pi_{1}[i])=A_{e_{ 2}}(\pi_{2}[i])\end{split}  \tag{9}\]  
As shown in Equation (9), \(obs\) is set as the observation function. \(A_{e}(\sigma)\) represents the state of the attacker and is not known to the Enclave, and \(I^{p}(\sigma)\) represents the non-deterministic input. The above proof process shows that for two different attacker programs, if their initial states or the states during the process are the same, based on transferring any of the same input state, once the two observers obtain the same information, the observers cannot receive any information generated by Enclave's internal operation other than public output. Thus, its confidentiality is proved. Based on the characteristics given by Equations (6)-(9), a federated learning scheme for privacy protection enhancement begins to be built. For hybrid model training, the definition of a trusted application is shown in Equation (10), where \(\{f\cdot h\}\_sha256\) represents the hash value of the model code. \[ \begin{split} e:=<init_{e},config_{e}>\\ init_{e}:=<f\cdot h,\{f\cdot h\}\_sha256,\{D_{A},D_{B}\},\{D_{A},D_{B} \}\_sha256>\\ config_{e}:=<Feldearner,Hyperparameters,orange,acl>\end{split}  \tag{10}\]  
Based on the security measures, integrity, and confidentiality shown above, this study proposes a privacy-preserving enhancement algorithm for additional federated learning, named Algorithm 1. ```
Input \(\text{D}_{A}\), \(\text{D}_{B}\), NN \(<f\), h \(>\), Hyperparameter, \(<\text{PK},\text{SK}>\) Output model \(\text{M}_{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text



#### 3.3.1 Privacy Protection of Computing Process

This method is implemented by using Gramine (version 1.0.3), which is jointly developed by Intel and Invisible Things Labs. The basic architecture of Gramine is shown in Figure 3.

Gramine provides a common platform compatibility layer (PAL), which greatly reduces the porting cost of native applications. #### 3.3.2 Integrity Protection

Integrity is a prerequisite for confidentiality. The integrity could be described as follows: for the input \(d\), after any number of calculations, the error of the result will lie in a small range. [PERSON] et al. [22] provided the definition of integrity: according to the assumption that \(A\), \(B\) and \(C\) are n \(\times\) n matrices on the field \(F\), \(s\) is an element of a uniformly random vector \(S^{n}\), \(S\subseteq F\), which is defined as Equation (11), \(|F|\) is the number of elements in field \(F\). \[\Pr[C(s)=A(B(s))|C\
eq AB]<1/|F| \tag{11}\]

If the above condition is satisfied, the calculation process is integrity. With the support of asymmetric encryption, a public-private key pair (\(sk\), \(pk\)) is generated, and the overall integrity is shown as Equation (12), which is signed by the random private key inside the Enclave. \[SIG=Sig_{sk}(Hash(D,C,M_{0},E)) \tag{12}\]

The verification process is shown as Equation (13), and the signature is verified outside the Enclave through the public key of the Enclave's random private key. In Gramine, it is supported to specify integrity checks for externally dependent files. \[Verify_{pk}(Hash(D,C,M_{0},E),SIG)=?\,true \tag{13}\]

Figure 3: Schematic diagram of Gramine’s basic architecture. #### 3.3.3 Channel Protection

Common channel protection protocols include SSL/TLS protocols.