Cooperative encryption and decryption method and system based on NTRU algorithm
By employing a collaborative encryption and decryption method based on the NTRU algorithm, the key is distributed to both the client and the server, thus solving the problem of vulnerability of terminal device keys to attacks and improving both security and efficiency. This method is suitable for data protection of mobile terminals.
Patent Information
- Application Number
- CN202511705651.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2045-11-20
AI Technical Summary
In existing technologies, software-implemented digital signature keys on terminal devices are vulnerable to attacks, while hardware methods such as USB keys increase costs and provide a poor user experience, making it difficult to effectively protect user privacy and security on smart terminals.
A collaborative encryption and decryption method based on the NTRU algorithm is adopted, which divides the key into partial private keys generated by the client and the server respectively. Through collaborative encryption with a global public key and staged decryption, the security of the private key and the efficiency of operation are ensured.
It achieves distributed private key security, reduces the risk of key leakage, improves data security, reduces hardware costs, is suitable for mobile terminal resource-constrained scenarios, and maintains a good user experience.
Smart Images

Figure CN121173598A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data security, in particular to a collaborative encryption and decryption method and system based on NTRU algorithm. BACKGROUND
[0002] With the emergence of intelligent terminals and the development of network technology, new services such as mobile payment and mobile office have emerged. These new services need to be operated on smart phones. In order to protect user privacy and security, password technology is indispensable. The key of the digital signature realized by the software of the terminal is stored in the memory of the terminal, which is vulnerable to attack and very insecure. If a hardware method such as a usbkey is used, the user experience is not good, it is not convenient to use, and it also increases the cost. SUMMARY
[0003] The purpose of the present application is to provide a collaborative encryption and decryption method and system based on NTRU algorithm, which can effectively protect the security of data.
[0004] To achieve the above purpose, the present application provides the following scheme.
[0005] In a first aspect, the present application provides a collaborative encryption and decryption method based on NTRU algorithm, comprising: The client and the server generate local keys based on NTRU algorithm, and generate a global public key in collaboration; the keys include a partial private key of the client, a partial public key of the client, a partial private key of the server and a partial public key of the server; Encrypting the plaintext message to be encrypted using the global public key to generate a ciphertext; The server decrypts the ciphertext using the local partial private key to obtain a partial plaintext; The client decrypts the partial plaintext using the local partial private key to obtain a complete ciphertext.
[0006] In a second aspect, the present application provides a collaborative encryption and decryption system based on NTRU algorithm, comprising: a client and a server; The client comprises: a first key generation module for generating a partial private key and a partial public key of the client; a first public key synthesis module for receiving a partial public key of the server and synthesizing a global public key with the local partial public key; and a second decryption module for recovering the final plaintext in combination with the local partial private key after receiving the partial plaintext sent by the server; The server comprises: a second key generation module, configured to generate a partial private key and a partial public key of the server; a second public key synthesis module, configured to receive a partial public key of the client and synthesize a global public key with the local partial public key; and a first decryption module, configured to decrypt the ciphertext by using the local partial private key to obtain a partial plaintext and send the partial plaintext to the client.
[0007] According to the specific embodiments provided in the application, the application has the following technical effects.
[0008] 1. Distributed private key security: The private key is divided into a partial private key of the client and a partial private key of the server. If a single participant leaks, only the local partial private key is exposed, and the complete private key cannot be restored, which greatly reduces the risk of key leakage and improves the security of data.
[0009] 2. Consideration of experience and cost: No additional hardware is required, and the interaction between the client and the server is achieved, which does not affect the user operation experience and reduces the hardware procurement and maintenance cost.
[0010] 3. Efficient operation: All operations are based on polynomial ring operation, which can be accelerated by fast number theory transformation, and the encryption / decryption speed is faster, which is suitable for mobile terminals and other resource-constrained scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor.
[0012] Figure 1 A flowchart of a collaborative encryption and decryption method based on the NTRU algorithm is provided for an embodiment of the application. DETAILED DESCRIPTION
[0013] The technical solutions in the embodiments of the application will be described clearly and completely in the following with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.
[0014] The application provides a collaborative encryption and decryption method and system based on the NTRU algorithm, which effectively protects the security of the post-quantum NTRU algorithm private key. The two keys are generated in a distributed manner, and the keys are independently generated on the client and the server, respectively. Even if the client leaks, the complete decryption key will not be leaked, effectively protecting the security of the data.
[0015] In order to make the above objects, features and advantages of the present application more apparent, further detailed description will be made to the present application with reference to the accompanying drawings and specific embodiments.
[0016] In one exemplary embodiment, as shown in Figure 1 , a collaborative encryption and decryption method based on NTRU algorithm is provided, which is executed by a computer device, specifically, can be executed by a terminal or a server alone or by a terminal and a server together, and in the embodiments of the present application, the method is taken as an example applied to a server, which includes the following steps S1 to S4.
[0017] S1: the client and the server generate local keys based on the NTRU algorithm respectively, and generate a global public key collaboratively; the keys include a partial private key of the client, a partial public key of the client, a partial private key of the server and a partial public key of the server.
[0018] S2: encrypting a plaintext message to be encrypted using the global public key to generate a ciphertext.
[0019] S3: the server decrypts the ciphertext using the local partial private key to obtain a partial plaintext.
[0020] S4: the client decrypts the partial plaintext using the local partial private key to obtain a complete ciphertext.
[0021] The NTRU algorithm has the characteristics of resisting quantum computing and high operation efficiency, and is suitable for building a distributed encryption and decryption system. By dispersing the key generation process to the client and the server, and designing a two-stage decryption process, the risk of single-point key leakage can be effectively eliminated. The key is stored in the client and the server respectively through the key fragmentation storage mechanism, and the leakage of the whole key will not occur even if any of the client and the server is attacked. The dependence on external hardware devices is eliminated, and the user can complete the secure encryption and decryption operation only with a regular terminal. The dynamic combination mechanism of the keys of both parties in the encryption and decryption process forms a temporary effective complete key for each operation, which further improves the attack resistance of the system.
[0022] In a specific embodiment, step S1 specifically includes the following steps.
[0023] S11: setting the core parameters of the NTRU algorithm; the core parameters include: polynomial degree n, modulus q, prime number p and polynomial ring ; wherein, represents a set of polynomials with coefficients in ; x represents the element of the polynomial.
[0024] The modulus q refers to a polynomial coefficient modulus operation parameter, which can be implemented by a numerical value such as 2048 or 4096, and is used to constrain the range of polynomial coefficients. The prime number p refers to a modulus parameter used when constructing a public key, which can be implemented by a small prime number such as 3 or 5, to ensure that there is an inverse element in the modulus operation.
[0025] S12: The client randomly generates a base polynomial , and calculates a partial private key , solves , and if does not exist, re-generates . represents a modulus remainder operation.
[0026] S13: The client randomly generates an auxiliary private key polynomial , generates a partial public key , and sends to the server.
[0027] S14: The server randomly generates a base polynomial , and calculates a partial private key , solves , and if does not exist, re-generates .
[0028] S15: The server randomly generates an auxiliary private key polynomial , generates a partial public key , and sends to the client.
[0029] S16: The client calculates a global public key , and the server calculates a global public key .
[0030] In the above embodiment, the random generation of the auxiliary private key polynomial enhances the unpredictability of the private key, and the construction method of the partial public key retains the characteristics of the NTRU algorithm while providing necessary parameters for subsequent collaborative generation of the global public key. The interaction mechanism of exchanging partial public keys by both parties makes the synthesis of the global public key unnecessary for any party to hold a complete private key, and realizes private key sharding storage through distributed key generation, which realizes key security management on the premise of maintaining the encryption efficiency of the algorithm.
[0031] After generating the respective partial public keys, the client and the server combine the partial public keys to obtain the global public key by performing the same polynomial operation rule synchronously without relying on a third-party trusted node. Since the calculation processes of the client and the server are completely consistent and the parameters are open, the global public key is automatically agreed between the client and the server. In this process, the generation right of the global public key is dispersed to two independent nodes, and the inseparability of the partial public keys of the two parties is ensured through mathematical constraints, so that an attacker cannot derive complete key information by intercepting the partial public key of a single node, thereby avoiding the risk that the global public key is cracked due to the leakage of the private key of a single node. Further, since the client and the server only need to exchange partial public keys and perform local operations, without multiple interactions or complex verification mechanisms, the communication overhead of the key generation process is reduced.
[0032] In a specific embodiment, step S2 specifically comprises: randomly generating a polynomial , generating a ciphertext , for the plaintext message to be encrypted.
[0033] The encryption process first generates a dynamic parameter through a random polynomial generation module, performs a polynomial ring multiplication operation on the parameter and the global public key, superimposes the plaintext message, and then generates the final ciphertext through a modulo operation. The random polynomial is independently generated each time of encryption, ensuring that different ciphertexts are generated for the same plaintext in different encryption operations. The global public key is composed of the partial public key components maintained by the client and the server respectively, and an attacker cannot derive the complete public key structure by intercepting the communication data of a single party. In the polynomial ring operation process, the plaintext message is converted into a polynomial coefficient distribution on the ring, and the interference effect of the random parameter forms a ciphertext form resistant to analysis attacks. The selection of the modulo operation parameter is consistent with the core parameters of the NTRU algorithm, ensuring the mathematical reversibility of the decryption process.
[0034] In a specific embodiment, step S4 specifically comprises: S41: The server decrypts the ciphertext using the local partial private key to obtain a partial plaintext , and sends the partial plaintext to the client.
[0035] S42: The client decrypts the partial plaintext using the local partial private key to obtain the complete ciphertext .
[0036] In the above embodiments, by splitting the decryption process into a cooperative operation of the server and the client, the server uses the local partial private key to perform the first decryption on the ciphertext to generate partial plaintext, and the client receives the intermediate result and uses the partial private key of the client to perform the second decryption to obtain the final plaintext. In this process, the partial private keys generated by the client and the server form a chain-like dependent relationship in the decryption process, and neither party can complete the complete decryption operation alone, which significantly improves the security of the system.
[0037] Based on the same inventive concept, the embodiments of the present application also provide a collaborative encryption and decryption system based on the NTRU algorithm. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme described in the above method, so the specific limitations in one or more collaborative encryption and decryption system embodiments based on the NTRU algorithm provided below can refer to the limitations of the collaborative encryption and decryption method based on the NTRU algorithm in the above, which will not be repeated here.
[0038] In an exemplary embodiment, a collaborative encryption and decryption system based on the NTRU algorithm is provided, comprising: a client and a server.
[0039] The client comprises: a first key generation module for generating a partial private key and a partial public key of the client; a first public key synthesis module for receiving a partial public key of the server and synthesizing a global public key with the local partial public key; and a second decryption module for combining the local partial private key to complete the recovery of the final plaintext after receiving the partial plaintext sent by the server.
[0040] The server comprises: a second key generation module for generating a partial private key and a partial public key of the server; a second public key synthesis module for receiving a partial public key of the client and synthesizing a global public key with the local partial public key; and a first decryption module for decrypting the ciphertext using the local partial private key to obtain partial plaintext and sending the partial plaintext to the client.
[0041] The system further comprises: an encryption module for encrypting the plaintext message to be encrypted using the global public key to generate the ciphertext.
[0042] In a specific embodiment, the first public key synthesis module and the second public key synthesis module use the formula to generate the global public key , wherein is the partial public key of the client, is the partial public key of the server.
[0043] In a specific embodiment, the encryption module comprises: a polynomial generation unit for randomly generating a polynomial ; an encryption unit configured to generate ciphertext , a plaintext message to be encrypted.
[0044] The technical features of the above embodiments can be combined in any manner. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not result in contradictions, they shall be considered within the scope of the present disclosure.
[0045] The principles and implementation manners of the present application are described herein by using specific examples, and the above embodiments are only used to help understand the method of the present application and its core idea; meanwhile, for those of ordinary skill in the art, the specific implementation manners and application range can be changed according to the idea of the present application. In conclusion, the content of the present disclosure should not be understood as a limitation to the present application.
Claims
1. A collaborative encryption / decryption method based on the NTRU algorithm, characterized in that, include: The client and server each generate local keys based on the NTRU algorithm, and then collaboratively generate a global public key. The key includes a portion of the client's private key, a portion of the client's public key, a portion of the server's private key, and a portion of the server's public key. The plaintext message to be encrypted is encrypted using the global public key to generate ciphertext; The server uses a portion of its local private key to decrypt the ciphertext, obtaining a portion of the plaintext; The client uses a portion of its local private key to decrypt the plaintext portion, obtaining the complete ciphertext.
2. The collaborative encryption / decryption method based on the NTRU algorithm according to claim 1, characterized in that, The client and server each generate local keys based on the NTRU algorithm, specifically including: Set the core parameters of the NTRU algorithm; the core parameters include: polynomial degree n, modulus q, prime number p, and polynomial ring. ;in, Indicates the coefficient in The set of polynomials, The integer representing the modulus q, and x representing the elements of the polynomial; The client randomly generates the fundamental polynomial. And calculate part of the private key ,beg ,like If it does not exist, regenerate it. ; Modulus Modulo operation; The client randomly generates a secondary private key polynomial. Generate a partial public key and will Send to the server; The server randomly generates the basic polynomial. And calculate part of the private key ,beg ,like If it does not exist, regenerate it. ; Server-side randomized auxiliary private key polynomial Generate a partial public key and will Send to the client.
3. The collaborative encryption / decryption method based on the NTRU algorithm according to claim 2, characterized in that, The collaborative generation of a global public key includes: Both the client and server use a formula based on a portion of the client's public key and a portion of the server's public key. Generate a global public key ,in, For part of the client's public key, This is a portion of the server's public key.
4. The collaborative encryption / decryption method based on the NTRU algorithm according to claim 2, characterized in that, The plaintext message to be encrypted is encrypted using the global public key to generate ciphertext, specifically including: Randomly generated polynomials Generate ciphertext , This is the plaintext message to be encrypted.
5. The collaborative encryption / decryption method based on the NTRU algorithm according to claim 4, characterized in that, The server uses a portion of the local private key. For ciphertext Decryption yields partial plaintext. and part of the plaintext This occurs to the client.
6. The collaborative encryption / decryption method based on the NTRU algorithm according to claim 5, characterized in that, The client uses a portion of the local private key. For some plain text Decrypt to obtain the complete ciphertext. .
7. A collaborative encryption / decryption system based on the NTRU algorithm, characterized in that, include: Client and server; The client includes: a first key generation module for generating a partial private key and a partial public key for the client; a first public key synthesis module for receiving a partial public key from the server and synthesizing a global public key with a local partial public key; and a second decryption module for recovering the final plaintext by combining a local partial private key after receiving a partial plaintext sent by the server. The server includes: a second key generation module for generating a partial private key and a partial public key for the server; a second public key synthesis module for receiving a partial public key from the client and synthesizing a global public key with a local partial public key; and a first decryption module for decrypting the ciphertext using a local partial private key to obtain a partial plaintext and sending the partial plaintext to the client.
8. The collaborative encryption / decryption system based on the NTRU algorithm according to claim 7, characterized in that, The first public key synthesis module and the second public key synthesis module use the formula Generate a global public key ,in, For part of the client's public key, This is a portion of the server's public key.
9. The collaborative encryption / decryption system based on the NTRU algorithm according to claim 7, characterized in that, The system also includes: The encryption module is used to encrypt the plaintext message to be encrypted using the global public key, generating ciphertext.
10. The collaborative encryption / decryption system based on the NTRU algorithm according to claim 9, characterized in that, The encryption module includes: Polynomial generation unit, used to randomly generate polynomials ; Encryption unit, used to generate ciphertext , This is the plaintext message to be encrypted.
Citation Information
Patent Citations
Multi-party collaborative encryption and decryption method and device suitable for cloud computing and based on ElGamal algorithm
CN116781356A
Collaborative signature and decryption method and device, electronic equipment and storage medium
CN116823260A
NTRU-based efficient homomorphic ciphertext multiplication method
CN119483897A
Quantum decryption method and device after cooperation of two parties
CN120074816A
Fused quantum cryptography system and fusion encryption method and fusion decryption method thereof
CN120223298A
Cited By
Secret key packaging method and device
CN122226285A
