Data transmission method, device, electronic device, and storage medium
By constructing a multi-party homomorphic encryption mechanism and a hierarchical BGV algorithm, encrypted data computation is achieved from multiple data providers, solving the problem that existing homomorphic encryption cannot perform joint computation, and improving data security and privacy protection.
Patent Information
- Application Number
- CN202110368291.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-06
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-04-06
AI Technical Summary
Existing homomorphic encryption technology only supports computation on ciphertext data encrypted with a single key, and cannot perform joint computation on multiple ciphertext data encrypted with different keys, thus limiting the application scenarios of homomorphic encryption.
A multi-party homomorphic encryption mechanism is constructed. By generating encryption public keys and evaluation public keys, homomorphic encryption computation of encrypted data from multiple data providers is realized. Private keys are distributed and managed in a decentralized manner. The hierarchical BGV algorithm based on LWE is used for key generation and data transmission.
It expands the application scenarios of homomorphic encryption, improves data security, prevents information leakage from data providers, and enhances the security and privacy protection of data transmission.
Smart Images

Figure CN113810170B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data transmission method, device, electronic device, and storage medium. Background Art
[0002] Homomorphic encryption allows calculations to be performed on encrypted ciphertext data, which can protect the security of data while using it. In related technologies, homomorphic encryption only supports calculations on ciphertext data encrypted with one key, and cannot realize joint calculations on multiple ciphertext data encrypted with different keys, which limits the use scenarios of homomorphic encryption. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one purpose of the present application is to propose a multi-party homomorphic encryption mechanism that can achieve the purpose of homomorphic encryption of encrypted data of multiple data providers, thereby expanding the application scenarios of homomorphic encryption.
[0004] The first objective of the present application is to provide a data transmission method.
[0005] The second objective of the present application is to propose another data transmission method.
[0006] The third objective of the present application is to provide a data transmission device.
[0007] The fourth objective of the present application is to provide another data transmission device.
[0008] A fifth objective of the present application is to provide an electronic device.
[0009] A sixth object of the present application is to provide a computer-readable storage medium.
[0010] To achieve the above-mentioned purpose, the first aspect embodiment of the present application proposes a data transmission method, which is applicable to a data provider, and the method includes: interacting with other data providers to generate an encryption public key and an evaluation public key; encrypting local data using the encryption public key to generate ciphertext data, and sending it to the data user; receiving the ciphertext calculation result sent by the data user, wherein the ciphertext calculation result is determined by the data user based on the evaluation public key and the received ciphertext data; using the data provider's own private key fragment to decrypt the ciphertext calculation result to obtain plaintext data.
[0011] To achieve the above-mentioned purpose, the second aspect embodiment of the present application proposes a data transmission method, which is applicable to the data user end, and the method includes: receiving ciphertext data sent by each data provider end; using the evaluated public key to perform encryption calculation on each ciphertext data to obtain a ciphertext calculation result; and sending the ciphertext calculation result to each data provider end for decryption.
[0012] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes a data transmission device, which is suitable for a data provider, and the device includes: a key generation module, which is used to interact with other data providers to generate an encryption public key and an evaluation public key; an encryption module, which is used to encrypt local data using the encryption public key to generate ciphertext data, and send it to the data user; a receiving module, which is used to receive the ciphertext calculation result sent by the data user, wherein the ciphertext calculation result is determined by the data user based on the evaluation public key and the received ciphertext data; a decryption module, which is used to use the data provider's own private key fragment to decrypt the ciphertext calculation result to obtain plaintext data.
[0013] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a data transmission device, which is suitable for a data user end. The device includes: a receiving module, which is used to receive ciphertext data sent by each data provider end; an encryption module, which is used to use an evaluated public key to perform encryption calculation on each ciphertext data to obtain a ciphertext calculation result; and a sending module, which is used to send the ciphertext calculation result to each data provider end for decryption.
[0014] To achieve the above-mentioned purpose, a fifth aspect of the present application provides an electronic device, characterized in that it includes a processor and a memory;
[0015] The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the data transmission method provided in the above aspect.
[0016] To achieve the above-mentioned purpose, the sixth aspect embodiment of the present application proposes a computer-readable storage medium, on which a computer program is stored, characterized in that when the program is executed by a processor, the data transmission method provided in the above aspect is implemented.
[0017] The data transmission method and device provided by the present application construct a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expand the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on a homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0018] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of an application scenario of the data transmission method provided by this application;
[0020] Figure 2 A flowchart of a data transmission method provided in one embodiment of the present application;
[0021] Figure 3 A schematic diagram of a key generation method provided by another embodiment of the present application;
[0022] Figure 4 A schematic diagram of a data transmission method provided by another embodiment of the present application;
[0023] Figure 5 A schematic diagram of a data transmission method provided by another embodiment of the present application;
[0024] Figure 6 A schematic diagram of a data transmission method provided by another embodiment of the present application;
[0025] Figure 7 A schematic diagram of a data transmission method provided by another embodiment of the present application;
[0026] Figure 8 An application diagram of a data transmission method provided by an embodiment of the present application;
[0027] Fig. 9 A schematic diagram of the structure of a data transmission device provided by an embodiment of the present application;
[0028] Fig.10 A structural diagram of a data transmission device provided by another embodiment of the present application;
[0029] Fig.11 A structural diagram of a data transmission device provided by another embodiment of the present application;
[0030] Fig.12 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0031] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0032] For example, Figure 1 Schematic diagram of the application scenario of the data transmission method provided by this application. Figure 1As shown, the application scenario may include: at least one data provider ( Figure 1 Three data providers are shown, namely data provider 111, data provider 112, data provider 113), network 12 and data user 13. Each data provider can communicate with data user 13 through network 12. Each data provider can communicate with each other through network 12.
[0033] It should be noted that Figure 1 This is only a schematic diagram of an application scenario provided by the embodiment of the present application. Figure 1 does not limit the equipment included in Figure 1 The positional relationship between the devices in the Figure 1 In the application scenario shown, a data storage device may also be included. The data storage device may be an external memory relative to the data providing end and the data using end 13, or may be an internal memory integrated therein.
[0034] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0035] Figure 2 The following is a flow chart of a data transmission method provided by an embodiment of the present application. Figure 2 As shown, the execution subject is the data provider, which can be an electronic device such as an e-commerce server, a social server, a communication server, etc. that has multiple data of the user.
[0036] like Figure 2 As shown, the data transmission method includes the following steps:
[0037] S201, generate a private key fragment of the data provider itself, as well as an encryption public key and an evaluation public key.
[0038] In this embodiment, the data provider generates its own private key fragment, encrypted public key and evaluated public key by means of interactive cooperation between the data provider and other data providers. In some implementations, the data provider can obtain its own key generation parameters, wherein the key generation parameters include public parameters and public random numbers. Further, the data provider generates its own private key fragment, encrypted public key fragment and partial content of the evaluated public key based on its own key generation parameters, and interacts with other data providers to share its own encrypted public key fragment and partial content of the evaluated public key with other data providers. Correspondingly, other data providers will also share their own encrypted public key fragment and partial content of the evaluated public key. After the data provider obtains the encrypted public key fragment of other data providers, it can obtain the encrypted public key. Similarly, based on the partial content of the evaluated public key, it can also obtain the evaluated public key. Among them, other data providers can be the same type of server as the data provider as the execution subject, or other types of servers. Each data provider participates in the calculation of the encryption public key and the evaluation public key, constructing a multi-party homomorphic encryption mechanism, which can achieve the purpose of homomorphic encryption of data for multiple data providers.
[0039] S202, encrypt the local data using the encryption public key to generate ciphertext data, and send it to the data user.
[0040] When multiple data providers need to provide data at the same time, in order to prevent the data of the data providers from being leaked or stolen, in this embodiment, the data provider needs to use the encryption public key to encrypt its own local data and then generate a ciphertext data. After generating the ciphertext data, the data provider sends the ciphertext data to the data user. Correspondingly, the data user can receive the respective ciphertext data sent by multiple data providers. The purpose of encrypting its own local data with the encryption public key is to make only the data provider know its own data, and other data providers obtain the data, so that the data of each data provider has a higher security and avoids data leakage.
[0041] Continue with Figure 1 For example, the data provider 111 uses the encryption public key to encrypt the local data u1 to generate the ciphertext data ct1, the data provider 112 uses the encryption public key to encrypt the local data u2 to generate the ciphertext data ct2, and the data provider 113 uses the encryption public key to encrypt the local data u3 to generate the ciphertext data ct3. The data user 13 can receive the ciphertext data sent by each data provider.
[0042] S203, receiving the ciphertext calculation result sent by the data user, wherein the ciphertext calculation result is determined by the data user according to the evaluated public key and the received ciphertext data.
[0043] After receiving the ciphertext data sent by each data provider, the data user performs encryption calculation on the ciphertext data based on the evaluated public key, generates a ciphertext calculation result, and then sends the ciphertext calculation result to each data provider respectively.
[0044] Accordingly, the data provider can receive the ciphertext calculation result sent by the data user.
[0045] S204, using the private key fragment, decrypt the ciphertext calculation result to obtain the plaintext data.
[0046] In order to ensure the security of the data of each data provider, in this embodiment, each data provider cannot directly obtain the complete private key. Each data provider has part of the private key, that is, a private key fragment. After receiving the ciphertext calculation result, the data provider can use its own private key fragment to decrypt the ciphertext calculation result to obtain the plaintext data.
[0047] The data transmission method provided in this embodiment constructs a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expands the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on the homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0048] On the basis of the above embodiments, in order to realize the encryption and decryption of data, before using the encryption public key to encrypt the local data to generate the ciphertext data, the data provider ends need to collaborate to generate a key, wherein the key includes a public key and a private key. In this embodiment, the public key used for encryption includes an encryption public key and an evaluation public key. In the embodiment of the present application, a hierarchical homomorphic encryption (BGV) algorithm based on the learning with errors (Learning With Errors, LWE) problem is adopted. It should be noted that the symbol E.PubKeygen(s; A) is used to represent an encryption public key generation algorithm executed using a fixed coefficient A. The symbol E.PubKeygen(s; A; e) is used to represent an encryption public key generation algorithm executed using a fixed coefficient A and noise e.
[0049] The key generation process is introduced below.
[0050] Figure 3 Another embodiment of the present application provides a flowchart of a key generation method. Figure 3 As shown, the execution subject is the data provider, and the key generation process includes the following steps:
[0051] S301, generate a private key fragment of the data provider.
[0052] Each data provider has key generation parameters for generating keys, and generates keys based on the key generation parameters. The key generation parameters include public parameters and public random numbers. The public parameters are Among them, params d is the parameter of the hierarchical BGV algorithm based on LWE, d indicates that the modulus of the ciphertext is q d ,κ,m,n, and χ are the parameters of the above algorithm, where κ is the security parameter, m, n are the dimensions, and χ represent the key probability distribution and noise probability distribution respectively. B χ ∈Z is a probability distribution and the boundaries of χ. Whenever sampling is performed (or x←χ), check (or |x|≤B χ ), if the condition is not met, re-sample. eval is the noise bound for evaluating the key computation, B enc is the noise boundary of the encryption calculation, B dec is the noise bound for the decryption calculation.
[0053] Optionally, the public random number includes:
[0054]
[0055] i∈[n], [[n] represents the set of all integers from 1 to n, N is the number of data providers, and D is the maximum multiplication level of the circuit supported by the LWE-based hierarchical BGV algorithm.
[0056] Furthermore, after obtaining the key generation parameters, the data provider can generate its own private key fragment based on the key generation parameters and the private key generation algorithm. The private key generation algorithm is E.SymKeygen(params), and the public parameters in the key generation parameters are input into the private key generation algorithm to output the private key fragment corresponding to the data provider.
[0057] Data provider P k Use the public parameters in the key generation parameters to generate your own private key fragment First of all, k Call the private key generation algorithm of the LWE-based hierarchical BGV algorithm, and for each d∈{0,...,D}, generate
[0058] S302, generating an encrypted public key fragment of the data provider itself based on the private key fragment.
[0059] Furthermore, after obtaining the private key fragment, the data provider can generate the encrypted public key fragment of the data provider based on the private key fragment, the public random number and the encrypted public key generation algorithm. The encrypted public key generation algorithm is E.PubKeygen(s). The private key fragment and the public random number are input into the encrypted public key generation algorithm, and the encrypted public key fragment corresponding to the data provider can be output.
[0060] Data provider P k Generate your own encrypted public key fragment using the private key fragment and the public random number in the key generation parameters First of all, k Call the encryption public key generation algorithm based on the LWE hierarchical BGV algorithm, and for each d∈{0,...,D}, generate in,
[0061] S303, generating a target intermediate result corresponding to the evaluation public key based on the private key fragment.
[0062] After obtaining the private key fragment, the data provider can generate a first intermediate result of the evaluation public key corresponding to the data provider based on the private key fragment, the public random number and the evaluation public key generation algorithm. The evaluation public key generation algorithm is E.symEnc(s). The private key fragment and the public random number are input into the evaluation public key generation algorithm, and the first intermediate result of the evaluation public key corresponding to the data provider can be output.
[0063] Data provider P k Generates the first intermediate result of evaluating the public key using the private key fragment and the public random number from the key generation parameters First of all, k Call the public key generation algorithm, for each d∈{0,...,D}, i∈[n], [n] represents the set of all integers from 1 to n, The calculation is as follows:
[0064]
[0065] in, express represents the i-th component of .
[0066] In addition, for each d, i, τ and each l∈[N]-{k} as above, the data provider P k calculate in,
[0067] After obtaining the first intermediate result of the evaluation public key, the first intermediate result of the data provider can be sent to other data providers. For example, the data provider can broadcast its first intermediate result. Similarly, other data providers will also broadcast their first intermediate results. Accordingly, the data provider can receive the first intermediate results broadcast by other data providers. After obtaining the first intermediate results of other data providers, combined with its own first intermediate result, the second intermediate result of the evaluation public key can be further obtained.
[0068] Data provider P k In getting The second intermediate result can be calculated P k based on The second intermediate result can be calculated. If all data owners comply with the agreement, then in The public key evaluated in the implementation is The calculated second intermediate result Already close to evaluating the public key above.
[0069] Further, after obtaining the second intermediate result, the data provider can obtain the target intermediate result of evaluating the public key based on the private key fragment, the public random number in the key generation parameter and the second intermediate result.
[0070] Data provider P k After obtaining the second intermediate result For every l∈[N],d∈[D],i,j∈[n], e← $ [-B eval ,B eval ], After the above operations, the target intermediate result corresponding to the public key can be evaluated More similar to One step closer to evaluating the public key.
[0071] S304, broadcasting the target intermediate result corresponding to the encrypted public key fragment and the evaluated public key.
[0072] S305, receiving the respective encrypted public key fragments and target intermediate results sent by other data providers.
[0073] S306, generating an encrypted public key based on each encrypted public key fragment, and generating an evaluation public key based on each target intermediate result.
[0074] The specific processing of steps S304 to S306 is described in detail below.
[0075] In this embodiment, after obtaining its own encrypted public key fragment, the data provider can send its own encrypted public key fragment to other data providers. For example, the data provider can broadcast its own encrypted public key fragment. Similarly, other data providers will also broadcast their own encrypted public key fragments. Correspondingly, the data provider can receive the respective encrypted public key fragments broadcasted by other data providers. After obtaining the encrypted public key fragments of other data providers, combined with its own encrypted public key fragments, the encrypted public key can be restored.
[0076] Data provider P k In getting in, Used to represent the set of encryption public key fragments of all data providers. k After obtaining the collection, the encryption public key can be calculated P k based on The encryption public key can be calculated.
[0077] In the homomorphic encryption process, if each data provider follows the protocol, that is, each data provider is a trusted data provider, the encryption public key generation algorithm is in, Among them, l∈[N], d∈[D].
[0078] Furthermore, after obtaining the target intermediate result of the evaluation public key, the data provider can send the target intermediate result to other data providers. For example, the data provider can broadcast its own target intermediate result. Similarly, other data providers will also broadcast their respective target intermediate results. Accordingly, the data provider can receive the respective target intermediate results broadcast by other data providers. After obtaining the target intermediate results of other data providers, combined with its own target intermediate result, the evaluation public key can be restored.
[0079] Data provider P k Have input setup, Compute output evaluation key P k Perform the following calculations: for each l∈[N], d∈[D], i∈[n], j∈[n]∪{0}, The public key can be calculated using the following formula:
[0080]
[0081] Accordingly, the data user can receive the encrypted public key fragments broadcast by each data provider, and can obtain the complete encrypted public key in a similar manner. The data user can calculate the evaluated public key using the calculation formula of the evaluated public key.
[0082] After obtaining the encryption public key, the data provider calls the encryption algorithm, where the encryption algorithm is E.PubEnc pk (μ), using the encryption algorithm to encrypt its own data to obtain ciphertext data. k , call the encryption algorithm to calculate (v,w)←E.Enc pk (μ), and finally get the ciphertext data c k =((v,w+2e),0), where 0 means the multiplication level is 0, e← $ [-B enc ,B enc ].
[0083] After obtaining the evaluation public key, the data user uses the evaluation public key to encrypt the ciphertext data sent by each data provider to obtain the ciphertext calculation result.
[0084] The data user calls Eval evk The encryption algorithm encrypts each ciphertext data based on the evaluated public key, i.e. Eval evk (f,c1,…,c l ), we can calculate the ciphertext calculation result. Among them, the evaluation algorithm, Eval evk (f,c1,…,c l ) and E.Eval evk (f,c1,…,c l )same.
[0085] The key generation process provided in this embodiment performs two rounds of protocols between N data providers, the input is setup, and the output is the evaluated public key. Encryption public key Each data owner obtains a private key In this embodiment, the encrypted data can be further encrypted based on the evaluated public key, thereby better ensuring the security of data transmission. In addition, the private keys for decryption of multiple data providers are managed in a decentralized manner, thereby improving the security of data.
[0086] On the basis of the above embodiment, after the data provider obtains the ciphertext calculation result, it will use its own private key fragment Decrypt the received ciphertext calculation result. Figure 4 Another embodiment of the present application provides a flow chart of a data transmission method. Figure 4As shown, the execution subject is the data provider, and the data transmission method includes the following steps:
[0087] S400, generating a private key fragment of the data provider itself, as well as an encryption public key and an evaluation public key.
[0088] S401, encrypt local data using an encryption public key to generate ciphertext data, and send the ciphertext data to a data user.
[0089] S402, receiving a ciphertext calculation result sent by a data user, wherein the ciphertext calculation result is determined by the data user according to an evaluated public key and received ciphertext data.
[0090] For the introduction of steps S400 to S402 , reference may be made to the relevant contents in the above embodiment, which will not be repeated here.
[0091] S403, using the private key fragment, decrypt the ciphertext calculation result to obtain first intermediate decrypted data, and send it to other data providers.
[0092] In this embodiment, since the data provider only has a part of the private key, it is unable to fully decrypt the ciphertext calculation result. After decrypting the ciphertext calculation result, a first intermediate decrypted data can be obtained. After obtaining the first intermediate decrypted data, in order to completely decrypt the data, the data provider needs to send the first intermediate decrypted data to other data providers, so that other data providers can also obtain their own first intermediate decrypted data, so that other data providers can decrypt the plaintext data.
[0093] Optionally, the data provider broadcasts the first intermediate decrypted data to other data providers, and other data providers can monitor the first intermediate decrypted data. Optionally, the data provider can also send it directly to other data providers. This is only an example, and the sending method of the first intermediate decrypted data is not specifically limited in this embodiment.
[0094] Data provider P k Own private key fragment Decrypt the received ciphertext calculation result, P k Calculate the first intermediate decrypted data Among them, e k ← $ [-B dec ,B dec ]. Then, P k Broadcast the first intermediate decrypted data w k .
[0095] S404, receiving second intermediate decrypted data sent by other data providers.
[0096] In this embodiment, the role of each data provider is the same, and other data providers will also use their own private key fragments to decrypt the received ciphertext calculation results to obtain a decrypted intermediate decrypted data. It should be noted that in order to distinguish the intermediate decrypted data decoded by other data providers using their own private key fragments, it is called the second intermediate decrypted data. After obtaining the second intermediate decrypted data, other data providers will also send the second intermediate decrypted data outward. Optionally, other data providers also want to broadcast their own second intermediate decrypted data, and the data provider can monitor the second intermediate decrypted data.
[0097] S405: Obtain plaintext data by fusing the first intermediate decrypted data and the second intermediate decrypted data.
[0098] Based on the secret sharing mechanism, it is necessary to obtain enough secret fragments to decrypt the secret. In this embodiment, the decrypted intermediate decrypted data can be shared between data providers, so as to ensure that each data provider can obtain enough intermediate decrypted data to decrypt the plaintext data. In this embodiment, the data provider can receive the ciphertext calculation result sent by the data user, where is the multiplication level. The data provider merges the first intermediate decrypted data and the second intermediate decrypted data, for example, the first intermediate decrypted data and the second intermediate decrypted data can be homomorphically added or multiplied to decrypt the plaintext data.
[0099] The data provider can obtain the second intermediate decrypted data sent by other data providers, and merge the first intermediate decrypted data and the second intermediate decrypted data using the following formula: Furthermore, based on the formula The plaintext data can be decrypted.
[0100] The data transmission method provided in this embodiment constructs a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expands the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on the homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0101] Figure 5 Another embodiment of the present application provides a flow chart of a data transmission method. Figure 5 As shown, the execution subject is a data user, and the data transmission method includes the following steps:
[0102] S501, receiving ciphertext data sent by each data provider.
[0103] When multiple data providers need to provide data at the same time, in order to prevent the data of the data providers from being leaked or stolen, in this embodiment, the data provider needs to use the encryption public key to encrypt its own local data and then generate a ciphertext data. After generating the ciphertext data, the data provider sends the ciphertext data to the data user. Correspondingly, the data user can receive the respective ciphertext data sent by multiple data providers.
[0104] S502, using the evaluated public key to perform encryption calculation on each ciphertext data to obtain a ciphertext calculation result.
[0105] After receiving the ciphertext data sent by each data provider, the data user calls the encryption algorithm for all the ciphertext data, performs encryption calculation on each ciphertext data based on the evaluation public key, generates the ciphertext calculation result, and then sends the ciphertext calculation result to each data provider. evk The encryption algorithm encrypts each ciphertext data based on the evaluated public key, i.e. Eval evk (f,c1,…,c l ), we can calculate the ciphertext calculation result. Among them, the evaluation algorithm, Eval evk (f,c1,…,c l ) and E.Eval evk (f,c1,…,c l )same.
[0106] S503, sending the ciphertext calculation result to each data provider for decryption.
[0107] After obtaining the ciphertext calculation result, the ciphertext calculation result is sent to each data provider, and the data provider can decrypt the ciphertext calculation result to obtain the plaintext data. In order to ensure the security of the data of each data provider, in this embodiment, each data provider cannot directly obtain the complete private key. Each data provider has part of the private key, that is, a private key fragment. After receiving the ciphertext calculation result, the data provider can use its own private key fragment to decrypt the ciphertext calculation result to obtain the plaintext data.
[0108] The data transmission method provided in this embodiment constructs a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expands the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on the homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0109] On the basis of the above embodiment, in order to realize encryption and decryption of data, before receiving the ciphertext data sent by the data provider, it is necessary to cooperate with the data provider to generate an encryption public key and an evaluation public key. Figure 6 Another embodiment of the present application provides a flow chart of a data transmission method. Figure 6 As shown, the execution subject is a data user, and the data transmission method includes the following steps:
[0110] S601, receiving encrypted public key fragments sent by each data provider.
[0111] In this embodiment, each data provider can first generate an encrypted public key fragment, and then broadcast the encrypted public key fragment to the data user. Correspondingly, the data user can receive the encrypted public key fragment sent by each data provider. The calculation process of the data provider generating the encrypted public key fragment can be referred to the relevant content in the above embodiment, which will not be repeated here.
[0112] S602, based on the encrypted public key fragments of each data provider, obtain the encrypted public key.
[0113] After obtaining the encrypted public key fragments of each data provider, the encrypted public key fragments are added together to obtain the encrypted public key. Optionally, the encrypted public key generation algorithm is: in,
[0114] Among them, l∈[N], d∈[D].
[0115] Figure 7 Another embodiment of the present application provides a flow chart of a data transmission method. Figure 7 As shown, the execution subject is a data user, and the data transmission method includes the following steps:
[0116] S701, receiving the target intermediate result of evaluating the public key sent by each data provider.
[0117] In this embodiment, each data provider can first generate a target intermediate result of evaluating a public key, and then broadcast the target intermediate result to the data user. Correspondingly, the data user can receive the target intermediate result sent by each data provider. The calculation process of the data provider generating the target intermediate result can be referred to the relevant content in the above embodiment, which will not be repeated here.
[0118] S702, based on the target intermediate result of each data provider, obtain the evaluation public key.
[0119] After obtaining the target intermediate results of each data provider, calculations are performed based on each target intermediate result to obtain an evaluation public key.
[0120] The data consumer has input setup, Compute output evaluation key For every l∈[N],d∈[D],i∈[n],j∈[n]∪{0}, The public key can be calculated using the following formula:
[0121]
[0122] After obtaining the evaluation public key, the data user can use the evaluation public key to encrypt the ciphertext data of each data provider to obtain the ciphertext calculation result.
[0123] The data transmission method provided by this application is explained below in combination with the application scenarios of two data providers. Figure 8 As shown, the data transmission process can be divided into four stages.
[0124] The first stage is the key generation stage:
[0125] The two data providers interact and collaborate to generate an encrypted public key. Figure 8 p k At the same time, each data provider has a part of the private key corresponding to the public key. Figure 8 In the data provider No. 1, there are s k1 , data provider No. 2 has s k2 Each data provider cannot obtain any information about the private key of other data owners, nor can it obtain any information about the private key.
[0126] The second stage is the data encryption stage:
[0127] Each data provider uses the encryption public key to encrypt its own data and generate ciphertext data, such as Figure 8 c t1 and c t2Each data provider sends its own ciphertext data to the data user.
[0128] The third stage is the ciphertext calculation stage:
[0129] The data user uses the evaluation key to encrypt each ciphertext data and obtain the ciphertext calculation result, such as Figure 8 c r The data user sends the ciphertext calculation results to all data providers.
[0130] The fourth stage is the decryption stage of the ciphertext calculation results:
[0131] Each data provider collaborates interactively and first uses its own private key to jointly decrypt the ciphertext calculation result to obtain the plaintext calculation result.
[0132] The following is an explanation and convention of the symbols used in the homomorphic encryption algorithm in the above embodiment:
[0133] Use E to represent the hierarchical BGV algorithm based on LWE. The maximum multiplication level of the supported circuit is D, and the plaintext space is {0,1}. Use TFHE to represent threshold homomorphic encryption. Assume there are N data owners and one data user. Use bold lowercase letters to represent vectors and lowercase letters to represent scalars. If s is a vector, then s[i] represents the i-th component of s, and s[0] = 1 is agreed. Assume represents the probability distribution on a finite set S, It means x is Sampling of x← $ S means x is a sample from a uniform distribution on S. The base of all logarithms is 2. If n is a positive integer, then [n] means the set of all integers from 1 to n.
[0134] E includes the following basic components:
[0135] 1) params is an implicit input to all algorithms, κ is a security parameter, q is an odd modulus, m and n are dimensions, and It's Z q The probability distribution on ;
[0136] 2) E.SymKeygen(params): Generate a private key
[0137] 3) E.PubKeygen(s): Generate e←χ m , set p:=A·s+2·e, output the private key s for the public key pk:=(A,p);
[0138] 4) E.SymEnc s (μ): To encrypt μ∈{0,1}, choose e←χ, set b:=<a,s> +2·e+μ, output ciphertext c=(a,b);
[0139] 5) E. PubEnc pk (μ): To encrypt μ∈{0,1} using the public key pk=(A,p), choose r←{0,1} m , set a:=r T ·A,b:=<r,p> +μ, output ciphertext c = (a, b);
[0140] 6) To decrypt c = (a, b), output the plaintext [b-<a,s> ] q mod2;
[0141] 7) Evaluation algorithm E.Eval evk (f,c1,…,c l ), use the evaluation key evk to calculate the function f, f:{0,1} l →{0,1} is represented as a Boolean circuit whose input is l ciphertexts c1,…,c l , the output is the ciphertext result c f .
[0142] The notation E.PubKeygen(s;A) is used to indicate that the public key generation algorithm is performed using a fixed coefficient A. The notation E.PubKeygen(s;A;e) is used to indicate that the public key generation algorithm is performed using a fixed coefficient A and noise e. The notation E.SymEnc s (μ; a) means that μ is encrypted using a fixed coefficient a and a private key s. Use the symbol E.SymEnc s (μ; a; e) means that μ is encrypted using a fixed coefficient a, noise e, and private key s.
[0143] Fig. 9 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application. Fig. 9 As shown, the data transmission device is suitable for a data provider, and includes: a key generation module 90, an encryption module 91, a receiving module 92 and a decryption module 93.
[0144] Among them, the key generation module 90 is used to generate the private key fragment of the data provider itself, as well as the encryption public key and the evaluation public key.
[0145] The encryption module 91 is used to encrypt local data using an encryption public key to generate ciphertext data and send the ciphertext data to a data user.
[0146] The receiving module 92 is used to receive the ciphertext calculation result sent by the data user, wherein the ciphertext calculation result is determined by the data user according to the evaluated public key and the received ciphertext data.
[0147] The decryption module 93 is used to decrypt the ciphertext calculation result using the private key fragment to obtain the plaintext data.
[0148] Optionally, the decryption module 93 is further used to use a private key fragment to decrypt the ciphertext calculation result, obtain first intermediate decrypted data, and send it to other data providers, receive second intermediate decrypted data sent by other data providers, and obtain plaintext data by fusing the first intermediate decrypted data and the second intermediate decrypted data.
[0149] In some embodiments, the key generation module 90 includes: a first generation unit 901 , a sending unit 902 , a receiving unit 903 and a second generation unit 904 .
[0150] The first generating unit 901 is used to generate a private key fragment, and based on the private key fragment, generate an encrypted public key fragment of the data provider itself and a target intermediate result corresponding to the evaluated public key.
[0151] The sending unit 902 is used to broadcast the encrypted public key fragment and the target intermediate result.
[0152] The receiving unit 903 is used to receive the respective encrypted public key fragments and target intermediate results sent by other data providers.
[0153] The second generation unit 904 is used to generate an encrypted public key based on each encrypted public key fragment, and to generate an evaluation public key based on each target intermediate result.
[0154] Optionally, the first generation unit 901 is also used to obtain key generation parameters, wherein the key generation parameters include public parameters and public random numbers, obtain a private key fragment based on the public parameters and the private key generation algorithm, generate an encrypted public key fragment based on the private key fragment, the public random number and the encrypted public key generation algorithm, and generate a target intermediate result based on the private key fragment and the evaluated public key generation algorithm.
[0155] Optionally, the first generation unit 901 is further used to generate a first intermediate result of the evaluated public key based on the private key fragment, the public random number and the evaluated public key generation algorithm, and broadcast the first intermediate result, receive the respective first intermediate results sent by other data providers, obtain the second intermediate result of the evaluated public key based on its own first intermediate result and the first intermediate results of other data providers, obtain the target intermediate result of the evaluated public key based on the private key fragment, the public random number and the second intermediate result, and broadcast the target intermediate result.
[0156] The data transmission device provided in this embodiment constructs a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expands the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on the homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0157] It should be noted that the above explanation of the data transmission method embodiment is also applicable to the data transmission device of this embodiment, and will not be repeated here.
[0158] Fig.10 A structural diagram of a data transmission device provided in another embodiment of the present application. Fig.10 As shown, the data transmission device is suitable for a data user end and includes: a receiving module 210, an encryption module 220 and a sending module 230.
[0159] The receiving module 210 is used to receive the ciphertext data sent by each data provider.
[0160] The encryption module 220 is used to perform encryption calculation on each ciphertext data using the evaluated public key to obtain a ciphertext calculation result.
[0161] The sending module 230 is used to send the ciphertext calculation results to each data provider for decryption.
[0162] The data transmission device provided in this embodiment constructs a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expands the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on the homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0163] Fig.11 A structural diagram of a data transmission device provided in another embodiment of the present application. Fig.11 As shown, the data transmission device is suitable for a data user end and includes: a receiving module 310, an encryption module 320 and a sending module 330, as well as a first key generation module 340 and a second key generation module 350.
[0164] The functions and structures of the receiving module 310, the encryption module 320 and the sending module 330 are similar to Fig.10The receiving module 210, encryption module 220 and sending module 230 are not described in detail here.
[0165] The first key generation module 340 is used to receive the encrypted public key fragments sent by each data provider, and obtain the encrypted public key based on each encrypted public key fragment.
[0166] The second key generation module 350 is used to receive the target intermediate result of the evaluation public key sent by each data provider, and obtain the evaluation public key based on each target intermediate result.
[0167] The data transmission device provided in this embodiment constructs a multi-party homomorphic encryption mechanism, which can achieve the purpose of performing homomorphic encryption calculations on encrypted data of multiple data providers, and expands the application scenarios of homomorphic encryption. Furthermore, a secure multi-party computing technology based on homomorphic encryption is provided to improve data security. Transmitting data based on the homomorphic encryption algorithm can protect the security of the data of the data provider, thereby preventing information leakage from the data provider. Furthermore, the private keys used for decryption of multiple data providers are managed in a decentralized manner to improve data security.
[0168] It should be noted that the above explanation of the data transmission method embodiment is also applicable to the data transmission device of this embodiment, and will not be repeated here.
[0169] In order to implement the above-mentioned embodiments, the present application also proposes an electronic device, comprising: a memory 410 and a processor 420; wherein the processor 420 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 410, so as to implement the data transmission method proposed in the above-mentioned embodiments of the present application.
[0170] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the data transmission method proposed in the above embodiments of the present application is implemented.
[0171] In order to implement the above embodiments, the present invention further proposes a computer program product, which, when an instruction processor in the computer program product executes, implements the data transmission method proposed in the above embodiments of the present application.
[0172] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0173] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0174] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0175] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0176] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0177] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0178] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0179] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A data transmission method, characterized in that: Applicable to a data provider, the method comprises: Generate a private key fragment of the data provider, and generate an encrypted public key fragment of the data provider itself and a target intermediate result corresponding to the evaluation public key based on the private key fragment; broadcasting the encrypted public key fragment and the target intermediate result; Receiving the respective encrypted public key fragments and the target intermediate results sent by other data providers; generating an encryption public key based on each of the encryption public key fragments, and generating the evaluation public key based on each of the target intermediate results; Encrypting local data using the encryption public key to generate ciphertext data, and sending the ciphertext data to the data user; Receiving a ciphertext calculation result sent by the data user, wherein the ciphertext calculation result is determined by the data user according to the evaluated public key and the received ciphertext data; The ciphertext calculation result is decrypted using the private key fragment to obtain plaintext data.
2. The data transmission method according to claim 1, characterized in that: The decrypting the ciphertext calculation result using the private key fragment to obtain plaintext data includes: Decrypting the ciphertext calculation result using the private key fragment to obtain first intermediate decrypted data, and sending the first intermediate decrypted data to other data providers; Receiving second intermediate decrypted data sent by the other data provider; The plaintext data is obtained by fusing the first intermediate decrypted data and the second intermediate decrypted data.
3. The data transmission method according to claim 1, characterized in that: The step of generating a private key fragment of the data provider itself includes: Acquire key generation parameters, wherein the key generation parameters include public parameters and public random numbers; Based on the public parameters and a private key generation algorithm, the private key fragment is obtained.
4. The data transmission method according to claim 3, characterized in that: The step of generating an encrypted public key fragment and an intermediate result corresponding to the evaluated public key based on the private key fragment comprises: Generate the encrypted public key fragment based on the private key fragment, the public random number and an encrypted public key generation algorithm; Based on the private key fragment and the evaluated public key generation algorithm, the target intermediate result is generated.
5. The data transmission method according to claim 4, characterized in that: The generating the target intermediate result based on the private key fragment and the evaluation public key generation algorithm comprises: Generate a first intermediate result of the evaluated public key based on the private key fragment, the public random number and the evaluated public key generation algorithm, and broadcast the first intermediate result; receiving the first intermediate results respectively sent by other data providers; Based on the first intermediate result of the self and the first intermediate result of the other data provider, obtain the second intermediate result of the evaluated public key; Based on the private key fragment, the public random number and the second intermediate result, a target intermediate result of the evaluated public key is obtained, and the target intermediate result is broadcasted.
6. A data transmission method, characterized in that: Applicable to a data user, the method includes: Receive ciphertext data sent by each data provider; Using the evaluated public key to perform encryption calculation on each of the ciphertext data to obtain a ciphertext calculation result; Sending the ciphertext calculation results to each of the data providing terminals for decryption; Before receiving the ciphertext data sent by each data provider, the method further includes: Receiving the encrypted public key fragments sent by each of the data providers; Based on each of the encrypted public key fragments, obtaining the encrypted public key; Receiving the target intermediate result of the public key evaluation sent by each of the data providers; Based on each of the target intermediate results, the evaluation public key is obtained.
7. A data transmission device, characterized in that: Applicable to a data provider, the data transmission device comprises: A key generation module, used to generate a private key fragment of the data provider itself, as well as an encryption public key and an evaluation public key; An encryption module, used to encrypt local data using the encryption public key to generate ciphertext data, and send it to the data user; A receiving module, configured to receive a ciphertext calculation result sent by the data user, wherein the ciphertext calculation result is determined by the data user according to the evaluated public key and the received ciphertext data; A decryption module, used to decrypt the ciphertext calculation result using the private key fragment to obtain plaintext data; The key generation module comprises: A first generating unit, configured to generate the private key fragment, and generate the encrypted public key fragment of the data provider itself and a target intermediate result corresponding to the evaluation public key based on the private key fragment; A sending unit, configured to broadcast the encrypted public key fragment and the target intermediate result; A receiving unit, used for receiving the respective encrypted public key fragments and the target intermediate results sent by other data providers; The second generating unit is used to generate the encryption public key based on each of the encryption public key fragments, and to generate the evaluation public key based on each of the target intermediate results.
8. The data transmission device according to claim 7, characterized in that: The decryption module is further used for: Decrypting the ciphertext calculation result using the private key fragment to obtain first intermediate decrypted data, and sending the first intermediate decrypted data to other data providers; Receiving second intermediate decrypted data sent by the other data provider; The plaintext data is obtained by fusing the first intermediate decrypted data and the second intermediate decrypted data.
9. The data transmission device according to claim 7, characterized in that: The first generating unit is further configured to: Acquire key generation parameters, wherein the key generation parameters include public parameters and public random numbers; Based on the public parameters and a private key generation algorithm, the private key fragment is obtained.
10. The data transmission device according to claim 9, characterized in that: The first generating unit is further configured to: Generate the encrypted public key fragment based on the private key fragment, the public random number and an encrypted public key generation algorithm; Based on the private key fragment and the evaluated public key generation algorithm, the target intermediate result is generated.
11. The data transmission device according to claim 10, characterized in that: The first generating unit is further configured to: Generate a first intermediate result of the evaluated public key based on the private key fragment, the public random number and the evaluated public key generation algorithm, and broadcast the first intermediate result; receiving the first intermediate results respectively sent by other data providers; Based on the first intermediate result of the self and the first intermediate result of the other data provider, obtain the second intermediate result of the evaluated public key; Based on the private key fragment, the public random number and the second intermediate result, a target intermediate result of the evaluated public key is obtained, and the target intermediate result is broadcasted.
12. A data transmission device, characterized in that: Applicable to a data user, the data transmission device comprises: A receiving module, used to receive ciphertext data sent by each data provider; An encryption module, used to perform encryption calculation on each of the ciphertext data using the evaluated public key to obtain a ciphertext calculation result; A sending module, used for sending the ciphertext calculation results to each of the data providing terminals for decryption; A first key generation module, used for receiving the encrypted public key fragments sent by each of the data providers, and obtaining the encrypted public key based on each of the encrypted public key fragments; The second key generation module is used to receive the target intermediate result of the evaluation public key sent by each of the data providers, and obtain the evaluation public key based on each of the target intermediate results.
13. An electronic device, characterized in that: including a processor and a memory; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the data transmission method as described in any one of claims 1 to 5, or to implement the data transmission method as described in claim 6.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the data transmission method as described in any one of claims 1 to 5, or is used to implement the data transmission method as described in claim 6.
Citation Information
Patent Citations
Multi-party safety calculation method and device, and electronic equipment
CN109359470A
Pathogenic gene positioning method based on multi-key fully homomorphic encryption
CN111354416A