A privacy protection method for TEE federated learning based on proxy re-encryption
By adopting the NTRU public key cryptography system and proxy re-encryption algorithm in federated learning, and building a TEE environment with Intel SGX, the problem of data privacy protection in federated learning is solved and efficient end-to-end secure computing is achieved.
Patent Information
- Application Number
- CN202310221039.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-03-09
AI Technical Summary
In federated learning, it is difficult for the prior art to effectively protect data privacy without affecting computing efficiency, especially when edge device resources are limited, the complexity of defending against inference attacks is insufficient.
A proxy re-encryption algorithm based on the NTRU grid public key cryptography system is adopted, and a TEE environment is built in combination with Intel SGX. The model training and encryption calculation are performed by allocating isolated memory at the endpoints of the participants and the agent, and data transmission is carried out with the cooperation of the TEE module and the agent, ensuring the security of the data at the hardware level.
End-to-end security federated learning in untrusted other environments is realized, data privacy is protected, gradient parameter leakage is avoided, and computing efficiency and security is improved.
Smart Images

Figure CN116436593B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to NTRU lattice public key cryptography technology, to a TEE environment built on Intel SGX, and in particular to a TEE federated learning privacy protection method based on proxy re-encryption. Background Art
[0002] In recent years, with the continued development of big data, data privacy and security have become a global trend. Federated learning, as a distributed machine learning paradigm, can effectively address data silos, technically breaking down data silos and enabling AI collaboration. It is currently being applied in fields such as finance and healthcare. The key feature of federated learning is that participants can store their own data locally, and the target model can be trained solely using shared model information. However, private information can leak from shared model gradients. Due to the limited resources of edge devices, they do not support complex defenses against inference attacks. Therefore, it is crucial to ensure data privacy during the federated learning process without compromising accuracy and efficiency. Therefore, research on secure, efficient, and privacy-preserving federated learning offers significant innovation and competitive advantages.
[0003] Trusted Execution Environments (TEEs) are a privacy and security approach that allocates private areas of computing resources (such as memory) while providing hardware and software isolation. This allows for privacy-preserving computations while ensuring efficiency. Compared to software protection measures like homomorphic encryption, TEEs offer lower overhead and higher privacy.
[0004] Public-key cryptography uses different keys for encryption and decryption. NTRU is a lattice-based public-key cryptography. Compared to traditional public-key cryptography, NTRU offers significant computational performance advantages because it relies solely on modular multiplication and modular inversion operations, and is considered resistant to quantum attacks. NTRU-based proxy re-encryption algorithms utilize a semi-trusted proxy as an intermediary to convert ciphertext, enabling data transmission without the need for traditional public-key infrastructure. Summary of the Invention
[0005] The present invention aims to protect the privacy of federated learning. To this end, a privacy-preserving method for federated learning using a TEE (Telecommunication Entity) based on proxy encryption is proposed. This method involves three parties: a participant, a server, and a proxy. Participants can complete privacy-preserving federated learning without trusting the server or proxy, while also achieving significant efficiency advantages while maintaining privacy. At the participant and proxy endpoints, a separate, isolated memory block is allocated in the hardware for sensitive data. Model training and aggregation, as well as model parameter encryption and decryption calculations, are all performed in this memory block. Except for authorized interfaces, no other hardware components can access the information in this isolated memory block, thereby ensuring privacy at the endpoints. During the federated learning parameter transmission process, through the cooperation of the TEE module and the proxy, a participant sends model parameters encrypted with its own private key to the proxy. The proxy converts the ciphertext and sends it to the server, which then decrypts it using its own private key to obtain the parameters. The server also encrypts the aggregated parameters sent by the server using its own private key and forwards them to each participant through the proxy. Each participant decrypts the message using its own private key to obtain the aggregated, updated parameters.
[0006] To achieve the above objectives, the technical solution of the present invention is: a TEE federated learning privacy protection method based on proxy re-encryption, comprising the following steps:
[0007] (9) The participants in the federated learning establish proxy re-encrypted communication with the server;
[0008] (10) The server sends the federation policy to each participant;
[0009] (11) The participants learn the local data in the TEE environment according to the strategy to obtain the gradient parameters, encrypt the gradient parameters and send them to the agent;
[0010] (12) The proxy re-encrypts the received message and sends it to the server;
[0011] (13) The server decrypts the received message in TEE;
[0012] (14) The server aggregates the gradient parameters and encrypts them and sends them to the agent;
[0013] (15) The agent re-encrypts the received message and sends it to the participant;
[0014] (16) The participants decrypt the message to obtain the gradient parameters and continue model training;
[0015] (9) Repeat steps (3) to (8) according to the federated learning strategy until the federated learning converges.
[0016] Further, a proxy re-encryption communication is established between the participating parties and the server side that perform federated learning. The steps are as follows:
[0017] Step 1.1: Input the security parameter k, and select the polynomial ring R is the polynomial ring of integer coefficients, is the finite ring field, x n is in the specific polynomial form, n is a power of 2, q is a large prime number. Let G t be the set of polynomials with coefficients from q on R , t is an integer and t > 2. Let the plaintext space M be the set of polynomials with coefficients from {-1, 0, 1} on R q , where p is a small prime number and p << q. Select the set of random noise polynomials χ α sampled from the Υ q distribution, and output the public parameters {n, q, p, t, α};
[0018] Step 1.2: Local key generation KeyGen: Randomly and uniformly select a polynomial B ∈ R t from G q , randomly select a polynomial g with small coefficients from G t ∈ R q , g satisfies the following two conditions: g q ·g ≡ 1 (mod q), g ≡ 1 (mod p), where g q is the modulo q operation of g. If g does not meet the conditions, re-select. Randomly select a polynomial e q with small coefficients from χ ′ ∈ R q , calculate the public key PK = gqB + e′ (mod q), and the private key SK is g;
[0019] Step 1.3: Proxy re-key generation ReKeyGen: The private keys of the participating party and the server side are Sk u and Sk s respectively. The participating party needs to first select a random polynomial q from R , select a random polynomial e q from χ s , calculate Send to the server side, and send to the proxy side. The server side calculates for the received and sends to the proxy side. The proxy side calculates based on the received and Calculate the re-encryption key: Similarly, we get rk s→u .
[0020] Furthermore, in step (2), the server sends the federation policy to each participant; the steps are as follows:
[0021] Step 2.1: Determine the participant's local training strategy, including control of the loss function, alignment with the server, how to transmit gradients or parameters upstream, and the hash function selected by the TEE.
[0022] Step 2.2: Determine the corresponding strategy on the server side, including how to aggregate the gradients or parameters uploaded by the participants, how to update them, how to distribute them downstream, and the hash function selected by TEE.
[0023] Furthermore, in step (3), the participant learns the local data in the TEE environment according to the strategy to obtain the gradient parameters, encrypts the gradient parameters and sends them to the agent; the steps are as follows:
[0024] Step 3.1: Use Intel SGX to build a TEE. Create an enclave using the sgx_enable_device API exported by Intel SGX PSW. The locally trained code and data run in the enclave. The CPU running in enclave mode will not directly respond to interrupts, errors, or VM exits. Participants learn the data according to the algorithm in the policy and obtain the model's gradient parameter m.
[0025] Step 3.2: Calculate s = hash (m) in the enclave and encrypt M (s, m) using the local public key: t Select random numbers u and e from u , calculate the message ciphertext C u =p(uPk i +e u )+M(mod q); where s is the hash value of the parameter, Pk i represents the public key of the i-th participant;
[0026] Step 3.3: The calculated message ciphertext C u Send to the agent;
[0027] Step 3.4: Call the sgx_destroy_enclave() function to destroy the corresponding enclave and reclaim the EPC memory and the untrusted memory used by the enclave.
[0028] Furthermore, in step (4), the agent re-encrypts the received message and sends it to the server; the steps are as follows:
[0029] Step 4.1: The agent receives the ciphertext message C u Then, use rk u→s Perform re-encryption operation, and Pk u Encrypted ciphertext C u Transformed into Pk s Encrypted ciphertext C s :C s =C u rk u→s ; Among them, Pk u Pk is the public key of the participant s is the server's public key, rk u→s Rekeying agents at the proxy center;
[0030] Step 4.2: Convert the converted ciphertext C s Sent to the server.
[0031] Furthermore, in step (5), the server decrypts the received message in the TEE; the steps are as follows:
[0032] Step 5.1: The server receives the ciphertext C s , use Intel SGX to form TEE, create enclave through the API exported by Intel SGX PSW: sgx_enable_device, decrypt ciphertext C s The corresponding code and data of the aggregation parameters will run in the constructed enclave;
[0033] Step 5.2: Enclave ciphertext C s Decryption: Calculate M′=C s Sk s (mod q), obtain M = M'(mod p) through M'; after obtaining M, perform digital signature verification on message m according to the strategy, where Sk s The server's private key.
[0034] Furthermore, in step (6), the server aggregates the gradient parameters and encrypts and sends them to the agent; the steps are as follows:
[0035] Step 6.1: Aggregate the gradient parameters according to the specific aggregation algorithm in the strategy (such as FedAvg, FedProx, etc.) to obtain the new gradient parameter m1;
[0036] Step 6.2: Calculate s1 = hash (m1), and encrypt M1 (s1, m1) using the server's public key: t Select random numbers u and e1 and calculate the message ciphertext C s1 =p(uPk i +e1)+M1(modq); where s1 is the hash value of the new gradient parameter m1;
[0037] Step 6.3: Send the calculated message ciphertext C1 to the agent;
[0038] Step 6.4: Call the sgx_destroy_enclave() function to destroy the corresponding enclave and reclaim the EPC memory and the untrusted memory used by the enclave.
[0039] Furthermore, in step (7), the agent performs a re-encryption operation on the received message and sends it to the participant; the steps are as follows:
[0040] Step 7.1: The agent receives message C s1 Then, use rk s→u Perform re-encryption operation, and Pk s Encrypted ciphertext C s1 Transformed into Pk s Encrypted ciphertext C u1 :C u1 =C s1 rk s→u ;rk s→u The re-key is used to convert the server's ciphertext into the participant's ciphertext.
[0041] Step 7.2: Convert the converted ciphertext C u1 Sent to participants.
[0042] Furthermore, in step (8), the participants decrypt the message to obtain the gradient parameters and continue model training; the steps are as follows:
[0043] Step 8.1: The participants receive the ciphertext C u1 , build TEE using Intel SGX, and create an enclave through the API exported by Intel SGX PSW: sgx_enable_device. The corresponding code and data of local training will run in the enclave. The CPU running in enclave mode will not directly respond to interrupts, errors or VM exit operations;
[0044] Step 8.2: Enclave ciphertext C u1 Decryption: Calculate M1′=C u1 Sk u(mod q), obtain M1=M1′(mod p) through M1′; after obtaining M1, perform digital signature verification on message m1 according to the strategy; where M1′ is the calculated intermediate value, C u1 is the received ciphertext message, Sk u is the local private key;
[0045] Step 8.3: Continue to learn the data and train the model based on the new parameter m1 in TEE.
[0046] Furthermore, in step (9), according to the federated learning strategy agreed upon in step (2), steps (3) to (8) are repeated until the federated learning is completed and the model converges.
[0047] The beneficial effects of the solution proposed by the present invention include:
[0048] (1) This paper proposes a new federated learning solution that protects the privacy of data during the federated learning process. The server at the endpoint cannot obtain the gradient parameters it is processing, thus avoiding the privacy data leakage problem caused by the leakage of gradient parameters on the server.
[0049] The present invention protects the security of data. Only authorized persons can see the original data, and the proxy server only plays the role of storing encrypted data. This protects data privacy to a great extent.
[0050] (2) The present invention integrates TEE and proxy re-encryption algorithm in the federated learning process, ensuring efficiency while protecting the security of gradient parameter transmission.
[0051] (3) The present invention realizes federated learning in an environment without a trusted other party, ensuring the end-to-end security of the entire federated learning process and having higher efficiency than general methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 The overall flow chart of the method for the specific embodiment of the present invention is as follows
[0053] Figure 2 This is the system model diagram of the solution in the present invention DETAILED DESCRIPTION
[0054] The present invention will be described in detail below with reference to the various embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0055] like Figure 1As shown, a proxy re - searchable encryption - based data security sharing scheme, which includes: the proxy server generates a public - private key pair, the authorizer encrypts the data and uploads the data keywords to the proxy server, the authorized party and the authorizer interact, the proxy server queries the keywords, the proxy server performs proxy re - encryption on the ciphertext and then sends the re - encrypted ciphertext to the authorized party, and the authorized party uses its own private key to decrypt and view the data.
[0056] This invention mainly includes the following parts;
[0057] 1. Construct proxy re - encryption communication conditions
[0058] The three - party communication among the participating party, the server party and the proxy party is carried out to establish a trusted channel based on proxy re - encryption.
[0059] The specific steps are as follows:
[0060] Step 1.1: Input the security parameter k, and select the polynomial ring R is a polynomial ring of integer coefficients, is a finite ring domain, x n is in a specific polynomial form, n is a power of 2, q is a large prime number. Let G t be the set of polynomials with coefficients from q on R Let the plaintext space M be the set of polynomials with coefficients from {-1, 0, 1} on R q where p is a small prime number and p << q, select the set of random noise polynomials χ α sampled from the Υ q distribution, and output the public parameters {n, q, p, t, α};
[0061] Step 1.2: Local key generation KeyGen: Randomly and uniformly select a polynomial B ∈ R t from G q , randomly select a small - coefficient polynomial g ∈ R t from G q , g satisfies the following two conditions: g q · g ≡ 1 (mod q), g ≡ 1 (mod p), where g q is the modulo - q operation of g. If g does not meet the conditions, re - select it. Randomly select a small - coefficient polynomial e q ∈ R ′ from χ q , calculate the public key PK = gqB + e′ (mod q), and the private key SK is g;
[0062] Step 1.3: Proxy re - key generation ReKeyGen: The private keys of the participating party and the server party are Sk u and Sk s, the participants need to first q Pick a random polynomial from From χ q Choose a random polynomial e from s ,calculate Will Send to the server and Sent to the agent, the server receives Perform calculations and will Sent to the agent, the agent receives and Calculate the re-encryption key: Similarly, we get rk s→u .
[0063] 2. Model training and encryption and decryption in the TEE environment of participants
[0064] Participants create an enclave locally using the sgx_enable_device API exported by Intel SGX, forming a TEE computing environment. During the initial round of computation, the model is trained on local data. After completing a round of training according to a predetermined algorithm, the model parameters are encrypted using the local public key. A hash value is set to ensure message integrity and immutability before the model parameters are sent.
[0065] The specific steps are as follows:
[0066] Step 2.1: Build a TEE using Intel SGX and create an enclave using the sgx_enable_device API exported by Intel SGX PSW. The locally trained code and data run in the enclave. The CPU running in enclave mode will not directly respond to interrupts, errors, or VM exits. Participants learn the data using the algorithm in the policy to obtain the model's gradient parameters.
[0067] Step 2.2: Calculate s = hash (m) in the enclave and encrypt M (s, m) using the local public key: t Select random numbers u, e u ∈G t , calculate the message ciphertext C u =p(uPk i +e u )+M(modq); where s is the hash value of the parameter, Pk i represents the public key of the i-th participant;
[0068] Step 2.3: The calculated message ciphertext Cu Send to the agent;
[0069] Step 2.4: Call the sgx_destroy_enclave() function to destroy the corresponding enclave and reclaim the EPC memory and the untrusted memory used by the enclave.
[0070] 3. Agent's ciphertext message conversion and distribution
[0071] The proxy re-encrypts the message using the re-key, converting the ciphertext. If a message is sent from a participant to the server, the ciphertext encrypted with the participant's public key is converted to ciphertext encrypted with the server's public key. The same applies if the message is sent from the server to a participant. Throughout the federated learning process, the server receives messages from multiple participants, and multiple participants receive messages from the same server with the same content.
[0072] The specific steps are as follows:
[0073] Step 3.1: The agent receives message C u Then, use rk u→s Perform re-encryption operation, and Pk u Encrypted ciphertext C u Transformed into Pk s Encrypted ciphertext C s :C s =C u rk u→s ; Among them, Pk u Pk is the public key of the participant s is the server's public key, rk u→s Rekeying agents at the proxy center;
[0074] Step 3.2: Convert the converted ciphertext C s Send to the server;
[0075] Step 3.3: The agent receives message C s1 Then, use rk s→u Perform re-encryption operation, and Pk u Encrypted ciphertext C s1 Transformed into Pk s Encrypted ciphertext C u1 :C u1 =C s1 rk s→u ; Among them, rk s→u A re-key to convert the server's ciphertext into the participant's ciphertext;
[0076] Step 3.4: Convert the converted ciphertext C u1 Sent to participants.
[0077] 4. Model aggregation and encryption and decryption in the server-side TEE environment
[0078] The server creates an enclave using the sgx_enable_device API exported by Intel SGX, establishing a TEE computing environment. Message encryption and decryption, as well as model aggregation, are all performed within the enclave. Upon receiving a ciphertext message from a participant, it first decrypts it using its own private key. It then aggregates the model parameters from multiple parties to generate a new model parameter. The model parameter is then hashed and encrypted before being sent to each participant.
[0079] The specific steps are as follows:
[0080] Step 4.1: The server receives the ciphertext C s , using Intel SGX to form TEE, and creating enclave through the API exported by Intel SGX PSW: sgx_enable_device. Decrypted ciphertext C s The corresponding code and data of the aggregation parameters will run in the constructed enclave;
[0081] Step 4.2: Enclave ciphertext C s Decryption: Calculate M′=C s Sk s (modq), thus obtaining M=M′(mod p); after obtaining M, perform digital signature verification on message m according to the strategy; where Sk s The server's private key.
[0082] Step 4.3: Aggregate the gradient parameters according to the specific aggregation algorithm in the strategy (such as FedAvg, FedProx, etc.) to obtain the new gradient parameter m1;
[0083] Step 4.4: Calculate s1 = hash (m1), and encrypt M1 (s1, m1) using the server's public key: t Select a random number u from G, e1∈G t , calculate the message ciphertext C s1 =p(uPk i +e1)+M1(modq); where s1 is the hash value of the new gradient parameter m1;
[0084] Step 4.5: Send the calculated message ciphertext C1 to the agent;
[0085] Step 4.6: Call the sgx_destroy_enclave() function to destroy the corresponding enclave and reclaim the EPC memory and the untrusted memory used by the enclave.
[0086] In summary, the method of the present invention includes the following steps: (1) establishing proxy re-encryption communication; (2) the server issues a federation policy; (3) the participant performs local learning to obtain the gradient parameters, encrypts them, and sends them to the proxy; (4) the proxy performs a re-encryption operation on the message and sends it to the server; (5) the server decrypts the message; (6) the server aggregates the gradient parameters and encrypts them and sends them to the proxy; (7) the proxy performs a re-encryption operation on the message and sends it to the participant; (8) the participant decrypts the message to obtain the gradient parameters and continues model training; (9) repeats (3) to (8) until the federated learning converges.
[0087] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative uses of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0088] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
Claims
1. A privacy protection method for TEE federated learning based on proxy re-encryption, characterized by: The following steps are involved: (1) The participants in federated learning establish proxy re-encrypted communication with the server; (2) The server sends the federation policy to each participant; (3) The participants learn the local data in the TEE environment according to the strategy to obtain the gradient parameters, encrypt the gradient parameters and send them to the agent; (4) The proxy re-encrypts the received message and sends it to the server; (5) The server decrypts the received message in TEE; (6) The server aggregates the gradient parameters and encrypts them and sends them to the agent; (7) The proxy re-encrypts the received message and sends it to the participant; (8) The participants decrypt the message to obtain the gradient parameters and continue model training; (9) Repeat steps (3) to (8) according to the federated learning strategy until the federated learning converges; The step (1) establishes proxy re-encrypted communication between the federated learning participant and the server; The steps are as follows: Step 1.1: Input the security parameter k and select the polynomial ring R is a polynomial ring with integer coefficients, is a finite ring field, x n is in a specific polynomial form, n is a power of 2, q is a large prime number, let G t be the polynomial set over R q with coefficients taken from , t is an integer and t > 2, let the plaintext space M be the polynomial set over R q with coefficients taken from {-1, 0, 1}, where p is a small prime number and p << q, select a set of random noise polynomials χ α sampled from the Υ q distribution, and output the public parameters {n, q, p, t, α}; Step 1.2: Local key generation KeyGen: From G t Randomly and uniformly select polynomial B∈R q , from G t Randomly select a small coefficient polynomial g∈R q ,g satisfies the following two conditions:g q g≡1(mod q), g≡1(mod p), where g q is the modulo q operation of g. If g does not meet the conditions, reselect it from χ q Randomly select a small coefficient polynomial e′∈R q , calculate the public key PK = gqB + e′ (mod q), the private key SK is g; Step 1.3: Proxy re-key generation ReKeyGen: The private keys of the participant and the server are Sk u and Sk s , the participants need to first q Pick a random polynomial from From χ q Choose a random polynomial e from s ,calculate Will Send to the server and Sent to the agent, the server receives Perform calculations and will Sent to the agent, the agent receives and Calculate the re-encryption key: Similarly, we get rk s→u ; In step (2), the server sends the federation policy to each participant; The steps are as follows: Step 2.1: Determine the participant's local training strategy, including control of the loss function, alignment with the server, how to transmit gradients or parameters upstream, and the hash function selected by the TEE; Step 2.2: Determine the server's corresponding strategy, including how to aggregate the gradients or parameters uploaded by the participants, how to update them, how to distribute them downstream, and the hash function selected by the TEE; In step (3), the participant learns the local data in the TEE environment according to the strategy to obtain the gradient parameters, encrypts the gradient parameters and sends them to the agent; The steps are as follows: Step 3.1: Use Intel SGX to build a TEE. Create an enclave using the sgx_enable_device API exported by Intel SGX PSW. The locally trained code and data run in the enclave. The CPU running in enclave mode will not directly respond to interrupts, errors, or VM exits. Participants learn the data according to the algorithm in the policy and obtain the model's gradient parameter m. Step 3.2: Calculate s = hash (m) in the enclave and encrypt M (s, m) using the local public key: t Select random numbers u and e from u , calculate the message ciphertext C u =p(uPk i +e u )+M(mod q); where s is the hash value of the parameter, Pk i represents the public key of the i-th participant; Step 3.3: The calculated message ciphertext C u Send to the agent; Step 3.4: Call the sgx_destroy_enclave() function to destroy the corresponding enclave, reclaim the EPC memory and the untrusted memory used by the enclave; In step (4), the agent re-encrypts the received message and sends it to the server. The steps are as follows: Step 4.1: The agent receives the ciphertext message C u Then, use rk u→s Perform re-encryption operation, and Pk u Encrypted ciphertext C u Transformed into Pk s Encrypted ciphertext C s :C s =C u rk u→s ; Among them, Pk u Pk is the public key of the participant s is the server's public key, rk u→s Rekeying agents at the proxy center; Step 4.2: Convert the converted ciphertext C s Send to the server; In step (5), the server decrypts the received message in the TEE; the steps are as follows: Step 5.1: The server receives the ciphertext C s , use Intel SGX to form TEE, create enclave through the API exported by Intel SGX PSW: sgx_enable_device, decrypt ciphertext C s The corresponding code and data of the aggregation parameters will run in the constructed enclave; Step 5.2: Enclave ciphertext C s Decryption: Calculate M′=C s Sk s (mod q), obtain M = M'(mod p) through M'; after obtaining M, perform digital signature verification on message m according to the strategy, where Sk s The server's private key; In step (6), the server aggregates the gradient parameters and encrypts and sends them to the agent; the steps are as follows: Step 6.1: Aggregate the gradient parameters according to the specific aggregation algorithm FedAvg or FedProx in the strategy to obtain the new gradient parameter m1; Step 6.2: Calculate s1 = hash (m1), and encrypt M1 (s1, m1) using the server's public key: t Select random numbers u and e1 and calculate the message ciphertext C s1 =p(uPk i +e1)+M1(mod q); where s1 is the hash value of the new gradient parameter m1; Step 6.3: Send the calculated message ciphertext C1 to the agent; Step 6.4: Call the sgx_destroy_enclave() function to destroy the corresponding enclave, reclaim the EPC memory and the untrusted memory used by the enclave; In step (7), the agent performs a re-encryption operation on the received message and sends it to the participant; the steps are as follows: Step 7.1: The agent receives message C s1 Then, use rk s→u Perform re-encryption operation, and Pk s Encrypted ciphertext C s1 Transformed into Pk s Encrypted ciphertext C u1 :C u1 =C s1 rk s→u ;rk s→u A re-key to convert the server's ciphertext into the participant's ciphertext; Step 7.2: Convert the converted ciphertext C u1 Sent to the participants; In step (8), the participants decrypt the message to obtain the gradient parameters and continue model training; the steps are as follows: Step 8.1: The participants receive the ciphertext C u1 , build TEE using Intel SGX, and create an enclave through the API exported by Intel SGX PSW: sgx_enable_device. The corresponding code and data of local training will run in the enclave. The CPU running in enclave mode will not directly respond to interrupts, errors or VM exit operations; Step 8.2: Enclave ciphertext C u1 Decryption: Calculate M1′=C u1 Sk u (mod q), obtain M1=M1′(mod p) through M1′; after obtaining M1, perform digital signature verification on message m1 according to the strategy; where M1′ is the calculated intermediate value, C u1 is the received ciphertext message, Sk u is the local private key; Step 8.3: Continue to learn the data and train the model based on the new parameter m1 in TEE.
2. A privacy protection method for TEE federated learning based on proxy re-encryption according to claim 1, characterized in that: The step (9); according to the federated learning strategy agreed in step (2), repeat steps (3) to (8) until the federated learning is completed and the model converges.