Asymmetric key encryption and decryption method

By generating a key pair of specific positive integers and decimals, and using trigonometric functions such as cosine functions for encryption and decryption, the problem of fewer types of existing asymmetric encryption algorithms is solved, efficient encryption and decryption operations are realized, and security and efficiency are enhanced. .

CN114745121BActive Publication Date: 2024-11-05ZHEJIANG DIGITAL QIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210455114.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2024-11-05
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

There are fewer types of existing asymmetric encryption algorithms and lack efficient encryption and decryption methods.

Method used

Using a new asymmetric key encryption and decryption method, by generating positive integers e, d and decimal s, d*e*s=(k*10^r*2*π)_N+1, using a cosine function or Other trigonometric functions perform encryption and decryption operations, avoid exponentiation operations and improve efficiency.

Benefits of technology

It provides an efficient asymmetric encryption and decryption method, which reduces the computational complexity, improves the efficiency of the encryption and decryption process, and enhances security through precision control and error management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114745121B_ABST
    Figure CN114745121B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information technology, and in particular to an asymmetric key encryption and decryption method, comprising: generating a secret key pair: generating a positive integer e, a positive integer d and a positive decimal s, so that d*e*s=(k*10^r*2*π)_N+1; the positive integer e is saved as a secret key, an integer n is generated, and {d, s, r, N, n} is made public as a public key; an encryption process: generating a decimal m, so that floor(10^n*cos(m))=M, M is a plain text; calculating C=(cos(d*s*m))_N, C is a cipher text; a decryption process: using a double angle formula to calculate an intermediate value T=(cos(e*d*s*m))_N; the intermediate value T=(cos(m))_N; calculating floor(10^n*T) to obtain the plain text M. The substantial effect of the present invention is: providing a new asymmetric encryption method, the encryption and decryption operations do not involve power operations, and have higher efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to an asymmetric key encryption and decryption method. Background Art

[0002] Asymmetric encryption refers to an encryption and decryption algorithm that uses different keys for encryption and decryption. The two keys in an asymmetric encryption algorithm are public key and private key, referred to as public key and private key. The public key is open to the public and can be used by anyone, while the private key is known only to the decryptor. If the data is encrypted with a public key, it can only be decrypted with the corresponding private key, which is called the encryption process; if the data is encrypted with a private key, it can only be decrypted with the corresponding public key, which is called the signing and verification process. Illegal users cannot deduce the decryption key based on the public encryption key, which greatly strengthens the protection of information. Summary of the invention

[0003] The technical problem to be solved by the present invention is that there are few types of current asymmetric encryption algorithms. A new asymmetric key encryption and decryption method is proposed.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: an asymmetric key encryption and decryption method, comprising: generating a secret key pair: generating a positive integer e, a positive integer d and a positive decimal s, so that d*e*s=(k*10^r*2*π)_N+1, wherein r is a preset decimal limit, the subscript N indicates that the calculation formula in the brackets finally retains N decimal places, and k is a positive integer; the positive integer e is saved as a secret key, an integer n is generated, n represents the length value of the plain text when it is expressed in decimal, and {d, s, r, N, n} is made public as a public key; encryption process: the encrypting party attempts to generate a decimal m, so that floor(10^n*cos(m))=M, and the number of decimal places of m does not exceed r, and M is the plain text; the encrypting party calculates C=(cos(d*s*m))_N, and C is the ciphertext; decryption process: using the double angle formula to calculate the intermediate value T=(cos(e*d*s*m))_N, wherein e is a multiple; by d*e* s=(k*10^r*2*π)_N+1, and the intermediate value T=(cos(((k*10^r*2*π)_N+1)*m))_N=(cos(m))_N; calculate floor(10^n*T) to get the plaintext M; signature process: try to generate a decimal w, so that floor(10^n*cos(w))=W, and the number of decimal places of w does not exceed r, W is the signature content; calculate Sn=(cos( e*s*w))_N, Sn is used as the signature; verification process: use the multiple angle formula to calculate the intermediate value T=(cos(d*e*s*w))_N, where d is the multiple; from d*e*s=(k*10^s*2*π)_N+1, we can get the intermediate value T=(cos(((k*10^s*2*π)_N+1)*w))_N=(cos(w))_N; calculate floor(10^n*T) to get the signature content W.

[0005] Preferably, the cos() functions in the encryption process, decryption process, signature process and verification process are all replaced by sin() functions or tan() functions, and the generated positive integers e and d are both odd numbers.

[0006] Preferably, the method for generating a decimal m includes: taking out the value of the secret key M at each bit, recorded as (m_0, m_1, ..., m_n-1), that is, M=m_n-1*10^(n-1)+...+m_1*10+m_0; setting the auxiliary variable j=1, trying to generate a decimal m, so that floor(10^j*cos(m))=m_n-1; adding 1 to the auxiliary variable j, trying to generate a decimal p, so that floor(10^j*(cos(m+p)- cos(m)))=1, generate multiple b, b∈[-9,9], try to change the value of b so that floor(10^j*(cos(m+b*p)))=floor(m_n-1*10^(j-1)+m_n-2*10^(j-2)+…+m_0*10^(jn)), update m to m+b*p; repeat the previous step until floor(10^n*cos(m))=M, and get the value of the decimal m.

[0007] The substantial effect of the present invention is that it provides a new asymmetric encryption method, in which encryption and decryption operations do not involve power operations and have higher efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 This is a schematic diagram of an asymmetric key encryption and decryption method according to Embodiment 1.

[0009] Figure 2 This is a schematic diagram of a method for generating a decimal m according to the first embodiment. DETAILED DESCRIPTION

[0010] The specific implementation of the present invention will be further described below through specific examples in conjunction with the accompanying drawings.

[0011] An asymmetric key encryption and decryption method, please refer to the attached Figure 1 ,include:

[0012] Generate a key pair: Step A01) Generate a positive integer e, a positive integer d, and a positive decimal s, so that d*e*s=(k*10^r*2*π)_N+1, where r is the preset decimal limit, the subscript N indicates that the calculation formula in the brackets will eventually retain N decimal places, and k is a positive integer; Step A02) The positive integer e is saved as a secret key, and an integer n is generated, where n represents the length value of the plaintext when it is expressed in decimal, and {d, s, r, N, n} is published as a public key. N is used to ensure the accuracy of the calculation. In this embodiment, N=6. Take the plaintext length of 2 as an example for explanation, that is, in this implementation, n=2, and r=5 is set at the same time.

[0013] In this embodiment, a positive integer e=3, a positive integer d=9, and a positive decimal s=674860.681141 are generated. At this time, d*e*s=(29*10^5*2*π)_N+1=18221238.390807. The verification process is: cos(2.567)=-0.83941376, and cos(d*e*s*2.567)=cos(46773918.949201)= -0.83939419. The error is 0.00001957, and the error rate is 0.0023%. It can be used for encryption and decryption within the error range. If you want to improve the accuracy, just increase the value of N. If you set N=100, it will provide higher accuracy. The public key is {d,s,r,N,n}={9,674860.681141,5,6,2}.

[0014] Encryption process: Step A03) The encrypting party attempts to generate a decimal m such that floor(10^n*cos(m))=M, and the number of decimal places in m does not exceed r, and M is the plaintext; Step A04) The encrypting party calculates C=(cos(d*s*m))_N, and C is the ciphertext.

[0015] The plaintext length is 2. For example, the process of encrypting plaintext M=36 is as follows: Try to generate a decimal m so that floor(10^2*cos(m))=36. Try to generate m=67.92, cos(67.92)=0.366977, where the first two digits exactly match the plaintext M.

[0016] Calculate cos(d*s*m)=cos(d*m)=cos(412528837.16787048)=-0.921645701. Keep 6 decimal places and get cos(d*m)_N=-0.921645. That is, the ciphertext C=-0.921645. Send the ciphertext to the decryption party.

[0017] Decryption process: Step A05) Use the multiple angle formula to calculate the intermediate value T=(cos(e*d*s*m))_N, where e is the multiple; Step A06) From d*e*s=(k*10^r*2*π)_N+1, we get the intermediate value T=(cos(((k*10^r*2*π)_N+1)*m))_N=(cos(m))_N; Step A07) Calculate floor(10^n*T) to get the plaintext M.

[0018] cos(e*d*s*m)=cos(3*d*m)=-3*cos(d*s*m)+4*(cos(d*s*m))^3=-3*C+4*C^3=-0.3665548283. Keep 6 decimal places and get T=cos(e*d*m)_N=-0.366554. Calculate floor(10^2*T)=36, which is the plaintext M, thus completing the decryption process.

[0019] Signature process: Step A08) Try to generate a decimal w, so that floor(10^n*cos(w))=W, and the number of decimal places of w does not exceed r, W is the signature content; Step A09) Calculate Sn=(cos(e*s*w))_N, Sn is the signature. The signature length is 2, signature W=12, try to generate a decimal w=1.45, so that floor(10^2*cos(1.45))=floor(10^2*0.120502)=12.

[0020] Calculate cos(3*674860.681141*1.45)=cos(e*s*w)=0.0134236342 and keep 6 decimal places to obtain the signature Sn=(cos(d*s*w))_N=0.013423, and publish the signature Sn.

[0021] Verification process: Step A10) Use the multiple angle formula to calculate the intermediate value T=(cos(d*e*s*w))_N, where d is the multiple; Step A11) From d*e*s=(k*10^s*2*π)_N+1, we get the intermediate value T=(cos(((k*10^s*2*π)_N+1)*w))_N=(cos(w))_N; Step A12) Calculate floor(10^n*T) to obtain the signature content W.

[0022] Calculate cos(9*e*s*w):

[0023] cos(9*e*s*w)=cos(e*s*w)*(-3+4*cos(e*s*w)^2)*(64*cos(e*s*w)^6-96*cos(e*s*w)^4 +36*cos(e*s*w)^2-3)=Sn*(-3+4*Sn^2)*(64*Sn^6-96*Sn^4+36*Sn^2-3)=0.1205169664.

[0024] Keep 6 decimal places to get T=(cos(d*e*s*w))_N=0.120516, and calculate floor(10^n*T)=12. This verifies that the source of the signature W=12 is the owner of the private key corresponding to the public key d.

[0025] Replace all cos() functions in the encryption process, decryption process, signature process, and verification process with sin() functions or tan() functions, and the generated positive integers e and d are both odd numbers. When d and e are odd numbers, the angle-doubling formula of the sin() function does not contain the cosine term.

[0026] The angle doubling formula for the sine function is:

[0027] sin(mx)=∑(-1)^k*m! / ((2k+1)!*(m-2k-1)!)*(cosx)^(m-2k-1)*(sinx)^(2k+1), where m is an even number, k∈[0,m / 2-1].

[0028] sin(mx)=∑(-1)^k*m! / ((2k+1)!*(m-2k-1)!)*(cosx)^(m-2k-1)*(sinx)^(2k+1), where m is an odd number, k∈[0,(m-1) / 2].

[0029] The double angle formula of the cosine function is:

[0030] cos(mx)=∑(-1)^k*m! / ((2k)!*(m-2k)!)*(cosx)^(m-2k)*(sinx)^(2k), where m is an even number, k∈[0,m / 2].

[0031] cos(mx)=∑(-1)^k*m! / ((2k)!*(m-2k)!)*(cosx)^(m-2k)*(sinx)^(2k), where m is an odd number, k∈[0,(m-1) / 2].

[0032] The security of this embodiment is based on the fact that the cosine value of a given number can be calculated quickly and the accuracy can be set by oneself. However, it is very difficult to reversely calculate the angle value from the cosine value. There are two ways to reversely calculate the angle value from the cosine value: exhaustive cracking and inverse cosine function calculation.

[0033] Exhaustive cracking requires traversing each possible value one by one, that is, trying to generate a guess value d', calculating cos(d*s*m), so that cos(d*s*m) is exactly the same as the public ciphertext C. When m is a decimal and the value of r is large, such as r is 100, the decimal places of m can be up to 100. Assuming that the integer number of m is fixed as a constant, traversing 100 decimal places requires 10^100 cosine function operations. At a computing frequency of 1GHz, it takes 10^91 seconds, about 3*10^82 years. When calculating with a computing power of 537212.00Tflops, Tflops is a trillion floating-point operations per second. Assuming that the cosine function calculation takes the same time as a single floating-point operation, the time required is still 2*10^82 seconds, about 6*10^73 years. It can be seen that increasing the value of r is sufficient to deal with exhaustive cracking.

[0034] Since the value range of the inverse cosine function arccos is [-π / 2, π / 2], after obtaining the value of the inverse cosine function arccos, it is necessary to correct it. That is, add the value of arccos(C) to 2*k*π. Since π is an irrational number, it has countless decimal places. The decimal places of the value of m are also uncertain, so the value of m cannot be determined. Moreover, the ciphertext C only retains N decimal places, and the decimal places exceeding N are truncated, which is a lossy transformation. The result of using C to calculate the inverse cosine function itself has a large error.

[0035] Please see attached Figure 2 , the method for generating a decimal m includes: step B01) taking out the value of the secret key M at each bit, recorded as (m_0, m_1, ..., m_n-1), that is, M=m_n-1*10^(n-1)+...+m_1*10+m_0; step B02) setting the auxiliary variable j=1, trying to generate a decimal m, so that floor(10^j*cos(m))=m_n-1; step B03) adding 1 to the auxiliary variable j, trying to generate a decimal p, so that floor(10^j*(cos(m +p)-cos(m)))=1, generate multiple b, b∈[-9,9], try to change the value of b so that floor(10^j*(cos(m+b*p)))=floor(m_n-1*10^(j-1)+m_n-2*10^(j-2)+…+m_0*10^(jn)), update m to m+b*p; step B04) repeat the previous step until floor(10^n*cos(m))=M, and get the value of the decimal m.

[0036] In this embodiment, M=36, and the two digits are m_1=3 and m_0=6. Try to generate m=67.86, calculate cos(67.86)=0.310537, only the first decimal matches m_1, and the second decimal differs from m_0 by 5. Then j adds 1 to itself, and tries to find the decimal p=0.015, so that floor(10^2*(cos(67.86+0.015)-cos(67.86)))=floor(10^2*0.01422)=1. When trying to generate the multiple b=4, floor(10^2*(cos(67.86+4*0.015)))=36, and update m to the value of m+b*p, that is, m=67.92, to obtain the value of the decimal m that finally meets the requirements.

[0037] The beneficial technical effect of this embodiment is: a new asymmetric encryption method is provided, and the encryption and decryption operations do not involve power operations, which has higher efficiency.

[0038] The above-described embodiment is only a preferred solution of the present invention and does not limit the present invention in any form. There are other variations and modifications without exceeding the technical solution described in the claims.

Claims

1. An asymmetric key encryption and decryption method, characterized in that: include: Generate a key pair: Generate a positive integer e, a positive integer d, and a positive decimal s, so that d*e*s=(k*10^r*2*π)_N+1, where r is the preset decimal limit, the subscript N indicates that the calculation formula in the brackets will eventually retain N decimal places, and k is a positive integer; The positive integer e is saved as the secret key, and the integer n is generated, where n represents the length of the plaintext in decimal, and {d, s, r, N, n} is published as the public key; Encryption process: The encryption party attempts to generate a decimal m such that floor(10^n*cos(m))=M, and the number of decimal places in m does not exceed r, and M is the plaintext; The encryption party calculates C = (cos(d*s*m))_N, where C is the ciphertext; Decryption process: Use the double angle formula to calculate the intermediate value T=(cos(e*d*s*m))_N, where e is the multiple; From d*e*s=(k*10^r*2*π)_N+1, we can get the intermediate value T=(cos(((k*10^r*2*π)_N+1)*m))_N=(cos(m))_N; Calculate floor(10^n*T) to get the plaintext M; Signing process: Try to generate a decimal w such that floor(10^n*cos(w))=W, and the number of decimal places of w does not exceed r, where W is the signature content; Calculate Sn=(cos(e*s*w))_N, Sn is used as the signature; Verification process: Use the double angle formula to calculate the intermediate value T=(cos(d*e*s*w))_N, where d is the multiple; From d*e*s=(k*10^s*2*π)_N+1, we can get the intermediate value T=(cos(((k*10^s*2*π)_N+1)*w))_N=(cos(w))_N; Calculate floor(10^n*T) to get the signature content W; Methods for generating the decimal m include: Take out the value of each bit of the secret key M, recorded as (m_0, m_1, ..., m_n-1), that is, M = m_n-1*10^(n-1)+...+m_1*10+m_0; Set the auxiliary variable j=1, and try to generate a decimal m so that floor(10^j*cos(m))=m_n-1; Add 1 to the auxiliary variable j, try to generate a decimal p, so that floor(10^j*(cos(m+p)-cos(m)))=1, generate a multiple b, b∈[-9,9], try to change the value of b, so that floor(10^j*(cos(m+b*p)))=floor(m_n-1*10^(j-1)+m_n-2*10^(j-2)+…+m_0*10^(jn)), update m to m+b*p; Repeat the previous step until floor(10^n*cos(m))=M, and get the value of the decimal m; The double angle formula of the cosine function is: cos(mx)=∑(-1)^k*m! / ((2k)!*(m-2k)!)*(cosx)^(m-2k)*(sinx)^(2k), where m is an even number, k∈[0,m / 2]; cos(mx)=∑(-1)^k*m! / ((2k)!*(m-2k)!)*(cosx)^(m-2k)*(sinx)^(2k), where m is an odd number, k∈[0,(m-1) / 2].

2. The asymmetric key encryption and decryption method according to claim 1, characterized in that: Replace all cos() functions in the encryption process, decryption process, signature process and verification process with sin() function or tan() function, and the generated positive integers e and d are both odd numbers.