Homomorphic encryption system and method based on integer polynomial ring, homomorphic encryption apparatus
Patent Information
- Application Number
- CN202211356473.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-11-01
AI Technical Summary
制约同态加密计算硬件处理系统效能的瓶颈主要是计算能力和数据传输效率
[0019]上述实施例中公开的同态加密系统,包括密文生成装置和密文获取装置。密文生成装置用于基于整数多项式环对明文数据进行同态加密计算,以获取随机数种子数据、压缩公钥和压缩密文;其中,压缩公钥和压缩密文是将公钥数据和密文数据中的多项式被随机数种子数据中的随机数种子替换。密文获取装置,用于依据随机数种子数据、压缩公钥和压缩密文获取密文数据和公钥数据。由于将公钥数据和密文数据中的多项式替换成随机数种子,大大降低了同态数据传输的数据量,进而提高了同态加密运算时的数据传输效率。
Smart Images

Figure CN117318909B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data security protection technology, specifically to a homomorphic encryption system and method, and a homomorphic encryption device based on integer polynomial rings. Background Technology
[0002] With the rapid development of internet technology, an ever-increasing volume of data is being transmitted, stored, and processed. Much of this data is critical, encrypted, secure, or private. Private data, in particular, may be protected by confidentiality laws and regulations. Users typically protect their data by encrypting it to prevent malicious insiders, external attackers, or accidental exposure. Traditional encryption mechanisms can protect data during transmission and storage. However, in the data usage phase, encrypted data often requires decryption before processing, making plaintext data highly vulnerable to attacks. Academia and industry have been proposing various solutions to address this challenge, such as homomorphic encryption.
[0003] Homomorphic encryption (HE) is a widely used cryptographic tool. It's an encryption algorithm that satisfies the homomorphic operation property of ciphertext. This means that after data is homomorphically encrypted, performing a specific computation on the ciphertext yields a ciphertext that, when homomorphically decrypted, results in plaintext that is equivalent to performing the same computation directly on the plaintext data, achieving "computable but invisible" data. Therefore, it is widely used in privacy-preserving scenarios such as cloud computing services, outsourced computing, and federated learning, representing a direction in emerging privacy technologies. The bottlenecks limiting the performance of homomorphic encryption computing hardware processing systems are primarily computational power and data transmission efficiency. Homomorphic encryption application systems generally include a homomorphic encryption end, a homomorphic computation end, and a homomorphic decryption end. Data transmission efficiency mainly considers data transmission between any two ends and within the internal hardware processing system of any end. Improving the data transmission efficiency of homomorphic encryption computing hardware processing systems is currently the main research direction for homomorphic encryption. Summary of the Invention
[0004] The main technical problem addressed in this application is how to improve data transmission efficiency when used for homomorphic encryption operations.
[0005] In one aspect, one embodiment provides a homomorphic encryption system based on an integer polynomial ring, including a ciphertext generation device and a ciphertext acquisition device;
[0006] A ciphertext generation device is used to perform homomorphic encryption calculations on plaintext data based on an integer polynomial ring to obtain homomorphically encrypted data. The homomorphically encrypted data includes random number seed data, a compressed public key, and compressed ciphertext. The ciphertext generation device is further used to select a polynomial from the integer polynomial ring based on a random number seed in the random number seed data. The selected polynomial is used to generate public key data, and the polynomial contained in the public key data is replaced with the random number seed to serve as the compressed public key. There is a one-to-one correspondence between the replaced polynomial in the public key data and the random number seed used for replacement. The ciphertext generation device is also used to select a polynomial from the integer polynomial ring based on a random number seed in the random number seed data. The selected polynomial is used to perform homomorphic encryption operations on the plaintext data to obtain ciphertext data, and the polynomial contained in the ciphertext data is replaced with the random number seed to serve as the compressed ciphertext. There is a one-to-one correspondence between the replaced polynomial in the ciphertext data and the random number seed used for replacement.
[0007] A ciphertext acquisition device is used to acquire the ciphertext data and the public key data based on the homomorphic encrypted data.
[0008] Secondly, one embodiment provides a homomorphic encryption device based on an integer polynomial ring, including a random number generation unit, a polynomial acquisition unit, a homomorphic operation unit, and a compression unit;
[0009] The random number generation unit generates random number seed data, which includes a random number seed.
[0010] The polynomial acquisition unit is used to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data, wherein each random number seed corresponds to a polynomial selected from the integer polynomial ring;
[0011] The homomorphic operation unit is used to generate public key data from the polynomial selected from the integer polynomial ring; the homomorphic operation unit is also used to perform homomorphic encryption calculation on the polynomial selected from the integer polynomial ring and the plaintext data to obtain the ciphertext data;
[0012] The compression unit is used to replace the polynomial in the public key data and the ciphertext data with a random number seed corresponding to the polynomial, and output the replaced public key data and ciphertext data as the compressed ciphertext and the compressed public key.
[0013] Thirdly, one embodiment provides a homomorphic encryption method based on an integer polynomial ring, comprising:
[0014] Generate random number seed data; the random number seed data includes a random number seed.
[0015] A polynomial is selected from the integer polynomial ring based on the random number seed data, and each random number seed corresponds to a polynomial selected from the integer polynomial ring;
[0016] Homomorphic encryption computation is performed on the polynomial selected from the integer polynomial ring and the plaintext data to obtain the ciphertext data;
[0017] The polynomial in the ciphertext data is replaced with a random number seed corresponding to the polynomial, and the replaced ciphertext data is output as the compressed ciphertext.
[0018] Fourthly, in one embodiment, a computer-readable storage medium is provided, including a program that can be executed by a processor to implement the homomorphic encryption method as described in the third aspect.
[0019] The homomorphic encryption system disclosed in the above embodiments includes a ciphertext generation device and a ciphertext acquisition device. The ciphertext generation device performs homomorphic encryption calculations on plaintext data based on an integer polynomial ring to obtain random number seed data, a compressed public key, and compressed ciphertext; wherein the compressed public key and compressed ciphertext are obtained by replacing the polynomials in the public key data and ciphertext data with the random number seed from the random number seed data. The ciphertext acquisition device obtains ciphertext data and public key data based on the random number seed data, the compressed public key, and the compressed ciphertext. By replacing the polynomials in the public key data and ciphertext data with a random number seed, the amount of data transmitted in the homomorphic data is greatly reduced, thereby improving the data transmission efficiency during homomorphic encryption operations. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a homomorphic encryption method in one embodiment;
[0021] Figure 2 This is a structural block diagram of a homomorphic encryption system in one embodiment;
[0022] Figure 3 This is a structural block diagram of a homomorphic encryption device in one embodiment. Detailed Implementation
[0023] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0024] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0025] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. The terms "connection" and "linkage" used in this application, unless otherwise specified, include both direct and indirect connections (linkages).
[0026] Currently, most mainstream homomorphic encryption schemes are based on polynomial rings, and their basic operations include:
[0027] 1) Private key generation:
[0028] A polynomial S is randomly generated from a distribution of a polynomial ring R, and the private key sk = S.
[0029] 2) Public key generation:
[0030] The public key includes the encryption public key, the relinearization public key, and the rotation public key. Here, we take a version generated by the relinearization public key rlk as an example. The compression techniques for other encryption public keys, rotation public keys, and other algorithm versions are similar.
[0031] For i = 0, 1, ..., L-1, where L is a positive integer, a polynomial a is randomly generated in the polynomial ring R. i A noise polynomial e is randomly generated in the distribution of a certain polynomial ring R. i , relinearize the public key rlk.
[0032] Encryption (symmetric encryption):
[0033] A polynomial *a* is randomly generated within a polynomial ring *R*, and a noise polynomial *e* is randomly generated from a distribution within a certain polynomial ring *R*. The symmetric encryption function for plaintext data *m* is:
[0034] SymEnc(s, m) = (-a·s + f(m, e), a); where f() is a function that depends on the specific homomorphic encryption scheme.
[0035] BFV: f(m,e)=△·m +e;
[0036] BGV: f(m,e)=m+t·e;
[0037] CKKS: f(m, e) = m + e.
[0038] Ciphertext Calculation:
[0039] For a given homomorphic ciphertext computation operator, it is generally necessary to use the input ciphertext and the public key. For example, in ciphertext multiplication, ct2 = mul(ct0, ct1, rlk); where ct0 and ct1 are the input ciphertext, rlk is the relinearization public key, and ct2 is the output ciphertext.
[0040] In homomorphic computing applications, the most computationally intensive step is ciphertext computation, and homomorphic computing hardware processing modules are used to accelerate this computation. The performance bottleneck of homomorphic computing hardware processing modules is generally data transmission, including data transmission between the host and the homomorphic computing hardware processing module, as well as data transmission between the various sub-modules within the homomorphic computing hardware processing module.
[0041] Based on the homomorphic encryption method using integer polynomial rings described above, if the data that the homomorphic computation hardware processing module needs to transmit is a public key or encrypted ciphertext, then half of the polynomial is a randomly generated polynomial, which can be replaced by a random number seed used to generate it. Generally, the size of the polynomial in a homomorphic operation scheme is N × log Q (where N is the polynomial order, taking values such as 4096, 8192, 16384, etc., and Q is the ciphertext modulus, with log Q typically taking values from 100 to 500), ranging from tens of kB to thousands of kB, while the random number seed size is generally 128 bits to 512 bits, which can save most of the transmission volume of this polynomial.
[0042] The homomorphic encryption system disclosed in this application includes a ciphertext generation device and a ciphertext acquisition device. The ciphertext generation device performs homomorphic encryption calculations on plaintext data based on an integer polynomial ring to obtain random number seed data, a compressed public key, and compressed ciphertext; wherein the compressed public key and compressed ciphertext are obtained by replacing the polynomials in the public key data and ciphertext data with the random number seed from the random number seed data. The ciphertext acquisition device obtains ciphertext data and public key data based on the random number seed data, the compressed public key, and the compressed ciphertext. By replacing the polynomials in the public key data and ciphertext data with a random number seed, the amount of data transmitted in the homomorphic data is greatly reduced, thereby improving the data transmission efficiency during homomorphic encryption operations.
[0043] Example 1:
[0044] Please refer to Figure 1 The diagram below illustrates a homomorphic encryption method in one embodiment. The homomorphic encryption method based on integer polynomial rings includes:
[0045] Step 101: Generate random number seed data.
[0046] In one embodiment, the software generates random number seed data through a random number generation unit, and the random number seed data includes a random number seed.
[0047] Step 102: Randomly generate a polynomial.
[0048] A polynomial is selected from the ring of integer polynomials based on the random number seed data. Each random number seed corresponds to a polynomial selected from the ring of integer polynomials.
[0049] In one embodiment, a correspondence is established between a random number seed and a polynomial selected from an integer polynomial ring based on a block cipher and a pseudo-random expansion function, specifically including:
[0050] Set the bit width of the random number seed to n bits;
[0051] Choose an integer B, where B×128>logQ, Q is the ciphertext modulus, and the value of logQ ranges from 100 to 500;
[0052] The CTR mode of the national cryptographic algorithm SM4 is applied, and the random number seed is used as the key to encrypt the dataset {0, 1, ..., B·N-1} to obtain B·N n-bit data blocks, where N is a natural number;
[0053] The i-th coefficient of the polynomial is represented by data blocks i×B to (i+1)×B-1, with a bit width of B×128 bits. This is treated as a large integer r. i ;
[0054] When large integer At that time, the CTR mode of the national cryptographic algorithm SM4 is called again to regenerate the large integer r of B×128 bits. i ;
[0055] When large integer When, the i-th coefficient a of the polynomial is set. i =r i modQ;
[0056] in, To round down, i is a natural number;
[0057] Based on the coefficients of each obtained polynomial, obtain a polynomial with a completely random distribution.
[0058] Step 103: Obtain the encrypted data.
[0059] Homomorphic encryption computation is performed on a polynomial selected from an integer polynomial ring and plaintext data to obtain ciphertext data.
[0060] Step 104: Output compressed ciphertext.
[0061] Replace the polynomial in the ciphertext data with the corresponding random number seed, and output the replaced ciphertext data as compressed ciphertext.
[0062] In one embodiment, the above homomorphic encryption method further includes:
[0063] Step 105: Generate public key data.
[0064] The public key data is generated from a polynomial selected from the ring of integer polynomials.
[0065] Step 106: Output the compressed public key.
[0066] Replace the polynomial in the public key data with the corresponding random number seed, and output the replaced public key data as a compressed public key.
[0067] The principle and application steps of the homomorphic encryption method disclosed in this application are illustrated below through a specific embodiment.
[0068] A typical homomorphic encryption method based on an integer polynomial ring first determines a pseudo-random number expansion function (PRNG), whose input is a random number seed and output is a polynomial 'a' in the polynomial ring R determined by the random number seed. Then, the homomorphic encryption system performs public key generation and encryption. However, in one embodiment of this application, this step is changed to generating a random number seed using a random number generation unit, and then generating a random polynomial 'a' using the PRNG. A complete encrypted ciphertext is (b, a), and a compressed ciphertext is (b, seed). Similarly, a complete relinearization key is:
[0069] [(b i a i ): i=0,…,L-1];
[0070] And a compression relinearization key is:
[0071] [(b i ,seed i (i=0,…,L-1).
[0072] Before the ciphertext computation unit needs to use compressed ciphertext or compressed relinearized key, the pseudo-random expansion function PRNG with the same function is used to calculate the corresponding random polynomial based on the random number seed to obtain the complete ciphertext or relinearized key, and then the ciphertext computation continues.
[0073] In one embodiment, the above homomorphic encryption method further includes:
[0074] Step 107: Obtain the compressed public key and compressed ciphertext.
[0075] Step 108: Obtain public key data and ciphertext data.
[0076] Based on the random number seed in the random number seed data, a polynomial is selected from the integer polynomial ring, and the selected polynomial is used to replace the random number seed in the compressed ciphertext and the compressed public key to obtain the public key data and ciphertext data.
[0077] The homomorphic encryption method disclosed in this application selects a polynomial from a polynomial ring based on a random number seed. This polynomial is used to obtain ciphertext data and public key data. The polynomial in the ciphertext and public key data is then replaced with the random number seed to obtain compressed ciphertext and a compressed public key. The obtained compressed ciphertext and compressed public key are used as homomorphically encrypted data transmission. Compared to directly transmitting the complete public key data and ciphertext data, the transmitted compressed ciphertext and compressed public key reduce the amount of data transmitted from the public key data and encrypted data to the ciphertext by nearly 50%. This homomorphic encryption method still transmits the compressed public key and compressed ciphertext during transmission from the software to the hardware processing module, and during transmission between various sub-modules within the hardware processing module. Before the ciphertext calculation unit performs homomorphic computation on the public key data and ciphertext data, a decompression unit performs decompression processing to restore the uncompressed public key data and ciphertext data, and then performs the homomorphic ciphertext operation.
[0078] Please refer to Figure 2 The diagram below illustrates the structure of a homomorphic encryption system in one embodiment. Another embodiment of this application discloses a homomorphic encryption system for applying the homomorphic encryption method described above. This homomorphic encryption system includes a ciphertext generation device 10 and a ciphertext acquisition device 20. The ciphertext generation device 10 performs homomorphic encryption calculations on plaintext data based on an integer polynomial ring to obtain homomorphically encrypted data. The homomorphically encrypted data includes random number seed data, a compressed public key, and compressed ciphertext. The ciphertext generation device is further configured to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data. The selected polynomial is used to generate public key data, and the polynomial in the public key data is replaced with a random number seed to serve as the compressed public key. The ciphertext generation device is also configured to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data. The selected polynomial is used to perform homomorphic encryption operations on the plaintext data to obtain ciphertext data, and the polynomial in the ciphertext data is replaced with a random number seed to serve as the compressed ciphertext. Each random number seed corresponds to a polynomial selected from the integer polynomial ring. The ciphertext acquisition device 20 is used to acquire ciphertext data and public key data based on homomorphic encrypted data.
[0079] In one embodiment, the ciphertext generation device 10 includes a random number generation unit 11, a polynomial acquisition unit 12, a homomorphic operation unit 13, and a compression unit 14. The random number generation unit 11 generates random number seed data, which includes random number seeds. The polynomial acquisition unit 12 selects a polynomial from an integer polynomial ring based on the random number seeds in the random number seed data, with each random number seed corresponding to a polynomial selected from the integer polynomial ring. In one embodiment, the polynomial acquisition unit 12 establishes a correspondence between the random number seeds and the polynomials selected from the integer polynomial ring based on block ciphers and the application of a pseudo-random expansion function, specifically including:
[0080] Set the bit width of the random number seed to n bits;
[0081] Choose an integer B, where B×128>logQ, Q is the ciphertext modulus, and the value of logQ ranges from 100 to 500;
[0082] The CTR mode of the national cryptographic algorithm SM4 is applied, and the random number seed is used as the key to encrypt the dataset {0, 1, ..., B·N-1} to obtain B·N n-bit data blocks, where N is a natural number;
[0083] The i-th coefficient of the polynomial is represented by data blocks i×B to (i+1)×B-1, with a bit width of B×128 bits. This is treated as a large integer r. i ;
[0084] When large integer At that time, the CTR mode of the national cryptographic algorithm SM4 is called again to regenerate the large integer r of B×128 bits. i ;
[0085] When large integer When, the i-th coefficient a of the polynomial is set. i =r i modQ; where, To round down, i is a natural number;
[0086] Based on the coefficients of each obtained polynomial, obtain a polynomial with a completely random distribution.
[0087] The homomorphic operation unit 13 is used to generate public key data from a polynomial selected from the integer polynomial ring. The homomorphic operation unit 13 is also used to perform homomorphic encryption calculations on the polynomial selected from the integer polynomial ring and the plaintext data to obtain ciphertext data. The compression unit 14 is used to replace the polynomials in the public key data and ciphertext data with the corresponding random number seed, and output the replaced public key data and ciphertext data as compressed public key and compressed ciphertext, respectively.
[0088] In one embodiment, the ciphertext acquisition device 20 includes a decompression unit 21 and a ciphertext calculation unit 22. The decompression unit 21 is used to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data, and replace the random number seed with a polynomial based on the correspondence between the random number seed and the polynomial in the compressed public key and compressed ciphertext, thereby obtaining public key data and ciphertext data. The ciphertext calculation unit 22 is used to perform homomorphic operations on the ciphertext data based on the public key data.
[0089] In one embodiment, the decompression unit 21 and the ciphertext calculation unit 22 operate in parallel. While the decompression unit 21 decompresses the compressed public key and compressed ciphertext, the ciphertext calculation unit 22 simultaneously performs homomorphic operations on the decompressed public key data and ciphertext data.
[0090] Please refer to Figure 3 The diagram below illustrates the structure of a homomorphic encryption device in one embodiment. This application also discloses a homomorphic encryption device 30 for performing homomorphic encryption calculations on plaintext data and compressing the public key data and ciphertext data obtained from the homomorphic encryption calculations to obtain compressed public key and compressed ciphertext. The homomorphic encryption device 30 includes a random number generation unit 31, a polynomial acquisition unit 32, a homomorphic operation unit 33, and a compression unit 34. The random number generation unit 31 generates random number seed data, which includes random number seeds. The polynomial acquisition unit 32 selects a polynomial from an integer polynomial ring based on the random number seeds in the random number seed data, with each random number seed corresponding to a polynomial selected from the integer polynomial ring. The homomorphic operation unit 33 generates public key data from the polynomials selected from the integer polynomial ring and also performs homomorphic encryption calculations on the polynomials selected from the integer polynomial ring and the plaintext data to obtain ciphertext data. The compression unit 34 is used to replace the polynomial in the public key data and ciphertext data with the random number seed of the corresponding polynomial, and output the replaced public key data and ciphertext data as compressed ciphertext and compressed public key.
[0091] The homomorphic encryption system disclosed in this application includes a ciphertext generation device and a ciphertext acquisition device. The ciphertext generation device performs homomorphic encryption calculations on plaintext data based on an integer polynomial ring to obtain random number seed data, a compressed public key, and compressed ciphertext; wherein the compressed public key and compressed ciphertext are obtained by replacing the polynomials in the public key data and ciphertext data with the random number seed from the random number seed data. The ciphertext acquisition device obtains ciphertext data and public key data based on the random number seed data, the compressed public key, and the compressed ciphertext. By replacing the polynomials in the public key data and ciphertext data with a random number seed, the amount of data transmitted in the homomorphic data is greatly reduced, thereby improving the data transmission efficiency during homomorphic encryption operations.
[0092] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.
[0093] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.
Claims
1. A homomorphic encryption method based on integer polynomial rings, characterized in that, include: Generate random number seed data; The random number seed data includes a random number seed; A polynomial is selected from the integer polynomial ring based on the random number seed data, and each random number seed corresponds to a polynomial selected from the integer polynomial ring; Homomorphic encryption computation is performed on polynomials selected from the integer polynomial ring and plaintext data to obtain ciphertext data; Replace the polynomial in the ciphertext data with a random number seed corresponding to the polynomial, and output the replaced ciphertext data as compressed ciphertext. Public key data is generated from polynomials selected from the integer polynomial ring; Replace the polynomial in the public key data with a random number seed corresponding to the polynomial, and output the replaced public key data as a compressed public key. Obtain the compressed public key and the compressed ciphertext; A polynomial is selected from the integer polynomial ring based on the random number seed in the random number seed data, and the selected polynomial is used to replace the random number seed in the compressed ciphertext and the compressed public key to obtain the public key data and the ciphertext data; The step of selecting a polynomial from the integer polynomial ring based on the random number seed in the random number seed data includes: Based on block ciphers and the application of pseudo-random expansion functions, a correspondence is established between the random number seed and the polynomials selected from the integer polynomial ring, specifically including: The bit width of the random number seed is set to n bits; Choose an integer B, where B×128>logQ, Q is the ciphertext modulus, and the value of logQ ranges from 100 to 500; The random number seed is used as a key to encrypt the dataset {0, 1, ..., B•N-1} in the CTR mode of the national cryptographic algorithm SM4, so as to obtain B•N n-bit data blocks, where N is a natural number; The i-th coefficient of the polynomial is represented by data blocks from i×B to (i+1)×B-1, with a bit width of B×128 bits, and is treated as a large integer r. i ; When large integer At that time, the CTR mode of the national cryptographic algorithm SM4 is called again to regenerate the large integer r of B×128 bits. i ; When large integer When, the i-th coefficient a of the polynomial is set. i =r i modQ; where, To round down, i is a natural number; The polynomials are obtained by using the coefficients of each polynomial and obtaining a fully random distribution.
2. A computer-readable storage medium, characterized in that, The method includes a program that can be executed by a processor to implement the homomorphic encryption method as described in claim 1.
3. A homomorphic encryption system based on an integer polynomial ring, characterized in that, For applying the homomorphic encryption method as described in claim 1, the homomorphic encryption system includes a ciphertext generation device and a ciphertext acquisition device; A ciphertext generation device is used to perform homomorphic encryption calculations on plaintext data based on an integer polynomial ring to obtain homomorphically encrypted data; wherein, the homomorphically encrypted data includes random number seed data, a compressed public key, and compressed ciphertext; the ciphertext generation device is further used to select a polynomial from the integer polynomial ring according to the random number seed in the random number seed data, the selected polynomial is used to generate public key data, and the polynomial contained in the public key data is replaced with the random number seed as the compressed public key; wherein, there is a one-to-one correspondence between the polynomial replaced in the public key data and the random number seed used for replacement; The ciphertext generation device is further configured to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data, and the selected polynomial is used to perform homomorphic encryption operation on the plaintext data to obtain ciphertext data, and replace the polynomial contained in the ciphertext data with the random number seed to serve as the compressed ciphertext; wherein, there is a one-to-one correspondence between the polynomial replaced in the ciphertext data and the random number seed used for replacement. A ciphertext acquisition device is used to acquire the ciphertext data and the public key data based on the homomorphic encrypted data.
4. The homomorphic encryption system as described in claim 3, characterized in that, The ciphertext generation device includes a random number generation unit, a polynomial acquisition unit, a homomorphic operation unit, and a compression unit; The random number generation unit is used to generate random number seed data, which includes a random number seed. The polynomial acquisition unit is used to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data, and each random number seed corresponds to a polynomial selected from the integer polynomial ring; The homomorphic operation unit is used to generate public key data from the polynomials selected from the integer polynomial ring; The homomorphic operation unit is also used to perform homomorphic encryption calculations on the polynomial selected from the integer polynomial ring and the plaintext data to obtain the ciphertext data; The compression unit is used to replace the polynomial in the public key data and the ciphertext data with a random number seed corresponding to the polynomial, and output the replaced public key data and ciphertext data as the compressed public key and the compressed ciphertext, respectively.
5. The homomorphic encryption system as described in claim 3, characterized in that, The ciphertext acquisition device includes a decompression unit and a ciphertext calculation unit; The decompression unit is used to select a polynomial from the integer polynomial ring according to the random number seed in the random number seed data, and replace the random number seed with a polynomial according to the correspondence between the random number seed and the polynomial in the compressed public key and the compressed ciphertext, so as to obtain the public key data and the ciphertext data; The ciphertext calculation unit is used to perform homomorphic operations on the ciphertext data based on the public key data.
6. The homomorphic encryption system as described in claim 5, characterized in that, The decompression unit and the ciphertext calculation unit operate in parallel. While the decompression unit decompresses the compressed public key and the compressed ciphertext, the ciphertext calculation unit synchronously performs homomorphic operations on the decompressed public key data and the ciphertext data.
7. A homomorphic encryption device based on an integer polynomial ring, characterized in that, For applying the homomorphic encryption method as described in claim 1, the homomorphic encryption device includes a random number generation unit, a polynomial acquisition unit, a homomorphic operation unit, and a compression unit; The random number generation unit generates random number seed data, which includes a random number seed. The polynomial acquisition unit is used to select a polynomial from the integer polynomial ring based on the random number seed in the random number seed data, wherein each random number seed corresponds to a polynomial selected from the integer polynomial ring; The homomorphic operation unit is used to generate public key data from the polynomials selected from the integer polynomial ring; The homomorphic operation unit is also used to perform homomorphic encryption calculations on polynomials selected from the integer polynomial ring and plaintext data to obtain ciphertext data; The compression unit is used to replace the polynomial in the public key data and the ciphertext data with a random number seed corresponding to the polynomial, and output the replaced public key data and ciphertext data as compressed ciphertext and compressed public key.