A digital signature generation and verification method based on elliptic curve encryption algorithm

Through the digital signature generation and verification method based on the elliptic curve encryption algorithm, the problems of low efficiency, low accuracy and low security in the prior art digital signature generation and verification are solved, and more efficient, accurate and secure digital signature processing is achieved.

CN119788285APending Publication Date: 2025-04-08CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411765664.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing digital signature generation and verification process is inefficient, low accuracy and low security.

Method used

Digital signature generation and verification methods based on elliptic curve encryption algorithm are adopted to generate and verify digital signatures through the parameters of preset elliptic curves, and the one-way efficiency of private keys and public keys is used to ensure security.

Benefits of technology

It improves the efficiency and accuracy of digital signature generation and verification, enhances security, and meets different security needs and application scenarios flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788285A_ABST
    Figure CN119788285A_ABST
Patent Text Reader

Abstract

The present invention relates to the field of digital signature technology, and discloses a digital signature generation and verification method based on an elliptic curve encryption algorithm. The generation method is applied to the sender of a signed message, and the method includes: obtaining a message to be signed and parameters of a preset elliptic curve; obtaining a random integer, and determining the coordinates of a target point according to the base point coordinates and the random integer; obtaining a private key, and generating a digital signature of the message to be signed according to the private key, the random integer, the hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point. The present invention uses the parameters of a preset elliptic curve to analyze and determine the digital signature of the message to be signed. The elliptic curve encryption algorithm can use a shorter key length while maintaining the same security level, save computing resources, and improve the efficiency of digital signature generation. By selecting different preset elliptic curves and their parameters, different security requirements and application scenarios can be met, and flexibility and scalability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital signatures, and in particular to a digital signature generation and verification method based on an elliptic curve encryption algorithm. Background Art

[0002] In many industries and fields, e-commerce and transactions are transitioning and developing towards the mobile Internet. Electronic contracts have replaced traditional paper contracts because of their convenience and efficiency. However, the authenticity and integrity of data are crucial for data transmission over the network. Digital signatures are one of the important mechanisms to ensure network security. They are generated through specific rules and parameters, allowing the recipient of data to confirm the source and integrity of the data. Elliptic Curve Cryptography (ECC) is a public key cryptography system based on elliptic curve mathematics. It is widely used in cryptography to implement security protocols such as key exchange, digital signatures, and public key encryption. In the face of massive amounts of data, it is crucial to protect the integrity, authenticity, and non-repudiation of data in response to the challenges of information security. Therefore, how to use limited resources to improve the efficiency, accuracy, and security of generating and verifying digital signatures is a problem that needs to be solved. Summary of the invention

[0003] In view of this, the present invention provides a digital signature generation and verification method based on elliptic curve encryption algorithm to solve the problems of low efficiency, low accuracy and low security in the existing digital signature generation and verification process.

[0004] In a first aspect, the present invention provides a method for generating a digital signature based on an elliptic curve encryption algorithm, the method being applied to a sender of a signed message, the method comprising:

[0005] Obtaining a message to be signed and parameters of a preset elliptic curve, the parameters of the preset elliptic curve including: coordinates of a base point of the preset elliptic curve and an order corresponding to the base point;

[0006] Get a random integer, and determine the target point coordinates based on the base point coordinates and the random integer;

[0007] Get the private key, and generate the digital signature of the message to be signed based on the private key, the random integer, the hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point.

[0008] The digital signature generation method based on the elliptic curve encryption algorithm provided by the present invention uses the parameters of a preset elliptic curve to analyze and determine the digital signature of a message to be signed. The elliptic curve encryption algorithm can use a shorter key length while maintaining the same security level, saving computing resources and improving the efficiency of digital signature generation. By selecting different preset elliptic curves and their parameters, different security requirements and application scenarios can be met, thereby improving flexibility and scalability.

[0009] In an optional implementation, the method further includes: generating a public key according to the base point coordinates and the private key.

[0010] The digital signature generation method based on the elliptic curve encryption algorithm provided by the present invention is a one-way and efficient process of generating a public key using a private key. Even if the public key and the base point coordinates are known, it is very difficult to calculate the private key, which provides a strong security guarantee for data exchange, thereby ensuring the security of the key.

[0011] In an optional implementation, generating a digital signature of the message to be signed according to the private key, the random integer, the hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point includes:

[0012] Calculate the hash value of the message to be signed using the hash function, and determine the horizontal coordinate of the target point according to the coordinates of the target point;

[0013] Substitute the private key, random integer, hash value of the message to be signed, horizontal coordinate of the target point, and order corresponding to the base point into the preset signature formula to generate the digital signature of the message to be signed.

[0014] The digital signature generation method based on the elliptic curve encryption algorithm provided by the present invention generates a digital signature by using a preset signature formula. The sender and the receiver of the signed message follow the same rules, which makes it easy for the receiver to obtain an accurate digital signature and improves the accuracy of the digital signature. The hash value of the message to be signed is calculated by using a hash function, thereby ensuring the integrity and security of the message to be signed.

[0015] In a second aspect, the present invention provides a digital signature verification method based on an elliptic curve encryption algorithm, the method is applied to a recipient of a signed message, and the method comprises:

[0016] Obtain a signed message and a public key, wherein the signature of the signed message is a digital signature obtained by using any digital signature generation method in the first aspect;

[0017] The intermediate parameters are obtained by calculating the order and digital signature corresponding to the base point on the preset elliptic curve;

[0018] Determine the coordinates of the first reference point and the second reference point on the preset elliptic curve according to the intermediate parameter, the hash value of the signed message, the digital signature, and the order corresponding to the base point;

[0019] The coordinates of the verification point on the preset elliptic curve are calculated according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key;

[0020] Compare the verification point coordinates with the target point coordinates to obtain the verification result of the digital signature.

[0021] The digital signature verification method based on the elliptic curve encryption algorithm provided by the present invention performs decryption according to the rules when the digital signature is generated to obtain the coordinates of the verification point, and obtains the verification result by comparing the verification point with the target point. The verification process is efficient and accurate, and the security of the digital signature is improved by using a preset elliptic curve.

[0022] In an optional implementation, obtaining the coordinates of the verification point on the preset elliptic curve according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key calculation includes:

[0023] Determine the horizontal coordinate of the first reference point according to the coordinates of the first reference point, and determine the horizontal coordinate of the second reference point according to the coordinates of the second reference point;

[0024] The coordinates of the first intermediate point are obtained by multiplying the horizontal coordinate of the first reference point with the coordinates of the base point, and the coordinates of the second intermediate point are obtained by multiplying the horizontal coordinate of the second reference point with the public key;

[0025] The coordinates of the first intermediate point are added to the coordinates of the second intermediate point to obtain the coordinates of the verification point.

[0026] The digital signature verification method based on the elliptic curve encryption algorithm provided by the present invention uses random numbers to increase the uniqueness of the signature during the digital signature generation and verification process, avoids duplication and guessing of the digital signature, improves the security of the digital signature, and uses points on a preset elliptic curve to perform conversion calculations to obtain the verification point coordinates, thereby effectively protecting the integrity, authenticity and non-repudiation of the digital signature.

[0027] In an optional implementation, comparing the verification point coordinates with the target point coordinates to obtain a verification result of the digital signature includes:

[0028] Compare the horizontal coordinates of the verification point with the horizontal coordinates of the target point;

[0029] If the horizontal coordinate of the verification point is the same as that of the target point, the verification is successful;

[0030] If the horizontal coordinates of the verification point are different from those of the target point, the verification fails.

[0031] The digital signature verification method based on the elliptic curve encryption algorithm provided by the present invention directly verifies the digital signature by comparing the horizontal coordinates of the verification point and the horizontal coordinates of the target point. The verification method is simple, but the verification result is accurate, thereby improving the verification efficiency and accuracy of the digital signature.

[0032] In a third aspect, the present invention provides a digital signature generation device based on an elliptic curve encryption algorithm, the device is applied to the sender of the signature message, and the device includes:

[0033] A parameter acquisition module, used to acquire the message to be signed and the parameters of the preset elliptic curve, the parameters of the preset elliptic curve including: the base point coordinates of the preset elliptic curve and the order corresponding to the base point;

[0034] The target point determination module is used to obtain a random integer and determine the target point coordinates according to the base point coordinates and the random integer;

[0035] The digital signature generation module is used to obtain the private key and generate the digital signature of the message to be signed based on the private key, the random integer, the hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point.

[0036] In a fourth aspect, the present invention provides a digital signature verification device based on an elliptic curve encryption algorithm, the device is applied to a recipient of a signed message, and the device includes:

[0037] A signed message receiving module, used to obtain a signed message and a public key, wherein the signature of the signed message is a digital signature obtained by using any digital signature generation method in the first aspect;

[0038] An intermediate parameter determination module is used to calculate the intermediate parameters according to the order and digital signature corresponding to the base point on the preset elliptic curve;

[0039] A reference point coordinate determination module, used to determine the coordinates of a first reference point and a second reference point on a preset elliptic curve according to the intermediate parameters, the hash value of the signed message, the digital signature, and the order corresponding to the base point;

[0040] A verification point coordinate determination module, used to calculate the verification point coordinates on the preset elliptic curve according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key;

[0041] The signature verification module is used to compare the verification point coordinates with the target point coordinates to obtain the verification result of the digital signature.

[0042] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof, the second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0043] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method of the first aspect or any corresponding embodiment thereof, the second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 is a flow chart of a method for generating a digital signature based on an elliptic curve encryption algorithm according to an embodiment of the present invention;

[0046] Figure 2 is a flow chart of a digital signature verification method based on an elliptic curve encryption algorithm according to an embodiment of the present invention;

[0047] Figure 3 is a structural block diagram of a digital signature generation device based on an elliptic curve encryption algorithm according to an embodiment of the present invention;

[0048] Figure 4 is a structural block diagram of a digital signature verification device based on an elliptic curve encryption algorithm according to an embodiment of the present invention;

[0049] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0051] The embodiment of the present invention provides a digital signature generation and verification method based on the elliptic curve encryption algorithm. By presetting the elliptic curve and its parameters, the elliptic curve algorithm is used to generate and verify the digital signature, so as to achieve the effect of improving the accuracy and security of digital signature generation and verification.

[0052] According to an embodiment of the present invention, an embodiment of a digital signature generation method based on an elliptic curve encryption algorithm is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] In this embodiment, a digital signature generation method based on elliptic curve encryption algorithm is provided, which can be used in the above-mentioned computer system. Figure 1 is a flow chart of a method for generating a digital signature based on an elliptic curve encryption algorithm according to an embodiment of the present invention, which is applied to the sender of a signed message, such as Figure 1 As shown, the process includes the following steps:

[0054] Step S101, obtaining a message to be signed and parameters of a preset elliptic curve, wherein the parameters of the preset elliptic curve include: coordinates of a base point of the preset elliptic curve and an order corresponding to the base point.

[0055] Specifically, obtain the message M to be signed, and select a preset elliptic curve as a basis according to the requirements of the message to be signed, such as secp256r1, which is only used as an example, but not limited to this. Select a generator (base point) G based on the preset elliptic curve, and the horizontal and vertical coordinates of the base point are xG and yG respectively. Based on the generator, the order corresponding to the points on the preset elliptic curve is calculated, which is usually a prime number n. The calculation process of the order is a mature existing technology and will not be repeated here.

[0056] Elliptic curve cryptography is based on the elliptic curve discrete logarithm problem (ECDLP), which is a computationally very difficult problem: given a point P and an integer k on an elliptic curve, it is relatively easy to find the point kP, but conversely, given points kP and P, it is very difficult to find the integer k.

[0057] Step S102, obtaining a random integer, and determining the coordinates of the target point according to the base point coordinates and the random integer.

[0058] Specifically, an integer k is randomly selected, the value range of the random integer k is [1, n-1], a target point R=kG on a preset elliptic curve is calculated based on the random integer, and the horizontal coordinate r of the target point is calculated.

[0059] Step S103, obtaining a private key, and generating a digital signature of the message to be signed according to the private key, a random integer, a hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point.

[0060] Specifically, a private key d is randomly selected in the range of [1, n-1], and a hash value h=Hash(M) of the message to be signed is calculated using a hash function, where Hash represents a hash function.

[0061] The digital signature of the message to be signed is calculated using the private key, random integer, hash value of the message to be signed, coordinates of the target point, and the order corresponding to the base point as known quantities. The algorithm formula for calculating the digital signature can be set according to the preset rules. It is necessary to ensure that the sender and the receiver follow the same preset rules to ensure that the rules for generating and decrypting digital signatures are the same, thereby improving the accuracy of the digital signature.

[0062] The digital signature generation method based on the elliptic curve encryption algorithm provided in this embodiment uses the parameters of a preset elliptic curve to analyze and determine the digital signature of the message to be signed. The elliptic curve encryption algorithm can use a shorter key length while maintaining the same security level, saving computing resources and improving the efficiency of digital signature generation. By selecting different preset elliptic curves and their parameters, different security requirements and application scenarios can be met, thereby improving flexibility and scalability.

[0063] In some optional implementations, the method further includes: generating a public key based on the base point coordinates and the private key.

[0064] Specifically, the formula for generating a public key based on the base point coordinates and the private key is expressed as: public key Q = private key d × base point coordinates G. Public key cryptography is the basis of digital signatures. It uses a pair of keys, namely the public key and the private key. The public key can be shared publicly with others, while the private key must be kept secret; the public key is used to verify the validity of the signature, and the private key is used to generate the digital signature.

[0065] The digital signature generation method based on the elliptic curve encryption algorithm provided in this embodiment is a one-way and efficient process of generating a public key using a private key. Even if the public key and the base point coordinates are known, it is very difficult to calculate the private key, which provides a strong security guarantee for data exchange, thereby ensuring the security of the key.

[0066] In some optional implementations, generating a digital signature of the message to be signed according to the private key, the random integer, the hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point includes:

[0067] Step a1, using a hash function to calculate the hash value of the message to be signed, and determining the horizontal coordinate of the target point according to the coordinates of the target point.

[0068] Specifically, hash functions are an indispensable component of digital signatures. Hash functions convert input data of any length into an output of fixed length, called a hash value or message digest. Hash functions have the following characteristics: the same input always generates the same hash value, slightly different inputs can generate completely different hash values, and they are irreversible (the original input cannot be derived from the hash value). Hash functions are used in digital signatures to generate a summary of the message to ensure data integrity and prevent tampering. The hash value h = Hash (M) of the message to be signed is calculated using the hash function Hash. The horizontal coordinate r of the target point can be directly determined based on the coordinate R of the target point.

[0069] Step a2, substitute the private key, the random integer, the hash value of the message to be signed, the horizontal coordinate of the target point, and the order corresponding to the base point into the preset signature formula to generate a digital signature of the message to be signed.

[0070] Specifically, the private key, the random integer, the hash value of the message to be signed, the horizontal coordinate of the target point, and the order corresponding to the base point are substituted into the preset signature formula to obtain the second parameter of the digital signature. The formula is expressed as follows:

[0071] s=(k^(-1)*(h+d*r))mod n

[0072] Among them, s represents the second parameter of the digital signature, k^(-1) represents the modular inverse of k, h represents the hash value of the message to be signed, d represents the private key, r represents the horizontal coordinate of the target point, n represents the order corresponding to the base point, and mod represents the modular operation.

[0073] The horizontal coordinate of the target point is used as the first parameter of the digital signature to generate a complete digital signature represented as: (r, s).

[0074] The digital signature generation method based on the elliptic curve encryption algorithm provided in this embodiment uses a preset signature formula to generate a digital signature. The sender and receiver of the signed message follow the same rules, which makes it easy for the receiver to obtain an accurate digital signature and improves the accuracy of the digital signature. The hash value of the message to be signed is calculated using a hash function, thereby ensuring the integrity and security of the message to be signed.

[0075] In this embodiment, a digital signature verification method based on elliptic curve encryption algorithm is provided, which can be used in the above-mentioned computer system. Figure 2 is a flow chart of a digital signature verification method based on an elliptic curve encryption algorithm according to an embodiment of the present invention, which is applied to a recipient of a signed message, such as Figure 2 As shown, the process includes the following steps:

[0076] Step S201, obtaining a signed message and a public key, wherein the signature of the signed message is a digital signature obtained by using any of the digital signature generation methods in the first embodiment.

[0077] Specifically, a digital certificate is an important component of a digital signature. It is an electronic document issued by a trusted third-party organization (certificate authority) and is used to verify the legitimacy of a digital signature and prove the identity of the signer. A digital certificate contains important information such as the public key, signer information, and validity period to ensure the credibility and non-repudiation of the digital signature.

[0078] When the sender sends the signed message to the recipient, in addition to the signed message, it also comes with a digital signature generated by the sender's private key. The recipient receives the signed message M and public key Q with the signature (r, s). The recipient of the signed message has the same public key as the sender.

[0079] Step S202, calculating and obtaining intermediate parameters according to the order and digital signature corresponding to the base point on the preset elliptic curve.

[0080] Specifically, the intermediate parameter w is calculated using the order and digital signature corresponding to the base point on the preset elliptic curve. The formula is as follows:

[0081] w=s^(-1)mod n

[0082] Wherein, w is an integer, s represents the second parameter of the digital signature, n represents the order corresponding to the base point on the preset elliptic curve, mod represents modular calculation, and s^(-1) is the modular inverse of s.

[0083] Step S203, determining the coordinates of the first reference point and the second reference point on the preset elliptic curve according to the intermediate parameters, the hash value of the signed message, the digital signature, and the order corresponding to the base point.

[0084] Specifically, the hash value h=Hash(M) of the signed message is calculated using a hash function, and the coordinates of the first reference point and the second reference point on the preset elliptic curve are determined according to the intermediate parameter w, the hash value h of the signed message, the digital signature (r, s), and the order n corresponding to the base point. The formula is as follows:

[0085] U=(h*w)mod n, V=(r*w)mod n

[0086] Among them, U represents the coordinates of the first reference point, h represents the hash value of the signed message, w represents the intermediate parameter, n represents the order corresponding to the base point, r represents the first parameter of the digital signature, and V represents the coordinates of the second reference point.

[0087] Step S204, calculating the verification point coordinates on the preset elliptic curve according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key.

[0088] Specifically, the coordinates of the verification point on the preset elliptic curve are calculated according to the first reference point coordinates U, the second reference point coordinates V, the base point coordinates G of the preset elliptic curve, and the public key Q.

[0089] Step S205, comparing the verification point coordinates with the target point coordinates to obtain a verification result of the digital signature.

[0090] Specifically, the verification point coordinates are the reverse calculation of the target point coordinates according to the same preset rules. Under normal circumstances, the verification point coincides with the target point and their coordinate values ​​are the same, so the verification point coordinates can be verified by comparing them with the target point coordinates.

[0091] The digital signature verification method based on the elliptic curve encryption algorithm provided in this embodiment performs decryption according to the rules when the digital signature is generated to obtain the coordinates of the verification point, and obtains the verification result by comparing the verification point with the target point. The verification process is efficient and accurate, and the security of the digital signature is improved by using a preset elliptic curve.

[0092] In some optional implementations, the above step S204 includes:

[0093] Step S2041, determining the horizontal coordinate of the first reference point according to the coordinates of the first reference point, and determining the horizontal coordinate of the second reference point according to the coordinates of the second reference point.

[0094] Specifically, the horizontal coordinate u of the first reference point is determined according to the coordinate U of the first reference point, and the horizontal coordinate v of the second reference point is determined according to the coordinate V of the second reference point.

[0095] Step S2042, multiplying the horizontal coordinate of the first reference point by the base point coordinate to obtain the first intermediate point coordinate, and multiplying the horizontal coordinate of the second reference point by the public key to obtain the second intermediate point coordinate.

[0096] Specifically, the horizontal coordinate u of the first reference point is multiplied by the base point coordinate G to obtain the first intermediate point coordinate uG, and the horizontal coordinate v of the second reference point is multiplied by the public key Q to obtain the second intermediate point coordinate vQ.

[0097] Step S2043, adding the first middle point coordinates to the second middle point coordinates to obtain the verification point coordinates.

[0098] Specifically, the coordinates of the first intermediate point and the second intermediate point are added to obtain the coordinates of the verification point, and the formula is as follows:

[0099] P=uG+vQ

[0100] Among them, P represents the coordinates of the verification point on the preset elliptic curve, u represents the horizontal coordinate of the first reference point, v represents the horizontal coordinate of the second reference point, G represents the base point coordinates of the preset elliptic curve, and Q represents the public key.

[0101] The digital signature verification method based on the elliptic curve encryption algorithm provided in this embodiment uses random numbers to increase the uniqueness of the signature during the digital signature generation and verification process, avoids duplication and guessing of the digital signature, improves the security of the digital signature, and uses the points on the preset elliptic curve to perform conversion calculations to obtain the verification point coordinates, thereby effectively protecting the integrity, authenticity and non-repudiation of the digital signature.

[0102] In some optional implementations, comparing the verification point coordinates with the target point coordinates to obtain a verification result of the digital signature includes:

[0103] Compare the horizontal coordinates of the verification point with the horizontal coordinates of the target point. If the horizontal coordinates of the verification point are the same as the horizontal coordinates of the target point, the verification passes. If the horizontal coordinates of the verification point are different from the horizontal coordinates of the target point, the verification fails.

[0104] Specifically, the horizontal coordinate of the verification point P is compared with the horizontal coordinate of the target point to see if they are the same. If they are the same, the verification is successful; if they are not the same, the verification is unsuccessful.

[0105] The digital signature verification method based on the elliptic curve encryption algorithm provided in this embodiment directly verifies the digital signature by comparing the horizontal coordinates of the verification point and the horizontal coordinates of the target point. The verification method is simple, but the verification result is accurate, thereby improving the verification efficiency and accuracy of the digital signature.

[0106] Due to the convenience and efficiency of electronic contracts, they have replaced traditional paper contracts. Therefore, ensuring the authenticity and integrity of electronic contracts is crucial for both parties to the contract. In a specific implementation, the digital signature generation and verification method based on the elliptic curve encryption algorithm in this embodiment is applied to the signing and verification of electronic contracts. The specific process includes:

[0107] (1) Contract generation and signing: First, the content of the contract will be created and digitally signed using the elliptic curve-based digital signature algorithm proposed above. In the process of generating the digital signature, the hash value of the contract is encrypted using the private key to generate a signature. The generated digital signature will be sent together with the contract to the contract recipient.

[0108] (2) Contract transmission and receipt: The contract and its accompanying digital signature are sent to the contract recipient via a secure transmission channel. The transmission channel may use encryption and other security protocols to protect the confidentiality and integrity of the data.

[0109] (3) Signature verification: The contract recipient uses the public key to verify the validity of the received digital signature. By decrypting the digital signature and using the hash function to calculate the contract content, the recipient can compare the calculated hash value with the hash value in the digital signature to see if they match. If they match, it means that the contract content has not been tampered with and the digital signature is valid.

[0110] (4) Contract storage and archiving: After successful verification, the contract recipient can store the contract and its digital signature in a secure storage system for subsequent auditing and archiving needs.

[0111] By using the above-mentioned digital signature generation and verification method based on elliptic curves, the authenticity and integrity of the electronic contract are ensured. The signature generation and verification process uses public key cryptography and hash function technology to provide protection and verification of the contract content. It has a wide range of applications in law, finance, e-commerce and other fields, and provides a safe, efficient and reliable solution for the contract signing and verification process. The digital signature generation and verification method based on elliptic curves provided in this embodiment can be widely used in fields such as data protection, identity authentication and secure communication, providing important technical support for information security.

[0112] In the present embodiment, a digital signature generation device based on elliptic curve encryption algorithm is also provided, and the device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0113] This embodiment provides a digital signature generation device based on elliptic curve encryption algorithm, which is applied to the sender of the signature message, such as Figure 3 As shown, the device comprises:

[0114] The parameter acquisition module 301 is used to acquire the message to be signed and the parameters of the preset elliptic curve. The parameters of the preset elliptic curve include: the coordinates of the base point of the preset elliptic curve and the order corresponding to the base point.

[0115] The target point determination module 302 is used to obtain a random integer and determine the target point coordinates according to the base point coordinates and the random integer.

[0116] The digital signature generation module 303 is used to obtain a private key and generate a digital signature of the message to be signed according to the private key, a random integer, a hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point.

[0117] In the present embodiment, a digital signature verification device based on elliptic curve encryption algorithm is also provided, and the device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0118] This embodiment provides a digital signature verification device based on an elliptic curve encryption algorithm, which is applied to a recipient of a signed message, such as Figure 4 As shown, the device comprises:

[0119] The signed message receiving module 401 is used to obtain a signed message and a public key. The signature of the signed message is a digital signature obtained by using any digital signature generation method in the first embodiment.

[0120] The intermediate parameter determination module 402 is used to calculate the intermediate parameters according to the order corresponding to the base point on the preset elliptic curve and the digital signature.

[0121] The reference point coordinate determination module 403 is used to determine the coordinates of the first reference point and the second reference point on the preset elliptic curve according to the intermediate parameters, the hash value of the signed message, the digital signature, and the order corresponding to the base point.

[0122] The verification point coordinate determination module 404 is used to calculate the verification point coordinates on the preset elliptic curve according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key.

[0123] The signature verification module 405 is used to compare the verification point coordinates with the target point coordinates to obtain the verification result of the digital signature.

[0124] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0125] The digital signature generation device based on the elliptic curve encryption algorithm and the digital signature verification device based on the elliptic curve encryption algorithm in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0126] The embodiment of the present invention also provides a computer device having the above Figure 3 The digital signature generation device based on the elliptic curve encryption algorithm shown or Figure 4 The digital signature verification device based on the elliptic curve encryption algorithm is shown.

[0127] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0128] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0129] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0130] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0131] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0132] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0133] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0134] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A digital signature generation method based on elliptic curve encryption algorithm, characterized in that: The method is applied to the sender of the signed message, and the method comprises: Obtaining a message to be signed and parameters of a preset elliptic curve, wherein the parameters of the preset elliptic curve include: coordinates of a base point of the preset elliptic curve and an order corresponding to the base point; Obtain a random integer, and determine the coordinates of the target point according to the base point coordinates and the random integer; A private key is obtained, and a digital signature of the message to be signed is generated according to the private key, a random integer, a hash value of the message to be signed, the coordinates of the target point, and an order corresponding to the base point.

2. The method according to claim 1, characterized in that: The method further comprises: A public key is generated according to the base point coordinates and the private key.

3. The method according to claim 1, characterized in that The step of generating a digital signature of the message to be signed according to the private key, the random integer, the hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point includes: Calculate the hash value of the message to be signed using the hash function, and determine the horizontal coordinate of the target point according to the coordinates of the target point; Substitute the private key, the random integer, the hash value of the message to be signed, the horizontal coordinate of the target point, and the order corresponding to the base point into a preset signature formula to generate a digital signature of the message to be signed.

4. A digital signature verification method based on elliptic curve encryption algorithm, characterized in that: The method is applied to a recipient of a signed message, and comprises: Obtain a signed message and a public key, wherein the signature of the signed message is a digital signature obtained by using the digital signature generation method described in any one of claims 1 to 3; The intermediate parameters are obtained by calculating the order and digital signature corresponding to the base point on the preset elliptic curve; Determine the coordinates of a first reference point and a second reference point on a preset elliptic curve according to the intermediate parameter, the hash value of the signed message, the digital signature, and the order corresponding to the base point; Calculate the verification point coordinates on the preset elliptic curve according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key; The verification point coordinates are compared with the target point coordinates to obtain a verification result of the digital signature.

5. The method according to claim 4, characterized in that The verification point coordinates on the preset elliptic curve are obtained by calculating according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key, including: Determine the horizontal coordinate of the first reference point according to the coordinates of the first reference point, and determine the horizontal coordinate of the second reference point according to the coordinates of the second reference point; Multiply the abscissa of the first reference point by the base point coordinate to obtain the first intermediate point coordinate, and multiply the abscissa of the second reference point by the public key to obtain the second intermediate point coordinate; The first middle point coordinates and the second middle point coordinates are added to obtain the verification point coordinates.

6. The method according to claim 4, characterized in that Comparing the verification point coordinates with the target point coordinates to obtain a verification result of the digital signature, including: Comparing the verification point abscissa with the target point abscissa; If the horizontal coordinate of the verification point is the same as the horizontal coordinate of the target point, the verification is successful; If the horizontal coordinate of the verification point is different from the horizontal coordinate of the target point, the verification fails.

7. A digital signature generation device based on elliptic curve encryption algorithm, characterized in that: The device is applied to a sender of a signed message, and comprises: A parameter acquisition module, used to acquire the message to be signed and the parameters of a preset elliptic curve, wherein the parameters of the preset elliptic curve include: the base point coordinates of the preset elliptic curve and the order corresponding to the base point; A target point determination module, used to obtain a random integer, and determine the target point coordinates according to the base point coordinates and the random integer; The digital signature generation module is used to obtain a private key and generate a digital signature of the message to be signed based on the private key, a random integer, a hash value of the message to be signed, the coordinates of the target point, and the order corresponding to the base point.

8. A digital signature verification device based on elliptic curve encryption algorithm, characterized in that: The device is applied to a receiver of a signed message, and comprises: A signed message receiving module, used to obtain a signed message and a public key, wherein the signature of the signed message is a digital signature obtained by using the digital signature generation method according to any one of claims 1 to 3; An intermediate parameter determination module is used to calculate the intermediate parameters according to the order and digital signature corresponding to the base point on the preset elliptic curve; A reference point coordinate determination module, used to determine the coordinates of a first reference point and a second reference point on a preset elliptic curve according to the intermediate parameter, the hash value of the signed message, the digital signature, and the order corresponding to the base point; A verification point coordinate determination module, used to calculate the verification point coordinates on the preset elliptic curve according to the first reference point coordinates, the second reference point coordinates, the base point coordinates of the preset elliptic curve, and the public key; The signature verification module is used to compare the verification point coordinates with the target point coordinates to obtain a verification result of the digital signature.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the digital signature generation method based on the elliptic curve encryption algorithm described in any one of claims 1 to 3 and the digital signature verification method based on the elliptic curve encryption algorithm described in any one of claims 4 to 6 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the digital signature generation method based on the elliptic curve encryption algorithm described in any one of claims 1 to 3 and the digital signature verification method based on the elliptic curve encryption algorithm described in any one of claims 4 to 6.