An asymmetric encryption method

By generating positive integer e and decimal d of a specific relationship, a new asymmetric encryption method is formed, and the cosine function is used for encryption and decryption, which solves the problem of fewer types of existing asymmetric encryption algorithms and achieves more efficient information protection.

CN114726531BActive Publication Date: 2025-03-18ZHEJIANG DIGITAL QIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210454558.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2025-03-18
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

There are fewer types of existing asymmetric encryption algorithms, which are difficult to meet the needs of complex information protection.

Method used

A new asymmetric encryption method is proposed. By generating the positive integer e and the decimal d, d*e=(k*10^s*2*π)_N+1, the integer n is generated, and the public key {d,s,N,n} is formed. The ciphertext is calculated using the cosine function during the encryption process, and the intermediate value is calculated using the multi-angle formula during the decryption process to obtain the plaintext.

Benefits of technology

This method provides higher encryption and decryption efficiency, can effectively protect information, and can resist exhaustive cracking attacks by increasing the number of decimal places.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114726531B_ABST
    Figure CN114726531B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information technology, and in particular to an asymmetric encryption method, comprising: generating a key pair: generating a positive integer e and a positive decimal d, so that d*e=(k*10^s*2*π)_N+1; the positive integer e is saved as a key, n represents the length value of a plain text in decimal, and {d, s, N, n} is made public as a public key; encryption process: trying to generate a decimal m, so that floor(10^n*cos(m))=M, M is a plain text; the encryption party calculates C=(cos(d*m))_N as a cipher text; decryption process: calculating T=(cos(e*d*m))_N; intermediate value T=(cos(m))_N; calculating floor(10^n*T) to obtain a plain text M. The substantial effect of the present invention is: providing a new asymmetric encryption method with higher encryption and decryption 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 encryption method. Background Art

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

[0003] The technical problem to be solved by the present invention is that the types of current asymmetric encryption algorithms are relatively few. A new asymmetric encryption algorithm is proposed.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: an asymmetric encryption method, comprising: generating a secret key pair: generating a positive integer e and a positive decimal d, so that d*e=(k*10^s*2*π)_N+1, where s 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, and an integer n is generated, where n represents the length value of the plaintext when it is expressed in decimal, and {d, s, 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 s, M is the plaintext; the encryption party calculates C=(cos(d*m))_N, and C is the ciphertext; decryption process: use the multiple angle formula to calculate the intermediate value T=(cos(e*d*m))_N, where e is the multiple; from d*e=(k*10^s*2*π)_N+1, we can get the intermediate value T=(cos(((k*10^s*2*π)_N+1)*m))_N=(cos(m))_N; calculate floor(10^n*T) to get the plaintext M.

[0005] Preferably, all cos() functions in the encryption process and the decryption process are replaced by sin() functions or tan() functions, and the generated positive integer e is an odd number.

[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 r=1, trying to generate a decimal m, so that floor(10^r*cos(m))=m_n-1; adding 1 to the auxiliary variable r, trying to generate a decimal p, so that floor(10^r*(cos(m+p)- cos(m)))=1, generate multiple b, b∈[-9,9], try to change the value of b so that floor(10^r*(cos(m+b*p)))=floor(m_n-1*10^(r-1)+m_n-2*10^(r-2)+…+m_0*10^(rn)), 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 to provide a new asymmetric encryption method with higher encryption and decryption efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 Schematic diagram of the key generation process of the asymmetric encryption method in Example 1.

[0009] Figure 2 This is a schematic diagram of the encryption process of the asymmetric encryption method in Example 1.

[0010] Figure 3 This is a schematic diagram of the decryption process of the asymmetric encryption method in Example 1.

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

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

[0013] Embodiment 1:

[0014] An asymmetric encryption method, see the attached Figure 1 , generating a secret key pair includes: step A01) generating a positive integer e and a positive decimal d, so that d*e=(k*10^s*2*π)_N+1, where s is the 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; 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, N, n} is made public as a public key. N is used to ensure the accuracy of the calculation, and in this embodiment, N=6. Take the plaintext length of 2 as an example for explanation, that is, in this implementation, n=2, and s=5 is set at the same time.

[0015] In this embodiment, a positive integer e=3 and a decimal d=6073746.130273 are generated. At this time, d*e=(29*10^5*2*π)_N+1=18221238.390819. The verification process is: cos(2.567)=-0.83941376, and cos(d*e*2.567)=cos(46773918.949232)= -0.83941104. The error is 0.00000272, and the error rate is 0.0003%. 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,N,n}={6073746.130273,5,6,2}.

[0016] Please see attached Figure 2 The encryption process includes: Step B01) The encryption party attempts to generate a decimal m such that floor(10^n*cos(m))=M, and the number of decimal places of m does not exceed s, and M is the plain text; Step B02) The encryption party calculates C=(cos(d*m))_N, and C is the cipher text.

[0017] 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 decimals exactly match the plaintext M.

[0018] Calculate cos(d*m)=cos(d*m)=cos(412528837.16814216)=-0.9216475410. Keep 6 decimal places and get cos(d*m)_N=-0.921647. That is, the ciphertext C=-0.921647. Send the ciphertext to the decryption party.

[0019] Please see attached Figure 3 The decryption process includes: step C01) using the multiple angle formula to calculate the intermediate value T=(cos(e*d*m))_N, where e is the multiple; step C02) from d*e=(k*10^s*2*π)_N+1, the intermediate value T=(cos(((k*10^s*2*π)_N+1)*m))_N=(cos(m))_N; step C03) calculating floor(10^n*T) to obtain the plaintext M.

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

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

[0022] 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].

[0023] 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].

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

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

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

[0027] Replace all cos() functions in the encryption and decryption processes with sin() functions or tan() functions, and the generated positive integer e is an odd number. When e is an odd number, the angle-doubling formula of the sin() function does not contain the cosine term.

[0028] 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.

[0029] Exhaustive cracking requires traversing each possible value one by one, that is, trying to generate a guess value d', calculating cos(d*m), so that cos(d*m) is exactly the same as the public ciphertext C. When m is a decimal and the value of s is large, such as s 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 time is the same 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 s is sufficient to deal with exhaustive cracking.

[0030] 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.

[0031] Please see attached Figure 4 , the method for generating a decimal m includes: step D01) 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 D02) setting the auxiliary variable r=1, trying to generate a decimal m, so that floor(10^r*cos(m))=m_n-1; step D03) adding 1 to the auxiliary variable r, trying to generate a decimal p, so that floor(10^r*(cos(m +p)-cos(m)))=1, generate multiple b, b∈[-9,9], try to change the value of b so that floor(10^r*(cos(m+b*p)))=floor(m_n-1*10^(r-1)+m_n-2*10^(r-2)+…+m_0*10^(rn)), update m to m+b*p; step D04) repeat the previous step until floor(10^n*cos(m))=M, and get the value of the decimal m.

[0032] 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 r is added by 1, and try 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, update m to the value of m+b*p, that is, m=67.92, and obtain the value of the decimal m that finally meets the requirements.

[0033] The beneficial technical effect of this embodiment is: providing a new asymmetric encryption method, the encryption and decryption process involves the calculation of a cosine function, and has higher encryption and decryption efficiency.

[0034] 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 encryption method, characterized in that: include: Generate a key pair: Generate a positive integer e and a positive decimal d, so that d*e=(k*10^s*2*π)_N+1, where s 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, 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 s, and M is the plaintext; The encryption party calculates C = (cos(d*m))_N, where C is the ciphertext; Decryption process: Use the double angle formula to calculate the intermediate value T=(cos(e*d*m))_N, where e is the multiple; From d*e=(k*10^s*2*π)_N+1, we can get the intermediate value T=(cos(((k*10^s*2*π)_N+1)*m))_N=(cos(m))_N; Calculate floor(10^n*T) to get the plaintext M; 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 r=1, and try to generate a decimal m so that floor(10^r*cos(m))=m_n-1; Add 1 to the auxiliary variable r, try to generate a decimal p, so that floor(10^r*(cos(m+p)-cos(m)))=1, generate a multiple b, b∈[-9,9], try to change the value of b, so that floor(10^r*(cos(m+b*p)))=floor(m_n-1*10^(r-1)+m_n-2*10^(r-2)+…+m_0*10^(rn)), 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. An asymmetric encryption method according to claim 1, characterized in that: Replace all cos() functions in the encryption and decryption processes with sin() functions or tan() functions, and the generated positive integer e is an odd number.

Citation Information

Patent Citations

  • Asymmetric FHE (Fully Homomorphic Encryption) method and secret key substitution and cipher text delivery methods thereof

    CN107181584A

  • Encrypted data transmission system and method based on E-mail

    CN113301027A