Data processing method, system and device, storage medium and program product

By obtaining the encryption parameters and the Chinese remainder theorem, the depth of the encryption circuit and the ciphertext data are determined, which solves the problem of small homomorphic encryption plaintext space, achieves expansion of the plaintext space and improvement of encryption performance, and is suitable for e-commerce transactions on cloud platforms. .

CN118764170AActive Publication Date: 2024-10-11BEIJING INFOSEC TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411218173.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-10-11
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The existing homomorphic encryption technology has a small plaintext space and a narrow application range, and cannot effectively protect user privacy and security in e-commerce transactions on cloud platforms.

Method used

By obtaining the encryption parameters, including the additive cyclic group, the multiplicative cyclic group and the generator, combined with the Chinese remainder theorem, the depth of the encryption circuit and the ciphertext data are determined to achieve homomorphic encryption and decryption of the data to be processed, and to expand the plaintext space.

Benefits of technology

It significantly improves the plaintext space of homomorphic encryption, improves encryption performance and application scope, can effectively protect larger bits of plaintext data, and is suitable for e-commerce transactions on cloud platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764170A_ABST
    Figure CN118764170A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method, system and device, a storage medium and a program product. The method comprises the following steps: acquiring encryption parameters for performing homomorphic encryption on to-be-processed data, the encryption parameters comprising a first addition cycle group, a second addition cycle group, a first generator corresponding to the first addition cycle group, a second generator corresponding to the second addition cycle group, a multiplication cycle group, a homomorphic private key and a homomorphic public key, the homomorphic public key is determined according to the first generator, the second generator, the homomorphic private key and the random number; determining the depth of an encryption circuit of the to-be-processed data; determining ciphertext data based on the depth of the encryption circuit and the encryption parameter of homomorphic encryption; and based on the depth of the encryption circuit and the homomorphic private key, decrypting the ciphertext data according to the Chinese remainder theorem to obtain a decryption result. The plaintext space of homomorphic encryption can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, system, device, storage medium and program product. Background Art

[0002] With the widespread application of cloud computing, especially the large number of e-commerce transactions 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 sensitive data to cloud service providers, which will bring a series of security issues to user confidential data. To solve this problem, homomorphic encryption technology came into being. Homomorphic encryption technology is a cryptographic technology based on the computational complexity theory of data problems. It processes the homomorphically encrypted data to obtain an output, and then decrypts this output. The decrypted result is the same as the output obtained by processing the unencrypted original plaintext data in the same way.

[0003] However, the plaintext space of homomorphic encryption in existing technologies is relatively small (generally only 32 bits) and has a narrow scope of application. Summary of the invention

[0004] Multiple aspects of the present application provide a data processing method, system, device, storage medium and program product to improve the plaintext space of homomorphic encryption.

[0005] The present application provides a data processing method, the method comprising: Obtain encryption parameters for homomorphic encryption of the processed data, the encryption parameters including: a first additive cyclic group G1, a second additive cyclic group G2, a first generator P1 corresponding to the first additive cyclic group G1, a second generator P2 corresponding to the second additive cyclic group G2, a multiplication cyclic group G T , homomorphic private key sk, homomorphic public key pk, and the multiplication cyclic group G T The homomorphic public key pk is determined according to the first generator P1, the second generator P2, the homomorphic private key sk, and the random number d, the random number d is determined based on the Chinese remainder theorem and the plaintext space T of the homomorphic encryption, the first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T Satisfies bilinear mapping; Determining the depth of the encryption circuit of the data to be processed; Determining ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption; Based on the depth of the encryption circuit and the homomorphic private key sk, the ciphertext data is decrypted according to the Chinese remainder theorem to obtain a decryption result.

[0006] In an optional embodiment, the determining the ciphertext data based on the depth of the encryption circuit and the encryption parameter of the homomorphic encryption includes: When the depth of the encryption circuit of the data to be processed is 1, based on the first generator P1, the second generator P2 and the homomorphic public key pk, the data to be processed is homomorphically encrypted to obtain ciphertext data corresponding to the data to be processed; When the depth of the encryption circuit of the data to be processed is 2, based on the multiplication cycle group G T The multiple elements g in the data to be processed are homomorphically encrypted to obtain the ciphertext data corresponding to the data to be processed.

[0007] In an optional embodiment, the homomorphic private key sk includes a first private key s1 and a second private key s2, and the decryption processing of the ciphertext data based on the depth of the encryption circuit and the homomorphic private key sk according to the Chinese remainder theorem includes: When the depth of the encryption circuit of the data to be processed is 1, decrypting the ciphertext data according to the Chinese remainder theorem based on the first private key s1 or the second private key s2; When the depth of the encryption circuit of the data to be processed is 2, the ciphertext data is decrypted based on the first private key s1 and the second private key s2 according to the Chinese remainder theorem.

[0008] In an optional embodiment, the homomorphic public key pk includes a first public key Q1 and a second public key Q2, and the multiple elements g include a first element g1, a second element g2, a third element g3, and a fourth element g4; The first element g1 is obtained by performing a bilinear mapping calculation on the first generator P1 of the first additive cyclic group G1 and the second generator P2 of the second additive cyclic group G2; The second element g2 is obtained by performing a bilinear mapping calculation on the first generator P1 and the second public key Q2; The third element g3 is obtained by performing a bilinear mapping calculation on the first public key Q1 and the second generator P2; The fourth element g4 is obtained by performing bilinear mapping calculation on the first public key Q1 and the second public key Q2.

[0009] In an optional embodiment, the ciphertext data includes first ciphertext data and second ciphertext data, and after determining the ciphertext data based on the depth of the encryption circuit and the encryption parameter of the homomorphic encryption, the method further includes: Based on the depth of the encryption circuit, homomorphic calculation is performed on the first ciphertext data and the second ciphertext data.

[0010] In an optional embodiment, the data to be processed includes first data to be processed and second data to be processed, and the performing homomorphic calculation on the first ciphertext data and the second ciphertext data based on the depth of the encryption circuit includes: When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 1, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, Performing an addition operation on the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data which have a corresponding relationship; When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 2, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship are multiplied.

[0011] In an optional embodiment, the method further includes: Based on the decryption result, the correctness of the addition operation and the multiplication operation is verified.

[0012] The present application also provides a data processing system, the system comprising: An acquisition module is used to acquire encryption parameters for homomorphic encryption of the processed data, wherein the encryption parameters include: a first additive cyclic group G1, a second additive cyclic group G2, a first generator P1 corresponding to the first additive cyclic group G1, a second generator P2 corresponding to the second additive cyclic group G2, a multiplication cyclic group G T , homomorphic private key sk, homomorphic public key pk, and the multiplication cyclic group G T The homomorphic public key pk is determined according to the first generator P1, the second generator P2, the homomorphic private key sk, and the random number d, the random number d is determined based on the Chinese remainder theorem and the plaintext space T of the homomorphic encryption, the first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T Satisfies bilinear mapping; A determination module, used to determine the depth of the encryption circuit of the data to be processed; An encryption module, used to determine ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption; The decryption module is used to decrypt the ciphertext data based on the homomorphic private key sk and according to the Chinese remainder theorem to obtain a decryption result.

[0013] An embodiment of the present application also provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the above-mentioned data processing method.

[0014] An embodiment of the present application also provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes the above-mentioned data processing method.

[0015] An embodiment of the present application further provides a computer program product, which includes: a computer program, which, when executed by a processor of an electronic device, enables the processor to execute the above-mentioned data processing method.

[0016] In an embodiment of the present application, by obtaining encryption parameters for homomorphic encryption of the data to be processed, and determining the depth of the encryption circuit of the data to be processed, the ciphertext data is determined based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption, the depth factor of the encryption circuit can be fully considered, and the present solution is used to homomorphically encrypt the data to be processed, which can improve the encryption performance of the data homomorphic encryption. Furthermore, by combining the Chinese remainder theorem in the process of obtaining the encryption parameters, and after determining the ciphertext data, the ciphertext data is decrypted according to the Chinese remainder theorem based on the depth of the encryption circuit and the homomorphic private key sk to obtain the decryption result, the larger bit of plaintext data can be split and encrypted during the encryption process, and merged into a complete plaintext during decryption, that is, the present application can increase the plaintext space and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A schematic diagram of the principle of homomorphic encryption provided for an exemplary embodiment of the present application; Figure 2 A flowchart of a data processing method provided for an exemplary embodiment of the present application; Figure 3 A schematic diagram of the structure of a data processing system provided for an exemplary embodiment of the present application; Figure 4 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0019] With the widespread application of cloud computing, especially the large number of e-commerce transactions on cloud platforms, how to safely and effectively protect user privacy and security has become a hot topic in the field of cryptography research today. If data is stored in plain text, it is possible to expose sensitive data to cloud service providers, which will bring a series of security issues to user confidential data. To solve this problem, homomorphic encryption technology came into being. Homomorphic encryption technology is a cryptographic technology based on the computational complexity theory of data problems. The data that has been homomorphically encrypted is processed to obtain an output, and this output is decrypted. The decrypted result is the same as the output result obtained by processing the unencrypted original plaintext data in the same way. However, the plaintext space of homomorphic encryption in the prior art is small (generally only 32 bits) and has a narrow scope of application. In view of this, an embodiment of the present application provides a data processing method.

[0020] Before introducing the methods provided by the embodiments of the present application, in order to facilitate understanding of the present solution, the terms involved in the present application are first explained: Homomorphic encryption (HE) refers to an encryption algorithm that satisfies the homomorphic operation property of ciphertext. That is, after the data is homomorphically encrypted to obtain the corresponding ciphertext data, a specific calculation is performed on the ciphertext data. The calculation result of the ciphertext data is equivalent to the plaintext directly after the corresponding homomorphic decryption, which realizes the "computable but invisible" data. The implementation effect of homomorphic encryption can be seen in Figure 1 Schematic diagram of the homomorphic encryption principle shown.

[0021] Chinese Remainder Theorem: Also known as "Sun Tzu's Theorem", is an ancient Chinese method for solving linear congruence groups (see congruence). It is an important theorem in number theory and is widely used in cryptography.

[0022] Depth of a cryptographic circuit: refers to the number of levels or steps required to complete an encryption or decryption operation.

[0023] The following is a detailed introduction to the methods provided in each embodiment of the present application.

[0024] The execution subject of the methods provided in the following embodiments may be the corresponding devices. For example, the execution subject of the data processing scheme provided in one embodiment may be the corresponding data processing device. The device may be a hardware with an embedded program integrated on an electronic device, or it may be an application software installed in the electronic device, or it may be a tool software embedded in the device operating system, etc., which is not limited in the embodiments of the present application. The above-mentioned electronic device may be a client or server with a logical operation function; wherein the client may be any terminal device such as a mobile phone, a tablet computer, a smart wearable device, etc., and the server may be a common server, a cloud or a virtual server, etc., which is not specifically limited in the embodiments of the present application.

[0025] Figure 2 Flow chart of the data processing method provided in the embodiment of the present application. Figure 2 As shown, the method comprises the following steps: 201. Obtain encryption parameters for homomorphic encryption of the data to be processed, the encryption parameters including: a first additive cyclic group G1, a second additive cyclic group G2, a first generator P1 corresponding to the first additive cyclic group G1, a second generator P2 corresponding to the second additive cyclic group G2, a multiplication cyclic group G T , homomorphic private key sk, homomorphic public key pk, and multiplicative cyclic group G T The homomorphic public key pk is determined according to the first generator P1, the second generator P2, the homomorphic private key sk, and the random number d, the random number d is determined based on the Chinese remainder theorem and the plaintext space T of homomorphic encryption, the first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T Satisfies bilinear mapping.

[0026] 202. Determine the depth of the encryption circuit of the data to be processed.

[0027] 203. Determine ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption.

[0028] 204. Based on the depth of the encryption circuit and the homomorphic private key, the ciphertext data is decrypted according to the Chinese remainder theorem to obtain the decryption result.

[0029] In practical applications, the type of data to be processed can be audio and video data in the audio and video transmission process, or it can also be text data, image data, etc. in the file information transmission process. It can be determined according to the application scenario of data encryption and is not limited here.

[0030] In specific implementation, the embodiment of the present application includes at least the following stages: 1. Key generation phase: S1. The SM9 identification cryptographic algorithm (hereinafter referred to as the SM9 algorithm) can be used to determine the encryption parameters used for homomorphic encryption of the data to be processed. The SM9 algorithm is a cryptographic algorithm based on bilinear pairings on elliptic curve point groups, which includes four functions: digital signature, public key encryption, key encapsulation, and key exchange; among them, the bilinear pairing refers to the joint mapping of the first additive cyclic group G1 and the second additive cyclic group G2 to another multiplicative cyclic group G T In elliptic cryptography applications, bilinear pairing is a mapping of two elliptic curve cyclic point groups to a multiplicative cyclic group while satisfying linear invariance. The first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T The order of is the number of its elements is a prime number, and the first generator P1 and the second generator P2 are the generators of the first additive cyclic group G1 and the second additive cyclic group G2 respectively. The bilinear pairing e is a mapping G1×G2→GT.

[0031] The system parameters required by the above SM9 algorithm (G1, G2, G T , e, P1, P2), can be selected using the Key Generation Center (KGC). The KGC is a trusted organization in the SM9 cryptographic system, which is mainly used to select SM9 algorithm system parameters, generate master keys (master private keys) and generate private keys, etc.

[0032] S2, two randomly generated integers can be used as the first private key s1 and the second private key s2 contained in the homomorphic private key sk. , is a finite field modulo p.

[0033] Corresponding to the homomorphic private key, the homomorphic public key determined above also contains two public keys, namely the first public key Q1 and the second public key Q2. In specific implementation, the first public key Q1 and the second public key Q2 can be determined based on the first private key s1, the second private key s2, the first generator P1 and the second generator P2. The specific calculation formula is as follows: , .

[0034] S3, random selection , and satisfy , for example, when hour, is 32 bits. Among them, n can be 32 bits, and T is the plaintext space. Specifically, it should be understood that, assuming that the plaintext m is 256 bits, in actual encryption, only 32 bits of data can be encrypted (because if the amount of encrypted data is too large, the subsequent decryption cannot be successfully completed). In view of this, the present application uses the Chinese remainder theorem to split the 256-bit plaintext m into 8 32-bit sub-plaintexts m i, such as m1, m2...m8, and then concatenated to form the complete ciphertext data. In the specific implementation, assume that there are 8 , each is 32 bits, and the plaintext m is used to take the modulus, for example, Modulo can get m1, right By taking the modulus, you can get m2, and so on, until you get m8. Then concatenating m1, m2...m8 together will give you the complete ciphertext data.

[0035] S4. Based on the above S1-S3, output the private key , public key .

[0036] S5. Precompute the multiplication cycle group G T The multiple elements g in . The multiple elements g include a first element g1, a second element g2, a third element g3 and a fourth element g4. Among them, the first element g1 is obtained by performing a bilinear mapping calculation on the first generator P1 of the first additive cyclic group G1 and the second generator P2 of the second additive cyclic group G2; the second element g2 is obtained by performing a bilinear mapping calculation on the first generator P1 and the second public key Q2; the third element g3 is obtained by performing a bilinear mapping calculation on the first public key Q1 and the second generator P2; the fourth element g4 is obtained by performing a bilinear mapping calculation on the first public key Q1 and the second public key Q2. The calculation expressions of the above-mentioned first element g1, second element g2, third element g3 and fourth element g4 are as follows: .

[0037] It should be noted that, among the encryption parameters determined above, except for the homomorphic private key which will be hidden from the outside, some other parameters, such as the generators of the additive cyclic group, the homomorphic public key, and the multiple elements contained in the multiplicative cyclic group, can be made public for use in decryption calculation and analysis.

[0038] 2. Encryption stage: S1. Determine the depth of the encryption circuit of the data to be processed. The purpose of this step is: according to the depth of the encryption circuit corresponding to the data to be processed (which can also be understood as the encryption level), different parameters in the determined encryption parameters will be used to perform homomorphic encryption processing on the data to be processed, so as to improve the encryption performance of homomorphic encryption of the data to be processed. Among them, the depth of the encryption circuit is used to reflect the encryption of the data to be processed with a depth of L, L is an integer and 0<L≤2, that is, the value of L is 1 and 2. For example, if the depth of the encryption circuit is 1, it reflects that the data to be processed is encrypted at the first level; and if the depth of the encryption circuit is 2, it reflects that the data to be processed is encrypted at the second level, and it also indicates that the data to be processed is data that has been encrypted at one level.

[0039] S2. Determine the ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption, which specifically includes the following steps: when the depth of the encryption circuit of the data to be processed is 1, perform homomorphic encryption on the data to be processed based on the first generator P1, the second generator P2 and the homomorphic public key pk to obtain the ciphertext data corresponding to the data to be processed; when the depth of the encryption circuit of the data to be processed is 2, perform homomorphic encryption on the data to be processed based on the multiplication cyclic group G T Multiple elements g in the data to be processed are homomorphically encrypted to obtain the ciphertext data corresponding to the data to be processed.

[0040] In the specific implementation, it is assumed that the data to be processed (that is, the input message m) ,M is the message space, satisfying .

[0041] When the depth of the encryption circuit of the data to be processed is 1, a first random number is generated. ,in, .calculate . After that, the ciphertext data is calculated as follows: The ciphertext data corresponding to the data to be processed is , the first ciphertext data is C i1 , the second ciphertext data is C i2 , the first ciphertext is c i1 , the second ciphertext is c i2 , the third ciphertext is c i3 , the fourth ciphertext is c i4 , then the ciphertext data corresponding to the data to be processed The expression can be as follows: in, , , Enc represents the encryption operator symbol, =( ), =( ), the following describes in detail how to determine the first ciphertext is c i1 , the second ciphertext is c i2 , the third ciphertext is c i3 , the fourth ciphertext is c i4 : First, calculate the first product value of the scalar of the data to be processed and the first generator P1, the first random number The scalar of the first public key Q1 and the second product value, and then the sum of the first product value and the second product value is used as the first ciphertext c i1 , then: c i1 = .

[0042] The first random number The product of the scalar of and the first generator P1 is used as the second ciphertext c i2 That is, c i2 = .

[0043] Calculate the second product value of the scalar of the data to be processed and the second generator P2, the second random number The scalar of the second public key Q2 is multiplied by the second product value, and then the sum of the first product value and the second product value is used as the third ciphertext c i3 , then: c i3 = .

[0044] The second random number The product of the scalar of and the second generator P2 is used as the fourth ciphertext c i4 That is, c i4 = .

[0045] According to the first ciphertext c i1 , the second ciphertext is c i2 , the third ciphertext is c i3 , the fourth ciphertext is c i4 , the ciphertext data corresponding to the data to be processed can be determined .

[0046] When the depth of the encryption circuit of the data to be processed is 2, a third random number is generated , the fourth random number and the fifth random number ,Should . After that, the ciphertext data is calculated as follows: Data to be processed As the power of the first element g1, with the fifth random number as the power of the fourth element g4, and then the first element g1 The power of the fourth element g4 The product value of the power is used as the fifth ciphertext, that is, the fifth ciphertext = .

[0047] With the third random number As the power of the second element g2, the second element g2 The sixth ciphertext is the power of = .

[0048] With the fourth random number As the power of the third element g3, The seventh ciphertext is the power of = .

[0049] Calculate the third random number With the fourth random number The sum of the values ​​is added to the fifth random number The difference between them is taken as the power of the first element g1, and then the power of the difference of the first element g1 is taken as the eighth ciphertext, that is, the eighth ciphertext = .

[0050] According to the fifth ciphertext 、The sixth ciphertext 、The seventh ciphertext 、The eighth ciphertext , determine the ciphertext data corresponding to the data to be processed , .

[0051] 3. Decryption stage: Based on the depth of the encryption circuit and the homomorphic private key sk, the ciphertext data is decrypted according to the Chinese remainder theorem, specifically including the following steps: when the depth of the encryption circuit of the data to be processed is 1, the ciphertext data is decrypted according to the Chinese remainder theorem based on the first private key s1 or the second private key s2; when the depth of the encryption circuit of the data to be processed is 2, the ciphertext data is decrypted according to the Chinese remainder theorem based on the first private key s1 and the second private key s2. Specifically: When the depth of the encryption circuit for the data to be processed is 1, from the ciphertext data shown above It can be seen that the ciphertext data The first ciphertext contained is c i1 , the second ciphertext is c i2 , the third ciphertext is c i3 , the fourth ciphertext is c i4 Among these four ciphertexts, only the first ciphertext c i1 and the third ciphertext c i3 is the data to be processed m i The second ciphertext c i2 and the fourth ciphertext c i4 It does not carry any data to be processed m i , where the second ciphertext c i2 and the fourth ciphertext c i4 It plays a confusing role. When decrypting to recover the corresponding data to be processed, the first ciphertext c can be decrypted using the corresponding private key. i1 Or the third ciphertext c i3 Just decrypt it.

[0052] For example, for the first ciphertext c i1 Decrypt to recover the data to be processed m i For example, due to c i1 = ,in, , Represents the first private key, so c i1 = , and because c i2 = , which can be simplified to: , and then use the first private key , by solving the elliptic curve discrete logarithm problem (ECDLP) to obtain the data to be processed (i.e. plaintext) Specifically, when solving the ECDLP problem, the Pollard rho algorithm may be used but is not limited to it.

[0053] For another example, for the third ciphertext c i3 Decrypt to recover the data to be processed m i For example, due to c i3 = ,in, , Represents the second private key, so c i3 = , and because c i4 = , which can be simplified to: , and then use the second private key , by solving the elliptic curve discrete logarithm problem (ECDLP) to obtain the data to be processed (i.e. plaintext) Specifically, when solving the ECDLP problem, the Pollard rho algorithm may be used but is not limited to it.

[0054] Based on the above two examples, the Chinese remainder theorem is used to recover the data to be processed (i.e., plain text) m. It should be understood that the above m i It is called the data to be processed for ease of understanding. i The set m formed is called the complete data to be processed. Specifically, calculate ,but . It should be noted that when decrypting multiple m i After that, you need to put multiple m i Restore to the complete plaintext m, but if you just simply i The complete plaintext m cannot be restored by splicing. In view of this, this application uses the Chinese remainder theorem, that is, the above The formula completes thei of merger.

[0055] When the depth of the encryption circuit for the data to be processed is 2, from the ciphertext data shown above It can be seen that the ciphertext data The fifth ciphertext contained 、The sixth ciphertext 、The seventh ciphertext 、The eighth ciphertext Of these four ciphertexts, only the fifth ciphertext Is carrying m i The sixth ciphertext 、The seventh ciphertext 、The eighth ciphertext It does not carry m i , here the sixth ciphertext 、The seventh ciphertext 、The eighth ciphertext It plays a confusing role. When decrypting to recover the corresponding plaintext m, the corresponding private key can be used to decrypt the fifth ciphertext Specifically, the fifth ciphertext 、The sixth ciphertext 、The seventh ciphertext 、The eighth ciphertext The corresponding formula can be obtained: Based on this formula, the first private key s1 and the second private key s2 can be used to solve the ECDLP problem to obtain the data to be processed (i.e., plaintext). Specifically, when solving the ECDLP problem, the Pollard rho algorithm may be used but is not limited to it.

[0056] Based on the above example, the Chinese remainder theorem is used to recover the data to be processed (i.e., plain text) m. It should be understood that the above mi is called the data to be processed for ease of understanding. In fact, the set m composed of mi is called the complete data to be processed. Specifically, calculate ,but . It should be noted that when decrypting multiple m i After that, you need to put multiple m i Restore to the complete plaintext m, but if you just simply i The complete plaintext m cannot be restored by splicing. In view of this, this application uses the Chinese remainder theorem, that is, the above The formula completes the i of merger.

[0057] Based on the above, the data processing method provided by the embodiment of the present application, by obtaining the encryption parameters for homomorphic encryption of the data to be processed, and determining the depth of the encryption circuit of the data to be processed, based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption, the ciphertext data is determined, and the depth factor of the encryption circuit can be fully considered. By using this scheme to homomorphically encrypt the data to be processed, the encryption performance of the data homomorphic encryption can be improved. Further, by combining the Chinese remainder theorem in the process of obtaining the encryption parameters, and after determining the ciphertext data, based on the depth of the encryption circuit and the homomorphic private key sk, the ciphertext data is decrypted according to the Chinese remainder theorem to obtain the decryption result, the larger bit of plaintext data can be split and encrypted during the encryption process, and merged into a complete plaintext during decryption, that is, the present application can improve the plaintext space, and the application range is wide. For ease of understanding, for example, the plaintext space of the prior art is generally only 32 bits, and by using this scheme, the plaintext space can be increased to 256 bits, and the plaintext space can be significantly improved.

[0058] In an embodiment of the present application, the ciphertext data includes first ciphertext data and second ciphertext data. Based on the depth of the encryption circuit and the encryption parameters of homomorphic encryption, after determining the ciphertext data, the method further includes: performing homomorphic calculations on the first ciphertext data and the second ciphertext data based on the depth of the encryption circuit. Specifically, the data to be processed includes first ciphertext data and second ciphertext data to be processed. Based on the depth of the encryption circuit, performing homomorphic calculations on the first ciphertext data and the second ciphertext data includes: When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 1, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, an addition operation is performed on the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, which have a corresponding relationship; When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 2, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship are multiplied.

[0059] In a specific implementation, when the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 1, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship are added. The specific expression is as follows: , When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 2, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship are added. The specific expression is as follows: . When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 2, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data having the corresponding relationship are multiplied, wherein the ciphertext in the first ciphertext data , the ciphertext in the second ciphertext data Based on this, the specific expression of the multiplication operation is as follows: Through the above homomorphic calculation, ciphertext data (ie, first ciphertext data and second ciphertext data) with better encryption performance can be obtained, and the calculation efficiency between ciphertext data can be effectively improved.

[0060] Furthermore, in order to ensure the correctness of the homomorphic operation result obtained by performing the homomorphic operation on the first ciphertext data and the second ciphertext data, the correctness of the homomorphic operation result may also be verified.

[0061] In specific implementation, when the depth of the encryption circuit of the data to be processed is 1, the ciphertext data , using the private key , by solving the elliptic curve discrete logarithm problem (ECDLP) to obtain the data to be processed (i.e. plaintext) Specifically, when solving the ECDLP problem, the Pollardrho algorithm can be used but is not limited to it. On this basis, the Chinese remainder theorem is used to recover the data to be processed (i.e., plain text) m. It should be understood that the above m i It is called the data to be processed for ease of understanding. i The set m formed is called the complete data to be processed. Specifically, calculate ,but . When the depth of the encryption circuit of the data to be processed is 2, , using the private key get: , , and then obtain the data to be processed (i.e. plaintext) by solving the elliptic curve discrete logarithm problem (ECDLP) Specifically, when solving the ECDLP problem, the Pollard rho algorithm can be used but is not limited to it. On this basis, the Chinese remainder theorem is used to recover the data to be processed (ie, plaintext) m. It should be understood that the above m i It is called the data to be processed for ease of understanding. i The set m formed is called the complete data to be processed. Specifically, calculate ,but . Based on the above, during the verification process, the result of the homomorphic operation can be decrypted to obtain a decrypted result; then the first data to be processed and the second data to be processed are directly subjected to the calculation processing corresponding to the homomorphic operation to obtain the corresponding calculation result. For example, if the homomorphic operation is a homomorphic addition operation, then the first data to be processed and the second data to be processed are directly subjected to an addition operation; finally, the decryption result is compared with the calculation result. If the decryption result is consistent with the calculation result (i.e., the same), the homomorphic operation result is determined to be correct. Otherwise, if the decryption result is inconsistent with the calculation result, the homomorphic operation result is determined to be incorrect.

[0062] Specifically, if the decryption result is consistent with the calculation result obtained by directly performing an addition operation on the first data to be processed and the second data to be processed, it means that the homomorphic addition operation result obtained by performing a homomorphic addition operation on the first ciphertext data and the second ciphertext data is correct; on the contrary, if the decryption result is inconsistent with the calculation result obtained by directly performing an addition operation on the first data to be processed and the second data to be processed, it means that the homomorphic addition operation result obtained by performing a homomorphic addition operation on the first ciphertext data and the second ciphertext data is wrong. Similarly, for multiplication operation, if the decryption result is consistent with the calculation result obtained by directly performing a multiplication operation on the first data to be processed and the second data to be processed, it means that the homomorphic multiplication operation result obtained by performing a homomorphic multiplication operation on the first ciphertext data and the second ciphertext data is correct; on the contrary, if the decryption result is inconsistent with the calculation result obtained by directly performing a multiplication operation on the first data to be processed and the second data to be processed, it means that the homomorphic multiplication operation result obtained by performing a homomorphic multiplication operation on the first ciphertext data and the second ciphertext data is wrong.

[0063] In summary, the present application can effectively improve the performance of homomorphic encryption, can calculate any number of addition homomorphic calculations and one multiplication homomorphic ciphertext calculation, and the plaintext space is significantly improved compared to the original algorithm space.

[0064] Figure 3 A structural diagram of a data processing system provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the system includes: an acquisition module 31, a determination module 32, an encryption module 33 and a decryption module 34.

[0065] The acquisition module 31 is used to obtain encryption parameters for homomorphic encryption of the processed data, and the encryption parameters include: a first additive cyclic group G1, a second additive cyclic group G2, a first generator P1 corresponding to the first additive cyclic group G1, a second generator P2 corresponding to the second additive cyclic group G2, a multiplication cyclic group G T , homomorphic private key sk, homomorphic public key pk, and multiplicative cyclic group G T The homomorphic public key pk is determined according to the first generator P1, the second generator P2, the homomorphic private key sk, and the random number d, the random number d is determined based on the Chinese remainder theorem and the plaintext space T of homomorphic encryption, the first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T Satisfies bilinear mapping.

[0066] The determination module 32 is used to determine the depth of the encryption circuit of the data to be processed.

[0067] The encryption module 33 is used to determine the ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption.

[0068] The decryption module 34 is used to decrypt the ciphertext data based on the homomorphic private key sk and according to the Chinese remainder theorem to obtain a decryption result.

[0069] Optionally, the determination module 32 is specifically used to: when the depth of the encryption circuit of the data to be processed is 1, based on the first generator P1, the second generator P2 and the homomorphic public key pk, perform homomorphic encryption on the data to be processed to obtain the ciphertext data corresponding to the data to be processed; when the depth of the encryption circuit of the data to be processed is 2, based on the multiplication cyclic group G T The multiple elements g in the data to be processed are homomorphically encrypted to obtain the ciphertext data corresponding to the data to be processed.

[0070] Optionally, the decryption module 34 is specifically used for: when the depth of the encryption circuit of the data to be processed is 1, decrypting the ciphertext data based on the first private key s1 or the second private key s2 according to the Chinese remainder theorem; when the depth of the encryption circuit of the data to be processed is 2, decrypting the ciphertext data based on the first private key s1 and the second private key s2 according to the Chinese remainder theorem.

[0071] Optionally, the homomorphic public key pk includes a first public key Q1 and a second public key Q2, and the multiple elements g include a first element g1, a second element g2, a third element g3 and a fourth element g4; the first element g1 is obtained by performing a bilinear mapping calculation on a first generator P1 of a first additive cyclic group G1 and a second generator P2 of a second additive cyclic group G2; the second element g2 is obtained by performing a bilinear mapping calculation on the first generator P1 and the second public key Q2; the third element g3 is obtained by performing a bilinear mapping calculation on the first public key Q1 and the second generator P2; the fourth element g4 is obtained by performing a bilinear mapping calculation on the first public key Q1 and the second public key Q2.

[0072] Optionally, the system further includes: a computing module, configured to perform homomorphic computing on the first ciphertext data and the second ciphertext data based on a depth of the encryption circuit.

[0073] Optionally, the calculation module is specifically used to: when the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 1, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, perform an addition operation on the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship; when the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 2, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, perform a multiplication operation on the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship.

[0074] Optionally, the system further includes: a verification module, configured to verify the correctness of the addition operation and the multiplication operation based on the decryption result.

[0075] In one possible design, the above Figure 3 The structure of the system shown can be implemented as an electronic device. Figure 4 As shown, the electronic device may include: a processor 41, a memory 42, and a communication interface 43. The memory 42 stores executable codes, and when the executable codes are executed by the processor 41, the processor 41 can at least implement the data processing method provided in the above embodiments.

[0076] In addition, an embodiment of the present application provides a non-temporary machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the data processing method provided in the aforementioned embodiment.

[0077] In addition, an embodiment of the present application provides a computer program product, which includes: a computer program, when the computer program is executed by a processor of an electronic device, the processor can at least implement the data processing method provided in the aforementioned embodiment.

[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0079] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0082] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0083] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0084] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0085] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0086] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A data processing method, characterized in that: include: Obtain encryption parameters for homomorphic encryption of the processed data, the encryption parameters including: a first additive cyclic group G1, a second additive cyclic group G2, a first generator P1 corresponding to the first additive cyclic group G1, a second generator P2 corresponding to the second additive cyclic group G2, a multiplication cyclic group G T , homomorphic private key sk, homomorphic public key pk, and the multiplication cyclic group G T The homomorphic public key pk is determined according to the first generator P1, the second generator P2, the homomorphic private key sk, and the random number d, the random number d is determined based on the Chinese remainder theorem and the plaintext space T of the homomorphic encryption, the first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T Satisfies bilinear mapping; Determining the depth of the encryption circuit of the data to be processed; Determining ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption; Based on the depth of the encryption circuit and the homomorphic private key sk, the ciphertext data is decrypted according to the Chinese remainder theorem to obtain a decryption result.

2. The method according to claim 1, characterized in that The determining of ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption includes: When the depth of the encryption circuit of the data to be processed is 1, based on the first generator P1, the second generator P2 and the homomorphic public key pk, the data to be processed is homomorphically encrypted to obtain ciphertext data corresponding to the data to be processed; When the depth of the encryption circuit of the data to be processed is 2, based on the multiplication cycle group G T The multiple elements g in the data to be processed are homomorphically encrypted to obtain the ciphertext data corresponding to the data to be processed.

3. The method according to claim 1, characterized in that The homomorphic private key sk includes a first private key s1 and a second private key s2, and the decryption process of the ciphertext data based on the depth of the encryption circuit and the homomorphic private key sk and the Chinese remainder theorem includes: When the depth of the encryption circuit of the data to be processed is 1, decrypting the ciphertext data according to the Chinese remainder theorem based on the first private key s1 or the second private key s2; When the depth of the encryption circuit of the data to be processed is 2, the ciphertext data is decrypted based on the first private key s1 and the second private key s2 according to the Chinese remainder theorem.

4. The method according to claim 1, characterized in that: The homomorphic public key pk includes a first public key Q1 and a second public key Q2, and the multiple elements g include a first element g1, a second element g2, a third element g3 and a fourth element g4; The first element g1 is obtained by performing a bilinear mapping calculation on the first generator P1 of the first additive cyclic group G1 and the second generator P2 of the second additive cyclic group G2; The second element g2 is obtained by performing a bilinear mapping calculation on the first generator P1 and the second public key Q2; The third element g3 is obtained by performing a bilinear mapping calculation on the first public key Q1 and the second generator P2; The fourth element g4 is obtained by performing bilinear mapping calculation on the first public key Q1 and the second public key Q2.

5. The method according to claim 1, characterized in that The ciphertext data includes first ciphertext data and second ciphertext data. After the ciphertext data is determined based on the depth of the encryption circuit and the encryption parameter of the homomorphic encryption, the method further includes: Based on the depth of the encryption circuit, homomorphic calculation is performed on the first ciphertext data and the second ciphertext data.

6. The method according to claim 5, characterized in that The data to be processed includes first data to be processed and second data to be processed, and the performing homomorphic calculation on the first ciphertext data and the second ciphertext data based on the depth of the encryption circuit includes: When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 1, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, Performing an addition operation on the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data which have a corresponding relationship; When the depth of the encryption circuit corresponding to the first data to be processed and the second data to be processed is 2, according to the corresponding relationship between the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data, the ciphertext in the first ciphertext data and the ciphertext in the second ciphertext data that have a corresponding relationship are multiplied.

7. The method according to claim 6, characterized in that Also includes: Based on the decryption result, the correctness of the addition operation and the multiplication operation is verified.

8. A data processing system, characterized in that: include: An acquisition module is used to acquire encryption parameters for homomorphic encryption of the processed data, wherein the encryption parameters include: a first additive cyclic group G1, a second additive cyclic group G2, a first generator P1 corresponding to the first additive cyclic group G1, a second generator P2 corresponding to the second additive cyclic group G2, a multiplication cyclic group G T , homomorphic private key sk, homomorphic public key pk, and the multiplication cyclic group G T The homomorphic public key pk is determined according to the first generator P1, the second generator P2, the homomorphic private key sk, and the random number d, the random number d is determined based on the Chinese remainder theorem and the plaintext space T of the homomorphic encryption, the first additive cyclic group G1, the second additive cyclic group G2 and the multiplicative cyclic group G T Satisfies bilinear mapping; A determination module, used to determine the depth of the encryption circuit of the data to be processed; An encryption module, used to determine ciphertext data based on the depth of the encryption circuit and the encryption parameters of the homomorphic encryption; The decryption module is used to decrypt the ciphertext data based on the homomorphic private key sk and according to the Chinese remainder theorem to obtain a decryption result.

9. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the method as claimed in any one of claims 1 to 7.

10. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to perform the method as claimed in any one of claims 1 to 7.

11. A computer program product, characterized in that include: A computer program, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data homomorphic encryption and decryption method and device for realizing privacy protection

    CN110348231A

  • Semi-homomorphic encryption Internet of Things privacy protection scheme based on block chain

    CN118473635A

  • Encrypting device, decrypting device, cryptosystem including the same devices, encrypting method, and decrypting method

    US20040208317A1