Semi-homomorphic encryption method and device for multi-key Paillier
By combining multi-key Paillier encryption with Shamir secret sharing technology, the problems of complex key management and low computational efficiency in multi-party data computation are solved, achieving efficient and secure data privacy protection and computation, which is suitable for multi-party collaborative computing scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU DATABAO NETWORK TECH CO LTD
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-17
AI Technical Summary
In multi-party data computation scenarios, traditional single-key homomorphic encryption schemes suffer from complex key management, single-point leakage risk, and low computational efficiency, making it difficult to perform computations efficiently while protecting data privacy.
The method employs multi-key Paillier encryption combined with Shamir secret sharing technology. Each participant independently generates a key and performs ciphertext addition calculation using a common modulus. Joint decryption is then performed to ensure data privacy. The Chinese Remainder Theorem and Shamir secret sharing algorithm are used for key splitting and merging.
It achieves efficient and secure data privacy protection in multi-party data computation, supports cross-key ciphertext addition operations, and ensures the security and privacy of data during the interaction process.
Smart Images

Figure CN121887370A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a semi-homomorphic encryption method and apparatus using a multi-key Paillier, belonging to the field of cryptography and data security technology. Background Technology
[0002] With the rapid development of cloud computing and distributed computing, data has become a crucial asset in today's increasingly digital society, making data privacy protection in multi-party collaborative computing scenarios increasingly urgent. From a key management perspective, traditional encryption technologies present complex key management problems in multi-party environments. Each participant needs to independently manage its own key and ensure key security during data exchange to prevent data leakage risks caused by key leaks. On the other hand, from a computational performance perspective, traditional encryption technologies have relatively high computational overhead. When faced with massive data processing demands, this significantly increases the system's operational burden, affecting the efficiency and real-time performance of data exchange. Therefore, in the process of multi-party data collaborative computing, how to achieve effective and secure multi-party computing functions while protecting the data privacy of all parties is a key technical challenge that urgently needs to be solved.
[0003] Homomorphic encryption technology has gradually come into the researchers' view and received widespread attention. The main advantage of homomorphic encryption lies in its ability to perform specific computational operations directly on encrypted data without decryption, providing a new approach and method for solving multi-party data privacy protection problems. Homomorphic encryption technology allows direct computation on ciphertext, but traditional single-key homomorphic encryption schemes (such as the Paillier algorithm) have limitations in multi-user scenarios: different users need to share the same key, leading to complex key management and the risk of single-point leakage. Moreover, in recent years, homomorphic multi-key computation schemes have mostly targeted fully homomorphic encryption, i.e., simultaneously satisfying ciphertext multiplication and addition. However, for applications that only require single-ciphertext addition computation, most fully homomorphic multi-key encryption schemes suffer from low computational efficiency and excessive computational overhead, which significantly hinders their widespread adoption and deployment in practical applications.
[0004] Furthermore, key sharing and management are crucial aspects of multi-party data interaction. Improper key management directly threatens data security and confidentiality. Therefore, in current multi-party data privacy computing scenarios, balancing data privacy protection with computational efficiency and designing a highly efficient and secure multi-key homomorphic encryption scheme is a pressing technical challenge for researchers in this field and an important research direction for advancing data security technology. Summary of the Invention
[0005] The purpose of this invention is to provide a semi-homomorphic encryption method and apparatus for multi-key Paillier, thereby solving the technical problem of data privacy protection in multi-party data computation.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: A semi-homomorphic encryption method for multi-key Paillier cryptography includes the following steps: The first step is key generation: Each participant uses the key generation module to generate two large prime numbers and calculate their product, and then uses the key generation module to independently generate their own Paillier public-private key pair. The second step is data encryption and homomorphic addition of ciphertext: Each participant broadcasts its own public key, selects a random number and uses its own public key to encrypt its own ciphertext, and calculates the common modulus using all the public keys, and broadcasts its own ciphertext; Each participant uses the Chinese Remainder Theorem to transform the ciphertext it receives into the representation under the common modulus, and multiplies all the ciphertexts together; The third step is joint decryption: Each participant first calculates a partial decryption share, then uses the Chinese Remainder Theorem to merge all partial decryption shares to obtain the modulo result; then calculates a specific expression, and splits the private key into multiple secret shares using Shamir secret sharing and shares them with each participant; after each participant receives their secret share, they add them together and broadcast the result, then obtain the corresponding data from all other participants, use the interpolation method of the Shamir secret sharing algorithm to obtain the result, and then calculate the final plaintext locally.
[0007] As a preferred embodiment, the first step includes the following steps: S1. Deploy the middleware in the front end on any participant's server, and deploy the client on each participant's host; S2. Participants who have deployed middleware use the sequence number generation module to generate n sequential numbers, and use the sequence number random distribution module and network communication module to distribute the sequence numbers to each participant. The sequence number serves as the participant's identity identifier. S3. Each participant Two large prime numbers are generated using the key generation module. and and calculate · ,calculate , where lcm represents the least common multiple; S4. Select a random integer in the key generation module. , making The order is Thus, the public key of each participant is obtained. , ,in ; Publish the public key of each participant using the network communication module , where i is the participant's identity identifier; S5. Each participant received all [information / received information] via the network communication module. .
[0008] As a preferred embodiment, the second step includes the following steps: S6. All participants choose to select a random number. Using your own public key The plaintext data required for encryption ,have They broadcast their own ciphertext using a network communication module; S7. Each participant uses all publicly available public keys. Calculate the common modulus ; S8. Use the data ciphertext reading module to read the ciphertext of all participants. Based on the linear congruence property of the Chinese Remainder Theorem, each participant can... Change to model The following representation is used to process the data, which is then multiplied using a ciphertext homomorphic addition module to obtain the combined ciphertext after homomorphic addition computation. This means that the plaintext data on the exponent is added together.
[0009] As a preferred embodiment, the third step includes the following steps: S9. All participants used the share decryption module to merge all shares using the Chinese Remainder Theorem. For ∀i, we get mod ; S10. All participants recalculate using the share decryption module. ,in ; S11. All participants use the Shamir secret sharing algorithm in the secret sharing module to share their private keys. Divide into n secret shares using network communication module Share with each participant; S12. Participants will Obtain n secret shares Adding the n secret shares together yields Post-broadcast; S13. Each participant received, except for [the following], through the network communication module. All outside ; S14. Obtain the result using the interpolation method of Shamir's secret sharing algorithm in the secret sharing module. Each participant calculates locally ; S15. Finally, each participant uses the share decryption module to obtain the calculated plaintext, and the final plaintext is: · .
[0010] A multi-key Paillier semi-homomorphic encryption device includes middleware and a client. The middleware contains a sequence number generation module, a sequence number random distribution module, and a network communication module. The client contains a key generation module, an encryption module, a data ciphertext reading module, a ciphertext homomorphic addition module, a network communication module, a share decryption module, and a secret sharing module. The middleware and the client communicate through the network communication module.
[0011] Beneficial Effects: The purpose of this invention is to solve the problem of multiple parties needing to combine their data for encrypted addition operations. The main pain point lies in the generation and management of keys under the premise that the parties do not trust each other. Currently, Paillier is a single-key homomorphic addition algorithm. Single-key homomorphic encryption has the following drawbacks: 1) The most secure way for multiple parties to jointly compute is for each party to generate and store its own public and private keys. However, due to algorithm limitations, information encrypted with different public keys cannot be computed with each other, resulting in the inability to perform privacy-preserving computations; 2) If multiple parties use a single public and private key, although computation can be performed, system security will be greatly reduced. If any party in the system is successfully attacked, the private key will be leaked; 3) If multiple parties use a single public and private key, it is impossible to determine which participant generates the public and private keys.
[0012] Compared with existing technologies, this invention transforms the single-key Paillier algorithm into a multi-key algorithm. By combining Paillier encryption with Shamir secret sharing technology, it ensures that during multi-party data interaction, different participants can independently generate keys to encrypt their own data, ensuring that no party can use its own key to decrypt the ciphertext of another party. Then, the ciphertext data is placed on a designated server for homomorphic addition calculation. The result of the calculation requires the combined private keys of multiple parties to successfully decrypt, ensuring that data privacy is not leaked. It achieves efficient and secure multi-key homomorphic data computation, and is particularly suitable for scenarios involving multi-party data privacy computation and multi-participant collaborative computation scenarios. It can support cross-key ciphertext addition operations and achieve secure and efficient joint decryption while protecting the data privacy of all parties, ensuring the privacy and security of data throughout the entire interaction process. Attached Figure Description
[0013] Figure 1 This is a schematic diagram of the overall process of the present invention; Figure 2 This is a schematic diagram of the device of the present invention. Detailed Implementation
[0014] To further illustrate the technical means and effects of the present invention in achieving the intended purpose, the following detailed description of the specific implementation methods, structures, features and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0015] A multi-key semi-homomorphic encryption method based on Paillier and secret sharing includes the following steps: S1 to S4 represent the first stage of system initialization and key generation steps of this invention: S1: The middleware is deployed on the server of any one participant, and the client is deployed on the host of each participant according to the specifications. The middleware includes a sequence number generation module, a sequence number random distribution module, and a network communication module. The clients of other participants include a key generation module, an encryption module, a data ciphertext reading module, a ciphertext homomorphic addition module, a network communication module, a share decryption module, and a secret sharing module. The interaction between the clients of each participant is carried out through their respective network communication modules. The overall architecture of the device is shown in the attached manual. Figure 2 As shown; S2: First, the participants who deployed the middleware used the sequence number generation module to generate n sequential numbers, and then used the sequence number random distribution module and network communication module to distribute the sequence numbers to each participant. The sequence number serves as the participant's identity identifier.
[0016] S3: For participants Two large prime numbers are generated using the key generation module. and and calculate · ,calculate , where lcm represents the least common multiple.
[0017] S4: Select a random integer from the key generation module. , making The order is Thus, the public key of each participant is obtained. , ,in The public key of each participant is published using the network communication module. , where i is the participant's identity identifier.
[0018] S5: Each participant received all [information / resources] through the network communication module. .
[0019] S6 to S8 represent the second stage of the present invention: data encryption and homomorphic addition of ciphertext. The purpose of this stage is to encrypt the data to be calculated for each participant and perform homomorphic addition on the ciphertext. S6: All participants choose to select a random number. Using your own public key The plaintext data required for encryption ,have They use network communication modules to broadcast their own encrypted messages.
[0020] S7: Each participant uses all publicly available public keys. Calculate the common modulus ; S8: Use the data ciphertext reading module to read the ciphertext of all participants. Based on the linear congruence property of the Chinese Remainder Theorem, each participant can... Change to model The following representation is used to process the data, which is then multiplied using a ciphertext homomorphic addition module to obtain the combined ciphertext after homomorphic addition computation. This means that the plaintext data on the exponent is added together.
[0021] S9 to S14 is the third stage of the present invention, which is the joint decryption stage. The purpose of this stage is to obtain a partial decryption share using the private keys of each participant and to obtain the combined private key by using secret sharing to calculate the calculated plaintext.
[0022] S9: All participants use the share decryption module to merge all shares using the Chinese Remainder Theorem (CRT). For ∀i, we get mod ; S10: All participants recalculate using the share decryption module. , among which ; S11: All participants use the Shamir secret sharing algorithm in the secret sharing module to share their private keys. Divide into n secret shares using network communication module Share with each participant; S12: Participants will Obtain n secret shares Adding the n secret shares together yields Post-broadcast; S13: Each participant received the message via the network communication module, except... All outside ; S14: Obtain the result using the interpolation method of Shamir's secret sharing algorithm in the secret sharing module. Thus, each participant can calculate locally. ; S15: Finally, each participant uses the share decryption module to obtain the calculated plaintext. The final plaintext is... · The overall flowchart is as follows Figure 1 As shown.
[0023] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A multi-key Paillier's semi-homomorphic encryption method, characterized by, Includes the following steps: The first step is key generation: Each participant uses the key generation module to generate two large prime numbers and calculate their product, and then uses the key generation module to independently generate their own Paillier public-private key pair. The second step is data encryption and homomorphic addition of ciphertext: Each participant broadcasts its own public key, selects a random number and uses its own public key to encrypt its own ciphertext, and calculates the common modulus using all the public keys, and broadcasts its own ciphertext; Each participant uses the Chinese Remainder Theorem to transform the ciphertext it receives into the representation under the common modulus, and multiplies all the ciphertexts together; The third step is joint decryption: Each participant first calculates a partial decryption share, then uses the Chinese Remainder Theorem to merge all partial decryption shares to obtain the modulo result; then calculates a specific expression, and splits the private key into multiple secret shares using Shamir secret sharing and shares them with each participant; after each participant receives their secret share, they add them together and broadcast the result, then obtain the corresponding data from all other participants, use the interpolation method of the Shamir secret sharing algorithm to obtain the result, and then calculate the final plaintext locally.
2. The multi-key Paillier's semi-homomorphic encryption method according to claim 1, wherein, The key generation includes the following steps: S1. Deploy the middleware in the front end on any participant's server, and deploy the client on each participant's host; S2. Participants who have deployed the middleware use the sequence number generation module to generate n sequential numbers, and use the sequence number random distribution module and network communication module to distribute the sequence numbers to each participant. The sequence number serves as the participant's identity identifier. S3. Each participant Two large prime numbers are generated using the key generation module. and and calculate · ,calculate , where lcm represents the least common multiple; S4. Select a random integer in the key generation module. , making The order is Thus, the public key of each participant is obtained. , ,in ; Publish the public key of each participant using the network communication module , where i is the participant's identity identifier; S5. Each participant has received all .
3. The multi-key Paillier's semi-homomorphic encryption method according to claim 1, wherein, The data encryption and ciphertext homomorphic addition calculation includes the following steps: S6. All participants select a random number , encrypt the data plaintext needed for the calculation using their own public key , have , broadcast their ciphertext using the network communication module; S7. Each participant computes a public modulus using all the public keys that are published ; S8. Use the data ciphertext reading module to read the ciphertext of all participants. Based on the linear congruence property of the Chinese Remainder Theorem, each participant can... Change to model The following representation is used to process the data, which is then multiplied using a ciphertext homomorphic addition module to obtain the combined ciphertext after homomorphic addition computation. This means that the plaintext data on the exponent is added together. According to claim 1, a multi-key Paillier semi-homomorphic encryption method is characterized in that the joint decryption includes the following steps: S9. All participants used the share decryption module to merge all shares using the Chinese Remainder Theorem. For ∀i, we get mod ; S10. All participants recompute with share decryption module wherein ; S11. All participants use the Shamir secret sharing algorithm in the secret sharing module to share their private keys. Divide into n secret shares using network communication module Share with each participant; S12. The participant will take n secret shares , add n secret shares to get post-broadcast; S13. Each participant received, except for [the following], through the network communication module. All outside ; S14. Obtain the result using the interpolation method of Shamir's secret sharing algorithm in the secret sharing module. Each participant calculates locally ; S15. Finally, each participant uses the share decryption module to obtain the calculated plaintext, and the final plaintext is: · .
4. A semi-homomorphic encryption device for multi-key Paillier encryption, characterized in that, The system includes middleware and a client. The middleware contains a sequence number generation module, a sequence number random distribution module, and a network communication module. The client contains a key generation module, an encryption module, a data ciphertext reading module, a ciphertext homomorphic addition module, a network communication module, a share decryption module, and a secret sharing module. The middleware and the client communicate through the network communication module.