Method, device, system, electronic device and storage medium for generating or assisting signature
The signature initiating device calculates and sends intermediate values to control the signature process, which solves the problem of the signature initiating device having insufficient control over the signature, simplifies the signature process and enhances security, ensuring the integrity and security of the signature process.
Patent Information
- Application Number
- CN202010225992.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-26
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-03-26
AI Technical Summary
In the existing technology, the signature initiating device does not have enough control over the signature and cannot prevent the signature assisting device from signing other illegal messages. Moreover, the signature process is complex and lacks security, and the intermediate signature value can easily become an attack target.
The intermediate value is calculated by the signature initiating device and sent to the signature assisting device, so that it can calculate the second intermediate signature value based on the intermediate value, ensuring that the signature result is controlled by the signature initiating device, and only two intermediate signature values are generated, using SM2 standard parameters, Simplify the process and enhance security.
The signature initiating device can fully control the signature process, eliminating the possibility of the signature assisting device tampering with information, improving the security of the signature, simplifying the process, and preventing third-party attacks.
Smart Images

Figure CN112311549B
Abstract
Description
Technical Field
[0001] The present application relates to the encryption algorithm part in the field of cryptography and information security technology. Specifically, the present application relates to a method, device, system, electronic device and storage medium for generating or assisting signatures. Background Art
[0002] With the development of modern technology, the Internet has become an indispensable tool in people's daily lives. When using the Internet, the confidentiality and security of personal information, confidential documents, etc. during transmission are particularly important.
[0003] Digital signature technology is the cornerstone of trust in many information systems. In 2010, the National Cryptography Administration issued a commercial digital signature standard based on elliptic curves (called the SM2 signature algorithm). Since the security of private key storage in digital signature algorithms has a significant impact on the security of information systems, researchers have proposed a collaborative signature system, which decomposes private key information into two parts, which are stored separately by two parties to improve the security of digital signatures in practical applications.
[0004] The characteristics of the collaborative signature system are: only when both parties participate in the signing process of a message can a valid signature be generated; no party can sign the message alone or impersonate the other party; the role of this cryptographic system is to divide the secret and prevent the private key of one party from being leaked and causing losses.
[0005] However, the solutions provided by the prior art have many shortcomings, such as:
[0006] 1. In the prior art, the signature assisting device performs encryption calculations based on the assisting public key generated by itself. This process will cause the signature assisting device to tamper with the signature result, and the signature initiating device cannot verify it. In addition, in the existing collaborative signature scheme, the signature initiating device does not have sufficient control over the signature, and cannot guarantee that the message signed by the signature assisting device is exactly the message it requires to sign. Since the signature assisting device independently generates the signature part and the intermediate signature, and the role of the signature initiating device is only to hide its private key information in the final result, the signature initiating device may not be able to prevent the signature assisting device from signing other illegal messages;
[0007] 2. The decomposition of the existing signature process is too complicated or other parameters need to be introduced, making the process complicated; for example, more than two intermediate signature values are generated during the signature process; or additional parameters are added during the signature process;
[0008] 3. The multiple intermediate signature values generated in the existing collaborative signature method introduce complexity to the security model of the digital signature, and the exposed intermediate signature values are likely to become an advantage for third-party adversaries to increase attacks. Summary of the invention
[0009] The present application provides a method, device, electronic device and computer-readable storage medium for generating a digital signature, which can solve the problem that the signature initiating device does not have enough control over the signature and the signature initiating device cannot prevent the signature assisting device from signing other illegal messages. The technical solution is as follows:
[0010] In a first aspect, a method for generating a digital signature is provided, the method comprising:
[0011] Calculating a first signature result according to the received intermediate parameters;
[0012] When the first signature result meets the first condition, the signature initiating device calculates an intermediate value and sends the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value;
[0013] receiving a second intermediate signature value sent by the signature assistance device, and calculating a second signature result according to the second intermediate signature value;
[0014] When the second signature result meets the second condition, the first signature result and the second signature result are output.
[0015] In a second aspect, the present application provides a digital signature initiating device, the device comprising:
[0016] A first calculation unit, used to calculate a first signature result according to the received intermediate parameters;
[0017] A sending unit, configured to, when the first signature result meets the first condition, cause the signature initiating device to calculate an intermediate value and send the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value;
[0018] A second calculation unit, configured to receive the second intermediate signature value sent by the signature assistance device, and calculate a second signature result according to the second intermediate signature value;
[0019] The first output unit is used to output the first signature result and the second signature result when the second signature result meets the second condition.
[0020] In a third aspect, the present application provides a signature assistance device, wherein the method used by the device is implemented based on an elliptic curve cryptography system, and the device includes:
[0021] A determination unit, configured to determine a first position according to the received intermediate parameters and a base point on the elliptic curve;
[0022] A third calculation unit, configured to calculate a first signature result according to the value on the X-axis corresponding to the first position;
[0023] A fourth calculation unit, used to calculate an intermediate value according to a preset calculation method;
[0024] The second output unit is used to send the first signature result and the intermediate value to the signature initiating device.
[0025] In a fourth aspect, the present application provides a digital signature system, the system comprising:
[0026] A signature initiating device, configured to calculate a first signature result based on the received intermediate parameter; when the first signature result meets the first condition, the signature initiating device calculates the intermediate value and sends the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value; receives the second intermediate signature value sent by the signature assisting device, and calculates a second signature result based on the second intermediate signature value; when the second signature result meets the second condition, outputs the first signature result and the second signature result;
[0027] A signature assistance device, the method used by the signature assistance device is implemented based on the elliptic curve cryptography system; the device is used to determine the first position according to the received intermediate parameters and the base point on the elliptic curve; calculate the first signature result according to the value on the X-axis corresponding to the first position; calculate the intermediate value according to a preset calculation method; and send the first signature result and the intermediate value to the signature initiation device.
[0028] In a fifth aspect, the present application provides a digital signature electronic device, the electronic device is used for digital signature, and the electronic device can implement a method for generating a digital signature.
[0029] In a sixth aspect, the present application provides an electronic device for assisting signature. The method used by the electronic device is implemented based on the elliptic curve cryptography system, and the electronic device can implement the method for assisting signature.
[0030] In a seventh aspect, the present application provides a computer-readable storage medium for generating a digital signature, wherein a computer program is stored on the computer-readable storage medium, and the program implements a digital signature generation method when executed.
[0031] In an eighth aspect, the present application provides another computer-readable storage medium for assisting a signature method, wherein a computer program is stored on the computer-readable storage medium, and the program implements the method for assisting a signature when executed.
[0032] The beneficial effects of the technical solution provided by this application are:
[0033] The present application provides a digital signature method, in which the main signature operation can be completed by the signature initiation device, rather than the signature assistance device independently generating the signature part and the intermediate signature. Therefore, the digital signature method provided by the embodiment of the present application can be controlled by the signature initiation device throughout the signature process, eliminating the possibility of tampering with the signature information due to too many independent operations of the signature assistance device. The existing parameters of the SM2 standard are used in this solution, and no other parameters are introduced. In addition, only two intermediate signature values are generated in this solution, so the process is relatively simple;
[0034] The present application also provides a method for assisting signature. In the process of assisting signature, the method does not generate new parameters but only uses the original public parameters, thereby eliminating the possibility of the assisting party tampering with the signed message. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0036] Figure 1 A flowchart of a method for constructing a collaborative signature in the prior art;
[0037] Figure 2 A flowchart of a signature assistance method provided in an embodiment of the present application;
[0038] Figure 3 A flowchart of a method for generating a digital signature provided in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of an optimized method for generating a digital signature provided in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of the structure of a digital signature initiating device provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of the structure of a signature assistance device provided in an embodiment of the present application;
[0042] Figure 7 A schematic diagram of the structure of a digital signature system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present invention.
[0044] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0045] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0046] First, several terms involved in this application are introduced and explained:
[0047] Since the technical solution involved in the present invention application is optimized based on the SM2 standard, it is necessary to explain some parameters involved in the SM2 standard, as follows:
[0048] Parameter E is the elliptic curve used;
[0049] The parameter G is the base point of order n on the elliptic curve E; [1,n-1] represents the set of integers from 1 to n-1;
[0050] [*] Used to represent point doubling operations on elliptic curves;
[0051] [+] is used to represent the addition operation of points on the elliptic curve;
[0052] [-] is used to represent the subtraction operation of points on the elliptic curve;
[0053] mod is used to represent modular operation;
[0054] Function H() represents a hash function;
[0055] The collaborative signing process involves both the signature initiator and the signature assistor.
[0056] The signature initiator is a participant who has the original message, has the need to sign the message, and issues a signature request;
[0057] A signature assisting device refers to a participant that responds to a signature request.
[0058] In the existing collaborative signature method, the intermediate signature value is likely to become the target of additional attacks by third-party adversaries, so enhanced measures are needed to ensure that the parameters transmitted in the middle are not changed. The specific process of the existing scheme is as follows Figure 1 As shown:
[0059] The process involves two parties, the signature initiator and the signature assistor, and the basic steps are as follows:
[0060] Step S11: The signature initiating device calculates the intermediate parameters and sends them to the signature assisting device. The details of this step are as follows:
[0061] The signature initiating device selects a random number k1∈[1,n-1], calculates the intermediate parameter Q1=k1[*](p[+]G), and then sends Q1 to the signature assisting device; wherein G is an existing base point on the elliptic curve; p is the verification public key calculated by the signature initiating device p=d1[*]p2[-]G; d1 is the initiating private key randomly selected by the signature initiating device, and d1∈[1,n-1]; p2 is the assisting public key calculated by the signature assisting device, and p2=d2[*]G; d2 is the assisting private key randomly selected by the signature assisting device, and d2∈[1,n-1];
[0062] Step S12: The signature assisting device calculates a first signature result and a first intermediate signature value according to the intermediate parameters, and sends the first signature result and the first intermediate signature value to the signature initiating device;
[0063] The signature assisting device first selects a random number k2∈[1,n-1] and calculates a point (x,y)=k2[*]p2[+]Q1 on the elliptic curve; then, according to the value of the point on the X-axis, the first signature result r=(x+e)mod n is calculated, where e is the hash value of the message M and the fixed string; finally, the first intermediate signature value s1=d2 is calculated. -1 ·r+k2 modn; the signature assisting device sends r and s1 to the signature initiating device; where d2 -1 represents the multiplicative inverse of d2 modulo n;
[0064] Step S13, the signature initiating device calculates the second signature result based on the received first signature result and the first intermediate signature value; the formula for calculating the second signature result in this step is:
[0065] s=d1 -1 s1+k1-r mod n
[0066] Among them, d1 -1 represents the multiplicative inverse of d1 modulo n;
[0067] Step 14: The signature initiating device outputs the first signature result and the second signature result (r, s) as the signature result.
[0068] The method, device, system, electronic device and storage medium for generating or assisting signatures provided in this application are intended to solve the above technical problems of the prior art.
[0069] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0070] In all embodiments provided in this application, the entire signing process is completed through the interaction between the signature initiating device and the signature assisting device. Both parties will generate their own signature private key, and finally the signature initiating device will generate a verification public key. The specific process is as follows:
[0071] The signature initiating device randomly selects the initiating private key d1, and d1∈[1,n-1];
[0072] The signature assisting device randomly selects an assisting private key d2, and d2∈[1,n-1]; the signature assisting device calculates an assisting public key p2, and p2=d2[*]G, and sends p2 to the signature initiating device;
[0073] The signature initiating device calculates the verification public key p=d1[-]p2[-]G;
[0074] The above process may be completed before the technical solution provided by the embodiment of the present invention, or may be completed simultaneously, that is, it is sufficient to ensure that the above parameters are generated during the implementation of the technical solution provided by the embodiment of the present invention.
[0075] The following is described with specific examples:
[0076] The present application embodiment provides a signature assistance method, such as Figure 2 As shown, the process is as follows:
[0077] Step S21: The signature initiating device generates an intermediate parameter Q1 and sends the intermediate parameter to the signature assisting device. The calculation method of the intermediate parameter Q1 in this step is as follows:
[0078] The signature initiating device selects a random number k1∈[1,n-1], then calculates Q1=k1[-](p[+]G) based on k1, and sends Q1 to the signature assisting device;
[0079] Step S22, the signature assistance device determines the first position point (x, y) according to the existing base point G and the received intermediate parameters; specifically as follows:
[0080] The signature assisting device selects a random number k2∈[1,n-1] and calculates the point (x,y)=k2[*]G[+]Q1 based on the existing base point G;
[0081] Step 23, the signature assisting device calculates the first signature result according to the value on the X-axis corresponding to the first position; the specific method is as follows:
[0082] Calculate the first signature result r=(x+e)mod n according to the x value on the x-axis corresponding to the first position;
[0083] Step 24, the signature initiating device calculates the intermediate value s1 according to a preset calculation method; the process is as follows:
[0084] The preset calculation method is to calculate the sum of the first signature result r and the random number k2 selected by the signature assisting device, then multiply it by the inverse element of d2, and finally perform a modulo n operation. The specific formula for k2∈[1,n-1] is as follows:
[0085] s1=d2 -1 (r+k2) mod n, where d2 -1 represents the multiplicative inverse element of d2 under modulo n; d2 is the assisting private key randomly selected by the signature assisting device, and d2∈[1,n-1];
[0086] It can be seen that the differences between the assisted signature method provided in the embodiment and the solution in the public literature are as follows:
[0087] In the public literature, the signature assistance device needs to use a parameter p2=d2[*]G when calculating the point (x, y) on the elliptic curve, and p2 is generated by the assistance private key randomly selected by itself; however, the solution in the present invention does not need this parameter at the end of the signature process, and only uses the original public parameter base point G; and the generation process of s1 is modified accordingly, and its calculation steps are changed to s1=d2 -1 (r+k2) mod n.
[0088] The digital signature generation method provided in the above embodiment has been able to improve security, but in general, the signature interaction process is still consistent with the prior art, that is, the signature initiator is still unable to control the security of the overall signature process. To address this problem, the present application proposes a digital signature generation method, which is based on the commercial digital signature standard SM2 parameter implementation of the elliptic curve; the method greatly improves the interaction process, so that the signature initiator can well control the entire process, thereby improving the security of the signature; Figure 3 As shown, the signature process of this scheme is as follows:
[0089] Step S301: The signature initiating device initiates a signature request to the signature assisting device.
[0090] Step S302: After receiving the signature request, the signature assisting device returns the intermediate parameter to the signature initiating device; the intermediate parameter in this step is the first intermediate parameter Q1, and the process in this step is as follows;
[0091] The signature assisting device selects a random number k1∈[1,n-1] and calculates Q1=k1[*](p[+]G); the signature assisting device sends Q1 as an intermediate parameter to the signature initiating device;
[0092] Step S303: The signature initiating device calculates the first signature result according to the received intermediate parameters. The process of this step is as follows:
[0093] The signature initiating device concatenates the message M to be signed and the fixed value Z to obtain M'=Z||M, where the fixed value Z is the message digest value related to the signer's identity as specified in the SM2 standard; the signature initiating device uses a hash function to calculate the digest value e=H(M') for M'.
[0094] The signature initiating device selects a random number k3∈[1,n-1], and then determines a first position (x,y)=k3[*]G[+]Q1 on the elliptic curve based on k3 and the base point G, and calculates a first signature result r=(x+e)mod n using the message digest value e and the x value on the X-axis corresponding to the first position;
[0095] Step S304: When the signature initiating device determines that the first signature result meets the first condition, step S305 is executed; otherwise, step S306 is executed. The process of this step is as follows:
[0096] The first condition is that the signature initiating device verifies whether the conditions r≠0 and r+k3≠n are true;
[0097] Step 305: The signature initiating device calculates a first intermediate signature value and sends the first intermediate signature value as an intermediate value to the signature assisting device. The specific process of this step is as follows:
[0098] The signature initiating device uses its initiating private key d1, the random number k3 selected by the signature initiating device, and the first signature result r to calculate the first signature intermediate value, s1 = d1 -1 (r+k3) mod n where d1 -1 Represents the multiplicative inverse of d1 modulo n, and uses the first intermediate signature value as the intermediate value.
[0099] Step S306: The signature initiating device re-initiates the signature request.
[0100] Step S307: The signature assisting device obtains a second intermediate signature value according to the first intermediate signature value and sends it to the signature initiating device. The specific process is as follows:
[0101] After receiving the first intermediate signature value s1, the signature assistance device uses its assistance private key d2 to calculate the second intermediate signature value s'=(d2 -1 s1+k1)mod n,d2 -1 Represent the multiplicative inverse element of d2 under modulo n, and send s' to the signature initiation device;
[0102] Step S308: The signature initiating device calculates the second signature result s according to the received second intermediate signature value. The specific process is as follows: after receiving s', the signature initiating device calculates s=(s'-r) mod n;
[0103] Step S309: When the signature initiating device determines that the second signature result meets the second condition, step S310 is executed; otherwise, step S305 is executed. The specific process of this step is as follows:
[0104] The second condition is to check whether s≠0 and s+r≠n are true. If so, the first signature result and the second signature result are used as the final signature result (r, s). Otherwise, step S306 is executed.
[0105] Step S310: The signature initiating device outputs the final signature result (r, s).
[0106] In the above embodiment, the first signature result and the second signature result are both completed by the signature initiating device, so the signature initiating device can well control the entire process to ensure that the signed message is not tampered with at will.
[0107] The embodiment of the present application also provides a method for generating a digital signature with enhanced security. In this embodiment, the intermediate information transmitted by both parties is further encrypted based on the modified process interaction, and no new parameters are introduced in the encryption process, so as to prevent the signature assistance device from tampering with the information and further prevent the third party from attacking the intermediate information. Figure 4 As shown, the specific process is as follows:
[0108] Step S401, the signature initiating device initiates a signature request to the signature assisting device;
[0109] Step S402: After receiving the signature request, the signature assisting device returns the intermediate parameters to the signature initiating device; the intermediate parameters in this step are the first intermediate parameter Q1 and the second intermediate parameter Q2. The process of this step is as follows;
[0110] After receiving the signature request, the signature assisting device selects its own random number k1∈[1,n-1] and calculates Q1=k1[*](p[+]G); at the same time, it selects a random number k2∈[1,n-1] and calculates Q2=k2[*]G; the signature assisting device sends Q1 and Q2 as intermediate parameters to the signature initiating device; Q1 is the first intermediate parameter and Q2 is the second intermediate parameter;
[0111] Step S403: The signature initiating device calculates the first signature result according to the received intermediate parameters. The process of this step is as follows:
[0112] The signature initiating device concatenates the message M to be signed and the fixed value Z to obtain M'=Z||M, where the fixed value Z is the message digest value related to the signer's identity as specified in the SM2 standard; the signature initiating device uses a hash function to calculate the digest value e=H(M') for M'.
[0113] The signature initiator selects a random number k3∈[1,n-1], and then calculates the point (x,y)=k3[*]G[+]Q1 based on k3 and the base point G, and uses the message digest value e and the x value on the X-axis of the point to calculate the first signature result r=(x+e)modn;
[0114] Step S404: When the signature initiating device determines that the first signature result meets the first condition, step S405 is executed, otherwise step S406 is executed; the process of this step is as follows:
[0115] The first conditional signature initiating device verifies whether the conditions r≠0 and r+k3≠n are true;
[0116] Step 405: The signature initiating device calculates the first intermediate signature value and the third intermediate parameter, and sends the first intermediate signature value and the third intermediate parameter as intermediate values to the signature assisting device. The specific process of this step is as follows:
[0117] The signature initiating device selects a random number k4∈[1,n-1] and calculates the third intermediate parameter Q3=k4[*]G; the signature initiating device calculates the second position (x1,y1)=k4[*]Q2 on the elliptic curve based on k4 and Q2, and calculates the first intermediate signature value s1=d1 based on the value on the X-axis corresponding to the second position, the first signature result, the random number k3, and the initiating private key d1 -1 (r+k3)+x1 mod n, d1 -1 represents the multiplicative inverse element of d1 under modulo n. The signature initiating device sends Q3 and s1 to the signature assisting device.
[0118] Step S406: The signature initiating device re-initiates the signature request.
[0119] Step S407: The signature assisting device calculates the second intermediate signature value and sends it to the signature initiating device. The specific process is as follows:
[0120] After receiving Q3 and s1, the signature assisting device uses k2 and Q3 to calculate the third position in the elliptic curve (x2, y2) = k2[*] Q3; calculates the third intermediate signature value s1' = (s1-x2) mod n based on s1 and the value x2 on the X-axis corresponding to the third position; then uses its private key d2 to calculate the second intermediate signature value Represents the multiplicative inverse element of d2 under modulo n, and sends the second intermediate signature value s' to the signature initiating device.
[0121] Step S408: The signature initiating device calculates the second signature result S according to the received second intermediate signature value. The specific process is as follows: after receiving s', the signature initiating device calculates s=(s'-r) mod n;
[0122] Step S409: When the signature initiating device determines that the second signature result meets the second condition, step S410 is executed; otherwise, step S406 is executed. The specific process of this step is as follows:
[0123] The signature initiating device checks whether s≠0 and s+r≠n are true according to the second condition, and if so, executes step S410, otherwise, executes step S406;
[0124] Step S410: The signature initiating device outputs the final signature result (r, s).
[0125] It can be seen that the technical solution provided by the present application further adds encryption calculations to the data exchanged between the signature initiating device and the signature assisting device on the basis of process changes, so as to ensure that all data are not transmitted nakedly during the data transmission process, thereby eliminating the possibility of a third party arbitrarily tampering with the data.
[0126] This application provides a digital signature initiating device, such as Figure 5 As shown, the device comprises:
[0127] A first calculation unit 51, configured to calculate a first signature result according to the received intermediate parameters;
[0128] A sending unit 52, configured to, when the first signature result meets the first condition, cause the signature initiating device to calculate an intermediate value and send the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value;
[0129] A second calculation unit 53, configured to receive the second intermediate signature value sent by the signature assistance device, and calculate a second signature result according to the second intermediate signature value;
[0130] The first output unit 54 is configured to output the first signature result and the second signature result when the second signature result meets the second condition.
[0131] The method run by the digital signature initiating device is implemented based on the commercial digital signature standard SM2 of the elliptic curve. The intermediate parameter is the first intermediate parameter. The first calculation unit 51 is used to determine the first position according to the first intermediate parameter and the base point on the elliptic curve, and calculate the first signature result according to the value on the X-axis corresponding to the first position.
[0132] The sending unit 52 is further used to calculate a first intermediate signature value as an intermediate value according to the value on the X-axis and the first signature result and send it to the signature assistance device;
[0133] The intermediate parameters include a second intermediate parameter, and the sending unit is used for the signature initiating device to calculate a third intermediate parameter based on the base point and a randomly selected random number; determine the second position based on the second intermediate parameter, and calculate the first intermediate signature value based on the value on the X-axis corresponding to the second position and the first signature result; and send the third intermediate parameter and the first intermediate signature value as intermediate values to the signature assistance device.
[0134] The present application provides a signature assisting device, the method used by the device is based on the commercial digital signature standard SM2 of the elliptic curve, such as Figure 6 As shown, the device comprises:
[0135] A determination unit 61, configured to determine a first position according to the received intermediate parameters and a base point on the elliptic curve;
[0136] A third calculation unit 62, configured to calculate a first signature result according to the value on the X-axis corresponding to the first position;
[0137] A fourth calculation unit 63, used to calculate the intermediate value according to a preset calculation method;
[0138] The second output unit 64 is used to send the first signature result and the intermediate value to the signature initiating device.
[0139] The fourth calculation unit 63 is used to perform a modular operation on the sum of the first signature result and the random number selected by the signature assistance device; and calculate an intermediate value according to the operation result.
[0140] The signature assistance device calculates a second intermediate signature value based on the intermediate value. The signature assistance device also includes a fifth calculation unit 65, which is used to determine a third position in the elliptic curve according to a third intermediate parameter, and calculate a third intermediate signature value according to the value on the X-axis corresponding to the third position and the first intermediate signature value, and calculate the second intermediate signature value according to the third intermediate signature value.
[0141] This application provides a digital signature system, such as Figure 7 The system shown comprises:
[0142] The signature initiating device 71 is used to calculate a first signature result according to the received intermediate parameters; when the first signature result meets the first condition, the signature initiating device calculates the intermediate value and sends the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value; receives the second intermediate signature value sent by the signature assisting device, and calculates the second signature result according to the second intermediate signature value; when the second signature result meets the second condition, outputs the first signature result and the second signature result;
[0143] The signature assistance device 72 uses a method based on the elliptic curve cryptography system; the device is used to determine the first position according to the received intermediate parameters and the base point on the elliptic curve; calculate the first signature result according to the value on the X-axis corresponding to the first position; calculate the intermediate value according to a preset calculation method; send the first signature result and the intermediate value to the signature initiation device.
[0144] The present application provides a digital signature electronic device, which is used for performing digital signature and can implement the above-mentioned digital signature generation method in the present application.
[0145] The present application provides an electronic device for assisting signature. The method used by the electronic device is implemented based on the elliptic curve cryptography system. The electronic device can implement the method for assisting signature.
[0146] The present application provides a computer-readable storage medium for generating a digital signature. A computer program is stored on the computer-readable storage medium. When the program is executed, a digital signature generation method is implemented.
[0147] The present application provides another computer-readable storage medium for assisting a signature method. A computer program is stored on the computer-readable storage medium, and the program implements the assisting signature method when executed.
[0148] The digital signature electronic device or signature assisting electronic device provided in this application can be a mobile phone, computer, tablet computer, or other electronic device.
[0149] The embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When it runs on a computer, the computer can execute the corresponding content in the aforementioned method embodiment. Compared with the prior art, the digital signature method provided by the present application can be completed by a signature initiation device. The main signature operation is not generated by a signature assistance device independently. The digital signature method provided by the embodiment of the present application can be controlled by the signature initiation device. The entire signature process eliminates the possibility of tampering with the signature information due to too many independent operations of the signature assistance device. The existing parameters of the SM2 standard are used in this solution, and no other parameters are introduced. In this solution, only two intermediate signature values are generated, so the process is relatively simple.
[0150] The present application also provides a method for assisting signature. In the process of assisting signature, the method does not generate new parameters but only uses the original public parameters, thereby eliminating the possibility of the assisting party tampering with the signed message.
[0151] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0152] The above descriptions are only some embodiments 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 principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for generating a digital signature, characterized in that: The method is applied to a signature initiating device, comprising: Calculating a first signature result according to the received intermediate parameters; When the first signature result meets the first condition, the signature initiating device calculates an intermediate value and sends the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value; receiving the second intermediate signature value sent by the signature assistance device, and calculating a second signature result according to the second intermediate signature value; When the second signature result meets the second condition, outputting the first signature result and the second signature result; Wherein, the intermediate parameters include a first intermediate parameter and a second intermediate parameter; The step of calculating the first signature result according to the received intermediate parameter includes: Determine a first position on the elliptic curve according to the first intermediate parameter and a base point on the elliptic curve, and calculate the first signature result according to a value on the X-axis corresponding to the first position; When the first signature result meets the first condition, the signature initiating device calculates an intermediate value and sends the intermediate value to the signature assisting device, including: The signature initiating device calculates a third intermediate parameter based on the base point and a randomly selected random number; Determine a second position on the elliptic curve according to the random number and the second intermediate parameter, and calculate a first intermediate signature value according to the value on the X-axis corresponding to the second position and the first signature result; The third intermediate parameter and the first intermediate signature value are sent to the signature assistance device as intermediate values.
2. The method according to claim 1, characterized in that The second intermediate signature value is obtained by the signature assistance device determining a third position in the elliptic curve according to the third intermediate parameter, calculating a third intermediate signature value according to the value on the X-axis corresponding to the third position and the first intermediate signature value, and calculating according to the third intermediate signature value.
3. A method for assisting signature, which is implemented based on elliptic curve cryptography and is characterized in that: The method is applied to a signature assistance device, comprising: Calculate an intermediate parameter according to the received signature request, and return the intermediate parameter to the signature initiating device; wherein the intermediate parameter includes a first intermediate parameter and a second intermediate parameter; A second intermediate signature value is calculated based on the received intermediate value, and the second intermediate signature value is returned to the signature initiation device; wherein the intermediate value includes the first intermediate signature value and the third intermediate parameter; wherein the third intermediate parameter is calculated by the signature initiation device according to the base point and a randomly selected random number; the first intermediate signature value is calculated by the signature initiation device according to the random number and the second intermediate parameter to determine the second position on the elliptic curve, and according to the value on the X-axis corresponding to the second position and the first signature result; wherein the first signature result is calculated by the signature initiation device according to the first intermediate parameter and the base point on the elliptic curve to determine the first position on the elliptic curve, and according to the value on the X-axis corresponding to the first position; The step of calculating the second intermediate signature value according to the received intermediate value includes: Determine a third position according to the third intermediate parameter and the random number; A third intermediate signature value is calculated based on the first intermediate signature value and the value on the X-axis corresponding to the third position, and the second intermediate signature value is calculated based on the third intermediate signature value.
4. A digital signature initiating device, characterized in that: The device comprises: A first calculation unit, used to calculate a first signature result according to the received intermediate parameters; A first sending unit, configured to, when the first signature result meets a first condition, cause the signature initiating device to calculate an intermediate value and send the intermediate value to the signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value; a second calculation unit, configured to receive the second intermediate signature value sent by the signature assistance device, and calculate a second signature result according to the second intermediate signature value; A first output unit, configured to output the first signature result and the second signature result when the second signature result meets a second condition; Wherein, the intermediate parameters include a first intermediate parameter and a second intermediate parameter; The first computing unit is configured to: Determine a first position on the elliptic curve according to the first intermediate parameter and a base point on the elliptic curve, and calculate the first signature result according to a value on the X-axis corresponding to the first position; When the first signature result meets the first condition, the sending unit is used to: The signature initiating device calculates a third intermediate parameter based on the base point and a randomly selected random number; Determine a second position on the elliptic curve according to the random number and the second intermediate parameter, and calculate a first intermediate signature value according to the value on the X-axis corresponding to the second position and the first signature result; The third intermediate parameter and the first intermediate signature value are sent to the signature assistance device as intermediate values.
5. A signature assisting device, wherein the method used by the device is implemented based on the elliptic curve cryptography system, characterized in that: The device can implement the method for generating the assisting signature as described in claim 3.
6. A digital signature system, characterized in that: The system comprises: A signature initiating device, configured to calculate a first signature result according to the received intermediate parameters; when the first signature result meets a first condition, the signature initiating device calculates an intermediate value and sends the intermediate value to a signature assisting device, so that the signature assisting device calculates a second intermediate signature value based on the intermediate value; receives the second intermediate signature value sent by the signature assisting device, and calculates a second signature result according to the second intermediate signature value; when the second signature result meets a second condition, outputs the first signature result and the second signature result; Wherein, the intermediate parameters include a first intermediate parameter and a second intermediate parameter; The step of calculating the first signature result according to the received intermediate parameter includes: Determine a first position on the elliptic curve according to the first intermediate parameter and a base point on the elliptic curve, and calculate the first signature result according to a value on the X-axis corresponding to the first position; When the first signature result meets the first condition, the signature initiating device calculates an intermediate value and sends the intermediate value to the signature assisting device, including: The signature initiating device calculates a third intermediate parameter based on the base point and a randomly selected random number; Determine a second position on the elliptic curve according to the random number and the second intermediate parameter, and calculate a first intermediate signature value according to the value on the X-axis corresponding to the second position and the first signature result; sending the third intermediate parameter and the first intermediate signature value as intermediate values to the signature assistance device; A signature assistance device, wherein the method used by the signature assistance device is based on the elliptic curve cryptography system; the signature assistance device is used to: Calculate an intermediate parameter according to the received signature request, and return the intermediate parameter to the signature initiating device; wherein the intermediate parameter includes a first intermediate parameter and a second intermediate parameter; A second intermediate signature value is calculated based on the received intermediate value, and the second intermediate signature value is returned to the signature initiating device; wherein the intermediate value includes the first intermediate signature value and the third intermediate parameter; wherein the third intermediate parameter is calculated by the signature initiating device according to the base point and a randomly selected random number; the first intermediate signature value is calculated by the signature initiating device according to the random number and the second intermediate parameter to determine the second position on the elliptic curve, and according to the value on the X-axis corresponding to the second position and the first signature result; wherein the first signature result is calculated by the signature initiating device according to the first intermediate parameter and the base point on the elliptic curve to determine the first position on the elliptic curve, and according to the value on the X-axis corresponding to the first position; The step of calculating the second intermediate signature value according to the received intermediate value includes: Determine a third position according to the third intermediate parameter and the random number; A third intermediate signature value is calculated based on the first intermediate signature value and the value on the X-axis corresponding to the third position, and the second intermediate signature value is calculated based on the third intermediate signature value.
7. A digital signature electronic device, the electronic device is used for digital signature, characterized in that: The electronic device can implement the method for generating a digital signature as described in any one of claims 1-2.
8. An electronic device assisting signature, wherein the method used by the electronic device is implemented based on the elliptic curve cryptography system, characterized in that: The electronic device can implement the signature assistance method described in claim 3.
9. A computer-readable storage medium for generating a digital signature, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the digital signature generation method described in any one of claims 1-2.
10. A computer-readable storage medium for assisting a signature method, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the signature assistance method described in claim 3.
Citation Information
Patent Citations
Collaborative signature and decryption method, apparatus and system of SM2 algorithm
CN107196763A
Digital signature generation method and system based on encrypted private key secrets
CN107483205A
Private key signature processing method and device, equipment and medium
CN108880807A
A cooperative signature method and system for both sides of communication based on SM2 algorithm
CN108989047A
Method and system for cooperative signature and decryption of both sides of communication based on sm2 algorithm
CN109088726A
