An improved additive homomorphic encryption method supporting floating-point operations
By introducing random perturbation parameters and floating-point number operations in the Paillier algorithm, the problem of insufficient performance when processing floating-point data is solved, efficient encryption and homomorphic addition of floating-point numbers are realized, and infinite floating-point numbers are supported. Addition operations meet the needs of practical application scenarios.
Patent Information
- Application Number
- CN202210638770.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-06-07
AI Technical Summary
The existing Paillier addition homomorphic encryption algorithm is insufficient in processing floating-point data, and because it is based on modulo operations, it only supports a limited number of addition operations, which cannot meet the requirements of floating-point number encryption in practical application scenarios.
By introducing random perturbation parameters and floating-point number operations based on the Paillier algorithm, the ciphertext is generated as a binary, and the homomorphism of the Paillier encryption scheme is used for addition or subtraction operations, supporting homomorphic addition calculation of floating-point numbers, and through private The key decryption obtains the plaintext, realizing infinite addition operation of floating-point numbers.
It realizes efficient encryption and homomorphic addition calculation of floating point numbers, improves the security and availability of encryption algorithms, supports any number of addition operations, and is suitable for data processing of floating point numbers in practical application scenarios.
Smart Images

Figure CN114866221B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an improved additive homomorphic encryption method supporting floating-point operations. Background Art
[0002] With the widespread application of cloud computing, especially the large amount of data processing on cloud platforms, how to safely and effectively protect user privacy and security has become a hot topic in the field of cryptography research. If data is stored in plain text, it is possible to expose the data to cloud service providers, which will bring a series of security issues to user confidential data.
[0003] To solve this problem, homomorphic encryption schemes came into being. Homomorphic encryption is a cryptographic technology based on the computational complexity theory of mathematical problems. The data that has been homomorphically encrypted is processed to obtain an output, and this output is decrypted. The result is the same as the output obtained by processing the unencrypted original data in the same way. The advantage of homomorphic encryption is that users can still analyze and retrieve specific encrypted data when the data is encrypted, which improves the efficiency of data processing and ensures the secure transmission of data.
[0004] Homomorphic encryption can be divided into the following three types according to the type of computing supported and the degree of support:
[0005] 1) Partially Homomorphic Encryption (PHE): only supports one of the operations of addition or multiplication. Among them, the one that only supports addition is also called Additive Homomorphic Encryption (AHE);
[0006] 2) Somewhat Homomorphic Encryption (SWHE): It can support both addition and multiplication operations, but the number of supported calculations is limited;
[0007] 3) Fully Homomorphic Encryption (FHE): supports any number of addition and multiplication operations.
[0008] Due to some shortcomings of general secure computing methods and the fact that only one HE operation (such as addition) is needed to complete functions in some specific scenarios, PHE has been widely used in the field of privacy computing, and it can be found in many open source libraries (such as FATE) and many top academic conferences (such as S&P, NDSS, etc.). PHE is efficient and supports unlimited addition or multiplication, making it an important basic component of privacy computing, which can assist in completing a variety of privacy computing functions.
[0009] Currently, the commonly used semi - homomorphic encryption algorithms mainly include the RSA algorithm and Elgamal algorithm that support multiplicative homomorphisms, and the Paillier algorithm and Benaloh algorithm that support additive homomorphisms. Among the additive homomorphic algorithms, the Paillier encryption algorithm [P. Paillier, “Public - Key Cryptosystems Based on Composite Degree Residuosity Classes”, 1999] is a scheme with the best comprehensive performance. This algorithm is the first additive homomorphic encryption cryptosystem based on the decision composite residue class problem. It was proposed by scholar Paillier in 1999. Its security is based on the decision composite residue problem and it is a widely used public - key encryption algorithm. The specific steps are as follows:
[0010] 1) Generation of public and private keys: Randomly select large prime numbers p and q, let [n = pq, λ(n)=lcm(p - 1, q - 1)], where lcm() is the least common multiple of the two parameters. And define the function L(n)=(n - 1) / n. Select a random number g, and satisfy μ=(L(g λ mod n 2 )) -1 . Exist. At this time, the public key is (n, g), and the private key is (λ, μ).
[0011] 2) Encryption process: For the plaintext m, m ∈ Z N , select a random number r < n, and the encryption process is c = g m r n (mod n 2 ).
[0012] 3) Decryption process: For the ciphertext c, the decryption process is
[0013] However, the current Paillier algorithm has acceptable performance when dealing with small - range integers, does not support floating - point data that appears more frequently in actual application scenarios, and because the Paillier algorithm is based on modular arithmetic, it only supports a finite number of addition operations, because the modular space and the integer space are not in a one - to - one mapping relationship.
[0014] Therefore, to meet the encryption of floating - point numbers with higher frequency in actual application scenarios, it is particularly important to have a semi - homomorphic additive encryption scheme that supports floating - point number encryption and unlimited - number addition operations. Summary of the Invention
[0015] The purpose of this invention is to overcome the above - mentioned shortcomings in the prior art and provide an improved additive homomorphic encryption method that supports floating - point operations, supports floating - point number encryption, and unlimited - number addition operations.
[0016] In order to achieve the above-mentioned purpose, the invention has the following structure:
[0017] The present invention includes an improved additive homomorphic encryption method supporting floating point operations, comprising the steps of:
[0018] SA, generate key PaiOpt key ={pk Paillier ,pk Paillier ,g,a,L K ,M K}, the generation steps include:
[0019] SA-1, use the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ;
[0020] SA-2, randomly select floating point numbers g and a as the base for encrypting the plaintext m;
[0021] SA-3, randomly pick two positive integers L K and M K ;
[0022] SB, encrypts the plaintext m, and the encrypted plaintext m is obtained as ciphertext c, ciphertext c = EncNum (L V ,R V ), the encryption steps specifically include:
[0023] SB-1, generates a random perturbation parameter k, k is a bounded positive integer, the range is (L K ,M K );
[0024] SB-2, obtain the public key pk Paillier , using the public key pk Paillier Encrypt the random perturbation parameter k to obtain L V =Enc Paillier (k);
[0025] SB-3, obtain random floating point numbers g, a and random perturbation parameter k, and get R V =g m×a+k ,
[0026] SD, decrypts the ciphertext c to obtain the plaintext m, and the decryption steps specifically include:
[0027] SD-1, using the private key sk Paillier For the L V The random perturbation parameter k is obtained by decrypting the term;
[0028] SD-2, using the random floating point numbers g, a and the random perturbation parameter k to calculate the R of the ciphertext c V The decryption item is m.
[0029] In the preferred improved additive homomorphic encryption method supporting floating-point operations, the plaintext m and the ciphertext c are respectively a plaintext set and a ciphertext set. By encrypting multiple plaintexts through the step SB, the plaintexts m1 to m t Encrypted into ciphertext c1 to c t ;
[0030] The encryption method further includes step SC, performing addition or subtraction operations on the ciphertexts c1 and c2 to obtain c3 or c4.
[0031] In the preferred improved additive homomorphic encryption method supporting floating-point operations, the step SC specifically includes, when it is an addition operation,
[0032] SC-1, using the homomorphism of the Paillier encryption scheme, converts the L V The terms are added together, and the formula is: Enc Paillier (k1)+Enc Paillier (k2) = Enc Paillier (k1+k2);
[0033] SC-2, replace the R in the ciphertext V Multiply the terms together, and the formula is:
[0034] SC-3, get ciphertext c3, ciphertext
[0035] In the preferred improved additive homomorphic encryption method supporting floating-point operations, when the step SC is a subtraction operation, the step SC specifically includes:
[0036] SC-1, using the homomorphism of the Paillier encryption scheme, converts the L V Subtract the terms, the formula is: Enc Paillier (k1)-Enc Paillier (k2) = Enc Paillier (k1-k2);
[0037] SC-2, replace the R in the ciphertext V Divide the terms, the formula is:
[0038] SC-3, get ciphertext c4, ciphertext
[0039] In the preferred improved additive homomorphic encryption method supporting floating-point operations, the L K and MK The M K =(p+1)×L K / p, where p is a positive integer greater than 2, L K Take an integer greater than 100.
[0040] In the preferred improved additive homomorphic encryption method that supports floating-point operations, the value of p is greater than 10.
[0041] The present application also includes a decryption method for ciphertext generated by the above encryption method, characterized in that it includes the steps of:
[0042] SD, decrypts the ciphertext c to obtain plaintext m, m=DecNum(c), specifically including the steps of:
[0043] SD-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c V The perturbation parameter k is obtained by decrypting the term, k = Dec Paillier (L V );
[0044] SD-2, obtain floating point numbers g and a, substitute the disturbance parameter k into the formula m=log g (g ((m×a+k)-k) / a ), and get the plaintext m.
[0045] In the preferred decryption method, when the encryption method is addition operation, the step SD is specifically as follows:
[0046] SD1, decrypting the ciphertext c3, specifically includes the steps of:
[0047] SD1-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c3 V The perturbation parameters k1 and k2 are obtained by decrypting the term, k1+k2=Dec Paillier (L V )==Dec Paillier (k1+k2);
[0048] SD1-2, obtain floating point numbers g and a, and use the perturbation parameter k1+k2 to decrypt R in c3 V term, we get m1+m2,
[0049] In the preferred decryption method, when the encryption method is a subtraction operation, the step SD is specifically as follows:
[0050] SD2, decrypting the ciphertext c4, specifically includes the steps of:
[0051] SD2-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c4 V The perturbation parameters k1 and k2 are obtained by decrypting the term, k1-k2=Dec Paillier (L V )==Dec Paillier (k1-k2);
[0052] SD2-2, obtain floating point numbers g and a, and use the perturbation parameters k1-k2 to decrypt R in c4 V Item, get m1-m2,
[0053] In the preferred decryption method, a key generation module, an encryption module and a decryption module are included.
[0054] The key generation module is used to generate the key PaiOpt key ={pk Paillier ,pk Paillier ,g,a,L K ,M K}, the generation steps specifically include: using the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ; Randomly select floating point numbers g and a as the base for encrypting plaintext m; Randomly select two positive integers L K and M K ;
[0055] The encryption module is used to encrypt the plaintext m, and the plaintext m is encrypted to obtain the ciphertext c, where ciphertext c=EncNum(L V ,R V ), the encryption steps specifically include: generating a random perturbation parameter k, where k is a bounded positive integer in the range of (L K ,M K ); Get the public key pk Paillier , using the public key pk Paillier Encrypt the random perturbation parameter k to obtain L V =Enc Paillier (k); Get the random floating point numbers g, a and random perturbation parameter k, and get R V =g m×a+k ;
[0056] The decryption module is used to decrypt the ciphertext c to obtain the plaintext m, m = DecNum (c), specifically including the steps of obtaining the private key sk Paillier , using the private key sk Paillier For L in ciphertext cV The perturbation parameter k is obtained by decrypting the term, k = Dec Paillier (L V ); Obtain floating point numbers g and a, and substitute the disturbance parameter k into the formula m=log g (g ((m×a+k)-k) / a ), and get the plaintext m.
[0057] The present application also includes a computer storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the above encryption method.
[0058] The present invention provides an improved additive homomorphic encryption method supporting floating-point operations, wherein the encryption method comprises the following steps: SA, generating a key PaiOpt key ={pk Paillier ,pk Paillier ,g,a,L K ,M K}, the generation steps include: SA-1, using the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ; SA-2, randomly select floating point numbers g and a as the base for encrypting plaintext m; SA-3, randomly select two positive integers L K and M K SB, encrypts the plaintext m, and the encrypted plaintext m is obtained as ciphertext c, ciphertext c = EncNum (L V ,R V ), SD, for the ciphertext c V and R V项 Decryption is performed to obtain the plaintext m. The encryption method of the present application retains the original Paillier scheme's additive homomorphism for integers, while supporting homomorphic addition calculations for floating-point numbers; during the encryption process, random perturbation parameters are added, and the original Paillier algorithm is used to control access to the perturbation parameters, thereby improving security; modular operations are not used, thereby supporting any number of addition operations and improving usability. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of the steps of the preferred encryption method of the present invention;
[0060] Figure 2 This is a schematic diagram of the structure of a preferred encryption system of the present invention. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work also fall within the scope of protection of the present invention.
[0062] The present invention includes an improved additive homomorphic encryption method supporting floating point operations, comprising the steps of:
[0063] SA, generate key PaiOpt key ={pk Paillier ,sk Paillier ,g,a,L K ,M K}, the generation steps include:
[0064] SA-1, use the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ;
[0065] SA-2, randomly select floating point numbers g and a as the base for encrypting the plaintext m;
[0066] SA-3, randomly pick two positive integers L K and M K ;
[0067] SB, encrypts the plaintext m, and the encrypted plaintext m is obtained as ciphertext c, ciphertext c = EncNum (L V ,R V ), the encryption steps specifically include:
[0068] SB-1, generates a random perturbation parameter k, k is a bounded positive integer, the range is (L K ,M K );
[0069] SB-2, obtain the public key pk Paillier , using the public key pk Paillier Encrypt the random perturbation parameter k to obtain L V =Enc Paillier (k);
[0070] SB-3, obtain random floating point numbers g, a and random perturbation parameter k, and get R V =g m×a+k .
[0071] SD, decrypts the ciphertext c to obtain the plaintext m, and the decryption steps specifically include:
[0072] SD-1, using the private key sk Paillier For the L V The random perturbation parameter k is obtained by decrypting the term;
[0073] SD-2, using the random floating point numbers g, a and the random perturbation parameter k to calculate the R of the ciphertext c V The decryption item is m.
[0074] In the preferred improved additive homomorphic encryption method that supports floating-point operations, two positive integers L are randomly selected. K and M K As the range of random perturbation parameter k, M K Greater than L K , the L K and M K M K =(p+1)×L K / p, where p is a positive integer greater than 2, L K Take an integer greater than 100. In a preferred embodiment, the value of p is greater than 10. The larger the value of p is, the higher the security is.
[0075] The encryption algorithm of this application retains the public key pk in the Paillier algorithm Paillier And the private key sk Paillier The generation method is different from the original Paillier algorithm, in which the key only includes the public key pk Paillier And the private key sk Paillier The encryption algorithm of the present application further adds a random perturbation parameter k and randomly taken floating point numbers g and a for the encryption algorithm.
[0076] The encryption operation of the original Paillier algorithm is to obtain the ciphertext through modular operation, so its plaintext and ciphertext can only be integers. It is impossible to encrypt floating point numbers. The technical solution of this application does not use modular operation. When the Paillier algorithm obtains the public key pk Paillier And the private key sk Paillier Based on this, encryption calculations can be performed on floating-point numbers.
[0077] The specific encryption method is to design the ciphertext c as a binary group, c = EncNum (L V ,R V ), including L V and R V Two items, preferably, where L V The generation method is through the Paillier encryption algorithm, assuming that the public key pk Paillier is (n,b)
[0078] The method of generating public and private keys is: randomly select large prime numbers p and q, let n = pq, λ(n) = lcm(p-1,q-1)], lcm() is the least common multiple of the two parameters. And define the function L(n) = (n-1) / n. Select a random number b, And satisfy μ=(L(b λ modn 2 )) -1 . Exists. At this time, the public key is (n,b) and the private key is (λ,μ). And generate a random perturbation parameter k, k is a bounded positive integer in the range of (L K ,M K );
[0079] The encryption process is as follows: for plaintext m, ciphertext L v =b m k n (modn 2 ), get the integer ciphertext L V item.
[0080] The encryption method of this application also includes R V Item, the R V The Paillier algorithm is different from the prior art and can encrypt floating point numbers. The specific method is to obtain the random floating point numbers g, a and the random perturbation parameter k in the key and obtain R V =g m ×a+k The R in this tuple V This calculation method does not use modular arithmetic. It can encrypt floating-point numbers, and the encrypted result also retains the floating-point number.
[0081] The decryption method of this application is through the private key sk Paillier For L in ciphertext c V The perturbation parameter k = Dec is obtained by decrypting the term Paillier (LV), the decryption method can directly use the decryption method of the Paillier algorithm. Then obtain the floating point numbers g and a in the key, and then substitute the calculated disturbance parameter k into the logarithmic formula to obtain the plaintext data m.
[0082] Preferably, the homomorphic encryption method of the present application comprises the steps of:
[0083] SA, generate system key PaiOpt key ={pk Paillier ,sk Paillier ,g,a,L K ,M K};
[0084] SB and SC, the plaintext set m = {m1,m2,...m t} as input, using the key PaiOpt key Encrypt the plaintext and get the ciphertext set c = {c1.c2...c t};
[0085] SD, according to the obtained ciphertext set c = {c1.c2...c t};, using the key PaiOpt key Decrypt it to get the plaintext data.
[0086] It should be noted that the subscripts of the plaintext m and ciphertext c recorded in the specification and claims of this application are only used for examples and convenient descriptions, and are not used as restrictions on the number of plaintexts and ciphertexts or specific references. Any number of plaintexts and ciphertexts using the technical solution of this application belongs to the protection scope of this application.
[0087] In the preferred improved additive homomorphic encryption method supporting floating-point operations, multiple plaintexts m are encrypted through the step SB, and plaintexts m1 and m2 are encrypted into ciphertexts c1 and c2;
[0088] The addition or subtraction operation in the encryption algorithm can be performed by a subject different from the plaintext encryption and key generation party. The party that performs the addition or subtraction operation in the encryption algorithm is called the homomorphic operator, and the party that encrypts the plaintext and generates the key is called the demander. The homomorphic operator performs an addition operation on the encrypted ciphertext c to obtain the ciphertext data after the operation, and transmits the data after the operation back to the demander. The demander decrypts the ciphertext data after the operation, and obtains the plaintext data after the operation based on the characteristics of the homomorphic operation. In the technical solution of the present application, the homomorphic operator can only receive the ciphertext data, and the original plaintext data and the key are retained by the demander. Therefore, the security level is high.
[0089] The encryption method further includes step SC, performing addition or subtraction operations on the ciphertexts c1 and c2 to obtain c3 or c4.
[0090] In the preferred improved additive homomorphic encryption method supporting floating-point operations, the step SC specifically includes, when it is an addition operation,
[0091] SC-1, using the homomorphism of the Paillier encryption scheme, converts the L V The terms are added together, and the formula is: Enc Paillier (k1)+Enc Paillier (k2) = Enc Paillier (k1+k2);
[0092] SC-2, replace the R in the ciphertext V Multiply the terms together, and the formula is:
[0093] SC-3, get ciphertext c3, ciphertext
[0094] The addition operation of this application is respectively for L V and R V Perform the operation, the ciphertext L V The term is the direct addition of two items. The R V The multiplication of terms is converted into the addition of exponents, and the computer performs the addition operation to obtain the corresponding tuple c3.
[0095] Compared with the Paillier algorithm in the prior art, its additive homomorphism property is for L V The present application also adds R V Homomorphic operations on terms.
[0096] In other preferred improved additive homomorphic encryption methods supporting floating-point operations, subtraction operations on ciphertext are also included, specifically including:
[0097] SC-1, using the homomorphism of the Paillier encryption scheme, converts the L V Subtract the terms, the formula is: Enc Paillier (k1)-Enc Paillier (k2) = Enc Paillier (k1-k2);
[0098] SC-2, replace the R in the ciphertext V Divide the terms, the formula is:
[0099] SC-3, get ciphertext c4, ciphertext
[0100] The present application also includes a decryption method for ciphertext generated by the above encryption method, characterized in that it includes the steps of: SD, decrypting the ciphertext c to obtain plaintext m, m=DecNum(c), specifically including the steps of:
[0101] SD-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c V The random perturbation parameter k is obtained by decrypting the term, k = Dec Paillier (L V );
[0102] SD-2, obtain floating point numbers g and a, substitute the random perturbation parameter k into the formula m=log g (g ((m×a+k)-k) / a ), and get the plaintext m.
[0103] Optionally, this application uses the Paillier algorithm to calculate L V The random perturbation parameter k is obtained by decrypting the term, and R is calculated by obtaining the floating point numbers g and a and the calculated random perturbation parameter k. V The item is decrypted, specifically by obtaining the plaintext m through logarithmic operation.
[0104] In the preferred decryption method, when the encryption method is addition operation, the step SD is specifically as follows:
[0105] SD1, decrypting the ciphertext c3, specifically includes the steps of:
[0106] SD1-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c3 V The perturbation parameters k1 and k2 are obtained by decrypting the term, k1+k2=Dec Paillier (L V )==Dec Paillier (k1+k2);
[0107] SD1-2, obtain floating point numbers g and a, and use the perturbation parameter k1+k2 to decrypt R in c3 V term, we get m1+m2,
[0108] In other preferred decryption methods, when the encryption method is a subtraction operation, the step SD is specifically as follows:
[0109] SD2, decrypting the ciphertext c4, specifically includes the steps of:
[0110] SD2-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c4 V The perturbation parameters k1 and k2 are obtained by decrypting the term, k1-k2=Dec Paillier (L V )==Dec Paillier (k1-k2);
[0111] SD2-2, obtain floating point numbers g and a, and use the perturbation parameters k1-k2 to decrypt R in c4 V Item, get m1-m2,
[0112] Through the above decryption steps, the calculated plaintext can be obtained from the calculated ciphertext, for example, m1+m2 and m1-m2 can be obtained through the calculated c3 and c4 (c3 and c4 are obtained by calculating c1 and c2).
[0113] It should be known that the present application is an encryption algorithm optimized based on the Paillier algorithm. Therefore, the Paillier algorithm, as the prior art of the present application, and its technical solutions can be directly applied to the present application and combined with the technical solutions of the present application.
[0114] The above encryption algorithm is executed, and the following table shows the specific execution results of the method.
[0115] The experimental conditions are shown in Table 1. The GNU high-precision arithmetic library (GMP) was used for specific experiments;
[0116] CPU AMD R7 5800H Memory 16G Number of threads 1 operating system Windows 10 Calculating safety parameters 128 bits
[0117] Table 1 Experimental conditions
[0118] This solution is used to perform encryption, decryption, addition and subtraction tests on small integers, large integers, small floating point numbers and large floating point numbers. The test results are shown in Table 2:
[0119]
[0120]
[0121] Table 2 Performance of Paillier optimization scheme on different types of data
[0122] From the experimental results in Table 2, the present invention not only supports homomorphic encryption of integers, but also can directly encrypt and homomorphically calculate floating-point numbers, without the need to map floating-point numbers to integers by other means before calculation, thus improving the calculation efficiency; since modular exponentiation calculation is not used, the present invention supports any number of addition operations. It can be seen that the present invention has substantial technical features and significant technical progress.
[0123] In the preferred decryption method, a key generation module, an encryption module and a decryption module are included.
[0124] The key generation module is used to generate the key PaiOpt key ={pk Paillier ,pk Paillier ,g,a,L K ,M K}, the generation steps specifically include: using the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ; Randomly select floating point numbers g and a as the base for encrypting plaintext m; Randomly select two positive integers L K and M K ;
[0125] The encryption module is used to encrypt the plaintext m, and the plaintext m is encrypted to obtain the ciphertext c, where ciphertext c=EncNum(L V ,R V ), the encryption steps specifically include: generating a random perturbation parameter k, where k is a bounded positive integer in the range of (L K ,M K ); Get the public key pk Paillier , using the public key pk Paillier Encrypt the random perturbation parameter k to obtain LV = Enc Paillier (k); Get random floating point numbers g, a and random perturbation parameter k, and get RV = g m×a+k ;
[0126] The decryption module is used to decrypt the ciphertext c to obtain the plaintext m, m = DecNum (c), specifically including the steps of obtaining the private key sk Paillier , using the private key sk Paillier For L in ciphertext c V The perturbation parameter k is obtained by decrypting the term, k = Dec Paillier (L V ); Obtain floating point numbers g and a, and substitute the disturbance parameter k into the formula m=log g (g ((m×a+k)-k) / a ), and get the plaintext m.
[0127] The third party performs homomorphic addition and subtraction operations. The addition operation specifically includes using the homomorphism of the Paillier encryption scheme to convert the L V The terms are added together, and the formula is: Enc Paillier (k1)+Enc Paillier (k2) = Enc Paillier (k1+k2); R in the ciphertext V Multiply the terms together, and the formula is: Get the ciphertext c3, ciphertext Similarly, the third party terminal can also be used for subtraction operation, and its technical solution is the same as above. The third party terminal sends the result of the operation to the decryption terminal.
[0128] The decryption module in the decryption end decrypts the calculated ciphertext according to the above decryption method.
[0129] The present application also includes a computer storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the above encryption method.
[0130] As shown in this application and claims, generally speaking, the terms "comprises" and "includes" only indicate the inclusion of explicitly identified steps and elements, and these steps and elements do not constitute an exclusive list, and the method or device may also include other steps or elements.
[0131] Unless otherwise specifically stated, the components, relative arrangements, functions, and numerical values described in these embodiments do not limit the scope of the present invention. At the same time, it is obvious that for ease of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship. The techniques, methods, and equipment known to ordinary technicians in the relevant fields are not described in detail, but where appropriate, the techniques, methods, and equipment should be regarded as part of the authorization specification. In all examples shown and discussed here, any specific values should be interpreted as merely exemplary and not as a limitation. Therefore, other examples of step-by-step embodiments may have different sequences.
[0132] The above is an explanation of the present invention and should not be considered as a limitation thereof. Although several exemplary embodiments of the present invention have been described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the technical features of the present invention. Therefore, all of these modifications are intended to be included within the scope of the present invention as defined in the claims. It should be understood that the above is an explanation of the present invention and should not be considered as being limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present invention is defined by the claims and their equivalents.
Claims
1. An improved additive homomorphic encryption method supporting floating-point operations, characterized in that: Includes steps: SA, generate key PaiOpt key ={pk Paillier ,sk Paillier ,g,a,L K ,M K }, the specific generation steps are include: SA-1, use the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ; SA-2, randomly select floating point numbers g and a as the base for encrypting the plaintext m; SA-3, randomly pick two positive integers L K and M K ; SB, encrypts the plaintext m, and the encrypted plaintext m is obtained as ciphertext c, ciphertext c = EncNum (L V ,R V ), the encryption steps specifically include: SB-1, generates a random perturbation parameter k, k is a bounded positive integer, the range is (L K ,M K ); SB-2, obtain the public key pk Paillier , using the public key pk Paillier Encrypt the random perturbation parameter k to obtain L V =Enc Paillier (k); SB-3, obtain random floating point numbers g, a and random perturbation parameter k, and get R V =g m×a+k ; SD, decrypts the ciphertext c to obtain the plaintext m, and the decryption steps specifically include: SD-1, using the private key sk Paillier For the L V The random perturbation parameter k is obtained by decrypting the term; SD-2, using the random floating point numbers g, a and the random perturbation parameter k to calculate the R of the ciphertext c V The decryption item is m.
2. The improved additive homomorphic encryption method supporting floating-point operations according to claim 1, characterized in that: The plaintext m and ciphertext c are respectively a plaintext set and a ciphertext set. By encrypting multiple plaintexts through the step SB, plaintexts m1 to m t Encrypted into ciphertext c1 to c t ; The encryption method further comprises step SC, performing addition or subtraction operation on the ciphertext set.
3. The improved additive homomorphic encryption method supporting floating-point operations according to claim 2, characterized in that: When the step SC is an addition operation, the step SC specifically includes: SC-1, using the homomorphism of the Paillier encryption scheme, converts the L V The terms are added together, and the formula is: Enc Paillier (k1)+Enc Paillier (k2) = Enc Paillier (k1+k2); SC-2, replace the R in the ciphertext V Multiply the terms together, and the formula is: SC-3, get ciphertext c3, ciphertext 4. The improved additive homomorphic encryption method supporting floating-point operations according to claim 2, characterized in that: When the step SC is a subtraction operation, the step SC specifically includes: SC-1, using the homomorphism of the Paillier encryption scheme, converts the L V Subtract the terms, the formula is: Enc Paillier (k1)-Enc Paillier (k2) = Enc Paillier (k1-k2); SC-2, replace the R in the ciphertext V Divide the terms, the formula is: SC-3, get ciphertext c4, ciphertext 5. The improved additive homomorphic encryption method supporting floating-point operations according to claim 1, characterized in that: The L K and M K The M K =(p+1)×L K / p, where p is a positive integer greater than 2, L K Take an integer greater than 100.
6. The improved additive homomorphic encryption method supporting floating-point operations according to claim 5, characterized in that: The p value is greater than 10.
7. The improved additive homomorphic encryption method supporting floating-point operations according to claim 1, characterized in that: The step SD is specifically to decrypt the ciphertext c to obtain the plaintext m, m=DecNum(c), which specifically includes the steps of: SD-1, get the private key sk Paillier , using the private key sk Paillier For L in ciphertext c V The random perturbation parameter k is obtained by decrypting the term, k = Dec Paillier (L V ); SD-2, obtain floating point numbers g and a, and substitute the random perturbation parameter k into the formula Get the plaintext m.
8. The improved additive homomorphic encryption method supporting floating-point operations according to claim 2, characterized in that: When the encryption method is addition, the decryption algorithm is as follows: SD1, decrypting the ciphertext after the addition operation, specifically comprising the steps of: SD1-1, get the private key sk Paillier , using the private key sk Paillier For L in the ciphertext V The random perturbation parameters k1 and k2 are obtained by decrypting the term, k1+k2=Dec Paillier (L V ); SD1-2, obtain floating point numbers g and a, and use the random perturbation parameter k1+k2 to decrypt R in the ciphertext V term, we get m1+m2, 9. The improved additive homomorphic encryption method supporting floating-point operations according to claim 2, characterized in that: When the encryption method is subtraction, the decryption algorithm is as follows: SD2, decrypting the ciphertext after the subtraction operation, specifically comprising the steps of: SD2-1, get the private key sk Paillier , using the private key sk Paillier For L in the ciphertext V The perturbation parameters k1 and k2 are obtained by decrypting the term, k1-k2=Dec Paillier (L V ); SD2-2, obtain floating point numbers g and a, and use the perturbation parameters k1-k2 to decrypt R in the ciphertext V Item, get m1-m2, 10. An improved additive homomorphic encryption system supporting floating point operations, characterized in that: Including key generation module, encryption module and decryption module, The key generation module is used to generate the key PaiOpt key ={pk Paillier ,sk Paillier ,g,a,L K ,M K }, the generation steps specifically include: using the Paillier algorithm to generate the public key pk Paillier And the private key sk Paillier ; Randomly select floating point numbers g and a as the base for encrypting plaintext m; Randomly select two positive integers L K and M K ; The encryption module is used to encrypt the plaintext m, and the plaintext m is encrypted to obtain the ciphertext c, where ciphertext c=EncNum(L V ,R V ), the encryption steps specifically include: generating a random perturbation parameter k, where k is a bounded positive integer in the range of (L K ,M K ); Get the public key pk Paillier , using the public key pk Paillier Encrypt the random perturbation parameter k to obtain L V =Enc Paillier (k); Get the random floating point numbers g, a and random perturbation parameter k, and get R V =g m×a+k ; The decryption module is used to decrypt the ciphertext c to obtain the plaintext m, m = DecNum (c), specifically including the steps of obtaining the private key sk Paillier , using the private key sk Paillier For L in ciphertext c V The perturbation parameter k is obtained by decrypting the term, k = Dec Paillier (L V ); Obtain floating point numbers g and a, and substitute the disturbance parameter k into the formula m=log g (g ((m×a+k)-k) / a ), and get the plaintext m.
