A method, device and system for generating post-quantum keys

By using Gaussian integers with real part equal to zero as encryption parameters during data encryption, the public and private keys are generated, and the problem of decryption failure caused by misconfiguration of data encryption parameters is solved, and the rapid encryption and decryption of data and efficient encryption and decryption efficiency are achieved.

CN119316140BActive Publication Date: 2025-04-01数盾信息科技股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411833206.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-01
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

During the data encryption process, the data encryption parameters are configured incorrectly, resulting in the problem of decryption failure.

Method used

By obtaining a Gaussian integer whose real part is equal to zero as encryption parameters, public and private key data are generated, and these data are passed between the receiving device and the sending device to achieve the encryption and decryption of the data.

Benefits of technology

It realizes rapid encryption and decryption of data, improves encryption and decryption efficiency, and avoids decryption failure caused by incorrect encryption parameters configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316140B_ABST
    Figure CN119316140B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and system for generating a post-quantum key, which belongs to the field of computer information processing technology, and solves the problem of data encryption parameter configuration error during data encryption, resulting in decryption failure. The method includes: obtaining encryption parameters, the encryption parameters are Gaussian integers with real parts equal to zero; generating public key data and private key data according to the encryption parameters; sending the public key data to a sending end device; obtaining ciphertext data sent by the sending end device, the ciphertext data is obtained by the sending end device processing plaintext data according to the public key data; processing the ciphertext data according to the private key data to obtain plaintext data. This scheme realizes the rapid encryption and decryption of data and improves the efficiency of encryption and decryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer information processing technology, and in particular to a method, device and system for generating a post-quantum key. Background Art

[0002] With the development of quantum computers, the security of traditional public key cryptography is under great threat, and post-quantum cryptography is booming. The public key cryptography system based on lattice design has the characteristics of resistance to quantum computing attacks. The security of public key encryption algorithms depends on the learning with errors (LWE) problem on the lattice. Quantum computers have not found quantum algorithms to solve difficult problems on lattices, so cryptographic algorithms constructed based on difficult problems on lattices are considered to be resistant to quantum attacks. The public key cryptography system of the number theory research unit (NTRU) algorithm has the characteristics of simple structure and resistance to quantum computing attacks, and is a typical post-quantum cryptographic algorithm. Summary of the invention

[0003] The present invention provides a method, device and system for generating a post-quantum key, which solves the problem of decryption failure caused by incorrect configuration of data encryption parameters during data encryption.

[0004] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0005] An embodiment of the present invention provides a method for generating a post-quantum key, which is applied to a receiving device, including:

[0006] Obtain an encryption parameter, where the encryption parameter is a Gaussian integer with a real part equal to zero;

[0007] Generate public key data and private key data according to the encryption parameters;

[0008] Sending the public key data to a sending end device;

[0009] Acquire ciphertext data sent by a sending end device, where the ciphertext data is obtained by the sending end device processing plaintext data according to the public key data;

[0010] The ciphertext data is processed according to the private key data to obtain plaintext data.

[0011] Optionally, obtain encryption parameters, including:

[0012] Generate random integers u, v, q;

[0013] according to:

[0014]

[0015] Obtaining a first encryption parameter;

[0016] according to:

[0017] g =vi,

[0018] Obtaining a second encryption parameter;

[0019] Where f is the first encryption parameter, g is the second encryption parameter, Z is an integer set, i is an imaginary unit, and i 2 =-1.

[0020] Optionally, generating public key data and private key data according to the encryption parameters includes:

[0021] according to:

[0022]

[0023] Generate public key data and private key data;

[0024] Where pk is the public key data, sk is the private key data, h is a real number, p is a public parameter, p and q are mutually prime, and q is greater than p, f q -1 is the inverse of f (modulo q), f p -1 is the inverse element of f (modulo p), and ≡ is the congruence symbol.

[0025] Optionally, the ciphertext data is processed according to the private key data to obtain plaintext data, including:

[0026] according to:

[0027] a≡f×c(mod q),

[0028] Processing the ciphertext data to obtain an intermediate result;

[0029] Among them, a is the intermediate result, c is the ciphertext data;

[0030] The intermediate result is processed to obtain plaintext data.

[0031] Optionally, the intermediate result is processed to obtain plaintext data, including:

[0032] according to:

[0033] b≡fp- 1 ×a(mod p),

[0034] Processing the intermediate result to obtain plaintext data;

[0035] Among them, a is the intermediate result and b is the plaintext data.

[0036] The embodiment of the present invention further provides a method for generating a post-quantum key, which is applied to a sending end device, comprising:

[0037] Obtain the public key data sent by the receiving device;

[0038] Processing the plaintext data according to the public key data to obtain ciphertext data;

[0039] The ciphertext data is sent to the receiving device.

[0040] Optionally, the plaintext data is processed according to the public key data to obtain the ciphertext data, including:

[0041] according to:

[0042] c≡p×h×r+m(mod q),

[0043] Mapping the plaintext data to obtain the ciphertext data;

[0044] Among them, c is the ciphertext data, h is the public key data, ≡ is the congruence symbol, p and q are public parameters, r is the element in the ring Rq[Z], Rq[Z] is a given complex ring, and m is the plaintext data.

[0045] The embodiment of the present invention further provides a receiving end device, including:

[0046] A first acquisition module, used for acquiring an encryption parameter, wherein the encryption parameter is a Gaussian integer whose real part is zero;

[0047] A first generating module, used to generate public key data and private key data according to the encryption parameters;

[0048] A first transceiver module, used to send the public key data to a sending end device;

[0049] The first transceiver module is further used to obtain ciphertext data sent by the sending end device, where the ciphertext data is obtained by the sending end device processing the plaintext data according to the public key data;

[0050] The first processing module is used to process the ciphertext data according to the private key data to obtain plaintext data.

[0051] The embodiment of the present invention further provides a sending end device, including:

[0052] The second transceiver module is used to obtain the public key data sent by the receiving device;

[0053] A second processing module, used to process the plaintext data according to the public key data to obtain ciphertext data;

[0054] The second transceiver module is further used to send the ciphertext data to the receiving end device.

[0055] An embodiment of the present invention further provides a post-quantum key generation system, comprising:

[0056] A receiving end device is used to obtain an encryption parameter, where the encryption parameter is a Gaussian integer whose real part is equal to zero; generate public key data and private key data according to the encryption parameter; send the public key data to a sending end device; obtain ciphertext data sent by the sending end device, where the ciphertext data is obtained by the sending end device processing plaintext data according to the public key data; and process the ciphertext data according to the private key data to obtain plaintext data;

[0057] The sending end device is used to obtain the public key data sent by the receiving end device; process the plaintext data according to the public key data to obtain the ciphertext data; and send the ciphertext data to the receiving end device.

[0058] The technical solution of the present invention includes at least the following effects:

[0059] The above scheme of the present invention obtains encryption parameters, which are Gaussian integers with real parts equal to zero; generates public key data and private key data according to the encryption parameters; sends the public key data to the sending end device; obtains ciphertext data sent by the sending end device, which is obtained by the sending end device processing plaintext data according to the public key data; and processes the ciphertext data according to the private key data to obtain plaintext data. This scheme realizes rapid encryption and decryption of data and improves encryption and decryption efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 is a flow chart of a method for generating a post-quantum key applied to a receiving device provided in an embodiment of the present invention;

[0061] Figure 2 is a flow chart of a method for generating a post-quantum key applied to a sending end device provided in an embodiment of the present invention;

[0062] Figure 3 is a structural diagram of a receiving end device provided by an embodiment of the present invention;

[0063] Figure 4 is a structural diagram of a transmitting end device provided by an embodiment of the present invention;

[0064] Figure 5 This is a workflow diagram of a post-quantum key generation system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0066] like Figure 1 As shown, an embodiment of the present invention proposes a method for generating a post-quantum key, which is applied to a receiving device, comprising:

[0067] Step 11, obtaining an encryption parameter, where the encryption parameter is a Gaussian integer whose real part is equal to zero;

[0068] Step 12, generating public key data and private key data according to the encryption parameters;

[0069] Step 13, sending the public key data to the sending end device;

[0070] Step 14, obtaining ciphertext data sent by the sending end device, wherein the ciphertext data is obtained by the sending end device processing the plaintext data according to the public key data;

[0071] Step 15: Process the ciphertext data according to the private key data to obtain plaintext data.

[0072] In this embodiment, first, the receiving end determines a parameter for the encryption process, which is a Gaussian integer with a real part equal to zero, which can be expressed as xi, where x is an integer; the value of the encryption parameter will directly affect the strength of the generated public key and private key; after obtaining the encryption parameter, an encryption algorithm is used to generate a pair of keys: a public key and a private key. As a preferred method, in this embodiment, a number theory research unit (NTRU) variant algorithm is selected to generate the public key and the private key; wherein the public key is public and can be used by any sending device that needs to communicate with the encryption party to encrypt messages; while the private key is confidential and is only stored in the encryption party device for decrypting messages encrypted by the public key; after generating the public key and the private key, the receiving end sends the public key to any sending device that wishes to communicate with it; the publicity of the public key enables any sending device that has the public key to use the public key to encrypt messages without worrying about the security of the message during transmission, because only the receiving end holding the corresponding private key can decrypt; once the public key is sent and successfully received, the sending device can use the public key to The plaintext data to be sent to the receiving end is encrypted to generate ciphertext data; the encryption process includes combining the plaintext data with the public key through an encryption algorithm (a variant algorithm of the number theory research unit is selected in this embodiment) to generate seemingly random, ciphertext data that cannot be directly understood. The sending device then sends this ciphertext data to the receiving end; finally, the receiving end uses its private key to decrypt the received ciphertext data; decryption is the inverse process of the encryption process, using the private key and encryption algorithm to restore the original plaintext data; since only the receiving end holds the correct private key, only the receiving end can successfully decrypt the message encrypted by the corresponding public key, thereby ensuring the security and privacy of the communication.

[0073] In an optional embodiment of the present invention, step 11 may include:

[0074] Step 111, generate random integers u, v, q;

[0075] Step 112, according to:

[0076]

[0077] Obtaining a first encryption parameter;

[0078] Step 113, according to:

[0079] g =vi (2)

[0080] Obtaining a second encryption parameter;

[0081] Where f is the first encryption parameter, g is the second encryption parameter, Z is an integer set, i is an imaginary unit, and i 2 =-1.

[0082] In this embodiment, a number theory research unit variant algorithm is selected to generate a public key and a private key. However, during the execution of the algorithm, if the encryption parameters are configured incorrectly, such as improper modulus selection, inappropriate key generation parameters, etc., decryption failure may occur. The number theory research unit variant algorithm on the Gaussian integer ring is based on the Gaussian integer ring. Different from the polynomial algebraic structure of the number theory research unit algorithm, its algebraic structure is a Gaussian integer, and its real part is zero. The algorithm has fast encryption and decryption speed and high efficiency. First, the random integers u, v, q are determined, and a numerical interval is obtained. Then, according to the random integer and the numerical range, the encryption parameters are determined, and the encryption parameters include a first encryption parameter f and a second encryption parameter g. The expression for determining the first encryption parameter f is: The expression for determining the second encryption parameter g is: g =vi; for pure imaginary number addition, f+g=(u+v)i; for pure imaginary number multiplication, f×g=-uv; for the multiplication of an integer and a pure imaginary number, f×b=uvi; for the pure imaginary number modulo q operation, f(mod q)=u(mod q)i; the first encryption parameter f and the second encryption parameter g can be used to generate a public key and a private key.

[0083] In an optional embodiment of the present invention, step 12 may include:

[0084] Step 121, according to:

[0085]

[0086] Generate public key data and private key data;

[0087] Where pk is the public key data, sk is the private key data, h is a real number, p is a public parameter, p and q are mutually prime, and q is greater than p, f q -1 is the inverse of f (modulo q), f p -1 is the inverse element of f (modulo p), and ≡ is the congruence symbol.

[0088] In this embodiment, after determining the first encryption parameter f and the second encryption parameter g, the public key data pk and the private key data sk can be obtained according to formula (3); the public parameter p∈Z, Z is an integer set, p and q are mutually prime, and q is much larger than p; in a given complex ring R q [Z], f, g∈R q [Z] has an inverse (modulo p and modulo q), and the inverse of f is expressed as (modulo p) and (modulo q), that is The coefficients of the modulo q operation are in the interval middle.

[0089] In an optional embodiment of the present invention, step 15 may include:

[0090] Step 151, according to:

[0091] a≡f×c(mod q)(4)

[0092] Processing the ciphertext data to obtain an intermediate result;

[0093] Among them, a is the intermediate result, c is the ciphertext data;

[0094] Step 152: Process the intermediate result to obtain plaintext data.

[0095] In this embodiment, after the receiving end obtains the ciphertext data c, it processes the ciphertext data c according to formula (4) to obtain the intermediate result a, where a∈R q [Z], whose coefficient is kept Then the intermediate result is processed to obtain plaintext data; specifically, according to:

[0096] b≡f p -1 ×a(mod p)(5)

[0097] Processing the intermediate result to obtain plaintext data;

[0098] Where b∈R q [Z], b is the decrypted plaintext data.

[0099] like Figure 2 As shown, an embodiment of the present invention proposes a method for generating a post-quantum key, which is applied to a sending end device, comprising:

[0100] Step 21, obtaining the public key data sent by the receiving device;

[0101] Step 22, processing the plaintext data according to the public key data to obtain ciphertext data;

[0102] Step 23: Send the encrypted data to the receiving device.

[0103] In this embodiment, a secure communication channel is first established between the sending end and the receiving end to ensure the security of the public key data during the transmission process; after the secure connection is established, the receiving end device will send its public key data to the sending end; after receiving the public key, the sending end selects an encryption algorithm to encrypt the plaintext data to ensure that even if the ciphertext is intercepted by a third party, it cannot be easily restored to plaintext; after the encryption is completed, the ciphertext data is obtained; the ciphertext data is the result of the plaintext data being processed by the encryption algorithm, and can only be decrypted if the corresponding private key is possessed; using the previously established secure connection, the sending end sends the ciphertext data to the receiving end; since the ciphertext data has been encrypted, even if it is intercepted by a third party during network transmission, the original information cannot be directly obtained; after confirming that the ciphertext data has been successfully sent and receiving the confirmation of the receiving end, the sending end can safely close the secure connection with the receiving end.

[0104] In an optional embodiment of the present invention, step 22 may include:

[0105] Step 221, according to:

[0106] c≡p×h×r+m(mod q)(6)

[0107] Mapping the plaintext data to obtain the ciphertext data;

[0108] Among them, c is the ciphertext data, h is the public key data, ≡ is the congruence symbol, p and q are public parameters, and r is the ring R q The elements in [Z], R q [Z] is a given complex ring, and m is plaintext data.

[0109] In this embodiment, after receiving the public key, the sender maps the plaintext data according to formula (6) to obtain the ciphertext data m, the public parameter p∈Z, Z is an integer set, p and q are mutually prime, and q is much larger than p.

[0110] A specific embodiment of the method for generating a post-quantum key provided by an embodiment of the present invention is:

[0111] Step 1: Obtain an encryption parameter, where the encryption parameter is a Gaussian integer whose real part is zero.

[0112] The encryption algorithm of this embodiment is preferably a number theory research unit variant algorithm on the Gaussian integer ring. The algorithm is built on the Gaussian integer ring, and the algebraic structure is changed from a polynomial to a pure imaginary number. No complex numbers with non-zero real parts are generated during operation.

[0113] The most notable feature of this algorithm is the dual modular operation, but the variant algorithm on the complex ring has a complex number structure of f = a + bi. When a ≠ 0, the complex number is a pure imaginary number, which can satisfy the modular operation. The algebra on which the algorithm is based is a part of the complex ring, a pure imaginary number.

[0114] Step 2: Generate public key data and private key data according to the encryption parameters.

[0115] Given a complex ring <R q [Z],+,×>,f∈R q [Z], that is, f is on the complex ring, and f is of the form The algebras on the ring R used in the algorithm are all in the form of f. Given two pure imaginary numbers f = ai, g = bi, a, b∈Z, for pure imaginary addition, f+g = (a+b)i; for pure imaginary multiplication, f×g = -ab; for integer and pure imaginary multiplication, f×b = abi; for pure imaginary modulo q operation, f(mod q) = a(mod q)i;

[0116] In this algorithm, the modulo q range is That is, for If satisfied Yuan is the inverse of f modulo q.

[0117] Let a∈R q The imaginary coefficient of [Z] is randomly chosen uniformly on Z as a←Z. The public parameters q, p∈Z, p, q are mutually prime, and q is much larger than p. In the ring R, f, g∈R q [Z] has an inverse (modulo p and modulo q), and the inverse of f is expressed as (modulo p) and (modulo q), that is

[0118] calculate:

[0119]

[0120] Where h∈R, the coefficients of the modulo q operation are in the interval Output public key pk = h, private key

[0121]

[0122] Step 3: Send the public key data to the sending device.

[0123] The public key is sent to the sending device and the private key is stored in the receiving device.

[0124] The sending device maps the plaintext message into pure imaginary plaintext m∈R q [Z], in ring Rq Select element r in [Z] and calculate:

[0125] c≡p×h×r+m(mod q)

[0126] Where c∈R q [Z], output ciphertext c.

[0127] The sending device then sends the ciphertext c to the receiving device.

[0128] Step 4: Obtain the ciphertext data sent by the sending device.

[0129] Step 5: Process the ciphertext data according to the private key data to obtain plaintext data.

[0130] After receiving the ciphertext c, the receiving device uses its own private key sk to decrypt it through the following steps to restore the plaintext:

[0131] (1) Calculation:

[0132] a≡f×c(mod q)

[0133] Where a∈R q [Z], whose coefficient is kept between.

[0134] (2) Calculation:

[0135]

[0136] Where b∈R q [Z], b is the decrypted plaintext m.

[0137] After decryption, the receiving device can restore the message content of the sending device.

[0138] The post-quantum key generation method proposed in the present invention solves the problem of decryption failure caused by incorrect data encryption parameter configuration during data encryption, realizes rapid encryption and decryption of data, and improves encryption and decryption efficiency; the main application scenarios of this method may include the following aspects:

[0139] (1) Cloud computing and distributed storage: In cloud computing and distributed storage scenarios, user data security and privacy are key requirements. This variant algorithm can be used to encrypt data at a lower computing cost, thereby saving server computing resources and improving cloud throughput and response efficiency. This is especially important for distributed storage that requires large-scale data encryption (such as file transfer, data storage, etc.).

[0140] (2) Real-time communication and instant messaging applications: In real-time communications (such as video calls and instant messaging), the increase in encryption and decryption speed can reduce latency and improve user experience. In particular, for instant messaging applications that require end-to-end encryption, such as private chats and corporate intranet communications, faster encryption services can be provided;

[0141] (3) Lightweight devices and the Internet of Things: In resource-constrained lightweight devices (such as Internet of Things devices, sensors, and smart home products), the hardware resources are limited and the computing power is weak. Traditional complex encryption algorithms may result in high computing and power consumption. This efficient number theory research unit variant algorithm can significantly reduce the computational burden of encryption and decryption while ensuring security, and is more suitable for the secure communication needs of these devices.

[0142] like Figure 3 As shown, the embodiment of the present invention further provides a receiving end device 30, including:

[0143] A first acquisition module 31 is used to acquire an encryption parameter, where the encryption parameter is a Gaussian integer with a real part equal to zero;

[0144] A first generating module 32, used to generate public key data and private key data according to the encryption parameters;

[0145] A first transceiver module 33, used to send the public key data to a sending end device;

[0146] The first transceiver module 33 is further used to obtain ciphertext data sent by the sending end device, where the ciphertext data is obtained by the sending end device processing the plaintext data according to the public key data;

[0147] The first processing module 34 is used to process the ciphertext data according to the private key data to obtain plaintext data.

[0148] Optionally, the first acquisition module 31 is specifically used for:

[0149] Generate random integers u, v, q;

[0150] according to:

[0151]

[0152] Obtaining a first encryption parameter;

[0153] according to:

[0154] g =vi,

[0155] Obtaining a second encryption parameter;

[0156] Where f is the first encryption parameter, g is the second encryption parameter, Z is an integer set, i is an imaginary unit, and i 2 =-1.

[0157] Optionally, the first generating module 32 is specifically used for:

[0158] according to:

[0159]

[0160] Generate public key data and private key data;

[0161] Where pk is the public key data, sk is the private key data, h is a real number, p is a public parameter, p and q are mutually prime, and q is greater than p, f q -1 is the inverse of f (modulo q), f p -1 is the inverse element of f (modulo p), and ≡ is the congruence symbol.

[0162] Optionally, the first processing module 34 is specifically used for:

[0163] according to:

[0164] a≡f×c(mod q),

[0165] Processing the ciphertext data to obtain an intermediate result;

[0166] Among them, a is the intermediate result, c is the ciphertext data;

[0167] The intermediate result is processed to obtain plaintext data.

[0168] Optionally, the intermediate result is processed to obtain plaintext data, including:

[0169] according to:

[0170] b≡f p -1 ×a(mod p),

[0171] Processing the intermediate result to obtain plaintext data;

[0172] Among them, a is the intermediate result and b is the plaintext data.

[0173] It should be noted that this device is a device corresponding to the above-mentioned method for generating a post-quantum key applied to a receiving device. All implementation methods in the above-mentioned method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0174] like Figure 4 As shown, the embodiment of the present invention further provides a sending end device 40, including:

[0175] The second transceiver module 41 is used to obtain the public key data sent by the receiving device;

[0176] A second processing module 42, used to process the plaintext data according to the public key data to obtain ciphertext data;

[0177] The second transceiver module 41 is further configured to send the ciphertext data to the receiving device.

[0178] Optionally, the second processing module 42 is specifically used for:

[0179] according to:

[0180] c≡p×h×r+m(mod q),

[0181] Mapping the plaintext data to obtain the ciphertext data;

[0182] Among them, c is the ciphertext data, h is the public key data, ≡ is the congruence symbol, p and q are public parameters, and r is the ring R q The elements in [Z], R q [Z] is a given complex ring, and m is plaintext data.

[0183] It should be noted that this device is a device corresponding to the above-mentioned method for generating a post-quantum key applied to the sending end device. All implementation methods in the above-mentioned method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0184] like Figure 5 As shown, an embodiment of the present invention further provides a post-quantum key generation system, including:

[0185] A receiving end device is used to obtain an encryption parameter, where the encryption parameter is a Gaussian integer whose real part is equal to zero; generate public key data and private key data according to the encryption parameter; send the public key data to a sending end device; obtain ciphertext data sent by the sending end device, where the ciphertext data is obtained by the sending end device processing plaintext data according to the public key data; and process the ciphertext data according to the private key data to obtain plaintext data;

[0186] The sending end device is used to obtain the public key data sent by the receiving end device; process the plaintext data according to the public key data to obtain the ciphertext data; and send the ciphertext data to the receiving end device.

[0187] In this embodiment, the post-quantum key generation system first controls the receiving device to determine a parameter for the encryption process, which is a Gaussian integer with a real part equal to zero, which can be expressed as xi, where x is an integer; the value of the encryption parameter will directly affect the strength of the generated public key and private key; after obtaining the encryption parameter, an encryption algorithm is used to generate a pair of keys: a public key and a private key. As a preferred method, the number theory research unit variant algorithm is selected in this embodiment to generate public keys and private keys; wherein the public key is public and can be used by any sending device that needs to communicate with the encryption party to encrypt messages; while the private key is confidential and is only stored in the encryption party device for decrypting messages encrypted by the public key; after generating the public key and private key, the post-quantum key generation system controls the receiving device to send the public key to the sending device; the publicity of the public key enables any sending device with the public key to use the public key to encrypt messages without worrying about the security of the message during transmission, because only the receiving end holds the corresponding private key to decrypt; the sending device successfully After receiving the public key, the post-quantum key generation system controls the sending device to select an encryption algorithm and encrypts the plaintext data according to the public key to ensure that even if the ciphertext is intercepted by a third party, it cannot be easily restored to plaintext; after the encryption is completed, the ciphertext data is obtained; the ciphertext data is the result of the plaintext data being processed by the encryption algorithm, and can only be decrypted if the corresponding private key is possessed; after obtaining the ciphertext data, the post-quantum key generation system controls the sending device to send the ciphertext data to the receiving end; since the ciphertext data has been encrypted, even if it is intercepted by a third party during network transmission, the original information cannot be directly obtained; after confirming that the ciphertext data has been successfully sent and receiving the confirmation from the receiving end, the encryption and decryption system controls the receiving end to use its private key to decrypt the received ciphertext data; decryption is the inverse process of the encryption process, using the private key and encryption algorithm to restore the original plaintext data; since only the receiving end holds the correct private key, only the receiving end can successfully decrypt the message encrypted by the corresponding public key, thereby ensuring the security and privacy of the communication.

[0188] The post-quantum key generation system provided in this embodiment solves the problem of decryption failure caused by incorrect configuration of data encryption parameters during data encryption, realizes rapid encryption and decryption of data, and improves encryption and decryption efficiency.

[0189] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0190] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0191] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0193] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0194] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0195] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0196] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general-purpose device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code for implementing a method or device. That is to say, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0197] The above are preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for generating a post-quantum key, characterized in that: Applied to receiving devices, including: Obtain an encryption parameter, where the encryption parameter is a Gaussian integer with a real part equal to zero; Generate public key data and private key data according to the encryption parameters; Sending the public key data to a sending end device; Acquire ciphertext data sent by a sending end device, where the ciphertext data is obtained by the sending end device processing plaintext data according to the public key data; Processing the ciphertext data according to the private key data to obtain plaintext data; The encryption parameters are obtained, including: Generate random integers u, v, q; according to: Obtaining a first encryption parameter; according to: g =we, Obtaining a second encryption parameter; Where f is the first encryption parameter, g is the second encryption parameter, Z is an integer set, i is an imaginary unit, and i 2 = -1; Wherein, generating public key data and private key data according to the encryption parameters includes: according to: Generate public key data and private key data; Where pk is the public key data, sk is the private key data, h is a real number, p is a public parameter, p and q are mutually prime, and q is greater than p, f q -1 is the inverse of f modulo q, f p -1 is the inverse element of f modulo p, and ≡ is the congruence symbol.

2. The method for generating a post-quantum key according to claim 1, characterized in that: The ciphertext data is processed according to the private key data to obtain plaintext data, including: according to: a≡f×c(mod q), Processing the ciphertext data to obtain an intermediate result; Among them, a is the intermediate result, c is the ciphertext data; The intermediate result is processed to obtain plaintext data.

3. The method for generating a post-quantum key according to claim 2, characterized in that: The intermediate result is processed to obtain plaintext data, including: according to: b≡f p -1 ×a(mod p), Processing the intermediate result to obtain plaintext data; Among them, a is the intermediate result and b is the plaintext data.

4. A receiving device, characterized in that: include: A first acquisition module, used for acquiring an encryption parameter, wherein the encryption parameter is a Gaussian integer whose real part is zero; A first generating module, used to generate public key data and private key data according to the encryption parameters; A first transceiver module, used to send the public key data to a sending end device; The first transceiver module is further used to obtain ciphertext data sent by the sending end device, where the ciphertext data is obtained by the sending end device processing the plaintext data according to the public key data; A first processing module, used to process the ciphertext data according to the private key data to obtain plaintext data; The encryption parameters are obtained, including: Generate random integers u, v, q; according to: Obtaining a first encryption parameter; according to: g =we, Obtaining a second encryption parameter; Where f is the first encryption parameter, g is the second encryption parameter, Z is an integer set, i is an imaginary unit, and i 2 = -1; Wherein, generating public key data and private key data according to the encryption parameters includes: according to: Generate public key data and private key data; Where pk is the public key data, sk is the private key data, h is a real number, p is a public parameter, p and q are mutually prime, and q is greater than p, f q -1 is the inverse of f modulo q, f p -1 is the inverse element of f modulo p, and ≡ is the congruence symbol.

5. A post-quantum key generation system, characterized in that: include: A receiving end device, used to obtain an encryption parameter, wherein the encryption parameter is a Gaussian integer with a real part equal to zero; and generate public key data and private key data according to the encryption parameter; Sending the public key data to a sending end device; Acquire ciphertext data sent by a sending end device, where the ciphertext data is obtained by the sending end device processing plaintext data according to the public key data; Processing the ciphertext data according to the private key data to obtain plaintext data; The sending device is used to obtain the public key data sent by the receiving device; Processing the plaintext data according to the public key data to obtain ciphertext data; Sending the ciphertext data to the receiving device; The encryption parameters are obtained, including: Generate random integers u, v, q; according to: Obtaining a first encryption parameter; according to: g =we, Obtaining a second encryption parameter; Where f is the first encryption parameter, g is the second encryption parameter, Z is an integer set, i is an imaginary unit, and i 2 = -1; Wherein, generating public key data and private key data according to the encryption parameters includes: according to: Generate public key data and private key data; Where pk is the public key data, sk is the private key data, h is a real number, p is a public parameter, p and q are mutually prime, and q is greater than p, f q -1 is the inverse of f modulo q, f p -1 is the inverse element of f modulo p, and ≡ is the congruence symbol.

Citation Information

Patent Citations

  • Method, device and system for processing cipher text

    CN102404121A

  • Data processing method and device and computer readable storage medium

    CN116975146A