A homomorphic encryption method and system based on Chinese remainder theorem
By adopting a homomorphic encryption method based on the Chinese Remainder Theorem, the ciphertext merging process is simplified, the ciphertext expansion and storage overhead are reduced, and the computational efficiency is improved. This solves the problem of low efficiency in existing homomorphic encryption schemes and is suitable for parallel computing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING YINSUAN TECH CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-15
AI Technical Summary
Existing homomorphic encryption schemes suffer from high computational complexity and severe ciphertext expansion, resulting in low efficiency and limiting their large-scale application in real-world scenarios.
A homomorphic encryption method based on the Chinese Remainder Theorem is constructed. Through the collaborative work of the client and server, message encryption, homomorphic computation and decryption are performed using the encoding module basis and encryption key, which simplifies the ciphertext merging process and is suitable for parallel computing.
It reduces ciphertext expansion and storage overhead, improves computational efficiency, reduces the burden on system communication and computing resources, is suitable for parallel computing, and the scheme is simple and easy to implement.
Smart Images

Figure CN121585339B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and more specifically to a homomorphic encryption method and system based on the Chinese Remainder Theorem. Background Technology
[0002] In today's era of cloud computing and big data, data privacy and security face severe challenges. While traditional encryption technologies can ensure the security of static data storage and transmission, data processing requires decryption, exposing the original information and posing a risk of privacy leaks. Homomorphic encryption, as an advanced cryptographic technique, allows specific algebraic operations to be performed directly on ciphertext, and the decrypted result is identical to the result of performing the same operation on the plaintext. This characteristic enables data to be processed while always in an encrypted state, providing an ideal solution for achieving "data usable but not visible," and has enormous application potential in fields such as secure cloud computing and privacy-preserving machine learning.
[0003] However, existing homomorphic encryption schemes, especially fully homomorphic ones, generally suffer from high computational complexity, severe ciphertext inflation, and low efficiency, hindering their large-scale application in practical scenarios. The Chinese Remainder Theorem, a classic theory in number theory, possesses inherent parallel computation and redundancy characteristics, demonstrating unique advantages in constructing efficient cryptographic systems. Exploring how to deeply integrate the Chinese Remainder Theorem with homomorphic encryption models to construct simpler and more efficient homomorphic encryption methods has significant theoretical and practical value for promoting the practical application of privacy computing technologies. Summary of the Invention
[0004] In view of the above problems, this invention proposes a homomorphic encryption method and system based on the Chinese Remainder Theorem, in order to overcome the above problems or at least partially solve them.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a homomorphic encryption method based on the Chinese Remainder Theorem, comprising the following steps:
[0007] S1. The client initializes system parameters and generates an encoding base.
[0008] S2. The client generates an encryption key using system parameters and a random number generator;
[0009] S3. The client uses the Chinese Remainder Theorem to encrypt the plaintext message into ciphertext using an encoding module and an encryption key, and then sends the ciphertext and the encoding module to the server.
[0010] S4. The server performs homomorphic computation on the ciphertext using the encoding module basis to generate the homomorphic operation result;
[0011] S5. The server uses an encryption key to decrypt the homomorphic operation result.
[0012] Furthermore, in S1, the system parameters include the amplification factor A and the number of congruences k; the encoding basis consists of prime numbers, and its number is the same as the number of congruences; the encoding basis is represented as... , where k represents the number of congruences.
[0013] Furthermore, in S2, k encryption keys composed of prime numbers are generated using system parameters and a random number generator, denoted as... In this context, each prime number in the encryption key is a random number.
[0014] Furthermore, S3 includes:
[0015] For each plaintext message in a set of plaintext messages Generate a corresponding random number for each. And calculate the true modulus component for each encoded modulus basis. , , where s represents the number of messages in the group of plaintext messages;
[0016] For each true modulus component In the encryption key The following calculation uses the Chinese Remainder Theorem to compute the ciphertext. ,in, For variable subscripts, , , ;
[0017] The ciphertext corresponding to each plaintext message and encoding module base Send to the server, where, This indicates the total number of plaintext messages.
[0018] Furthermore, in S4, the process by which the server performs homomorphic operations on the ciphertext using the cryptographic modulus is represented as follows:
[0019]
[0020] in, This represents the result of a homomorphic operation. This represents homomorphic addition or homomorphic multiplication. This represents a list of ciphertexts generated after encrypting different plaintext messages.
[0021] Furthermore, S5 includes:
[0022] The true modulus component in the homomorphic operation result is calculated using the encryption key. ,in, Indicates the first i One real module component;
[0023] Through true modulus and encoding module base Intermediate results of the calculation in plaintext ;
[0024] intermediate results Divide by the magnification factor A and round to the nearest integer to obtain the plaintext result. .
[0025] Furthermore, intermediate results in plaintext The calculation formula is:
[0026]
[0027]
[0028]
[0029] in, It represents the product.
[0030] Secondly, the present invention provides a homomorphic encryption system based on the Chinese Remainder Theorem, comprising:
[0031] The initialization module is used to initialize system parameters on the client side and generate encoding templates.
[0032] The key generation module is used to generate encryption keys on the client side using system parameters and a random number generator.
[0033] The encryption module is used on the client side to encrypt plaintext messages into ciphertext using the Chinese Remainder Theorem, an encoding module, and an encryption key, and then sends the ciphertext and the encoding module to the server.
[0034] The homomorphic operation module is used on the server side to perform homomorphic computation on the ciphertext using the encoded modular basis and generate the homomorphic operation result;
[0035] The decryption module is used on the server side to decrypt the homomorphic operation results using an encryption key.
[0036] Thirdly, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the computer program, it implements the steps of the homomorphic encryption method based on the Chinese Remainder Theorem as described above.
[0037] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the homomorphic encryption method based on the Chinese Remainder Theorem as described above.
[0038] As can be seen from the above technical solution, compared with the prior art, the present invention has the following beneficial effects:
[0039] 1. In this invention, the ciphertext size is finally merged back into an integer using the Chinese Remainder Theorem, and the message to be encrypted is also an integer. The ciphertext expansion and the message length are on the same order of magnitude in terms of storage overhead, resulting in a small ciphertext expansion, which greatly reduces the system's communication and storage overhead, and significantly reduces the communication burden on the system.
[0040] 2. This invention uses the Chinese Remainder Theorem to complete encryption and decryption, thus it is suitable for parallel computing and the scheme is simple and easy to implement, with high computational efficiency, saving equipment and system computing resources. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 This is a flowchart of a homomorphic encryption method based on the Chinese Remainder Theorem provided in an embodiment of the present invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] like Figure 1 As shown, this embodiment of the invention discloses a homomorphic encryption method based on the Chinese Remainder Theorem, comprising the following steps:
[0045] S1. The client initializes system parameters and generates an encoding base.
[0046] S2. The client generates an encryption key using system parameters and a random number generator;
[0047] S3. The client uses the Chinese Remainder Theorem to encrypt the plaintext message into ciphertext using an encoding module and an encryption key, and then sends the ciphertext and the encoding module to the server.
[0048] S4. The server performs homomorphic computation on the ciphertext using the encoding module basis to generate the homomorphic operation result;
[0049] S5. The server uses an encryption key to decrypt the homomorphic operation result.
[0050] The following provides further explanation of each of the above steps.
[0051] S1. The client initializes system parameters and generates the encoding base. The system parameters include the magnification factor A and the number of congruences k; the encoding base consists of prime numbers, and its number is the same as the number of congruences; the encoding base is represented as... , where k represents the number of congruences.
[0052] S2. The client generates k encryption keys composed of prime numbers using system parameters and a random number generator, denoted as follows: This makes the number of encryption keys the same as the number of congruences, and the key contains... These are a series of random numbers.
[0053] S3. The client uses the Chinese Remainder Theorem, an encoding module basis, and an encryption key to encrypt the plaintext message into ciphertext, and then sends the ciphertext and the encoding module basis to the server. Specifically, this includes:
[0054] S31. For any plaintext message Generate a corresponding random number for each. And calculate the true modulus component for each encoded modulus basis. , ;in, It is a coding module base. It is a set of plaintext messages that need to be encrypted, and there are s plaintext messages in total.
[0055] S32, For each real module component In the encryption key The following calculation uses the Chinese Remainder Theorem to compute the ciphertext. ,in, For variable subscripts, , , ;
[0056] S33. Repeat S31-S32 to encrypt each plaintext message in the group of plaintext messages into its corresponding ciphertext. and encoding module base Send to the server, where, This indicates the total number of plaintext messages.
[0057] S4. The server performs a homomorphic operation on the ciphertext. The specific operation process is as follows:
[0058]
[0059] in, This represents the result of a homomorphic operation. This represents homomorphic addition or homomorphic multiplication. This represents a list of ciphertexts generated after encrypting different plaintext messages.
[0060] S5. The server uses an encryption key to decrypt the homomorphic operation result, specifically including:
[0061] S51. Calculate the true modulus component in the homomorphic operation result using the encryption key. ,in, Indicates the first i Each real modulus component.
[0062] S52, using true modulus components and encoding module base Intermediate results of the calculation in plaintext ; intermediate results of plaintext results The calculation formula is:
[0063]
[0064]
[0065]
[0066] in, It represents the product.
[0067] S53, intermediate results Divide by the magnification factor A and round to the nearest integer to obtain the plaintext result. .
[0068] The method of the present invention will be further illustrated below with a specific example:
[0069] S1. Set the magnification factor A=100 and the number of congruences k=3, and generate an encoding base consisting of 3 prime numbers. Used for message encoding.
[0070] S2. Based on the number of congruences k, generate an encryption key consisting of k prime numbers. .
[0071] S3. To demonstrate the subsequent homomorphic computation steps, we will encrypt two messages together.
[0072] The encryption process for the first message is as follows:
[0073] Set the first message as Assign a random number Encoding 10 as The generated true modulus components , , ;
[0074] Reuse key , , Calculated as ciphertext :
[0075] ;
[0076] here , , , , , , .
[0077] The encryption process for the second message is as follows:
[0078] Set the second message as Assign a random number Encoded as 7 The generated true modulus components , , ;
[0079] Reuse key , , Calculated as ciphertext :
[0080] ;
[0081] here , , , , , .
[0082] Finally, the ciphertext of the two sets of messages was... and Send to the server.
[0083] S4. For demonstration purposes, this section shows the server performing homomorphic addition operations on encrypted data. , here use To represent homomorphic addition, then .
[0084] S5. The server uses an encryption key to decrypt the homomorphic operation result, specifically including:
[0085] Using the key , , Calculate ciphertext The actual modulus components in are respectively , , ;
[0086] Then use the coding module , , Intermediate results for calculating the true modulus components as plaintext of the final result. :
[0087] ;
[0088] here , , , , , , .
[0089] Calculate the final homomorphic result by dividing T by the magnification factor A=100 and rounding down. ,here Represents the integer part symbol.
[0090] This is similar to the example. The results were completely consistent.
[0091] In other embodiments, the present invention also provides a homomorphic encryption system based on the Chinese Remainder Theorem, comprising:
[0092] The initialization module is used to initialize system parameters on the client side and generate encoding templates.
[0093] The key generation module is used to generate encryption keys on the client side using system parameters and a random number generator.
[0094] The encryption module is used on the client side to encrypt plaintext messages into ciphertext using the Chinese Remainder Theorem, an encoding module, and an encryption key, and then sends the ciphertext and the encoding module to the server.
[0095] The homomorphic operation module is used on the server side to perform homomorphic computation on the ciphertext using the encoded modular basis and generate the homomorphic operation result;
[0096] The decryption module is used on the server side to decrypt the homomorphic operation results using an encryption key.
[0097] In another embodiment, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that, when the processor executes the computer program, it implements the steps of the above-described homomorphic encryption method based on the Chinese Remainder Theorem.
[0098] In another embodiment, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described homomorphic encryption method based on the Chinese Remainder Theorem.
[0099] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0100] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A homomorphic encryption method based on the Chinese Remainder Theorem, characterized in that, Includes the following steps: S1. The client initializes system parameters and generates an encoding base. S2. The client generates an encryption key using system parameters and a random number generator. The encryption key is represented as follows: , where k represents the number of congruences; S3. The client uses the Chinese Remainder Theorem, an encoding module basis, and an encryption key to encrypt the plaintext message into ciphertext, and then sends the ciphertext and the encoding module basis to the server. S3 includes: For each plaintext message in a set of plaintext messages Generate a corresponding random number for each. And calculate the true modulus component for each encoded modulus basis. , Where s represents the number of messages in the plaintext message group, and A represents the magnification factor; For each true modulus component In the encryption key The following calculation uses the Chinese Remainder Theorem to compute the ciphertext. ,in, For variable subscripts, , , ; The ciphertext corresponding to each plaintext message and encoding module base Send to the server, where, Indicates the total number of plaintext messages; S4. The server performs homomorphic computation on the ciphertext using the encoding module basis to generate the homomorphic operation result; S5. The server uses an encryption key to decrypt the homomorphic operation result.
2. The homomorphic encryption method based on the Chinese Remainder Theorem as described in claim 1, characterized in that, In S1, the system parameters include the amplification factor A and the number of congruences k; the encoding module base is composed of prime numbers, and its number is the same as the number of congruences.
3. The homomorphic encryption method based on the Chinese Remainder Theorem as described in claim 2, characterized in that, In S2, k encryption keys composed of prime numbers are generated using system parameters and a random number generator, where each prime number in the encryption key is a random number.
4. The homomorphic encryption method based on the Chinese Remainder Theorem as described in claim 1, characterized in that, In S4, the process of the server performing homomorphic operations on the ciphertext using the cryptographic modulus is represented as follows: in, This represents the result of a homomorphic operation. This represents homomorphic addition or homomorphic multiplication. This represents a list of ciphertexts generated after encrypting different plaintext messages.
5. The homomorphic encryption method based on the Chinese Remainder Theorem as described in claim 4, characterized in that, S5 include: The true modulus component in the homomorphic operation result is calculated using the encryption key. ,in, Indicates the first i One real module component; Through true modulus and encoding module base Intermediate results of the calculation in plaintext ; intermediate results Divide by the magnification factor A and round to the nearest integer to obtain the plaintext result. .
6. The homomorphic encryption method based on the Chinese Remainder Theorem as described in claim 5, characterized in that, intermediate results of plaintext The calculation formula is: in, It represents the product.
7. A homomorphic encryption system based on the Chinese Remainder Theorem, characterized in that, The homomorphic encryption method based on the Chinese Remainder Theorem as described in any one of claims 1-6 includes: The initialization module is used to initialize system parameters on the client side and generate encoding templates. The key generation module is used to generate encryption keys on the client side using system parameters and a random number generator. The encryption module is used on the client side to encrypt plaintext messages into ciphertext using the Chinese Remainder Theorem, an encoding module, and an encryption key, and then sends the ciphertext and the encoding module to the server. The homomorphic operation module is used on the server side to perform homomorphic computation on the ciphertext using the encoded modular basis and generate the homomorphic operation result; The decryption module is used on the server side to decrypt the homomorphic operation results using an encryption key.
8. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that, when the processor executes the computer program, it implements the steps of the homomorphic encryption method based on the Chinese Remainder Theorem as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the homomorphic encryption method based on the Chinese Remainder Theorem as described in any one of claims 1-6.