An Aggregate Verification Method for Federated Learning
Through the chameleon hash function and secret sharing technology, the problems of high number of information interactions and low aggregation efficiency in federated learning are solved, more efficient model parameter aggregation and verification is achieved, and the security of client parameters is enhanced.
Patent Information
- Application Number
- CN202210329985.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2042-03-31
AI Technical Summary
Existing secure aggregation protocols of federated learning require multiple information interactions during the aggregation and verification stages, resulting in large communication volume and low aggregation efficiency, and cannot effectively protect the security of client private parameters.
Chameleon hash function and secret sharing technology are used to generate secret shares through public keys and random numbers. The server aggregates and verifies model parameters, reduces the number of information interaction rounds, increases the aggregation rate, and verifies the aggregation results through homomorphic chameleon hash values. correctness.
It reduces the number of information interactions, improves aggregation efficiency, enhances the security of client model parameters, avoids additional commitment message sharing, and improves verification efficiency.
Smart Images

Figure CN114650128B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information encryption, and in particular relates to an aggregate verification method for federated learning. Background Art
[0002] Federated learning is a distributed machine learning framework that allows participating clients to upload model parameters to jointly train the model instead of directly uploading private training data. This can effectively protect the privacy of the client's original data. However, existing research shows that attackers can still infer the original training data through the uploaded model-related parameters.
[0003] In order to protect the security of client private parameters, a verifiable secure aggregation protocol is currently used to process the interactive data, so that the server can obtain global model parameters without leaking the private parameters of a single client. The existing verifiable secure aggregation protocol uses a commitment scheme to ensure the consistency of aggregation on the server, which results in the need to share additional open commitment-related messages during the aggregation and verification phases, thereby increasing the communication volume and the number of interaction rounds and reducing the aggregation rate. Summary of the invention
[0004] In order to solve the problems of many information interactions and low aggregation efficiency in the prior art, the present invention provides an aggregation verification method for federated learning, which has the characteristics of less aggregation verification interactions and higher aggregation verification efficiency.
[0005] A federated learning aggregation verification method provided according to a specific embodiment of the present invention includes:
[0006] Each client sends two public keys of the two generated public-private key pairs to the server, and the server broadcasts the received public key set to each of the clients connected to the server, and the clients that receive the public key set constitute a first client set;
[0007] For any client in the first client set: adding a secret share of a random number of the chameleon hash function of the client to the secret share, each client sends the generated secret share ciphertext to the server, the server broadcasts the received secret share ciphertext set to each client connected to the server, and the clients that receive the secret share ciphertext set constitute a second client set;
[0008] For any client in the second client set: using the public parameters of the chameleon hash function of the client, the random number and the model parameters as inputs of the chameleon hash function to generate a homomorphic chameleon hash value of the model parameters;
[0009] The server broadcasts the received set of the model parameter ciphertext and the homomorphic chameleon hash value to each of the clients connected to the server, and the clients that receive the set of the model parameter ciphertext and the homomorphic chameleon hash value constitute a third client set;
[0010] For any client in the third client set: decrypt the received secret share ciphertext of other clients, send the decrypted secret share to the server, and the clients still connected to the server after the sending are completed constitute a fourth client set;
[0011] Reconstructing and decrypting secret shares for clients belonging to the second client set but not belonging to the third client set in the server;
[0012] Aggregating the model parameters of each client in the third client set based on the random number obtained by decryption and other secret values to obtain an aggregation result;
[0013] Sending the aggregation result and the random number of each client in the third client set to each client in the fourth client set;
[0014] For any client in the fourth client set: use the public parameters of the chameleon hash function of the client, the aggregation result and the sum of the random numbers of each client in the third client set as inputs of the chameleon hash function, generate a homomorphic chameleon hash value of the aggregation result, and compare the product of the homomorphic chameleon hash value of the aggregation result and the homomorphic chameleon hash value of each client in the third client set.
[0015] Furthermore, the aggregate verification method of federated learning also includes:
[0016] For the server: if the number of clients constituting the current data set to be broadcast or the fourth client set is less than a preset secret sharing threshold, the data set to be broadcast will not be broadcast, and the data set to be broadcast is any one of the public key set, the secret share ciphertext set, the model parameter ciphertext and the homomorphic chameleon hash value set.
[0017] Furthermore, the aggregate verification method of federated learning also includes:
[0018] For any client in any client set: if the number of clients constituting the currently received data set is less than the preset secret sharing threshold, the data transmission with the server is terminated, and the received data set is any one of the public key set, the secret share ciphertext set, the model parameter ciphertext and the homomorphic chameleon hash value set.
[0019] Furthermore, for any client in the first client set: adding a secret share of a random number of the chameleon hash function of the client to the secret share, and each of the clients sending the generated secret share ciphertext to the server, comprises:
[0020] The first symmetric keys between the client and each other client are calculated based on the first private key of the client and the first public key of each other client, and the secret shares between the client and each other client are encrypted based on each of the first symmetric keys to generate secret share ciphertexts:
[0021] k i1,j1 ←KA.Agree(sk i1 , pk j1 )
[0022] where k i1,j1 is the first symmetric key, i1 and j1 are the client identifiers in the first client set, KA.Agree() is the key agreement algorithm, sk i1 is the first private key of the client, pk j1 is the first public key of the other client;
[0023] pass
[0024]
[0025] Get the secret share ciphertext, where ct i1,j1 is the secret share ciphertext, SE.Enc() is the ciphertext encryption algorithm, k i1,j1 is the first symmetric key, i1 and j1 are client identifiers in the first client set, is the secret share of the client's second private key, is the secret share of the first seed parameter, A secret share of the random number for the client-side Chameleon hash function.
[0026] Furthermore, the process of generating the model parameter ciphertext includes: for any client in the second client set: calculating the second symmetric key between the client and the other clients based on the second private key of the client and the second public key of each other client, using the second symmetric key as the second seed parameter of the pseudo-random generator of the client, and encrypting the model parameter of the client based on the first seed parameter and the second seed parameter of the client to generate the model parameter ciphertext:
[0027] mak i2,j2 ←KA.Agree(msk i2 ,mpk j2 )
[0028] Among them, mak i2,j2 is the second symmetric key, i2 and j2 are the client identifiers in the second client set, KA.Agree() is the key agreement algorithm, msk i2 is the second private key of the client, mpk j2 is the second public key of the other client;
[0029] pass
[0030]
[0031] Get the model parameter ciphertext, where msx i2 is the ciphertext of the model parameters, x i2 is the model parameter of the client, PRG(b i2 ) is the first pseudo-random bit string, PRG() is the pseudo-random generator, b i2 is the first seed parameter of the client, U2 is the second client set, PRG(mak i2,j2 ) is the second pseudo-random bit string, mak i2,j2 is the second seed parameter of the client, mod is the modular operation, B is the dimension of the model parameter,
[0032] Further, the method of using the public parameters of the chameleon hash function of the client, the random number and the model parameter as inputs of the chameleon hash function to generate a homomorphic chameleon hash value of the model parameter comprises:
[0033] ch i2 ←CH.Hash(CHpp, x i2 , r i2 )
[0034] Get the homomorphic chameleon hash value of the model parameters, where ch i2 is the homomorphic chameleon hash value of the model parameter, CH.Hash() is the chameleon hash function, CHpp is the public parameter of the chameleon hash function, x i2 is the model parameter of the client, r i2 is the random number of the client.
[0035] Further, the reconstructing and decrypting the secret share of the client belonging to the second client set but not belonging to the third client set in the server includes:
[0036] Reconstruct and decrypt the secret share of the second private key for the client that belongs to the second client set but does not belong to the third client set to obtain the second symmetric key of the client:
[0037]
[0038] where msk j is the second private key, j is the identifier of a client belonging to the second client set but not to the third client set, SS.Recon() is a secret reconstruction algorithm, is the secret share of the second private key, U4 is the fourth client set, and t is the preset secret sharing threshold of the secret reconstruction algorithm;
[0039] pass
[0040] mak j,i3 ←KA.Agree(msk j ,mpk i3 )
[0041] Get the second symmetric key of the client, where mak j,i3 is the second symmetric key of the client, KA.Agree() is the key agreement algorithm, msk j The second private key, mpk i3 is the second public key of the client in the third client set, and i3 is the identifier of the client in the third client set;
[0042] The secret shares of the first seed parameters and the secret shares of the random numbers of the clients in the third client set are reconstructed respectively to obtain the first seed parameters and the random numbers of the clients:
[0043]
[0044] where b i3 is the first seed parameter of the client, SS.Recon() is the secret reconstruction algorithm, is the secret share of the first seed parameter of the client, i3 is the identifier of the client in the third client set, i4 is the identifier of the client in the fourth client set, U4 is the fourth client set, and t is the preset secret sharing threshold of the secret reconstruction algorithm.
[0045] Furthermore, the model parameters of each client in the third client set are aggregated based on the random number obtained by decryption and other secret values to obtain an aggregation result, including:
[0046] Based on the second symmetric key of the client obtained by decryption, the first seed parameter of the client and the random number, the model parameters of each client in the third client set are aggregated to obtain an aggregation result:
[0047]
[0048] Where y is the aggregation result, x i3 is the model parameter of the client in the third client set, i3 is the identifier of the client in the third client set, U3 is the third client set, msx i3 is the ciphertext of the model parameters of the clients in the third client set, PRG(b i3 ) is the first pseudo-random bit string in the third client set, PRG(mak j,i3 ) is a second pseudo-random bit string of a client belonging to the second client set but not belonging to the third client set,
[0049] Further, for any client in the fourth client set: using the public parameters of the chameleon hash function of the client, the aggregation result and the sum of the random numbers of each client in the third client set as the input of the chameleon hash function, generating a homomorphic chameleon hash value of the aggregation result, and comparing the product of the homomorphic chameleon hash value of the aggregation result and the homomorphic chameleon hash value of each client in the third client set, including:
[0050]
[0051] For comparison, is the homomorphic chameleon hash value of the aggregation result, is the product of the homomorphic chameleon hash values of each client in the third client set.
[0052] Furthermore, the aggregate verification method of federated learning also includes:
[0053] For any client in the second client set: decrypt the secret share ciphertexts received from other clients and the client based on the first symmetric key of the client to obtain two client identifiers; if the two decrypted client identifiers do not correspond to the identifier of the client itself and the identifier of the client itself, decryption of the secret share ciphertext is terminated.
[0054] The aggregation verification method of federated learning provided by the present invention can add the secret share of the random number of the client chameleon hash function to the secret share ciphertext generated in the key sharing stage, and in the generation stage of the model parameter ciphertext, the random number, the public parameter of the chameleon hash function and the model parameter are used as the input of the chameleon hash function to generate the homomorphic chameleon hash value of the model parameter. In the decryption stage of the server, the server decrypts the secret share of the random number in the secret share decrypted by the client to obtain the corresponding random number. In the verification stage, the client uses the random number decrypted by the server, the aggregation result of the model parameters and the public parameter of the chameleon hash function as input to obtain the homomorphic chameleon hash value of the aggregation result, multiplies the homomorphic chameleon hash value of the model parameters of each client participating in the aggregation process, and compares it with the homomorphic chameleon hash value of the aggregation result, and verifies the aggregation result according to the homomorphism of the chameleon hash function. Compared with the existing verification scheme, it is not necessary to share the relevant messages of the additional open commitment, which reduces the number of information interaction rounds and improves the aggregation rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0056] Figure 1 is a flow chart of an aggregate verification method for federated learning provided according to an exemplary embodiment;
[0057] Figure 2 It is a flowchart of specific interactions of an aggregate verification method for federated learning provided according to an exemplary embodiment. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Figure 1 As shown, an embodiment of the present invention provides an aggregate verification method for federated learning, which may include the following steps:
[0059] 101. Each client sends two public keys of the two generated public-private key pairs to the server.
[0060] 102. The server broadcasts the received public key set to each of the clients connected to the server, and the clients that have received the public key set form a first client set. For any client in the first client set:
[0061] 103. Add the random number secret share of the client's chameleon hash function to the secret share, and each client sends the generated secret share ciphertext to the server.
[0062] 104. The server broadcasts the received secret share ciphertext set to each client connected to the server, and the clients that receive the secret share ciphertext set form a second client set. For any client in the second client set:
[0063] 105. The public parameters of the chameleon hash function of the client, the random number and the model parameters are used as inputs of the chameleon hash function to generate homomorphic chameleon hash values of the model parameters.
[0064] 106. The server broadcasts the received set of model parameter ciphertext and homomorphic chameleon hash value to each client connected to the server, and the clients that receive the set of model parameter ciphertext and homomorphic chameleon hash value constitute a third client set. For any client in the third client set:
[0065] 107. Decrypt the received secret share ciphertexts of other clients, and send the decrypted secret share to the server. The clients that are still connected to the server after the sending is completed constitute a fourth client set.
[0066] 108. Reconstruct and decrypt the secret share of the client that belongs to the second client set but does not belong to the third client set in the server;
[0067] 109. Aggregate the model parameters of each client in the third client set based on the random number obtained by decryption and other secret values to obtain an aggregation result;
[0068] 1010. Send the aggregation result and the random number of each client in the third client set to each client in the fourth client set. For any client in the fourth client set:
[0069] 1011. Use the public parameters of the chameleon hash function of the client, the aggregation result, and the sum of the random numbers of each client in the third client set as inputs of the chameleon hash function, generate a homomorphic chameleon hash value of the aggregation result, and compare the product of the homomorphic chameleon hash value of the aggregation result and the homomorphic chameleon hash value of each client in the third client set.
[0070] Specifically, in the process of aggregate verification, the cryptographic algorithms required include:
[0071] Symmetric encryption algorithm (SE.KGen, SE.Enc, SE.Dec):
[0072] SE.KGen(1 κ )→k: With security parameter 1 κ As input, output symmetric key k;.
[0073] SE.Enc(k, m)→ct: takes the symmetric key k and the message m as input and generates the ciphertext ct;
[0074] SE.Dec(k′, ct)→m′: takes the symmetric key k′ and the ciphertext message ct as input, and outputs the message m′ satisfying ct=SE.Enc(k′, m′).
[0075] Key Agreement Protocol (KA.Param, KA.KGen, KA.Agree):
[0076] KA.Param(1 κ ) → KApp: With security parameter 1 κ is the input and outputs the common parameter KApp;
[0077] KA.KGen(KApp)→(pk, sk): This algorithm generates a public-private key pair (pk, sk) for the user.
[0078] KA.Agree(sk i , pk j )→k i,j :The algorithm uses the private key sk of user i i and user j's public key pk j As input, output a negotiated key (private key) k i,j .
[0079] The key agreement protocol is to generate the same key k for user i and user j. i,j , that is
[0080] k i,j =KA.Agree(sk i , pk j )=KA.Agree(sk j , pk i ) = k j,i
[0081] In the present invention, the key negotiated by the key negotiation algorithm can be used as the session key generated between the client i and the client j and the mask value generated in pairs between the client i and the client j.
[0082] Secret Sharing Scheme (SS.Share, SS.Recon):
[0083] The secret sharing algorithm takes the secret value s, the threshold t and the user set U as input and outputs the secret share for each user i∈U Where |U|=N.
[0084] User Collection When |V|≥t, the secret reconstruction algorithm can recover the secret value s, otherwise the output is empty (i.e. ⊥).
[0085] The pseudo-random generator PRG can expand a short random string x into a long pseudo-random bit string PRG(x).
[0086] Chameleon hash algorithm (CH.Gen, CH.Hash, CH.HashCheck, CH.Adapt):
[0087] CH.Gen(1 κ )→(CHpp, TD): The algorithm takes the security parameter κ as input and outputs the public parameter CHpp and the trapdoor TD.
[0088] CH.Hash(CHpp, m, r) → hash: takes public parameter CHpp, message m to be hashed and random number r as input, and outputs hash.
[0089] CH.HashCheck(CHpp, m, r, hash) → 0 / 1: Output 1 if the verification passes the algorithm, and output 0 if the verification fails.
[0090] CH.Adapt(TD, m, r, hash, m′)→r′: This algorithm uses trapdoor TD, hash value hash, original message m, original random number r and new message m′ to output a new random number r′ so that CH.HashCheck(CHpp, m′, r′, hash)=1.
[0091] Compared with general hash functions, in addition to meeting the collision resistance requirement, it also needs to meet the chameleon property, that is, for any given m and m', for any given r, we can find
[0092] r'←CH.Adapt(TD,m,r,hash,m′) satisfies
[0093] CH.Hash(CHpp,m,r)=CH.Hash(CHpp,m′,r′).
[0094] And satisfy the homomorphism, that is
[0095] CH.Hash(CHpp, m1+m2, r1+r2)=CH.Hash(CHpp, m1, r1)·CH.Hash(CHpp, m2, r2).
[0096] Based on the above encryption algorithm, refer to Figure 2 The aggregation verification process shown in the figure first generates public parameters before aggregation, initializes a security parameter κ, and inputs the vector Where R is the modulus, d is the dimension of the vector; the aggregate value Where B ≥ N·R, N is the number of clients participating in each round of training.
[0097] Generate key negotiation public parameters KA.param(1 κ )→KApp.
[0098] Run the Chameleon Hash public parameter generation algorithm CH.Gen(1 κ )→CHpp.
[0099] During the key generation and distribution phase:
[0100] For client i: Generate two pairs of public and private key pairs (pk i ,sk i )←KA.KGen(KApp) and (mpk i ,msk i )←KA.KGen(KApp), pk i and mpk i Send to the server.
[0101] For the server: the client set that receives the message is recorded as U1, i.e. the first client set. Broadcast to clients in set U1.
[0102] During the key sharing phase:
[0103] For client i: Receive a message from the server To generate the seed of the pseudo-random generator PRG, randomly draw b i To calculate the homomorphic chameleon hash value, randomly select r i . Generate msk through secret sharing algorithm i , b i and r i Calculate the symmetric key k between client j∈U1\{i} i,j ←KA.Agree(sk i , pk j ), and calculate the corresponding secret share ciphertext The ciphertext ct i,j Sent to the server and stored locally.
[0104] For the server: the client set that receives the message is recorded as U2, i.e., the second client set, and the received ct i,j The corresponding data is sent to the clients in set U2.
[0105] During the double mask ciphertext and homomorphic chameleon hash value collection phase:
[0106] For client i: calculate the symmetric key mak i,j ←KA.Agree(msk i ,mpk j ), the key make i,j As the seed of the pseudo-random generator PRG, the model parameter ciphertext is then generated in Refers to the modular operation. Calculate the homomorphic chameleon hash value ch of the model parameters i . The generated msx i and i Send to the server.
[0107] For the server: the client set that receives the message is recorded as U3, i.e., the third client set, and the received Broadcast to clients in set U3.
[0108] During the decryption phase:
[0109] For client i: According to the symmetric key k i,j ←KA.Agree(sk i , pk j ), for which it receives Decrypt and decrypt the model parameter ciphertext, and convert b in the third client set j and r j The secret share and the msk in the set that dropped from the second client set j The secret share is sent to the server.
[0110] For the server: the client set that receives the message is recorded as U4, and the secret is reconstructed to obtain the aggregate value and sent to the clients in the fourth client set.
[0111] Finally, based on the received y and verify Is it true?
[0112] The whole process adds the secret share of the random number of the client's chameleon hash function to the secret share ciphertext generated in the key sharing phase. In the generation phase of the model parameter ciphertext, the random number, the public parameters of the chameleon hash function and the model parameters are used as the input of the chameleon hash function to generate the homomorphic chameleon hash value of the model parameters. In the decryption phase of the server, the server decrypts the secret share of the random number in the secret share decrypted by the client to obtain the corresponding random number. In the verification phase, the client uses the random number decrypted by the server, the aggregation result of the model parameters and the public parameters of the chameleon hash function as input to obtain the homomorphic chameleon hash value of the aggregation result. After multiplying the homomorphic chameleon hash values of the model parameters of each client participating in the aggregation process, they are compared with the homomorphic chameleon hash value of the aggregation result, and the aggregation result is verified according to the homomorphism of the chameleon hash function. Compared with the existing verification scheme, it is not necessary to share the relevant messages of the additional open commitment, which reduces the number of information interaction rounds and improves the aggregation rate.
[0113] In some specific embodiments of the present invention, in order to protect the security of the private model parameters (such as gradients) of the honest participants during the aggregation process and prevent them from being inferred by the above-mentioned adversary, the protocol can tolerate some clients being disconnected midway, that is, some clients being disconnected midway will not affect the normal operation of federated learning.
[0114] For the server: If the number of clients constituting the current data set to be broadcast or the fourth client set is less than the preset secret sharing threshold, the data set to be broadcast will not be broadcast, and the data set to be broadcast is any one of the public key set, the secret share ciphertext set, and the model parameter ciphertext and homomorphic chameleon hash value set.
[0115] For any client in any client set: if the number of clients constituting the currently received data set is less than the preset secret sharing threshold, the data transmission with the server is terminated, and the received data set is any one of the public key set, the secret share ciphertext set, and the model parameter ciphertext and homomorphic chameleon hash value set. And
[0116] For any client in the second client set: decrypt the secret share ciphertext received from other clients and the client based on the first symmetric key of the client to obtain two client identifiers. If the two decrypted client identifiers do not correspond to the client's own identifier and the client's own identifier, decryption of the secret share ciphertext is terminated.
[0117] This can protect the security of the private model parameters (such as gradients) of honest participants and prevent them from being inferred by the above-mentioned adversaries. It can also ensure the integrity of aggregation so that the adversary cannot force an honest client to accept a forged aggregation result. In addition, during the aggregation process, some clients can be tolerated to be disconnected midway, that is, some clients are disconnected midway without affecting the normal operation of federated learning.
[0118] After improvement, a complete aggregation verification process is as follows: add the secret sharing threshold t in the above common parameter generation stage
[0119] During the key generation and distribution phase:
[0120] For client i: KApp generates two pairs of public and private key pairs (pk i ,sk i )←KA.KGen(KApp) and (mpk i ,msk i )←KA.KGen(KApp), pk i and mpk i Send to the server.
[0121] For the server: the client set that receives the message is recorded as U1. If |U1|<t, the subsequent processing steps are terminated. Broadcast to clients in set U1.
[0122] During the key sharing phase:
[0123] For client i1: Received a message from the server First, verify whether |U1|≥t and whether all public keys are different to prevent the server from forging client data; otherwise, terminate the subsequent processing steps.
[0124] Randomly select b i Generate the seed of the pseudo-random generator PRG. To calculate the chameleon hash value, randomly draw r i1 . Generate msk through secret sharing algorithm i1 , b i1 and r i1 of the secrets. Calculate the symmetric key between the client j1∈U1\{i1}
[0125] k i1,j1 ←KA.Agree(sk i1 , pk j1 )
[0126] where k i1,j1is the first symmetric key, i1 and j1 are the client identifiers in the first client set, KA.Agree() is the key agreement algorithm, sk i1 The first private key of the client, pk j1 The first public key for other clients;
[0127] pass
[0128]
[0129] Get the secret share ciphertext, where ct i1,j1 is the secret share ciphertext, SE.Enc() is the ciphertext encryption algorithm, k i1,j1 is the first symmetric key, i1 and j1 are client identifiers in the first client set, is the secret share of the client's second private key, is the secret share of the first seed parameter, The secret share of the random number for the client's Chameleon hash function.
[0130] The ciphertext ct i1,j1 Sent to the server and stored locally.
[0131] The server records the client set that receives the message as U2. If |U2| < t, the subsequent processing process is terminated. i1,j1 The corresponding data is sent to the clients in set U2.
[0132] During the double mask ciphertext and homomorphic chameleon hash value collection phase:
[0133] For client i2:
[0134] First, for the message received from the server Verify whether |U2|≥t. If |U2|<t, terminate the subsequent processing. Calculate the symmetric key after verification
[0135] mak i2,j2 ←KA.Agree(msk i2 ,mpk j2 )
[0136] Among them, mak i2,j2 is the second symmetric key, i2 and j2 are the client identifiers in the second client set, KA.Agree() is the key agreement algorithm, msk i2 The second private key of the client, mpk j2 The second public key for other clients;
[0137] pass
[0138]
[0139] Get the model parameter ciphertext, where msx i2 is the ciphertext of model parameters, x i2 is the client model parameter, PRG(b i2 ) is the first pseudo-random bit string, PRG() is the pseudo-random generator, b i2 is the first seed parameter of the client, U2 is the second client set, PRG(mak i2,j2 ) is the second pseudo-random bit string, mak i2,j2 is the second seed parameter of the client, mod is the modulus operation, B is the dimension of the model parameter,
[0140] pass
[0141] ch i2 ←CH.Hash(CHpp, x i2 , r i2 )
[0142] Get the homomorphic chameleon hash value of the model parameters, where ch i2 is the homomorphic chameleon hash value of the model parameters, CH.Hash() is the chameleon hash function, CHpp is the public parameter of the chameleon hash function, x i2 is the client model parameter, r i2 is the random number of the client. If any operation in the above process fails, the subsequent operation will be terminated directly, otherwise the generated msx i2 and i2 Send to the server.
[0143] For Server:
[0144] The client set that receives the message is recorded as U3. If |U3|<t, the subsequent processing flow is terminated. After the verification is passed, msx i2 and i2 The collection is sent to the client in U3.
[0145] During the decryption phase:
[0146] For client i3:
[0147] Check whether the size of the received client set U3 is greater than or equal to t. If it is less than t, the subsequent processing flow is directly terminated. After verification, each client can use the symmetric key k i,j ←KA.Agree(sk i , pk j ) for the received Decrypt it to get Verify whether i2=i' and j2=j'. If not, terminate the subsequent processing flow. After verification, send the decrypted secret shares to the server.
[0148] For Server:
[0149] The client set that receives the message is recorded as U4. If |U4| < t, the subsequent processing flow is terminated. After the verification is passed, the secret share of the second private key of the client that belongs to the second client set but does not belong to the third client set is reconstructed and decrypted to obtain the second symmetric key of the client:
[0150]
[0151] where msk j is the second private key, j is the identifier of a client that belongs to the second client set but not to the third client set, SS.Recon() is the secret reconstruction algorithm, is the secret share of the second private key, U4 is the fourth client set, and t is the preset secret sharing threshold of the secret reconstruction algorithm.
[0152] pass
[0153] mak j,i3 ←KA.Agree(msk j ,mpk i3 )
[0154] Get the client's second symmetric key, where mak j,i3 is the second symmetric key of the client, KA.Agree() is the key agreement algorithm, msk j is the second private key, mpk i3 is the second public key of the client in the third client set, and i3 is the identifier of the client in the third client set.
[0155] The secret share of the first seed parameter and the secret share of the random number of the client in the third client set are reconstructed respectively to obtain the first seed parameter and the random number of the client:
[0156]
[0157] where b i3 is the first seed parameter of the client, SS.Recon() is the secret reconstruction algorithm, is the secret share of the first seed parameter of the client, i3 is the identifier of the client in the third client set, i4 is the identifier of the client in the fourth client set, U4 is the fourth client set, and t is the preset secret sharing threshold of the secret reconstruction algorithm.
[0158] For each client in the third client set, reconstruct the secret using the secret sharing algorithm:
[0159]
[0160] Based on the decrypted second symmetric key of the client, the first seed parameter of the client, and the random number, the model parameters of each client in the third client set are aggregated to obtain an aggregation result:
[0161]
[0162] Where y is the aggregation result, x i3 is the model parameter of the client in the third client set, i3 is the identifier of the client in the third client set, U3 is the third client set, msx i3 is the ciphertext of the model parameters of the client in the third client set, PRG(b i3 ) is the first pseudo-random bit string in the third client set, PRG(mak j,i3 ) is a second pseudo-random bit string of a client belonging to the second client set but not belonging to the third client set,
[0163] For any client in the fourth client set:
[0164]
[0165] Perform verification comparison, where is the homomorphic chameleon hash value of the aggregation result, is the product of the homomorphic chameleon hash values of each client in the third client set. After verification, it means that the aggregation process is reliable and the aggregated model can be used.
[0166] In the specific implementation process of the present invention, a homomorphic chameleon hash algorithm based on discrete logarithm assumption can be used:
[0167] in is a cyclic group of order p, g1, g2, …, g d , h is a group element, trapdoor α i satisfy where i∈[d].
[0168] Where the vector m=(m i , m2,…,m d ),
[0169]
[0170] if If yes, output 1, otherwise output 0.
[0171]
[0172] The chameleon hash function can meet the requirements of correctness, homomorphism and collision resistance.
[0173] The key agreement protocol (KA.Param, KA.KGen, KA.Agree) can be adopted as:
[0174] KA.param(1 κ )→KApp, where in, is a p-order cyclic group with a generator of g, H is a hash algorithm, and SHA-256, SM3, etc. can be used.
[0175]
[0176] KA.Agree(sk i , pk j )→k i,j , where sk i =x i is the private key of user i, The public key of user j, user i and j negotiate a key
[0177] The pseudo-random generator PRG may adopt AES-CTR or the like.
[0178] Symmetric encryption algorithms can use AES or national encryption algorithm SM4, etc.
[0179] The verifiability of the aggregation process can be verified based on the homomorphism and collision resistance of the Chameleon hash algorithm. For example, if there is an adversary who can forge the aggregation result Make an honest client i accept the verification, that is,
[0180]
[0181] Because of ch j are all generated honestly by the client, that is, ch j =CH.Hash(CHpp, x j , r j ), according to the homomorphism of the chameleon hash function, we know
[0182]
[0183] Will get and All satisfy the chameleon hash value h * , which contradicts the collision resistance of Chameleon Hash, and proves the verifiability of the aggregation result.
[0184] By adopting the Chameleon hash function, the commitment scheme is avoided, so only one round is needed in the verification phase, avoiding the extra communication rounds required for the commitment to be opened. At the same time, the hash algorithm based on discrete logarithms is constructed The output is a group element It is independent of the length of the input parameter m. This increases verifiability and ensures that the additional communication volume in each round of training of federated learning is O(N), which is independent of the size of the model parameter vector d.
[0185] The aggregate verification method for federated learning provided in the above-mentioned embodiment of the present invention adopts the chameleon hash function to avoid the use of the commitment scheme, thereby avoiding the extra communication rounds required for commitment opening in just one round during the verification phase, while reducing the communication volume of the protocol interaction and improving the efficiency of verification.
[0186] For the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0187] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0188] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted according to actual needs, and the technical features recorded in the embodiments may be replaced or combined.
[0189] The modules and sub-modules in the devices and terminals of the various embodiments of the present invention may be combined, divided, or deleted according to actual needs.
[0190] In the several embodiments provided by the present invention, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, such as multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0191] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0192] In addition, each functional module or submodule in each embodiment of the present invention may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0193] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0194] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0195] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0196] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An aggregate verification method for federated learning, characterized in that: include: Each client sends two public keys of the two generated public-private key pairs to the server, and the server broadcasts the received public key set to each of the clients connected to the server, and the clients that receive the public key set form a first client set, and the public key set includes the two public keys of each of the clients; For any client in the first client set: a secret share of a random number of a chameleon hash function of the client is added to the secret share, each client sends the generated secret share ciphertext to the server, the server broadcasts the received secret share ciphertext set to each client connected to the server, and the clients that receive the secret share ciphertext set constitute a second client set, the secret share ciphertext set includes the secret share ciphertext of each client in the first client set, and specifically includes: The first symmetric keys between the client and each other client are calculated based on the first private key of the client and the first public key of each other client, and the secret shares between the client and each other client are encrypted based on each of the first symmetric keys to generate secret share ciphertexts: k i1,j1 ←KA.Agree(sk i1 ,pk j1 ) where k i1,j1 is the first symmetric key, i1 and j1 are the client identifiers in the first client set, KA.Agree() is the key agreement algorithm, sk i1 is the first private key of the client, pk j1 is the first public key of the other client; pass Get the secret share ciphertext, where ct i1,j1 is the secret share ciphertext, SE.Enc() is the ciphertext encryption algorithm, k i1,j1 is the first symmetric key, i1 and j1 are client identifiers in the first client set, is the secret share of the client's second private key, is the secret share of the first seed parameter, A secret share of a random number of the client chameleon hash function; For any client in the second client set: using the public parameters of the chameleon hash function of the client, the random number and the model parameters as the input of the chameleon hash function to generate a homomorphic chameleon hash value of the model parameters, specifically comprising: ch i2 ←CH.Hash(CHpp,x i2 ,r 2) Get the homomorphic chameleon hash value of the model parameters, where ch i2 is the homomorphic chameleon hash value of the model parameter, CH.Hash() is the chameleon hash function, CHpp is the public parameter of the chameleon hash function, x i2 is the model parameter of the client, r i2 is the random number of the client; The server broadcasts the received model parameter ciphertext and the set of homomorphic chameleon hash values to each of the clients connected to the server, and the clients that receive the model parameter ciphertext and the set of homomorphic chameleon hash values constitute a third client set. The generation process of the model parameter ciphertext includes: for any client in the second client set: calculating the second symmetric key between the client and the other clients based on the second private key of the client and the second public key of each other client, using the second symmetric key as the second seed parameter of the pseudo-random generator of the client, and encrypting the model parameters of the client based on the first seed parameter and the second seed parameter of the client to generate the model parameter ciphertext: Mom i2,j2 ←KA.Agree(msk i2 ,mpk j2 ) Among them, mak i2,j2 is the second symmetric key, i2 and j2 are the client identifiers in the second client set, KA.Agree() is the key agreement algorithm, msk i2 is the second private key of the client, mpk j2 is the second public key of the other client; pass Get the model parameter ciphertext, where msx i2 is the ciphertext of the model parameters, x i2 is the model parameter of the client, PRG(b i2 ) is the first pseudo-random bit string, PRG () is the pseudo-random generator, b i2 is the first seed parameter of the client, U2 is the second client set, PRG(mak i2,j2 ) is the second pseudo-random bit string, mak i2,j2 is the second seed parameter of the client, mod is the modular operation, B is the dimension of the model parameter, For any client in the third client set: decrypt the received secret share ciphertext of other clients, send the decrypted secret share to the server, and the clients still connected to the server after the sending are completed constitute a fourth client set; Reconstructing and decrypting the secret share of the client belonging to the second client set but not belonging to the third client set in the server specifically includes: Reconstruct and decrypt the secret share of the second private key for the client that belongs to the second client set but does not belong to the third client set to obtain the second symmetric key of the client: where msk j is the second private key, j is the identifier of a client that belongs to the second client set but does not belong to the third client set, SS.Recon() is a secret reconstruction algorithm, is the secret share of the second private key, U4 is the fourth client set, and t is the preset secret sharing threshold of the secret reconstruction algorithm; pass Mom j,i3 ←KA.Agree(msk j ,mpk i3 ) Get the second symmetric key of the client, where mak j,i3 is the second symmetric key of the client, KA.Agree() is the key agreement algorithm, msk j The second private key, mpk i3 is the second public key of the client in the third client set, and i3 is the identifier of the client in the third client set; The secret shares of the first seed parameters and the secret shares of the random numbers of the clients in the third client set are reconstructed respectively to obtain the first seed parameters and the random numbers of the clients: where b i3 is the first seed parameter of the client, SS.Recon() is the secret reconstruction algorithm, is the secret share of the first seed parameter of the client, i3 is the identifier of the client in the third client set, i4 is the identifier of the client in the fourth client set, U4 is the fourth client set, and t is the preset secret sharing threshold of the secret reconstruction algorithm; Aggregating the model parameters of each client in the third client set based on the decrypted random number and other secret values to obtain an aggregation result, specifically including: Based on the second symmetric key of the client obtained by decryption, the first seed parameter of the client and the random number, the model parameters of each client in the third client set are aggregated to obtain an aggregation result: Where y is the aggregation result, x i3 is the model parameter of the client in the third client set, i3 is the identifier of the client in the third client set, U3 is the third client set, msx i3 is the ciphertext of the model parameters of the clients in the third client set, PRG(b i3 ) is the first pseudo-random bit string in the third client set, PRG(mak j,i3 ) is a second pseudo-random bit string of a client belonging to the second client set but not belonging to the third client set, Sending the aggregation result and the random number of each client in the third client set to each client in the fourth client set; For any client in the fourth client set: using the public parameters of the chameleon hash function of the client, the aggregation result, and the sum of the random numbers of each client in the third client set as inputs of the chameleon hash function, generating a homomorphic chameleon hash value of the aggregation result, and comparing the product of the homomorphic chameleon hash value of the aggregation result and the homomorphic chameleon hash value of each client in the third client set, specifically including: pass For comparison, is the homomorphic chameleon hash value of the aggregation result, is the product of the homomorphic chameleon hash values of each client in the third client set.
2. The method according to claim 1, characterized in that: Also includes: For the server: if the number of clients constituting the current data set to be broadcast or the fourth client set is less than a preset secret sharing threshold, the data set to be broadcast will not be broadcast, and the data set to be broadcast is any one of the public key set, the secret share ciphertext set, the model parameter ciphertext and the homomorphic chameleon hash value set.
3. The method according to claim 2, characterized in that Also includes: For any client in any client set: if the number of clients constituting the currently received data set is less than the preset secret sharing threshold, the data transmission with the server is terminated, and the received data set is any one of the public key set, the secret share ciphertext set, the model parameter ciphertext and the homomorphic chameleon hash value set.
4. The method according to claim 1, characterized in that: Also includes: For any client in the second client set: decrypt the secret share ciphertexts received from other clients and the client based on the first symmetric key of the client to obtain two client identifiers; if the two decrypted client identifiers do not correspond to the identifier of the client itself and the identifier of the client itself, decryption of the secret share ciphertext is terminated.
Citation Information
Patent Citations
Hash calculation method and signcryption method based on homomorphic chameleon Hash function
CN110086599A
Federated learning modeling method and device, and computer-readable storage medium
WO2021232754A1
