Signature implementation, signature verification method, signature terminal, signature verification terminal and storage medium

The signature private key is mapped to the encryption private key through a one-time encryption factor and a preset encryption function, and a third-party trusted agency is used to generate and update the encryption factor, which solves the inconvenience of saving private keys for elliptic curve encryption algorithms such as SM2 in a mobile environment. and the problem of insufficient security, realizing the security protection of signature private keys and improving information security.

CN113573304BActive Publication Date: 2024-10-15BEIJING EQUATION SOURCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010350854.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-28
Publication Date
2024-10-15
Estimated Expiration
2040-04-28

AI Technical Summary

Technical Problem

In the mobile environment, the storage of signature private keys of elliptic curve encryption algorithms such as SM2 has problems of inconvenience and insufficient security. The traditional independent hardware storage method affects user experience and security.

Method used

By using a one-time encryption factor and a preset encryption function to map the signature private key to an encryption private key, and perform encryption processing in the elliptic curve algorithm, a third-party trusted agency is used to generate and update the encryption factor to achieve safe hiding of the signature private key. and protection.

Benefits of technology

It reduces the risk of leakage of signature private keys, improves information security, and eliminates the need for professional security hardware to store private keys. It improves user experience and the security of signing terminals. It is suitable for elliptic curve encryption algorithm applications such as SM2 in mobile environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113573304B_ABST
    Figure CN113573304B_ABST
Patent Text Reader

Abstract

The present invention provides a signature implementation, a signature verification method, a signature terminal, a signature verification terminal and a storage medium, wherein the method comprises: performing calculations according to a signature private key, a one-time encryption factor and a preset encryption function to obtain an encrypted private key; the one-time encryption factor conforms to a random distribution; and encrypting a message digest according to the encrypted private key and an elliptic curve algorithm to generate a corresponding user digital signature. The present invention reduces the risk of signature private key leakage, does not require professional security hardware to maintain the signature private key, improves the information security of the signature terminal, and uses elliptic curve algorithms such as SM2 to sign normally in a mobile environment, greatly improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile security technology, and in particular to a signature implementation, a signature verification method, a signature terminal, a signature verification terminal and a storage medium. Background Art

[0002] With the development of e-commerce, electronic signatures can ensure the authenticity and reliability of information, so electronic signatures are becoming more and more important. In order to standardize electronic signatures, a national standard for electronic signatures has been specially formulated, and the SM2 elliptic curve cryptographic algorithm standard has been used as a national standard.

[0003] In the application, the preservation of SM2's signature private key is very important and needs to be stored in a secure manner. When storing it securely, secure hardware is generally used, such as encryption machines, IC cards and other physical hardware.

[0004] With the development of mobile Internet and the Internet of Things, signature terminals, Internet of Things terminals and sensors such as smartphones, notebooks and tablets are widely used. In these scenarios, SM2 electronic signatures are also needed in large quantities. If the traditional independent hardware method of storing private keys is still used in a mobile environment, there will be problems such as inconvenience in use and poor experience, which will directly affect the use experience and effect.

[0005] In a mobile environment, when using elliptic curve encryption algorithms such as SM2 for signing, it becomes very important to securely store the signature private key. Therefore, the market urgently needs a new method for securely storing signature private keys to protect the use of elliptic curve encryption algorithms such as SM2 in a mobile environment. This secure storage method can not only meet the requirements of securely storing signature private keys, but also does not affect the normal application of elliptic curve encryption algorithms such as SM2. Summary of the invention

[0006] The purpose of the present invention is to provide a signature implementation, a signature verification method, a signature terminal, a signature verification terminal and a storage medium, so as to reduce the risk of leakage of the signature private key, eliminate the need for professional security hardware to maintain the signature private key, improve the information security of the signature terminal, and normally use elliptic curve encryption algorithms such as SM2 for signing in a mobile environment, thereby greatly improving the user experience.

[0007] The technical solution provided by the present invention is as follows:

[0008] The present invention provides a signature implementation method, which is applied to a signature terminal and comprises the steps of:

[0009] The encrypted private key is obtained by performing calculations based on the signature private key, the one-time encryption factor and the preset encryption function; the one-time encryption factor conforms to the random distribution;

[0010] The message is encrypted according to the encryption private key and the elliptic curve algorithm to generate a corresponding user digital signature.

[0011] The present invention also provides a signature verification method, which is applied to a signature verification terminal and comprises the steps of:

[0012] Obtain the signature verification public key, user digital signature and message, and calculate the message to obtain the message digest; the message and user digital signature are obtained from the signing terminal; the signature verification public key is obtained from a third-party trusted institution;

[0013] The user digital signature is verified according to the signature verification public key and the message digest. When the verification passes, it is determined that the message is complete and has not been tampered with.

[0014] The present invention also provides a signature terminal, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the signature implementation method.

[0015] The present invention also provides a signature verification terminal, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the signature verification method.

[0016] The present invention also provides a storage medium, characterized in that at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the operation performed by the signature implementation method.

[0017] The present invention also provides a storage medium, characterized in that at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the operation performed by the signature verification method.

[0018] Through the signature implementation, signature verification method, signature terminal, signature verification terminal and storage medium provided by the present invention, the risk of signature private key leakage can be reduced, no professional security hardware is required to store the signature private key, the information security of the signature terminal is improved, and elliptic curve encryption algorithms such as SM2 can be used normally for signing in a mobile environment, which greatly improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The following will explain the preferred implementation mode in a clear and understandable manner with reference to the accompanying drawings, and further explain the above-mentioned characteristics, technical features, advantages and implementation methods of a signature implementation, a signature verification method, a signature terminal, a signature verification terminal and a storage medium.

[0020] Figure 1It is a flow chart of an embodiment of a signature implementation method of the present invention;

[0021] Figure 2 is a flow chart of another embodiment of a signature implementation method of the present invention;

[0022] Figure 3 is a flow chart of an embodiment of a signature verification method of the present invention;

[0023] Figure 4 is a flow chart of an embodiment of a signature verification method of the present invention;

[0024] Figure 5 It is a structural schematic diagram of an embodiment of a terminal device of the present invention. DETAILED DESCRIPTION

[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0026] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0027] Elliptic curve encryption algorithm belongs to asymmetric encryption algorithm, which requires a key pair. The key pair includes the signature private key d A and signature public key P A , where the signature public key P A Based on the signature private key d A Generated.

[0028] One embodiment of the present invention, as Figure 1 As shown, a signature implementation method includes:

[0029] S100 based on the signature private key d A , the one-time encryption factor u and the preset encryption function are used to calculate the encrypted private key d′ A ; The one-time encryption factor u conforms to random distribution;

[0030] S200 encrypts the private key d′ AThe message digest e is encrypted using the elliptic curve algorithm to generate the corresponding user digital signature.

[0031] Specifically, the signing terminal obtains the user's signature private key d A , by designing a preset encryption function, the signature private key d A and the one-time encryption factor u are substituted into the preset encryption function to calculate the encrypted private key d′ A Then, the signing terminal uses the encrypted private key d′ A The message digest e is encrypted with the elliptic curve algorithm to generate the corresponding user digital signature. The signing terminal uses the signature private key d A Encrypt and hide, using the encrypted private key d′ A Participating in the digital signature implementation process not only prevents attackers from obtaining the signature private key d A , which enables users to use elliptic curve cryptography for digital signatures in mobile environments, greatly improving the user experience while also reducing the signature private key d A Leakage risk, no need for professional security hardware to store signature private keys A , improving the information security of signature terminals.

[0032] One embodiment of the present invention, as Figure 2 As shown, a signature implementation method includes:

[0033] S111 receives a one-time encryption factor u sent by a third-party trusted institution; the data bit u of the one-time encryption factor is combined with the signature private key d A The data bits are within the same byte range;

[0034] Specifically, the signing terminal and the third-party trusted institution may agree on basic working specifications in advance, so that the signing terminal can obtain the one-time encryption factor u from the third-party trusted institution, for example, both parties adopt the same industry standard. Of course, the signing terminal can also send the signature private key d A The third-party trusted institution sends the data bit to the third-party trusted institution and receives the one-time encryption factor u sent by the third-party trusted institution. The third-party trusted institution obtains the signature private key d according to the agreement or from the signing terminal. A The third-party trusted institution then generates a one-time encryption factor u through a random number generator, where the signature terminal's features such as ID can participate in the generation of the one-time encryption factor u. The data bits of the one-time encryption factor u are related to the signature private key d A The one-time encryption factor u of the same level, that is, the data bit of the one-time encryption factor u and the signature private key d AThe data bits of are within the same byte range, and the one-time encryption factor u is a large integer. A third-party trusted institution can regenerate the one-time encryption factor u of each user used by each signing terminal at any time, and notify the signing terminal in real time to update.

[0035] S121 signs the private key d A Substitute the one-time encryption factor u into the preset encryption function to obtain the encrypted private key d′ A ;

[0036] Specifically, the communication between the signing terminal and the server of the third-party trusted institution is encrypted and bidirectionally authenticated to ensure secure and reliable communication between the signing terminal and the third-party trusted institution. For example, through the certificate authentication system (TLS1.0 protocol) and asymmetric encryption algorithms (such as RSA or SM2 key exchange, etc.), secure communication can be established between the signing terminal and the third-party trusted institution. After the signing terminal obtains the one-time encryption factor u from the third-party trusted institution through the above secure communication method, according to the principle of cryptography, since the one-time encryption factor u is the same as the signature private key d A The same level of unrelated data that is continuously updated by a third-party trusted organization can be encrypted using a preset encryption function to convert the signature private key d A Uniformly map to a large integer between (0, n) to obtain an encrypted private key d′ A , where n is a prime number. Point G (xG, yG) is the base point G on the preset elliptic curve, n is the order of point G, and n is a prime number.

[0037] Since the value of the one-time encryption factor u generated by the third-party trusted institution is statistically random, the one-time encryption factor u is constantly updated to make the encrypted private key d′ A It will also change constantly, so even if the illegal elements illegally obtain the encryption private key d′ A It will also become outdated soon, thus protecting the signature private key d A In a mobile environment, software encryption can be used to encrypt the signature private key d′ A Encrypt and then store the encrypted result. When signing, use the encrypted private key d′ directly. A Signing without using the signature private key A , which completes the signature private key d A protection.

[0038] Exemplarily, in this embodiment, a reversible function f(x, y)=y+x mod n (n is a prime number) may be selected as a preset encryption function, and the encryption private key d′ is obtained through the preset encryption function. A , where d ASubstitute x and u into the reversible function f(x, y) and use the result as the encrypted private key d' A , that is, d′ A =f (d A ,u)=u+d A mod n. This function is simple to calculate and meets the security requirements of cryptography.

[0039] S210: Calculate the message M according to the hash algorithm to obtain the message digest e, and generate a random number k that meets the preset conditions through a random number generator;

[0040] The hash algorithm associates the content to be retrieved with the index used for retrieval through a selected hash function. Here, a message M of any length is transformed into a message digest e of a fixed length (at least 128 bits in length for security reasons) according to the selected hash function (including but not limited to HAVAL function, MD5 function, SHA-2 function). Since the message digest e, i.e., the hash value, calculated for the message M according to the hash algorithm is irreversible, it can be used to subsequently identify whether the digital signature is at risk of being tampered with, thereby improving the data security of the signature terminal.

[0041] Random number k generators are generally divided into true random and pseudo random. True random is unpredictable, while pseudo random depends on random number k seeds and random algorithms and can be predicted. True random number generators (such as random) continuously collect non-deterministic, physically random device events, that is, device events generated in the running environment of the signature terminal equipped with a true random number generator as seeds. For example: the clock, virtual keyboard tapping time, mouse position changes, virtual keyboard tapping position changes, and even the signal strength of the surrounding WIFI signal, etc. may be used as seeds to generate a random number k that meets the preset conditions, where the preset condition is random number k∈[1, n-1].

[0042] S220 obtains a curve point Q by calculating the preset elliptic curve, the base point G obtained from the preset elliptic curve, and the random number k;

[0043] Specifically, the equation of the preset elliptic curve can be written as: 2 =x 3 +ax 2 +bx+c. Wherein, constants a, b and c are parameters that determine the shape of the preset elliptic curve. The base point G, parameters a, b, c and random number k are substituted into the equation of the preset elliptic curve. All solutions of the equation of the preset elliptic curve are not continuous but discrete. The value of the solution satisfies the restriction of the finite field. The preset elliptic curve is constructed by all solutions of the equation of the preset elliptic curve.

[0044] Since all other points on the finite field elliptic curve can be calculated by multiplying point G, that is, P A =[d A ]G,d A It also belongs to a finite field, d A The maximum value of is a prime number n. Since point G is known, through d A It is easy to calculate point P, but A Point reverse d A It is computationally difficult to achieve, so d A is the signature private key, corresponding to d on the preset elliptic curve A P A Point (xp, yp) is the signature public key.

[0045] In this embodiment, since the preset elliptic curve and base point G are selected, the base point G and the random number k generated by the random number generator can be substituted into the equation corresponding to the preset elliptic curve to solve the curve point Q = (xq, yq) = [k] G on the preset elliptic curve.

[0046] S230 performs calculation according to the curve point Q, the message digest e and the first preset calculation formula to obtain the corresponding first signature factor r;

[0047] S240 obtains a corresponding second signature factor s by calculating the encrypted private key d′A, the random number k, the first signature factor r, and the second preset calculation formula;

[0048] Among them, the elliptic curve algorithm includes two operation formulas for calculating the first signature factor r and the second signature factor s in the SM2 national secret algorithm, which are the first preset operation formula and the second preset operation formula. The first preset operation formula may include the reversible function f(x, y)=y+x mod n (n is a prime number) of the above example, where the x-axis coordinate xq of the curve point Q is used as x, and the message digest e is used as y to substitute into the reversible function f(x, y), and the calculation result is used as the first signature factor r, then the first signature factor r may include the following first preset operation formula:

[0049] r=f(xq,e)=e+xq mod n.

[0050] Note that it is necessary to set the first reset condition corresponding to the first signature factor r, where the first reset condition includes: if the first signature factor r is equal to zero (i.e., r=0), or the sum of the first signature factor r and the random number k generated by the random number generator is equal to the order of point G (i.e., r+k=n). If the signature terminal calculates that the first signature factor r meets any of the above first reset conditions, it controls the random number generator to regenerate a new random number k and calculates to obtain a new curve point Q until the calculated first signature factor r does not meet the first reset condition, and then enters the calculation process of the second signature factor s.

[0051] The second preset operation formula conforms to the reversible function f(x, y)=xy mod n (n is a prime number) of the above example, where the encrypted private key d′ A The reciprocal of the sum of 1 and (i.e. (1+d′ A ) -1 ) as x, the first signature factor r and the encrypted private key d′ A Perform a product operation, the difference between the random number k generated by the random number generator and the product operation result (i.e. (k-rd′ A ) as y is substituted into the reversible function f(x, y), and the calculation result is used as the second signature factor s, then the second signature factor s conforms to the following second preset calculation formula:

[0052] s=f((1+d′ A ) -1 ), (k-rd′ A ))=(1+d′ A ) -1 (k-rd′ A )mod n.

[0053] Note that it is necessary to set the second reset condition corresponding to the second signature factor s, where the second reset condition includes: if the second signature factor s is equal to zero (i.e., s=0). If the signature terminal calculates that the second signature factor s meets the above second reset condition, it controls the random number generator to regenerate a new random number k and calculates to obtain a new curve point Q until the calculated second signature factor s does not meet the second reset condition, and then enters the process of outputting the user's digital signature.

[0054] S250 obtains the user digital signature according to the first signature factor r and the second signature factor s.

[0055] Specifically, in the above signing process, it can be seen that the signature private key d is not used in the entire signing process. A Instead of calculating, the signature private key d A Mapping the hidden encrypted private key d′ AParticipate in the digital signature process, therefore, the signature private key d A It is kept confidential, reducing the signature private key d A The probability of occurrence is greatly improved, thereby greatly improving data security.

[0056] In this embodiment, the signing terminal uses the signature private key d A Encrypt and hide, and use the encrypted private key d′ throughout the process A Participating in the digital signature implementation process not only prevents attackers from obtaining the signature private key, A , so that users can use the SM2 algorithm for digital signature in a mobile environment, and can use software to store the encrypted private key d′ in a mobile environment A , since the one-time encryption factor u is generated by a third-party trusted institution and is constantly updated, u is securely transmitted between the third-party trusted institution and the signing terminal. In the case that u is secure, even if d′ A Even if it is leaked, it will not be reversed to get the signature private key d A , this not only reduces the signature private key d A The risk of leakage can be improved, and the information security of the signature terminal can be improved. In addition, when using the signature terminal for digital signature, users do not need to carry additional professional security hardware to store the signature private key. A , greatly enhancing the user experience.

[0057] Finally, in this embodiment, the one-time encryption factor is generated by a third-party trusted institution u or by a third-party trusted institution based on the characteristics of the terminal, and a one-time encryption factor generation algorithm that is different for each terminal is generated, which is executed by the signing terminal to generate u in the signing terminal. The one-time encryption factor u generated by a third-party trusted institution is more friendly to the operation of the signing terminal, and there is no need for the signing terminal to locally install and run the code program corresponding to the encryption factor generator. Due to the reduced memory usage, the signing terminal generates the corresponding digital signature more quickly and efficiently, and the waiting time for generating the digital signature is reduced, thereby greatly improving the user experience. If the application really needs the signing terminal to execute the code program corresponding to the encryption factor generator generated by the third-party trusted institution, then the third-party trusted institution must be able to reproduce the u generated by each terminal.

[0058] One embodiment of the present invention, as Figure 3 As shown, a signature verification method includes:

[0059] S300 obtains the signature verification public key P′ A , user digital signature and message M, and calculate the message digest e for message M; the message M and user digital signature are obtained from the signing terminal, and the signature verification public key P′ A Obtained from a trusted third party organization;

[0060] S400 verifies the signature using the public key P′ A The user's digital signature is verified with the message digest e. If the verification succeeds, it is determined that the message is complete and has not been tampered with.

[0061] Specifically, the signature verification terminal obtains the signature verification public key P′ A , user digital signature and message M, calculate message digest e, where the signature verification public key P′ A Obtained from a third-party trusted institution. The message digest e is obtained by the signature verification terminal by calculating the message M according to the hash algorithm, and the user's digital signature is obtained by the signing terminal according to the signature private key d A , a one-time encryption factor u, a preset encryption function and an elliptic curve algorithm are used to encrypt the message M. For the specific calculation process, please refer to the embodiment corresponding to the above-mentioned signature implementation method, which will not be described one by one here.

[0062] In this embodiment, the signature verification terminal obtains the signature verification public key P′ A , the user's digital signature and the message M, after calculating the message digest e based on the message M, the signature verification public key P′ A The message digest e is used to calculate and verify whether the user's digital signature is legal. If so, the verification is successful, indicating that the message is complete and has not been tampered with, that is, the user's digital signature is correct and the message is complete. In addition, the signature verification terminal directly uses the signature verification public key P' A It is convenient and easy to perform verification calculation with the message digest e.

[0063] An embodiment of the present invention is a signature verification method, comprising:

[0064] S300 obtains the signature verification public key P′ A , user digital signature and message M, and calculate the message digest e for message M; message M and user digital signature are obtained from the signing terminal; the signature verification public key P′ A Obtained from a trusted third party organization;

[0065] S410 determines whether the signature factor of the user's digital signature meets the preset conditions, and if so, obtains the data R to be verified by calculation;

[0066] S420 compares the data to be verified R with the first signature factor r in the user's digital signature to see if they are the same;

[0067] S430 If the data to be verified R is the same as the first signature factor r, the message is determined to be complete and has not been tampered with when the verification passes;

[0068] S440 If the user's digital signature does not meet the preset conditions, or the data to be verified R is not the same as the first signature factor r, the verification fails and the signature verification process is terminated.

[0069] Specifically, the preset conditions include that the first signature factor r of the user's digital signature is within a preset value range, that is, the first signature factor r∈[1, n-1], and the second signature factor s of the user's digital signature is within a preset value range, that is, the second signature factor s∈[1, n-1]. If the signature factor of the user's digital signature meets the preset conditions, the signature verification terminal will further verify the signature based on the public key P′. A , one-time encryption factor u and message digest e are used to calculate the data to be verified R. After obtaining the data to be verified R, the signature verification terminal compares the data to be verified R with the first signature factor r to see if they are the same or consistent. If they are the same, it is determined that the digital signature is verified. If the signature verification terminal determines that the user's digital signature does not meet the preset conditions, and the data to be verified R is different from the first signature factor r, the verification fails.

[0070] In this embodiment, the signature verification terminal obtains the signature verification public key P′ A , user digital signature and message digest e, according to the signature verification public key P′ A , the message digest e is calculated to verify whether the user's digital signature is legal. The signature verification terminal directly uses the signature verification public key P′ A , one-time encryption factor u and message digest e are used for verification calculation. In addition, once it is determined that the first signature factor r and the second signature factor s in the user digital signature obtained from the signing terminal are outside the preset value range, it is determined that the signature verification has failed and the entire signature verification process is terminated.

[0071] An embodiment of the present invention is a signature verification method, comprising:

[0072] S310 initiates a request to a third-party trusted institution and obtains the signature verification public key P′ from the third-party trusted institution A ; Verification public key P′ A Based on the base point G and the signature public key P A , a one-time encryption factor u and a third preset calculation formula are used to calculate; the one-time encryption factor u conforms to random distribution;

[0073] S320 obtains the user's digital signature and message M from the signing terminal, and calculates the message M to obtain the message digest e; the message digest e is calculated by the signature verification terminal based on the hash algorithm for the message M, and the user's digital signature is calculated by the signing terminal based on the signature private key d A , a one-time encryption factor u, a preset encryption function and an elliptic curve algorithm to encrypt the message M; the data bits of the one-time encryption factor e and the signature private key d A The data bits are within the same byte range;

[0074] Specifically, after the signature factor of the user's digital signature meets the preset conditions, the signature verification terminal initiates a request to the third-party trusted institution. After the third-party trusted institution obtains the request initiated by the signature verification terminal, it obtains the base point G and the signature public key P. A Substitute the one-time encryption factor u into the third preset calculation formula to calculate the signature verification public key P′ A , wherein the third preset operation formula is as follows: P′ A =uG+P A Then, the third-party trusted institution will calculate the obtained signature verification public key P′ A Feedback to the verification terminal.

[0075] S410 determines whether the signature factor of the user's digital signature meets the preset conditions, and if so, obtains the data R to be verified by calculation;

[0076] S420 compares the data to be verified R with the first signature factor r in the user's digital signature to see if they are the same;

[0077] S430 If the data to be verified R is the same as the first signature factor r, the message is determined to be complete and has not been tampered with when the verification passes;

[0078] S440 If the user's digital signature does not meet the preset conditions, or the data to be verified R is not the same as the first signature factor r, the verification fails and the signature verification process is terminated.

[0079] Specifically, after obtaining the data to be verified R, the signature verification terminal compares the data to be verified R with the first signature factor r to see if the two are identical or consistent. If they are identical, it is determined that the digital signature is verified, so that the message M of the signing terminal can be obtained. If the signature verification terminal determines that the user's digital signature does not meet the preset conditions, and the data to be verified R and the first signature factor r are different, the verification fails.

[0080] In this embodiment, the signature verification terminal obtains the signature verification public key P′ A , user digital signature and message digest e, according to the signature verification public key P′ A , the message digest e is calculated to verify whether the user's digital signature is legal. If it is, the verification is successful. The signature verification terminal directly uses the signature verification public key P′ A , message digest e is used for verification calculation.

[0081] One embodiment of the present invention, as Figure 4 As shown, a signature verification method includes:

[0082] S310 initiates a request to a third-party trusted institution and obtains the signature verification public key P′ from the third-party trusted institution A ; Verification public key P′ ABased on the base point G and the signature public key P A , a one-time encryption factor u and a third preset calculation formula are used to calculate; the one-time encryption factor u conforms to random distribution;

[0083] S320 obtains the user's digital signature and message M from the signing terminal, and calculates the message M to obtain the message digest e; the message digest e is calculated by the signature verification terminal based on the hash algorithm for the message M, and the user's digital signature is calculated by the signing terminal based on the signature private key d A , a one-time encryption factor u, a preset encryption function and an elliptic curve algorithm to encrypt the message M; the data bits of the one-time encryption factor e and the signature private key d A The data bits are within the same byte range;

[0084] Specifically, after the signature factor of the user's digital signature meets the preset conditions, the signature verification terminal initiates a request to the third-party trusted institution. After the third-party trusted institution obtains the request initiated by the signature verification terminal, it obtains the base point G and the signature public key P. A Substitute the one-time encryption factor u into the third preset calculation formula to calculate the signature verification public key P′ A , wherein the third preset operation formula is as follows: P′ A =uG+P A Then, the third-party trusted institution feeds back the calculated signature verification public key P′A to the verification terminal.

[0085] S411 determines whether the signature factor of the user's digital signature meets the preset conditions, and if so, obtains the second verification factor t by calculating the first signature factor r, the second signature factor s and the first preset calculation formula in the user's digital signature;

[0086] Specifically, the first preset operation formula conforms to the reversible function f(x, y)=y+x mod n (n is a prime number) in the above example, wherein the second signature factor s in the user's digital signature is used as x, and the first signature factor r in the user's digital signature is used as y to substitute into the reversible function f(x, y), and the calculation result is used as the second verification factor t, then the second verification factor t conforms to the following first preset operation formula:

[0087] t=f(s,r)=r+s mod n.

[0088] S412 obtains the verification point W by calculation according to the preset elliptic curve, the verification public key P′A, the second verification factor t, the base point G, the second signature factor s and the fourth preset calculation formula;

[0089] Specifically, the equation of the preset elliptic curve can be written as: 2 =x 3 +ax 2+bx+c. Among them, constants a, b and c are parameters that determine the shape of the preset elliptic curve. The signature verification terminal calculates the preset elliptic curve used by the signature terminal based on the constants a, b, c and the values ​​corresponding to the base point G, and then converts the signature verification public key P ′ A , the second verification factor t, the base point G, and the second signature factor s are substituted into the fourth preset calculation formula to obtain a calculation result, and the calculation result is substituted into the equation of the preset elliptic curve to calculate the coordinate data W (xw, yw) corresponding to the verification point W, that is, the coordinate data of the verification point W conforms to the following fourth preset calculation formula:

[0090] (xw, yw) = [s]G + [t]P′A

[0091] S413 obtains the data R to be verified by calculation based on the verification point, the message digest e and the first preset calculation formula;

[0092] After the signature verification terminal obtains the verification point, the x-axis coordinate corresponding to the verification point W and the message digest e obtained from the signature terminal are substituted into the first preset calculation formula to calculate the corresponding data R to be verified, wherein the x-axis coordinate xw of the verification point W is used as x, and the message digest e is used as y to substitute into the reversible function f(x, y), and the calculation result is used as the data R to be verified. Then, the data R to be verified conforms to the following first preset calculation formula:

[0093] R=f(xw,e)=e+xwmodn.

[0094] S420 compares the data to be verified R with the first signature factor r in the user's digital signature to see if they are the same;

[0095] S430 If the data to be verified R is the same as the first signature factor r, the message is determined to be complete and has not been tampered with when the verification passes;

[0096] S440 If the user's digital signature does not meet the preset conditions, or the data to be verified R is not the same as the first signature factor r, the verification fails and the signature verification process is terminated.

[0097] In this embodiment, the signature verification terminal obtains the signature verification public key P′ A , user digital signature and message digest e, according to the signature verification public key P′ A , one-time encryption factor u and message digest e are used to calculate and verify whether the user's digital signature is legal. If it is, the verification is passed and the message M of the signature terminal is obtained by decryption. The signature verification terminal directly uses the signature verification public key P′ A , convenient and easy.

[0098] In the entire signature verification process, the signature verification public key P′ is used A Participate in the signature verification process, therefore, the signature private key dA , thereby improving data security.

[0099] The above signature verification principle is explained as follows

[0100] [s]G+[r+s]P′ A

[0101] =[s]G+[s]P′ A +[r]P′ A

[0102] =[s]G+[s](P A +uG)+[r](P A +uG)

[0103] =[s]G+[s]P A +[su]G+[r]P A +[ru]G

[0104] =[s]G+[sd A ]G+[su]G+[rd A ]G+[ru]G

[0105] =[s(1+u+d A )]G+[r(u+d A )]G

[0106] =[(1+u+d A )-1(kr(u+d A ))(1+u+d A )]G+[r(u+d A )G

[0107] =[kr(u+d A )]G+[r+(u+d A )]G

[0108] =[k]G

[0109] The signature implementation method and signature verification method proposed in the present invention are compared with the SM2 common signature scheme. In terms of signature implementation, the computational complexity is the same, so the digital signature speed and efficiency of the two are the same. In terms of signature verification, the present invention requires a third-party trusted institution to transmit a signature public key P A The encrypted signature verification public key P′ A In addition, the process and calculation amount of the two algorithms are the same, and the calculation efficiency of the signature verification is the same. From the security aspect, the present invention is equivalent to the signature key d AThe encryption is performed with a one-time password, and the data used in the encryption is constantly changing, rather than being fixed. For attackers, it is impossible to obtain the signature private key by attacking the signature terminal. A In general, in terms of security, security is greatly improved, and in terms of implementation convenience and experience, the signature implementation method of the present invention does not require additional hardware overhead, the software occupies very little resources, and is easy to promote and popularize. It can reduce the risk of leakage of signature private keys, and does not require professional security hardware to maintain signature private keys, thereby improving the information security of signature terminals. In addition, the elliptic curve algorithm is used normally for signing in a mobile environment, which greatly improves the user experience.

[0110] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned program modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a processing unit, and the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program units. In addition, the specific names of the program modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0111] One embodiment of the present invention is a signature terminal, including a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to implement the signature implementation method in the above-mentioned corresponding method embodiment.

[0112] One embodiment of the present invention provides a signature verification terminal, including a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to implement the signature implementation method in the above-mentioned corresponding method embodiment.

[0113] Among them, both the signature terminal and the signature verification terminal can be mobile terminal devices, such as Figure 5 As shown, the terminal device 100 may be a desktop computer, a notebook, a PDA, a tablet computer, a mobile phone, a human-computer interaction screen, etc. The terminal device 100 may include, but is not limited to, a processor 110 and a memory 120. Those skilled in the art will understand that Figure 5It is only an example of the terminal device 100 and does not constitute a limitation of the terminal device 100. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device 100 may also include an input / output interface, a display device, a network access device, a communication bus, a communication interface, etc. The communication interface and the communication bus may also include an input / output interface, wherein the processor 110, the memory 120, the input / output interface and the communication interface communicate with each other through the communication bus. The memory 120 stores a computer program, and the processor 110 is used to execute the computer program stored in the memory 120.

[0114] The processor 110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0115] The memory 120 may be an internal storage unit of the terminal device 100, such as a hard disk or memory of the terminal device. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Furthermore, the memory 120 may include both an internal storage unit of the terminal device 100 and an external storage device. The memory 120 is used to store the computer program and other programs and data required by the terminal device 100. The memory may also be used to temporarily store data that has been output or is to be output.

[0116] The communication bus is a circuit that connects the elements described and implements transmission between these elements. For example, the processor 110 receives commands from other elements through the communication bus, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory 120 may include program modules, such as a kernel, middleware, an application programming interface (API) and an application. The program module may be composed of software, firmware or hardware, or at least two of them. The input / output interface forwards commands or data entered by the user through the input / output interface (such as a sensor, keyboard, touch screen). The communication interface connects the terminal device 100 to other network devices, user devices, and networks. For example, the communication interface can be connected to the network via wired or wireless connection to connect to other external network devices or user devices. Wireless communication may include at least one of the following: wireless fidelity (WiFi), Bluetooth (BT), near field communication technology (NFC), global satellite positioning system (GPS) and cellular communication, etc. Wired communication may include at least one of the following: universal serial bus (USB), high-definition multimedia interface (HDMI), asynchronous transmission standard interface (RS-232), etc. The network may be a telecommunication network and a communication network. The communication network may be a computer network, the Internet, the Internet of Things, or a telephone network. The terminal device 100 may be connected to the network via a communication interface, and the protocol used by the terminal device 100 to communicate with other network devices may be supported by at least one of an application, an application programming interface (API), a middleware, a kernel, and a communication interface.

[0117] One embodiment of the present invention is a storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operation performed by the signature implementation method in the above corresponding method embodiment. For example, the computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a read-only compact disk (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device.

[0118] One embodiment of the present invention is a storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operation performed by the signature verification method in the above corresponding method embodiment. For example, the computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a read-only compact disk (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device.

[0119] They can be implemented with program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0121] Those of ordinary skill 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 with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed with 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 this application.

[0122] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation. For example, 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, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

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

[0124] In addition, each functional unit in each embodiment of the present application 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. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0125] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by sending instructions to related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes: computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0126] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment 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 principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.

Claims

1. A signature implementation method, characterized in that: Applied to the signature terminal, including the steps: The encrypted private key is obtained by performing calculations based on the signature private key, the one-time encryption factor and the preset encryption function; the one-time encryption factor conforms to the random distribution; Encrypt the message digest according to the encryption private key and the elliptic curve algorithm to generate a corresponding user digital signature; The step of encrypting the message digest according to the encryption private key and the elliptic curve algorithm to generate the corresponding user digital signature comprises the following steps: The message is operated according to a hash algorithm to obtain a message digest, and a random number that meets preset conditions is generated by a random number generator; Obtaining a curve point according to a preset elliptic curve, a base point obtained from the preset elliptic curve and the random number operation; Performing calculation according to the curve point, the message digest and the first preset calculation formula to obtain a corresponding first signature factor; Obtain a corresponding second signature factor according to the encrypted private key, the random number, the first signature factor, and the second preset calculation formula; The user digital signature is obtained according to the first signature factor and the second signature factor.

2. The signature implementation method according to claim 1, characterized in that: The step of obtaining the encrypted private key by calculating the signature private key, the one-time encryption factor and the preset encryption function comprises the following steps: Receiving a one-time encryption factor sent by a third-party trusted institution; the data bits of the one-time encryption factor and the data bits of the signature private key are within the same byte range; Substitute the signature private key and the one-time encryption factor into the preset encryption function to obtain the encryption private key.

3. A signature verification method, characterized in that: Applied to the signature verification terminal, including the following steps: Obtain the signature verification public key, user digital signature and message, and calculate the message to obtain the message digest; the message and user digital signature are obtained from the signing terminal; the signature verification public key is obtained from a third-party trusted institution; Verify the user's digital signature based on the signature verification public key and the message digest, and if the verification is successful, determine that the message is complete and has not been tampered with; The step of verifying the user digital signature according to the signature verification public key and the message digest, and determining that the message is complete and has not been tampered with when the verification passes, includes the following steps: Determine whether the signature factor of the user's digital signature meets the preset conditions, and if so, obtain the data to be verified by calculation; Compare the data to be verified with the first signature factor in the user's digital signature to see if they are the same; If the data to be verified is the same as the first signature factor, the message is determined to be complete and has not been tampered with when the verification passes; If the user digital signature does not meet the preset conditions, or the data to be verified is different from the first signature factor, the verification fails and the signature verification process is terminated; The operation to obtain the data to be verified includes the following steps: Obtaining a second verification factor according to the first signature factor, the second signature factor and the first preset calculation formula in the user digital signature; Obtain a verification point by calculating the preset elliptic curve, the signature verification public key, the second verification factor, the base point, the second signature factor, and a fourth preset calculation formula; The data to be verified is obtained by operation according to the verification point, the message digest and the first preset operation formula.

4. The signature verification method according to claim 3, characterized in that: The steps of obtaining the signature verification public key, the user digital signature and the message, and calculating the message to obtain the message digest include: Initiate a request to a third-party trusted institution and obtain a signature verification public key from the third-party trusted institution; the signature verification public key is calculated based on the base point, the signature public key, the one-time encryption factor and a third preset calculation formula; the one-time encryption factor conforms to random distribution; Obtain the user's digital signature and message from the signing terminal, and calculate the message to obtain a message digest; the message digest is obtained by the signature verification terminal by calculating the message according to a hash algorithm, and the user's digital signature is obtained by the signing terminal by encrypting the message according to the signature private key, a one-time encryption factor, a preset encryption function and an elliptic curve algorithm; The data bits of the one-time encryption factor and the data bits of the signature private key are within the same byte range.

5. A signature terminal, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the signature implementation method as described in claim 1 or 2.

6. A signature verification terminal, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the signature verification method as described in claim 3 or 4.

7. A storage medium, characterized in that: The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operations performed by the signature implementation method as claimed in claim 1 or 2.

8. A storage medium, characterized in that: The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the signature verification method as described in claim 3 or 4.