An asymmetric encryption and signature method that can resist quantum computer attacks

Through the introduction of high -level remaining equations and trap conditions in asymmetric encryption and signature methods to construct an encryption and signature scheme for anti -quantum computer attacks, the existing technology cannot resist the problem of quantum computer attacks, and achieve high security of encrypted data. The authenticity of sex and signature.

CN115333740BActive Publication Date: 2025-01-28梁庆生
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210974256.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2025-01-28
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

Existing asymmetric encryption algorithms such as RSA and SM2 cannot effectively resist attacks from quantum computers, and cannot guarantee the security of encrypted data and the authenticity of signatures.

Method used

Through the generation of signature keys, the signatures of the clear text, the inspection of the clear text, the generation of the encryption key, the encryption of the clear text, and the decryption of the ciphertext, the high -end remaining equation and the condition of the trap are constructed Symmetric encryption and signature method.

Benefits of technology

Effectively resisting the SHOR algorithm and the GROver algorithm of the quantum computers improve the security of encrypted data and the authenticity of the signature. At the same time, it is fast, high, and small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115333740B_ABST
    Figure CN115333740B_ABST
Patent Text Reader

Abstract

The present invention discloses an asymmetric encryption and signature method capable of resisting attacks by quantum computers. The steps of the present invention include generation of signature key, signature of plain text, verification of plain text, generation of encryption key, encryption of plain text and decryption of cipher text. The signature principle is to construct a high-order residual equation 1 with a trap, solve equation 1 with a private key to obtain a signature, and verify whether equation 1 is established by using a public key to verify the signature; the encryption principle is to construct a high-order residual equation 2 with a trap, calculate equation 2 with a public key to obtain a cipher text, and solve equation 2 with a private key to obtain a plain text. The signature and encryption algorithm can effectively resist attacks by the Shor algorithm and the Grover algorithm of quantum computers, and at the same time, it has high speed, high efficiency, and few bits, thereby improving the security of encrypted data and the authenticity of signatures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data encryption and signature processing, and specifically relates to an asymmetric encryption and signature method that can resist quantum computer attacks. Background Art

[0002] Asymmetric encryption requires two keys, a public key and a private key. The public key and the private key are a pair. If the data is encrypted with the public key, it can only be decrypted with the corresponding private key. If the data is encrypted with the private key, it can only be decrypted with the corresponding public key. Because different keys are used for encryption and decryption, it is called asymmetric encryption. Currently, the asymmetric encryption algorithm mainly uses the RSA algorithm and the ECC algorithm for encryption.

[0003] The RSA algorithm is very easy to multiply two large prime numbers, but it is extremely difficult to factorize the product, so the product can be made public as the encryption key, that is, the public key, and the two large prime numbers are combined into a private key. The public key can be published for anyone to use, while the private key is owned by oneself for decryption.

[0004] The ECC algorithm uses the computational difficulty of elliptic discrete logarithms on the Abel additive group formed by rational points on the elliptic curve. Public key cryptography systems are generally divided into three categories according to the problems they are based on: large integer factorization problems, discrete logarithm problems, and elliptic curves. Sometimes elliptic curves are also classified as discrete logarithms.

[0005] However, the existing asymmetric algorithms RSA and SM2 (ECC) are unable to resist the upcoming quantum computers. In the foreseeable quantum era, algorithms such as RSA or SM2 (ECC) will not be able to guarantee the security of encrypted data and the authenticity of signatures. Summary of the invention

[0006] The purpose of the present invention is to provide an asymmetric encryption and signature method that can resist the attack of quantum computers. Through the generation of signature keys, the signing of plaintext, the verification of plaintext, the generation of encryption keys, the encryption of plaintext and the decryption of ciphertext, the method can effectively resist the attacks of Shor's algorithm and Grover's algorithm of quantum computers. At the same time, it has high speed, high efficiency and few bits, which improves the security of encrypted data and the authenticity of signature, so as to solve the problems raised in the above background technology.

[0007] To achieve the above object, the present invention adopts the following technical solution: an asymmetric encryption and signature method capable of resisting quantum computer attacks, comprising the following steps:

[0008] S1. Generation of signature key, based on the high-order remainder equation x h ≡t 2(modN), where t is the plaintext, x is the required signature data, h is a prime number, and i prime numbers p1, p2, p3..., p are randomly generated. i , called K1 set, and then according to p1, p2, p3..., p i-1 Find the prime number p that meets the trap conditions one and two i , repeat the above steps until j sets are generated, namely K1, K2, K3...K j , and finally K1 to K j Multiply all the elements in the set to get N, and make N and h public as the public key. j The collection is used as the private key K and is not public;

[0009] S2. Signature of plaintext. Suppose there is a plaintext t, and gcd(t,N)==1. The public key N and h are known. Use the private keys K1, K2, K3...K j , according to the higher-order residual equation: x h ≡t 2 (modN), find the solution x0 of the higher-order remainder equation, x0 is the signed data x0;

[0010] S3. Verify the signature of the plaintext. To verify the signature of the plaintext t, you only need to verify whether the signed data x0 is the solution of the high-order remainder equation.

[0011] S4, the generation of encryption key, according to the congruence theorem, equation two z f ≡d(modM) can be transformed into the following first and second equations, where the first equation is y f ≡d 3 (modM), the second equation is z 3 ≡y(modM), where d is the encrypted ciphertext of plaintext t, y is the encrypted data, and s prime numbers e1, e2, e3..., e are randomly generated. s , called G1 set, and then according to e1, e2, e3..., e s-1 Find the prime number e that meets the trap conditions three, four and five s , repeat the above steps until b sets are generated, namely G1, G2, G3...G b Finally, G1 to G b After multiplying all the elements in the set, we get M. Is it true? If it is true, the additional data A is 1, if not, the additional data A is 3, and finally M is multiplied by A, that is: M = M*A, and M and f are made public as the public key, G1 to G b The set and the additional number A are used as the private key G and are not made public;

[0012] S5. Encryption of plaintext. Suppose there is a plaintext r, and gcd(r,M)==1. According to the equation d≡r f (modM) calculates d, which is the encrypted ciphertext of the plaintext r;

[0013] S6, decryption of ciphertext, first according to the condition three of the trap condition And condition 4 M=A*G1*G2*G3*...Find the first equation y f ≡d 3 The solution y of (modM) is then based on condition five. Find the second equation z 3 = the solution z of y(modM), the solution z0 of the second equation is the plaintext r before encryption;

[0014] The trap conditions in steps S1 and S4 are as follows:

[0015] Condition 1 is: ...

[0016] Condition 2: N = K1*K2*K3*...

[0017] Condition three is: ...

[0018] Condition 4: M = A*G1*G2*G3*...

[0019] And condition five:

[0020] Preferably, the equations 1 and 2 in steps S1 and S4 may also be K H ≡t(mod3p), the trap condition is and H = h1*h2;

[0021] Preferably, the specific steps of generating the signature key are as follows:

[0022] A1. First, randomly generate a prime number set K1, which contains 256 prime number elements, namely: p1, p2, p3..., p256;

[0023] Each element p in the set A2 and K1 n , all meet

[0024] The first element p1 in the set A3 and K1 is a large prime number, p2, p3, ..., p 256 is a small prime number;

[0025] A4、Then, according to p1, p2, p3..., p 255 Find a prime number p that meets condition 1256 ;

[0026] A5. The properties are known: and Therefore And immediately derive equation 2: (p1-1)*(p2-1)*...*(p 256 -1)≡-2(modh);

[0027] A6. Since equation 2 is a linear remainder equation with one variable, it has an infinite number of solutions. Therefore, a prime number solution p that meets condition 1 can be obtained through a finite number of tests. 256 ;

[0028] A7. Then, repeat steps A1 to A6 to generate the K2 set;

[0029] A8. So far, two such sets are generated, namely K1 and K2;

[0030] A9. Multiply all elements in the sets K1 to K2 to obtain N.

[0031] A10. Make N and h public keys, and make the set of K1 to K2 the private key K, which is private and not public.

[0032] Preferably, the specific steps of signing the plain text in step 2 are as follows:

[0033] B1. Perform SM3 hash operation on the data m to be signed to obtain the hashed data t;

[0034] B2. If gcd(t,N)≠1, let t=t+1;

[0035] B3, repeat B2 until gcd(t,N)=1;

[0036] B4. Then, according to equation 1: x h ≡t 2 (modN), find the solution x0 of equation 1, x0 is the signed data x0;

[0037] B5. Since we know condition 2: N = K1*K2, we can get the following equation group 1 from equation 1:

[0038] x1 h ≡t 2 (modK1)

[0039] x2 h ≡t 2 (modK2);

[0040] B6. First find x1 in equation group 1 h≡t 2 The solution x'1 of (modK1);

[0041] B7, according to condition one According to Fermat's little theorem and congruence theory, we can deduce:

[0042] B8. Then calculate the following in equation group 1: x2 h ≡t 2 The solution x'2 of (modK2);

[0043] B9. Let x'1, x'2 be called set X';

[0044] B10. If K'1*x'1=1 modK1, K'2*x'2=1 modK2, then according to the Sun Tzu theorem and the set X', the solution x0' of the equation system 1 is: x0'≡(x'1*K'1*K1+x'2*K'2*K2)(modN). The solution x0' of the equation system 1 is the solution of equation 1, satisfying x0' h ≡t 2 (modN), which is the signed data.

[0045] Preferably, the specific steps of the plaintext signature verification in step S3 are as follows:

[0046] C1, after performing SM3 hash operation on the data m to be signed, the hashed data t is obtained;

[0047] C2. If gcd(t,N)≠1, let t=t+1;

[0048] C3, repeat C2 until gcd(t,N)=1;

[0049] C4, verify whether the signature data x0 is the solution of equation 1; that is, x0 h ≡t 2 (modN) is true or not. If so, it is a valid signature; otherwise, it is an invalid signature.

[0050] Preferably, the specific steps of generating the encryption key in step S4 are as follows:

[0051] D1. First, randomly generate a prime number set G1, which contains 256 prime number elements, namely: e1, e2, e3..., e 256 ;

[0052] Each element e in the set D2 and G1 m , all meet and

[0053] The first element e1 in the set D3 and G1 is a large prime number, e2, e3, ..., e 256 Can be a small prime number;

[0054] D4, then according to e1, e2, e3..., e 255 Find a prime number e that meets condition three 256 , condition three is ...;

[0055] D5. The properties are known: and Therefore And immediately derive equation 7: (e1-1)*(e2-1)*...*(e 256 -1)≡-3(modf);

[0056] D6. Since equation 7 is a linear remainder equation with one variable, it has an infinite number of solutions, so we can obtain a prime number solution e that meets condition 3 through a finite number of tests. 256 ;

[0057] D7, repeat steps D1-D6 to generate set G2;

[0058] D8. Generate two such sets, G1 and G2;

[0059] D9. Multiply all elements in the sets G1 to G2 to obtain M.

[0060] D10. Judgment condition five: Is it true? If it is true, the additional data A is 1, if it is not true, the additional data A is 3;

[0061] D11. Finally, multiply M by A, that is, M = M*A;

[0062] D12. Use M and f as public keys, and the set G1 to G2 and the additional number A as private keys.

[0063] Preferably, the specific steps of encrypting the plaintext in step S5 are as follows:

[0064] E1. Suppose there is a plaintext r. Shift r to the left by 16 bits to get data R, that is, R=r<<16;

[0065] E2. If gcd(r,M)≠1, let R=R+1;

[0066] E3, repeat step E2 until gcd(r,M)=1;

[0067] E4. According to equation 8: d = r f(modM) calculates d, which is the ciphertext after the plaintext r is encrypted.

[0068] Preferably, the specific steps of decrypting the ciphertext in step S6 are as follows:

[0069] F1. First, find equation 3 based on conditions 3 and 4: y f ≡d 3 Solution y of (modM), condition 4 is M=A*G1*G2

[0070] F2. Since we know that condition 4: M = A*G1*G2, we can get the following equation group 2 from equation 3:

[0071] y1 f ≡d 3 (modG1)

[0072] y2 f ≡d 3 (modG2)

[0073] y a f ≡d 3 (modA);

[0074] F3, first find y1 in equation group 2 f =d 3 The solution z'1 of (modG1);

[0075] F4, according to the three conditions According to Fermat's little theorem and congruence theory, we can deduce:

[0076] F5, then we calculate the following equations in the second group: y2 f ≡d 3 The solution y'2 of (modG2);

[0077] F6. Obtain the equation by exhaustive enumeration: y a f ≡d 3 The solution y' of (modA) a ;

[0078] F7, change y'1, y'2, y' a Call it set Y';

[0079] F8. If G'1*y'1=1modG1, G'2*y'2=1modG2, and A'*y' a =1modA;

[0080] F9. According to Sun Tzu's theorem and set Y', the solution y'0 of equation group 2 is:

[0081] y'0≡(y'1*G'1*G1+y'2*G'2*G2+y' a *A'*A)(modM);

[0082] F10, after obtaining y0', solve equation 4 according to condition 5: z 3 = solution z of y0'(modM);

[0083] F11. Due to condition five Therefore, according to Fermat's little theorem and congruence theory, equation 4 can be derived: 3 =y0'(modM) has the following solution: z0 is the solution to equation 8: d≡R f (modM), i.e. z0 = R;

[0084] F12. Shift z0 right by 16 bits to obtain the data r before encryption, that is, r=z0<<16.

[0085] The asymmetric encryption and signature method proposed in the present invention, which can resist quantum computer attacks, has the following advantages compared with the prior art:

[0086] The present invention can effectively resist the attacks of Shor's algorithm and Grover's algorithm of quantum computers by mainly generating signature keys, signing plaintext, verifying plaintext signatures, generating encryption keys, encrypting plaintext and decrypting ciphertexts. Meanwhile, the present invention has fast speed, high efficiency and few bits, thus improving the security of encrypted data and the authenticity of signatures. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] Figure 1 It is a flowchart of the present invention. DETAILED DESCRIPTION

[0088] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0089] The present invention provides Figure 1 An asymmetric encryption and signature method that can resist quantum computer attacks includes the following steps:

[0090] S1. Generation of signature key, based on the high-order remainder equation x h ≡t 2(modN), where t is the plaintext, x is the required signature data, h is a prime number, and i prime numbers p1, p2, p3..., p are randomly generated. i , called K1 set, and then according to p1, p2, p3..., p i-1 Find the prime number p that meets the trap conditions one and two i , repeat the above steps until j sets are generated, namely K1, K2, K3...K j , and finally K1 to K j After multiplying all the elements in the set, we get N, and use N and h as the public key, which can be made public. j The collection is used as the private key K and is not public;

[0091] The equation -x h ≡t 2 In (modN), h is a prime number greater than 2, and the trap conditions described in steps S1 and S4 are as follows:

[0092] Condition 1 is: ...

[0093] Condition 2 is: N=K1*K2*K3*...

[0094] The specific steps for generating the signature key are as follows:

[0095] A1. First, randomly generate a prime number set K1, which contains 256 prime number elements, namely: p1, p2, p3..., p256;

[0096] Each element p in the set A2 and K1 n , all meet

[0097] The first element p1 in the set A3 and K1 is a large prime number, p2, p3, ..., p 256 is a small prime number;

[0098] A4、Then, according to p1, p2, p3..., p 255 Find a prime number p that meets condition 1 256 ;

[0099] A5. The properties are known: and Therefore And immediately derive equation 2: (p1-1)*(p2-1)*...*(p 256 -1)≡-2(modh);

[0100] A6. Since equation 2 is a linear remainder equation with one variable, it has an infinite number of solutions. Therefore, a prime number solution p that meets condition 1 can be obtained through a finite number of tests. 256 ;

[0101] A7. Then, repeat steps A1 to A6 to generate the K2 set;

[0102] A8. So far, two such sets are generated, namely K1 and K2;

[0103] A9. Multiply all elements in the sets K1 to K2 to obtain N.

[0104] A10. Take N and h as the public key, which can be made public, and the set of K1 to K2 as the private key K, which is private and not made public.

[0105] S2. Signature of plaintext. Suppose there is a plaintext t, and gcd(t,N)==1. The public key N and h are known. Use the private keys K1, K2, K3...K j , according to the higher-order residual equation: x h ≡t 2 (modN), find the solution x0 of the higher-order remainder equation, x0 is the signed data x0;

[0106] The specific steps of signing the plaintext are as follows:

[0107] B1. Perform SM3 hash operation on the data m to be signed to obtain the hashed data t;

[0108] B2. If gcd(t,N)≠1, let t=t+1;

[0109] B3, repeat B2 until gcd(t,N)=1;

[0110] B4. Then, according to equation 1: x h ≡t 2 (modN), find the solution x0 of equation 1, x0 is the signed data x0;

[0111] B5. Since we know condition 2: N = K1*K2, we can get the following equation group 1 from equation 1:

[0112] x1 h ≡t 2 (modK1)

[0113] x2 h ≡t 2 (modK2);

[0114] B6. First find x1 in equation group 1 h ≡t 2The solution x'1 of (modK1);

[0115] B7, according to condition one According to Fermat's little theorem and congruence theory, we can deduce:

[0116] B8. Then calculate the following in equation group 1: x2 h ≡t 2 The solution x'2 of (modK2);

[0117] B9. Let x'1, x'2 be called set X';

[0118] B10. If K'1*x'1=1modK1, K'2*x'2=1modK2, then according to the Sun Tzu theorem and the set X', the solution x0' of the equation group 1 can be obtained as: x0'≡(x'1*K'1*K1+x'2*K'2*K2)(modN). The solution x0' of the equation group 1 is the solution of equation 1, satisfying x0' h ≡t 2 (modN), which is the signed data.

[0119] S3. Verify the signature of the plaintext. To verify the signature of the plaintext t, you only need to verify whether the signed data x0 is the solution of the high-order remainder equation.

[0120] The specific steps of the plaintext signature verification are as follows:

[0121] C1, after performing SM3 hash operation on the data m to be signed, the hashed data t is obtained;

[0122] C2. If gcd(t,N)≠1, let t=t+1;

[0123] C3, repeat C2 until gcd(t,N)=1;

[0124] C4, verify whether the signature data x0 is the solution of equation 1; that is, x0 h ≡t 2 (modN) is true or not. If so, it is a valid signature; otherwise, it is an invalid signature.

[0125] The signature principle is to construct a high-order remainder equation 1 with a trap condition, use the private key to solve equation 1 to obtain the signature, and use the public key to verify whether equation 1 holds to verify the signature. By generating the signature key, signing the plaintext and verifying the plaintext, it can effectively resist the attacks of the Shor algorithm and Grover algorithm of quantum computers. At the same time, it has fast speed, high efficiency, and few bits, which improves the authenticity of the signature.

[0126] S4, the generation of encryption key, according to the congruence theorem, equation two zf ≡d(modM) can be transformed into the following first and second equations, where the first equation is y f ≡d 3 (modM), the second equation is z 3 ≡y(modM), where d is the encrypted ciphertext of plaintext t, y is the encrypted data, and s prime numbers e1, e2, e3..., e are randomly generated. s , called G1 set, and then according to e1, e2, e3..., e s-1 Find the prime number e that meets the trap conditions three, four and five s , repeat the above steps until b sets are generated, namely G1, G2, G3...G b Finally, G1 to G b After multiplying all the elements in the set, we get M. Is it true? If it is true, the additional data A is 1, if not, the additional data A is 3, and finally M is multiplied by A, that is: M = M*A, and M and f are made public as the public key, G1 to G b The set and the additional number A are used as the private key G and are not made public;

[0127] The equation z f ≡d(modM), f is a prime number greater than 2, and the trap conditions described in steps S1 and S4 are as follows:

[0128] Condition three is: ...

[0129] Condition 4: M = A*G1*G2*G3*...

[0130] And condition five:

[0131] The specific steps of generating the encryption key are as follows:

[0132] D1. First, randomly generate a prime number set G1, which contains 256 prime number elements, namely: e1, e2, e3..., e 256 ;

[0133] Each element e in the set D2 and G1 m , all meet and

[0134] The first element e1 in the set D3 and G1 is a large prime number, e2, e3, ..., e 256 Can be a small prime number;

[0135] D4, then according to e1, e2, e3..., e 255Find a prime number e that meets condition three 256 , condition three is ...;

[0136] D5. The properties are known: and Therefore And immediately derive equation 7: (e1-1)*(e2-1)*...*(e 256 -1)≡-3(modf);

[0137] D6. Since equation 7 is a linear remainder equation with one variable, it has an infinite number of solutions, so we can obtain a prime number solution e that meets condition 3 through a finite number of tests. 256 ;

[0138] D7, repeat steps D1-D6 to generate set G2;

[0139] D8. Generate two such sets, G1 and G2;

[0140] D9. Multiply all elements in the sets G1 to G2 to obtain M.

[0141] D10. Judgment condition five: Is it true? If it is true, the additional data A is 1, if it is not true, the additional data A is 3;

[0142] D11. Finally, multiply M by A, that is, M = M*A;

[0143] D12. Use M and f as public keys, and the set G1 to G2 and the additional number A as private keys.

[0144] S5. Encryption of plaintext. Suppose there is a plaintext r, and gcd(r,M)==1. According to the equation d≡r f (modM) calculates d, which is the encrypted ciphertext of the plaintext r;

[0145] The specific steps of encrypting the plaintext are as follows:

[0146] E1. Suppose there is a plaintext r. Shift r to the left by 16 bits to get data R, that is, R=r<<16;

[0147] E2. If gcd(r,M)≠1, let R=R+1;

[0148] E3, repeat step E2 until gcd(r,M)=1;

[0149] E4. According to equation 8: d = r f (modM) calculates d, which is the ciphertext after the plaintext r is encrypted.

[0150] S6, decryption of ciphertext, first according to the condition three of the trap condition And condition 4 M=A*G1*G2*G3*...Find the first equation y f ≡d 3 The solution y of (modM) is then based on condition five. Find the second equation z 3 = the solution z of y(modM), the solution z0 of the second equation is the plaintext r before encryption;

[0151] The specific steps of decrypting the ciphertext are as follows:

[0152] F1. First, find equation 3 based on conditions 3 and 4: y f ≡d 3 Solution y of (modM), condition 4 is M=A*G1*G2

[0153] F2. Since we know that condition 4: M = A*G1*G2, we can get the following equation group 2 from equation 3:

[0154] y1 f ≡d 3 (modG1)

[0155] y2 f ≡d 3 (modG2)

[0156] y a f ≡d 3 (modA);

[0157] F3, first find y1 in equation group 2 f =d 3 The solution z'1 of (modG1);

[0158] F4, according to the three conditions According to Fermat's little theorem and congruence theory, we can deduce:

[0159] F5, then we calculate the following equations in the second group: y2 f ≡d 3 The solution y'2 of (modG2);

[0160] F6. Obtain the equation by exhaustive enumeration: y a f ≡d 3 The solution y' of (modA) a ;

[0161] F7, change y'1, y'2, y' a Call it set Y';

[0162] F8. If G'1*y'1=1modG1, G'2*y'2=1modG2, and A'*y' a =1modA;

[0163] F9. According to Sun Tzu's theorem and set Y', the solution y'0 of equation group 2 is:

[0164] y'0≡(y'1*G'1*G1+y'2*G'2*G2+y' a *A'*A)(modM);

[0165] F10, after obtaining y0', solve equation 4 according to condition 5: z 3 = solution z of y0'(modM);

[0166] F11. Due to condition five Therefore, according to Fermat's little theorem and congruence theory, equation 4 can be derived: 3 =y0'(modM) has the following solution: z0 is the solution to equation 8: d≡R f (modM), i.e. z0 = R;

[0167] F12. Shift z0 right by 16 bits to obtain the data r before encryption, that is, r=z0<<16.

[0168] The encryption principle is to construct a high-order remainder equation 2 with a trap condition, use the public key to calculate equation 2 to obtain the ciphertext, and use the private key to solve equation 2 with respect to the ciphertext to obtain the plaintext. The signature key is generated by first randomly generating i prime numbers called the K1 set, and then finding a prime number that meets the trap conditions 1 and 2 based on the K1 set, repeating the above steps until j sets are generated, and finally multiplying all elements in the K1 to Kj sets to obtain N, and using N and h as the public key, K1 to K j The set is used as the private key K. It can effectively resist the attacks of the Shor algorithm and Grover algorithm of quantum computers by generating encryption keys, encrypting plaintext and decrypting ciphertext. At the same time, it has fast speed, high efficiency and few bits, which improves the security of encrypted data.

[0169] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An asymmetric encryption and signature method capable of resisting quantum computer attacks, characterized in that: The steps include: S1. Generation of signature key, based on the high-order residual equation equation x h ≡t 2 (modN), where t is the plaintext, x is the required signature data, h is a prime number, and i prime numbers p1, p2, p3..., p are randomly generated. i , called K1 set, and then according to p1, p2, p3..., p i-1 Find the prime number p that meets the trap conditions one and two i , repeat the above steps until j sets are generated, namely K1, K2, K3...K j , and finally K1 to K j Multiply all the elements in the set to get N, and make N and h public as the public key. j The collection is used as the private key K and is not public; S2. Signature of plaintext. Suppose there is a plaintext t, and gcd(t,N)==1. The public key N and h are known. Use the private keys K1, K2, K3...K j , according to the higher-order residual equation: x h ≡t 2 (modN), find the solution x0 of the higher-order remainder equation, x0 is the signed data x0; S3. Verify the signature of the plaintext. To verify the signature of the plaintext t, you only need to verify whether the signed data x0 is the solution of the high-order remainder equation. S4, the generation of encryption key, according to the congruence theorem, equation two z f ≡d(modM) can be transformed into the following first and second equations, where the first equation is y f ≡d 3 (modM), the second equation is z 3 ≡y(modM), where d is the encrypted ciphertext of plaintext t, y is the encrypted data, and s prime numbers e1, e2, e3..., e are randomly generated. s , called G1 set, and then according to e1, e2, e3..., e s-1 Find the prime number e that meets the trap conditions three, four and five s , repeat the above steps until b sets are generated, namely G1, G2, G3...G b , and finally G1 to G b After multiplying all the elements in the set, we get M. Is it true? If it is true, the additional data A is 1, if not, the additional data A is 3, and finally M is multiplied by A, that is: M = M*A, and M and f are made public as the public key, G1 to G b The set and the additional number A are used as the private key G and are not made public; S5. Encryption of plaintext. Suppose there is a plaintext r, and gcd(r,M)==1. According to the equation d≡r f (modM) calculates d, which is the encrypted ciphertext of the plaintext r; S6, decryption of ciphertext, first according to the condition three of the trap condition And condition 4 M=A*G1*G2*G3*...Find the first equation y f ≡d 3 The solution y of (modM) is then based on condition five. Find the second equation z 3 = the solution z of y(modM), the solution z0 of the second equation is the plaintext r before encryption; The trap conditions in steps S1 and S4 are as follows: Condition 1 is: Condition 2: N = K1*K2*K3*... Condition three is: Condition 4: M = A*G1*G2*G3*... And condition five:

2. The asymmetric encryption and signature method capable of resisting quantum computer attacks according to claim 1, characterized in that: The specific steps for generating the signature key are as follows: A1. First, randomly generate a prime number set K1, which contains 256 prime number elements, namely: p1, p2, p3..., p 256 ; Each element p in the set A2 and K1 n , all meet The first element p1 in the set A3 and K1 is a large prime number, p2, p3, ..., p 256 is a small prime number; A4、Then, according to p1, p2, p3..., p 255 Find a prime number p that meets condition 1 256 ; A5. The properties are known: and Therefore And immediately derive equation 2: (p1-1)*(p2-1)*...*(p 256 -1)≡-2(modh); A6. Since equation 2 is a linear remainder equation with one variable, it has an infinite number of solutions. Therefore, a prime number solution p that meets condition 1 can be obtained through a finite number of tests. 256 ; A7. Then, repeat steps A1 to A6 to generate the K2 set; A8. So far, two such sets are generated, namely K1 and K2; A9. Multiply all elements in the sets K1 to K2 to obtain N. A10. Make N and h public keys, and make the set of K1 to K2 the private key K, which is private and not public.

3. The asymmetric encryption and signature method capable of resisting quantum computer attacks according to claim 1, characterized in that: The specific steps for signing the plain text in step 2 are as follows: B1. Perform SM3 hash operation on the data m to be signed to obtain the hashed data t; B2. If gcd(t,N)≠1, let t=t+1; B3, repeat B2 until gcd(t,N)=1; B4. Then, according to equation 1: x h ≡t 2 (modN), find the solution x0 of equation 1, x0 is the signed data x0; B5. Since we know condition 2: N = K1*K2, we can get the following equation group 1 from equation 1: x1 h ≡t 2 (modK1) <h2 style=";text-align:left;direction:ltr">x2<h2 style=";text-align:left;direction:ltr"> h <h2 style=";text-align:left;direction:ltr"> ≡t<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> (modK2); B6. First find x1 in equation group 1 h ≡t 2 The solution x'1 of (modK1); B7, according to condition one According to Fermat's little theorem and congruence theory, we can deduce: B8. Then calculate the following in equation group 1: x2 h ≡t 2 The solution x'2 of (modK2); B9. Let x'1, x'2 be called set X'; B10. If K'1*x'1=1modK1, K'2*x'2=1modX2, then according to the Sunzi theorem and the set X', the solution x0' of the equation group 1 can be obtained as: x0'≡(x'1*K'1*K1+x'2*K'2*K2)(modN). The solution x0' of the equation group 1 is the solution of equation 1, satisfying x0' h ≡t 2 (modN), which is the signed data.

4. The asymmetric encryption and signature method capable of resisting quantum computer attacks according to claim 1, characterized in that: The specific steps of the plaintext signature verification in step S3 are as follows: C1, after performing SM3 hash operation on the data m to be signed, the hashed data t is obtained; C2. If gcd(t,N)≠1, let t=t+1; C3, repeat C2 until gcd(t,N)=1; C4, verify whether the signature data x0 is the solution of equation 1; that is, x0 h ≡t 2 (modN) is true or not. If so, it is a valid signature; otherwise, it is an invalid signature.

5. The asymmetric encryption and signature method capable of resisting quantum computer attacks according to claim 1, characterized in that: The specific steps for generating the encryption key in step S4 are as follows: D1. First, randomly generate a prime number set G1, which contains 256 prime number elements, namely: e1, e2, e3..., e 256 ; Each element e in the set D2 and G1 m , all meet and The first element e1 in the set D3 and G1 is a large prime number, e2, e3, ..., e 256 Can be a small prime number; D4, then according to e1, e2, e3..., e 256 Find a prime number e that meets condition three 256 , condition three is D5. The properties are known: and Therefore And immediately derive equation 7: (e1-1)*(e2-1)*...*(e 256 -1)≡-3(modf); D6. Since equation 7 is a linear remainder equation with one variable, it has an infinite number of solutions, so we can obtain a prime number solution e that meets condition 3 through a finite number of tests. 256 ; D7, repeat steps D1-D6 to generate set G2; D8. Generate two such sets, G1 and G2; D9. Multiply all elements in the sets G1 to G2 to obtain M. D10. Judgment condition five: Is it true? If it is true, the additional data A is 1, if it is not true, the additional data A is 3; D11. Finally, multiply M by A, that is, M = M*A; D12. Use M and f as public keys, and the set G1 to G2 and the additional number A as private keys.

6. The asymmetric encryption and signature method capable of resisting quantum computer attacks according to claim 1, characterized in that: The specific steps of encrypting the plaintext in step S5 are as follows: E1. Suppose there is a plaintext r. Shift r to the left by 16 bits to get data R, that is, R=r<<16; E2. If gcd(r,M)≠1, let R=R+1; E3, repeat step E2 until gcd(r,M)=1; E4. According to equation 8: d = r f (modM) calculates d, which is the ciphertext after the plaintext r is encrypted.

7. The asymmetric encryption and signature method capable of resisting quantum computer attacks according to claim 6, characterized in that: The specific steps of decrypting the ciphertext in step S6 are as follows: F1. First, find equation 3 based on conditions 3 and 4: y f ≡d 3 Solution y of (modM), condition 4 is M=A*G1*G2 F2. Since we know that condition 4: M = A*G1*G2, we can get the following equation group 2 from equation 3: y1 f ≡d 3 (modG1) y2 f ≡d 3 (modG2) and a f ≡d 3 (fashion); F3, first find y1 in equation group 2 f =d 3 The solution z'1 of (modG1); F4, according to the three conditions According to Fermat's little theorem and congruence theory, we can deduce: F5, then we calculate the following equations in the second group: y2 f ≡d 3 The solution y'2 of (modG2); F6. Obtain the equation by exhaustive enumeration: y a f ≡d 3 The solution y' of (modA) a ; F7, change y'1, y'2, y' a Call it set Y'; F8. If G'1*y'1=1modG1, G'2*y'2=1modG2, and A'*y' a =1modA; F9. According to Sun Tzu's theorem and set Y', the solution y'0 of equation group 2 is: y'0≡(y'1*G'1*G1+y'2*G'2*G2+y' a *A'*A)(modM); F10, after obtaining y0', solve equation 4 according to condition 5: z 3 = solution z of y0'(modM); F11. Due to condition five Therefore, according to Fermat's little theorem and congruence theory, equation 4 can be derived: 3 =y0'(modM) has the following solution: z0 is the solution to equation 8: d≡R f (modM), i.e. z0 = R; F12. Shift z0 right by 16 bits to obtain the data r before encryption, that is, r=z0<<16.

Citation Information

Patent Citations

  • Big data encryption method

    CN104883257A

  • Quantum attack resistant asymmetric encryption method based on finite groups of lie type

    CN109981253A