A collaborative signature method and system based on the SM2 cryptographic algorithm
In the SM2 collaborative signature protocol, the initiator SM2 signature of the message digest and sent it to the collaborator to verify it, solving the problem that the collaborator failed to authenticate the initiator's identity, improving security and simplifying the identity authentication process.
Patent Information
- Application Number
- CN202410931245.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The existing SM2 collaborative signature agreement does not consider the identification of the initiator's identity by the collaborator, resulting in the need to introduce an additional identification mechanism, which increases system complexity and security risks.
During the collaborative signature process, when the initiator generates the signature value, he uses SM2 signature to sign the message digest and sends it to the collaborator for verification. If the collaborator passes the verification, he will continue to sign generation. If the signature fails, terminate the signature. process to realize the identification of the initiator’s identity.
The security of the collaborative signature protocol is improved, additional identity authentication message transmission overhead is saved, and the security is improved. The collaborators can identify the authenticity of the initiator during the SM2 collaborative signature process.
Smart Images

Figure CN118473665B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital signatures, and in particular to a collaborative signature method and system based on the SM2 cryptographic algorithm. Background Art
[0002] The SM2 collaborative signature method is that the two signing parties (the initiator and the collaborator) store the private keys separately, and the two parties work together to complete the message signing operation, preventing attacks in a relatively safe way to protect data security.
[0003] The patent document with application publication number CN114186251A is cited here, which discloses a collaborative signature and decryption method of the SM2 cryptographic algorithm for protecting user privacy. In this collaborative signature method, the service party does not know the user's complete public key and does not need to associate the initiator's partial private key to protect the user's privacy. However, this collaborative signature method increases the complexity of the collaborative signature system. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a collaborative signature method and system based on the SM2 cryptographic algorithm that overcomes the above problems or at least partially solves the above problems.
[0005] The present application discloses a collaborative signature method based on the SM2 cryptographic algorithm, the method involving an initiator and a collaborative end; the initiator and the collaborative end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborative end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiator and the collaborative end perform mutual verification through the first public key P1 and the second public key P2;
[0006] The collaborative signature method comprises:
[0007] The initiator determines the user public key PA according to the first private key d1, the second public key P2 and the base point G;
[0008] The initiator determines the elliptic curve point Q1 according to the order n and the base point G;
[0009] The initiator determines a first message digest e according to the message M to be signed, and determines a signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n;
[0010] The initiating end determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the cooperating end; the cooperating end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end;
[0011] The initiator determines the signature value component s based on the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification passes, the collaborative signature is successful.
[0012] Furthermore, the step of determining the elliptic curve point Q1 according to the order n and the base point G by the initiator includes:
[0013] The initiator determines a random number k1 according to the order n;
[0014] The initiator determines the elliptic curve point Q1 according to the random number k1 and the base point G.
[0015] Furthermore, the step of determining the signature value component r' by the initiator according to the first message digest e, the elliptic curve point Q1, the base point G and the order n includes:
[0016] The initiator determines a second message digest e1' according to the first message digest e and the elliptic curve point Q1;
[0017] The initiator determines a random number k1' according to the order n;
[0018] The initiator determines an intermediate value x1' according to the random number k1' and the base point G;
[0019] The initiator determines the signature value component r' according to the second message digest e1', the intermediate value x1' and the order n.
[0020] Furthermore, the step of determining the signature value component s by the initiator according to the signature value component r, the signature value component s2 and the order n comprises:
[0021] The initiator determines a random number k1 according to the order n;
[0022] The initiator determines the signature value component s according to the first private key d1, the random number k1, the signature value component s2, the signature value component r and the order n.
[0023] Furthermore, the step of mutual verification between the initiating end and the cooperating end through the first public key P1 and the second public key P2 includes:
[0024] The initiating end generates a random number rnd, determines a digest value c according to the random number rnd and the first public key P1, and sends the digest value c to the cooperating end; the cooperating end is used to send the second public key P2 to the initiating end according to the digest value c;
[0025] The initiator verifies the legitimacy of the second public key P2;
[0026] If the verification is successful, the initiator sends the random number rnd and the first public key P1 to the collaboration end; the collaboration end is used to verify the legitimacy of the first public key P1, and verify the random number rnd and the first public key P1 according to the summary value c.
[0027] The present application also discloses a collaborative signature method based on the SM2 cryptographic algorithm, the method involving an initiator and a collaborative end; the initiator and the collaborative end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborative end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiator and the collaborative end perform mutual verification through the first public key P1 and the second public key P2; the initiator is used to generate a key pair of the user based on the first private key d1, the second private key d2 and the second public key P2; The second public key P2 and the base point G determine the user public key PA, and determine the elliptic curve point Q1 according to the order n and the base point G, and determine the first message digest e according to the message M to be signed, and determine the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n, and determine the signature value component s' according to the first private key d1, the signature value component r', and the order n, and send the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end;
[0028] The collaborative signature method comprises:
[0029] The collaboration end performs signature verification on the signature value component r' and the signature value component s' by using the first public key P1;
[0030] If the verification is successful, the collaboration end determines the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n;
[0031] The collaborative end determines the signature value component s2 based on the second private key d2, the signature value component r and the order n, and sends the signature value component r and the signature value component s2 to the initiating end; the initiating end is used to determine the signature value component s based on the signature value component r, the signature value component s2 and the order n, and perform signature verification on the signature value component r and the signature value component s through the user public key PA.
[0032] Furthermore, the step of the collaboration end performing signature verification on the signature value component r' and the signature value component s' by using the first public key P1 includes:
[0033] The collaboration end determines an intermediate value t according to the signature value component r', the signature value component s' and the order n;
[0034] The cooperation end determines a third message digest e2' according to the first message digest e and the elliptic curve point Q1;
[0035] The collaboration end determines the intermediate value x2' according to the signature value component s', the base point G, the intermediate value t and the first public key P1;
[0036] The collaboration end determines an intermediate value R according to the third message digest e2', the intermediate value x2' and the order n;
[0037] The collaboration end performs verification: if t≠0 and R=r', the verification of the signature value component r' and the signature value component s' is successful.
[0038] Furthermore, the step of the collaboration end determining the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n includes:
[0039] The cooperation end determines a random number k2 according to the order n;
[0040] The collaboration end determines an intermediate value x1 according to the random number k2, the base point G, the second private key d2 and the elliptic curve point Q1;
[0041] The collaboration end determines the signature value component r according to the first message digest e, the intermediate value x1 and the order n.
[0042] Furthermore, the step of the collaboration end determining the signature value component s2 according to the second private key d2, the signature value component r and the order n includes:
[0043] The collaboration end determines the signature value component s2 based on the second private key d2, the signature value component r, the random number k2 and the order n.
[0044] The present application also discloses a collaborative signature system based on the SM2 cryptographic algorithm, the system comprising an initiator and a collaborative end; the initiator and the collaborative end are both preset with an elliptic curve; wherein the elliptic curve comprises a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborative end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiator and the collaborative end perform mutual verification through the first public key P1 and the second public key P2;
[0045] The collaborative signature system comprises:
[0046] The initiating end is used to determine the user public key PA according to the first private key d1, the second public key P2 and the base point G, and determine the elliptic curve point Q1 according to the order n and the base point G, and determine the first message digest e according to the message M to be signed, and determine the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n, and determine the signature value component s' according to the first private key d1, the signature value component r' and the order n, and send the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end;
[0047] The collaboration end is used to perform signature verification on the signature value component r' and the signature value component s' by using the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end;
[0048] The initiator is used to determine the signature value component s according to the signature value component r, the signature value component s2 and the order n, and to perform signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification is successful, the collaborative signature is successful.
[0049] This application has the following advantages:
[0050] In the embodiment of the present application, compared with the prior art, the collaborative signing process only involves the initiator's partial signature of the collaborator (r, s2), without considering the authentication of the initiator's identity by the collaborating party. The present application provides a collaborative signature method and system based on the SM2 cryptographic algorithm, the method involving an initiator and a collaborating end; the initiator and the collaborating end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborating end stores a second private key d2 and a second public key P2; when collaboratively generating a user's key pair, the initiator and the collaborating end perform mutual verification through the first public key P1 and the second public key P2; the collaborative signature method includes: the initiator determines the user public key PA based on the first private key d1, the second public key P2 and the base point G; the initiator determines the elliptic curve point Q1 based on the order n and the base point G; the initiator determines the first message digest e based on the message M to be signed, and determines the signature based on the first message digest e, the elliptic curve point Q1, the base point G and the order n value component r'; the initiator determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end; the collaboration end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiator; the initiator determines the signature value component s according to the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification passes, the collaborative signature is successful. This application solves the technical problem that the existing SM2 collaborative signature protocol does not consider the collaborating party's authentication of the initiator's identity and needs to introduce an additional identity authentication mechanism, thereby achieving the technical effect that the collaborating party can authenticate the authenticity of the initiator's identity during the SM2 collaborative signature process. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0052] Figure 1 It is a flowchart of a collaborative signature method based on the SM2 cryptographic algorithm provided in one embodiment of the present application;
[0053] Figure 2 This is a collaborative digital signature framework diagram provided by an embodiment of the present application;
[0054] Figure 3 This is a flowchart of the steps for collaboratively generating a key pair provided in an embodiment of the present application;
[0055] Figure 4 This is a flowchart of the steps of collaborative signing provided by an embodiment of the present application;
[0056] Figure 5 It is a structural diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the objects, features and advantages of the present application more obvious and understandable, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0058] The symbols and descriptions applicable to interpreting this application are as follows:
[0059] d1 is the private key of the initiator.
[0060] d2 is the private key of the collaborating party.
[0061] d-1 mod n is the inverse of d mod n.
[0062] E(Fq) is the set of all rational points of the elliptic curve E on Fq (including the point O at infinity).
[0063] e is the output value of the cryptographic hash algorithm acting on ZA and message M.
[0064] Fq is a finite field containing q elements.
[0065] G is a base point of the elliptic curve, and its order is a prime number.
[0066] Hv( ) is a cryptographic hash algorithm with a message digest length of v bits.
[0067] h is the cofactor, h=#E(Fq) / n, where n is the order of the base point G.
[0068] KDF() is a key derivation function.
[0069] M is the message to be signed or encrypted.
[0070] mod n is the modulo n operation.
[0071] n is the order of the base point G.
[0072] O is a special point on the elliptic curve, called the point at infinity or the zero point, and is the identity element of the elliptic curve additive group.
[0073] PA is the public key of user A.
[0074] P1 is the public key of the initiator.
[0075] P2 is the public key of the collaborating party.
[0076] x||y is the concatenation of x and y, where x and y can be bit strings or byte strings.
[0077] ZA is a hash value of the identifiable identifier of user A, some elliptic curve system parameters and user A's public key.
[0078] [k]P is a point k times the point P on the elliptic curve, where k is a positive integer.
[0079] (r, s) is the signature of the message.
[0080] [x, y] is the set of integers greater than or equal to x and less than or equal to y.
[0081] #E(Fq) is the number of points on E(Fq), which is called the order of the elliptic curve E(Fq).
[0082] The inventors have found through analysis of the prior art that the collaborative signature process of the existing collaborative signature method only involves the verification of the collaboratively generated complete signature (r, s) by the initiator, without considering the authentication of the identity of the initiator by the collaborating party. Therefore, the existing collaborative signature method needs to rely on an independent identity authentication protocol or needs to use an additional public-private key pair for identity authentication, which increases the complexity of the collaborative signature system.
[0083] However, if an asymmetric key-based identity authentication method is used to authenticate the identity of the initiator, the two parties need to distribute and protect additional public-private key pairs, which contradicts the purpose of solving the asymmetric key security protection problem based on the collaborative signature method; if a weak key identity authentication method is used, the security of the entire system will be reduced to the security of the weak key identity authentication method.
[0084] In addition, the existing collaborative signature method forces the initiator to follow the protocol to generate Q1=[k1]P2 and know k1, but the malicious initiator does not necessarily generate Q1=[k1]P2 according to the protocol. The collaborative party may not be able to resist the attack of the malicious initiator by only verifying Q1.
[0085] Based on the above analysis of the prior art by the inventors, one of the core technical concepts of the present application is that when the initiator initiates the signature, on the basis of generating Q1=[k1]P2, the hash value e1' of the message digest e can be SM2 signed to generate a signature value (r', s'), and the signature (r', s') is sent to the collaborating party. The collaborating party needs to verify the validity of the initiator's signature (r', s'). If the verification passes, the collaborative signature continues to generate the signature value (r, s2); if the verification fails, the collaborating party can terminate the collaborative signature. That is, by verifying the initiator's signature (r', s') during the collaborative signature process, the collaborating party can identify the authenticity of the initiator's identity, thereby improving the security of the collaborative signature protocol. Based on the above concepts, the present application can also save additional identity authentication message transmission overhead and further improve security.
[0086] Reference Figure 1 , shows a collaborative signature method based on the SM2 cryptographic algorithm provided by an embodiment of the present application, the method involves an initiator and a collaborative end; the initiator and the collaborative end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborative end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiator and the collaborative end perform mutual verification through the first public key P1 and the second public key P2;
[0087] The collaborative signature method comprises:
[0088] S110, the initiator determines the user public key PA according to the first private key d1, the second public key P2 and the base point G;
[0089] S120, the initiator determines an elliptic curve point Q1 according to the order n and the base point G;
[0090] S130, the initiator determines a first message digest e according to the message M to be signed, and determines a signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n;
[0091] S140, the initiating end determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the cooperating end; the cooperating end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end;
[0092] S150. The initiator determines the signature value component s according to the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification is successful, the collaborative signature is successful.
[0093] In the embodiment of the present application, compared with the prior art, the collaborative signing process only involves the initiator's partial signature of the collaborator (r, s2), without considering the authentication of the initiator's identity by the collaborating party. The present application provides a collaborative signature method and system based on the SM2 cryptographic algorithm, the method involving an initiator and a collaborating end; the initiator and the collaborating end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborating end stores a second private key d2 and a second public key P2; when collaboratively generating a user's key pair, the initiator and the collaborating end perform mutual verification through the first public key P1 and the second public key P2; the collaborative signature method includes: the initiator determines the user public key PA based on the first private key d1, the second public key P2 and the base point G; the initiator determines the elliptic curve point Q1 based on the order n and the base point G; the initiator determines the first message digest e based on the message M to be signed, and determines the signature based on the first message digest e, the elliptic curve point Q1, the base point G and the order n value component r'; the initiator determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end; the collaboration end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiator; the initiator determines the signature value component s according to the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification passes, the collaborative signature is successful. This application solves the technical problem that the existing SM2 collaborative signature protocol does not consider the collaborating party's authentication of the initiator's identity and needs to introduce an additional identity authentication mechanism, thereby achieving the technical effect that the collaborating party can authenticate the authenticity of the initiator's identity during the SM2 collaborative signature process.
[0094] Next, a collaborative signature method based on the SM2 cryptographic algorithm in this exemplary embodiment will be further described.
[0095] It should be noted that the signature value component r' and the signature value component s' can constitute the partial signature value (r', s') of the initiator, and the collaborating end can perform signature verification on the partial signature value (r', s'); the signature value component r and the signature value component s can constitute the user's complete signature value (r, s), and the initiator can perform signature verification on the complete signature value (r, s).
[0096] Reference Figure 2 , showing the collaborative digital signature framework of this application, the specific description is as follows:
[0097] The collaborative digital signature algorithm is a process where the initiator acts as the agent of the signer (user), jointly generates and holds the user's private key with the collaborator, and generates a digital signature through collaborative calculation with the collaborator. The initiator and the collaborator use the same elliptic curve system parameters, and the parameter definition should comply with the provisions of Chapter 4 of GB / T 32918.5-2017.
[0098] The initiator and the collaborator need to complete the initialization through the key pair collaborative generation process, that is, the initiator and the collaborator verify each other through the first public key P1 and the second public key P2, and the initiator determines the user public key PA based on the first private key d1, the second public key P2 and the base point G. After initialization, the initiator has the first private key d1 and the user public key PA, and the collaborator has the second private key d2 and the first public key P1. Subsequently, the initiator and the collaborator can complete the digital signature through collaboration.
[0099] It should be noted that the collaborating party may also generate a user public key PA' separately. Both the user public key PA and the user public key PA' are user public keys. The difference between the two lies in the different generating ends. The generation and storage of the user public key PA' by the collaborating party is an optional operation. The user public key PA' is generated only when the collaborating party needs to store or output the user public key PA'.
[0100] As described in step S130, the initiator determines the first message digest e according to the message M to be signed, and determines the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n.
[0101] It should be noted that the specific processes involved in the above steps may include:
[0102] Calculate e=Hv(ZA||M).
[0103] Among them, the data type of e is converted to an integer according to the method defined in Section 4.2 of Part 1 of GB / T 32918.1-2016, and ZA is calculated according to the method defined in Section 5.5 of Part 2 of GB / T 32918.2-2016.
[0104] In an embodiment of the present application, the specific process of step S120 "the initiator determines the elliptic curve point Q1 according to the order n and the base point G" can be further explained in combination with the following description.
[0105] The initiator determines a random number k1 according to the order n;
[0106] The initiator determines the elliptic curve point Q1 according to the random number k1 and the base point G.
[0107] It should be noted that the specific processes involved in the above steps may include:
[0108] Generate a random number k1∈[1,n-1];
[0109] Compute the elliptic curve point Q1=[k1]G.
[0110] In one embodiment of the present application, the specific process of step S130 "the initiator determines the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n" can be further explained in combination with the following description.
[0111] The initiator determines a second message digest e1' according to the first message digest e and the elliptic curve point Q1;
[0112] The initiator determines a random number k1' according to the order n;
[0113] The initiator determines an intermediate value x1' according to the random number k1' and the base point G;
[0114] The initiator determines the signature value component r' according to the second message digest e1', the intermediate value x1' and the order n.
[0115] It should be noted that the specific processes involved in the above steps may include:
[0116] Calculate e1'=Hv(e||Q1x||Q1y);
[0117] Generate a random number k1'∈[1, n-1];
[0118] Calculate the elliptic curve point (x1', y1') = [k1'] G;
[0119] Calculate r'=e1'+x1' mod n;
[0120] Among them, time variable parameters TVP (such as timestamps or counters) can also be introduced:
[0121] The initiator calculates e1'=Hv(e||Q1x||Q1y||TVP) and sends TVP, e, Q1 and (r', s') to the collaborator; when the collaborator receives the request, it can first verify the legitimacy of TVP.
[0122] In an embodiment of the present application, the specific process of step S150 "the initiator determines the signature value component s according to the signature value component r, the signature value component s2 and the order n" can be further explained in combination with the following description.
[0123] The initiator determines a random number k1 according to the order n;
[0124] The initiator determines the signature value component s according to the first private key d1, the random number k1, the signature value component s2, the signature value component r and the order n.
[0125] It should be noted that the specific processes involved in the above steps may include:
[0126] Generate a random number k1∈[1,n-1];
[0127] Calculate s'=(d1 -1 ⋅(k1'+r')-r') mod n;
[0128] After that, you can also include:
[0129] Verification: If r'=0 or r'+k1'=n or s'=0, then regenerate the random number k1'∈[1,n-1].
[0130] In an embodiment of the present application, the specific process of "the initiating end and the cooperating end performing mutual verification through the first public key P1 and the second public key P2" can be further explained in combination with the following description.
[0131] The initiating end generates a random number rnd, determines a digest value c according to the random number rnd and the first public key P1, and sends the digest value c to the cooperating end; the cooperating end is used to send the second public key P2 to the initiating end according to the digest value c;
[0132] The initiator verifies the legitimacy of the second public key P2;
[0133] If the verification is successful, the initiator sends the random number rnd and the first public key P1 to the collaboration end; the collaboration end is used to verify the legitimacy of the first public key P1, and verify the random number rnd and the first public key P1 according to the summary value c.
[0134] It should be noted that the collaboration end is used to send the second public key P2 to the initiating end according to the digest value c, wherein the digest value c and the second public key P2 are only a causal relationship in the timing of messages, and the generation and sending of the second public key P2 have no numerical dependency on the digest value c. It can be understood that when the collaboration end receives the digest value c, the collaboration end sends the second public key P2 to the initiating end.
[0135] It should be noted that the specific processes involved in the above steps may include:
[0136] Randomly generate 32 bytes rnd and calculate c=H(rnd || P1);
[0137] Verify whether P2 satisfies the elliptic curve equation; if not, the collaborative key pair generation fails;
[0138] If satisfied, rnd and P1 are sent to the collaborating party;
[0139] Verify whether P1 satisfies the elliptic curve equation and whether c=H(rnd ||P1) holds; if not, the collaborative key pair generation fails;
[0140] After that, you can also include:
[0141] Calculate the elliptic curve point PA'=[d2]P1-G, where user A's public key is PA'.
[0142] In a specific embodiment of the present application, the initiator and the collaborator generate their own key pairs (d1, P1) and (d2, P2) respectively, and jointly generate the public key PA of user A. The private key dA of user A is composed of the private keys of the initiator and the collaborator, and does not appear completely during the key pair generation and signing process.
[0143] As an example, see Figure 3 , showing the specific process of collaborative generation of key pairs of this application:
[0144] Initiator:
[0145] A1: Generates a random number d1ϵ[1,n-1];
[0146] A2: Calculate the elliptic curve point P1=[d1]G. The initiator’s key pair is (d1, P1).
[0147] A3: Randomly generate 32 bytes rnd and calculate c=H(rnd || P1);
[0148] A4: Send c to the collaborating party to request collaborative generation of a key pair.
[0149] Collaborators:
[0150] B1: Generate a random number d2∈[1,n-1];
[0151] B2: Calculate the elliptic curve point P2=[d2]G. The key pair of the collaborating party is (d2, P2).
[0152] B3: Send P2 to the initiator.
[0153] Initiator:
[0154] A5: Verify whether P2 satisfies the elliptic curve equation. If not, the collaborative key pair generation fails.
[0155] A6: Calculate the elliptic curve point PA = [d1]P2-G, where the public key of user A is PA.
[0156] A7: Send rnd and P1 to the collaborating party.
[0157] Collaborators:
[0158] B4: Verify whether P1 satisfies the elliptic curve equation and whether c=H(rnd || P1) holds. If not, the collaborative key pair generation fails.
[0159] B5: Calculate the elliptic curve point PA'=[d2]P1-G, where the public key of user A is PA'.
[0160] It should be noted that after the key pair is generated, both parties can complete a collaborative signing operation with the user public key PA as the message, that is, the message to be signed M includes the user public key PA. After the key pair is generated, the collaborating parties may not retain the first public key P1.
[0161] In the collaborative generation process of the key pair of the present application, the initiator first generates its own key pair (d1, P1) before initiating the protocol, and sends the commitment summary value c=H(rnd || P1) of its public key to the collaborating party, where rnd is a string of random numbers. After the collaborating party generates its own public key (d2, P2) in accordance with the original protocol and provides it to the initiator, the initiator needs to provide its public key P1 to the collaborating party after calculating the user public key. The collaborating party first verifies whether the commitment c is correct. If the commitment c is correct, the initiator calculates the user public key PA and completes the key pair generation process, otherwise the key pair generation process is terminated. Commitment c can prevent the initiator from controlling the generation of the user public key based on the public key information provided by the collaborating party.
[0162] An embodiment of the present application provides a collaborative signature method based on the SM2 cryptographic algorithm, the method involving an initiator and a collaborative end; the initiator and the collaborative end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborative end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiator and the collaborative end perform mutual verification through the first public key P1 and the second public key P2; the initiator is used to generate a key pair of the user based on the first private key d1, The second public key P2 and the base point G determine the user public key PA, and the elliptic curve point Q1 is determined according to the order n and the base point G, and the first message digest e is determined according to the message M to be signed, and the signature value component r' is determined according to the first message digest e, the elliptic curve point Q1, the base point G and the order n, and the signature value component s' is determined according to the first private key d1, the signature value component r' and the order n, and the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' are sent to the collaboration end;
[0163] The collaborative signature method comprises:
[0164] The collaboration end performs signature verification on the signature value component r' and the signature value component s' by using the first public key P1;
[0165] If the verification is successful, the collaboration end determines the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n;
[0166] The collaborative end determines the signature value component s2 based on the second private key d2, the signature value component r and the order n, and sends the signature value component r and the signature value component s2 to the initiating end; the initiating end is used to determine the signature value component s based on the signature value component r, the signature value component s2 and the order n, and perform signature verification on the signature value component r and the signature value component s through the user public key PA.
[0167] In an embodiment of the present application, the specific process of "the collaboration end performs signature verification on the signature value component r' and the signature value component s' through the first public key P1" can be further explained in combination with the following description.
[0168] The collaboration end determines an intermediate value t according to the signature value component r', the signature value component s' and the order n;
[0169] The cooperation end determines a third message digest e2' according to the first message digest e and the elliptic curve point Q1;
[0170] The collaboration end determines the intermediate value x2' according to the signature value component s', the base point G, the intermediate value t and the first public key P1;
[0171] The collaboration end determines an intermediate value R according to the third message digest e2', the intermediate value x2' and the order n;
[0172] The collaboration end performs verification: if t≠0 and R=r', the verification of the signature value component r' and the signature value component s' is successful.
[0173] It should be noted that the specific processes involved in the above steps may include:
[0174] Verify whether r'∈[1,n-1], s'∈[1,n-1] holds; if not, terminate the protocol;
[0175] If it holds, calculate e2'=Hv(e||Q1x||Q1y);
[0176] Calculate t = (r' + s') mod n;
[0177] Calculate (x2',y2') = [s']G+[t](P1-G)=[s'-t]G+[t]P1;
[0178] Calculate R = e2' + x2' mod n;
[0179] Check whether t is not equal to 0 and R = r'. If not, terminate the protocol.
[0180] In one embodiment of the present application, the specific process of "the collaborative end determines the signature value component r based on the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n" can be further explained in combination with the following description.
[0181] The cooperation end determines a random number k2 according to the order n;
[0182] The collaboration end determines an intermediate value x1 according to the random number k2, the base point G, the second private key d2 and the elliptic curve point Q1;
[0183] The collaboration end determines the signature value component r according to the first message digest e, the intermediate value x1 and the order n.
[0184] It should be noted that the specific processes involved in the above steps may include:
[0185] Generate a random number k2∈[1,n-1];
[0186] Calculate the elliptic curve point (x1, y1) = [k2] G + [d2] Q1; where the data type of x1 is converted to an integer according to the method defined in Section 4.2 of Part 1 of GB / T 32918.1-2016;
[0187] Calculate r = (e + x1) mod n;
[0188] Verification: If r=0 or r+k2=n, then regenerate the random number k2∈[1,n-1].
[0189] In one embodiment of the present application, the specific process of "the collaborative end determines the signature value component s2 based on the second private key d2, the signature value component r and the order n" can be further explained in combination with the following description.
[0190] The collaboration end determines the signature value component s2 based on the second private key d2, the signature value component r, the random number k2 and the order n.
[0191] It should be noted that the specific processes involved in the above steps may include:
[0192] Calculate s2=(d2 -1 ⋅(r+k2)) mod n;
[0193] In a specific embodiment of the present application, the initiator performs SM2 signature on the hash value e1' of the message digest e to generate a signature value (r', s'), and sends the signature (r', s') to the collaborating party; the collaborating party verifies the validity of the initiator's signature (r', s'), and if the verification passes, continues to collaboratively sign to generate a signature value (r, s2); if the verification fails, the collaborating party may terminate the collaborative signature.
[0194] As an example, see Figure 4 , showing the specific process of collaborative signing of this application:
[0195] Initiator:
[0196] A1: Calculate the message digest e = Hv(ZA||M), convert the data type of e to an integer according to the method defined in Section 4.2 of Part 1 of GB / T 32918.1-2016, where ZA needs to be calculated according to the method defined in Section 5.5 of Part 2 of GB / T 32918.2-2016;
[0197] A2: Generate a random number k1∈[1,n-1];
[0198] A3: Calculate the elliptic curve point Q1=[k1]G;
[0199] A4: Generate a random number k1'∈[1,n-1];
[0200] A5: Calculate the elliptic curve point (x1',y1')=[k1']G;
[0201] A6: Calculate e1'=Hv(e||Q1x||Q1y);
[0202] A7: Calculate r' =e1'+x1' mod n, s'=(d1 -1 ⋅(k1'+r')-r') mod n, if r'=0 or r'+k1' =n or s'=0, go to A4;
[0203] A8: Send e, Q1, (r',s') to the collaborating party.
[0204] Collaborators:
[0205] B1: Check whether r'∈[1,n-1], s'∈[1,n-1] holds. If not, terminate the protocol.
[0206] B2: Calculate e2'=Hv(e||Q1x||Q1y);
[0207] B3: Calculate t = (r' + s') mod n;
[0208] B4: Calculate (x2', y2') = [s']G+[t](P1-G)=[s'-t]G+[t]P1;
[0209] B5: Calculate R = e2' + x2' mod n;
[0210] B6: Check whether t is not equal to 0 and R = r'. If not, terminate the protocol.
[0211] B7: Generate a random number k2∈[1,n-1];
[0212] B8: Calculate the elliptic curve point (x1, y1) = [k2]G + [d2]Q1, and convert the data type of x1 to an integer according to the method defined in Section 4.2 of Part 1 of GB / T 32918.1-2016;
[0213] B9: Calculate r=(e+x1) mod n. If r=0 or r+k2=n, return to B7.
[0214] B10: Calculate s2=(d2 -1 ⋅(r+k2)) mod n;
[0215] B11: Send r, s2 to the initiator.
[0216] Initiator:
[0217] A7: If k1+s2=n, then return to A2;
[0218] A8: Calculate s=(d1 -1 ⋅(k1+s2)-r) mod n, if s=0 or s+r = 0 mod n, return A2;
[0219] A9: Use the user public key PA to verify whether (r, s) is the signature of message M. If not, the signature fails; otherwise, output (r, s) as the signature of message M.
[0220] It should be noted that the above-mentioned second message digest e1' and the third message digest e2' are numerically consistent, the difference is that the generation ends and generation processes of the two are different; the above-mentioned intermediate value (x2', y2') and the intermediate value (x2', y2') are numerically consistent, the difference is that the generation ends and generation processes of the two are different.
[0221] The above is a description of the method embodiment of the present application. As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, please refer to the partial description of the method embodiment.
[0222] refer to Figure 2 , an embodiment of the present application provides a collaborative signature system based on the SM2 cryptographic algorithm, the system comprising an initiator and a collaborative end; the initiator and the collaborative end are both preset with an elliptic curve; wherein the elliptic curve comprises a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaborative end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiator and the collaborative end perform mutual verification through the first public key P1 and the second public key P2;
[0223] The collaborative signature system comprises:
[0224] The initiating end is used to determine the user public key PA according to the first private key d1, the second public key P2 and the base point G, and determine the elliptic curve point Q1 according to the order n and the base point G, and determine the first message digest e according to the message M to be signed, and determine the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n, and determine the signature value component s' according to the first private key d1, the signature value component r' and the order n, and send the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end;
[0225] The collaboration end is used to perform signature verification on the signature value component r' and the signature value component s' by using the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end;
[0226] The initiator is used to determine the signature value component s according to the signature value component r, the signature value component s2 and the order n, and to perform signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification is successful, the collaborative signature is successful.
[0227] Reference Figure 5 , shows a computer device that implements a collaborative signature method based on the SM2 cryptographic algorithm of the present application, which may specifically include the following:
[0228] The computer device 12 is in the form of a general-purpose computing device, and the components of the computer device 12 may include but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 connecting different system components (including the memory 28 and the processing unit 16).
[0229] The bus 18 represents one or more of several types of bus 18 structures, including a memory bus 18 or memory controller, a peripheral bus 18, an accelerated graphics port, a processor, or a local bus 18 using any of a variety of bus 18 architectures. These architectures include, by way of example, but are not limited to, an Industry Standard Architecture (ISA) bus 18, a Micro Channel Architecture (MAC) bus 18, an Enhanced ISA bus 18, an Audio Video Electronics Standards Association (VESA) local bus 18, and a Peripheral Component Interconnect (PCI) bus 18.
[0230] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0231] Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). Although Figure 5Not shown, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42, which are configured to perform the functions of various embodiments of the present invention.
[0232] A program / utility 40 having a set (at least one) of program modules 42 may be stored in, for example, a memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0233] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, cameras, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs)), wide area networks (WANs), and / or public networks (e.g., the Internet) via a network adapter 20. Figure 5 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, etc.
[0234] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing a collaborative signature method based on the SM2 cryptographic algorithm provided in an embodiment of the present invention.
[0235] That is, when the processing unit 16 executes the above program, the following is achieved:
[0236] S110, the initiator determines the user public key PA according to the first private key d1, the second public key P2 and the base point G;
[0237] S120, the initiator determines an elliptic curve point Q1 according to the order n and the base point G;
[0238] S130, the initiator determines a first message digest e according to the message M to be signed, and determines a signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n;
[0239] S140, the initiating end determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the cooperating end; the cooperating end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end;
[0240] S150. The initiator determines the signature value component s according to the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification is successful, the collaborative signature is successful.
[0241] In an embodiment of the present invention, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a collaborative signature method based on the SM2 cryptographic algorithm as provided in all embodiments of the present application is implemented:
[0242] That is, when the program is executed by the processor:
[0243] S110, the initiator determines the user public key PA according to the first private key d1, the second public key P2 and the base point G;
[0244] S120, the initiator determines an elliptic curve point Q1 according to the order n and the base point G;
[0245] S130, the initiator determines a first message digest e according to the message M to be signed, and determines a signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n;
[0246] S140, the initiating end determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the cooperating end; the cooperating end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end;
[0247] S150. The initiator determines the signature value component s according to the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification is successful, the collaborative signature is successful.
[0248] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device.
[0249] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0250] The computer program code for performing the operation of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Python, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.
[0251] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0252] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0253] The above is a detailed introduction to a collaborative signature method and system based on the SM2 cryptographic algorithm provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A collaborative signature method based on the SM2 cryptographic algorithm, characterized in that: The method involves an initiating end and a cooperating end; the initiating end and the cooperating end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiating end stores a first private key d1 and a first public key P1; the cooperating end stores a second private key d2 and a second public key P2; when jointly generating a key pair of a user, the initiating end and the cooperating end perform mutual verification through the first public key P1 and the second public key P2; The collaborative signature method comprises: The initiator determines the user public key PA according to the first private key d1, the second public key P2 and the base point G; The initiator determines the elliptic curve point Q1 according to the order n and the base point G; The initiator determines a first message digest e according to the message M to be signed, and determines a signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n; The initiating end determines the signature value component s' according to the first private key d1, the signature value component r', and the order n, and sends the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the cooperating end; the cooperating end is used to perform signature verification on the signature value component r' and the signature value component s' through the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end; The initiator determines the signature value component s based on the signature value component r, the signature value component s2 and the order n, and performs signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification passes, the collaborative signature is successful.
2. The method according to claim 1, characterized in that: The step of the initiator determining the elliptic curve point Q1 according to the order n and the base point G comprises: The initiator determines a random number k1 according to the order n; The initiator determines the elliptic curve point Q1 according to the random number k1 and the base point G.
3. The method according to claim 1, characterized in that The step of the initiator determining the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n comprises: The initiator determines a second message digest e1' according to the first message digest e and the elliptic curve point Q1; The initiator determines a random number k1' according to the order n; The initiator determines an intermediate value x1' according to the random number k1' and the base point G; The initiator determines the signature value component r' according to the second message digest e1', the intermediate value x1' and the order n.
4. The method according to claim 1, characterized in that The step of determining the signature value component s by the initiator according to the signature value component r, the signature value component s2 and the order n comprises: The initiator determines a random number k1 according to the order n; The initiator determines the signature value component s according to the first private key d1, the random number k1, the signature value component s2, the signature value component r and the order n.
5. The method according to claim 1, characterized in that The step of mutual verification between the initiating end and the cooperating end through the first public key P1 and the second public key P2 includes: The initiating end generates a random number rnd, determines a digest value c according to the random number rnd and the first public key P1, and sends the digest value c to the cooperating end; the cooperating end is used to send the second public key P2 to the initiating end according to the digest value c; The initiator verifies the legitimacy of the second public key P2; If the verification is successful, the initiator sends the random number rnd and the first public key P1 to the collaboration end; the collaboration end is used to verify the legitimacy of the first public key P1, and verify the random number rnd and the first public key P1 according to the summary value c.
6. A collaborative signature method based on the SM2 cryptographic algorithm, characterized in that: The method involves an initiating end and a collaborating end; the initiating end and the collaborating end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiating end stores a first private key d1 and a first public key P1; the collaborating end stores a second private key d2 and a second public key P2; when collaboratively generating a key pair of a user, the initiating end and the collaborating end perform mutual verification through the first public key P1 and the second public key P2; the initiating end is used to generate a key pair of a user based on the first private key d1, the second public key P2 and the base point G. Determine the user public key PA, and determine the elliptic curve point Q1 according to the order n and the base point G, and determine the first message digest e according to the message M to be signed, and determine the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n, and determine the signature value component s' according to the first private key d1, the signature value component r' and the order n, and send the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end; The collaborative signature method comprises: The collaboration end performs signature verification on the signature value component r' and the signature value component s' by using the first public key P1; If the verification is successful, the collaboration end determines the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n; The collaborative end determines the signature value component s2 based on the second private key d2, the signature value component r and the order n, and sends the signature value component r and the signature value component s2 to the initiating end; the initiating end is used to determine the signature value component s based on the signature value component r, the signature value component s2 and the order n, and perform signature verification on the signature value component r and the signature value component s through the user public key PA.
7. The method according to claim 6, characterized in that The step of the collaboration end performing signature verification on the signature value component r' and the signature value component s' by using the first public key P1 includes: The collaboration end determines an intermediate value t according to the signature value component r', the signature value component s' and the order n; The cooperation end determines a third message digest e2' according to the first message digest e and the elliptic curve point Q1; The collaboration end determines the intermediate value x2' according to the signature value component s', the base point G, the intermediate value t and the first public key P1; The collaboration end determines an intermediate value R according to the third message digest e2', the intermediate value x2' and the order n; The collaboration end performs verification: if t≠0 and R=r', the verification of the signature value component r' and the signature value component s' is successful.
8. The method according to claim 6, characterized in that The step of determining the signature value component r by the collaboration end according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n comprises: The cooperation end determines a random number k2 according to the order n; The collaboration end determines an intermediate value x1 according to the random number k2, the base point G, the second private key d2 and the elliptic curve point Q1; The collaboration end determines the signature value component r according to the first message digest e, the intermediate value x1 and the order n.
9. The method according to claim 8, characterized in that The step of the collaboration end determining the signature value component s2 according to the second private key d2, the signature value component r and the order n includes: The collaboration end determines the signature value component s2 based on the second private key d2, the signature value component r, the random number k2 and the order n.
10. A collaborative signature system based on the SM2 cryptographic algorithm, characterized in that: The system includes an initiator and a collaboration end; the initiator and the collaboration end are both preset with an elliptic curve; wherein the elliptic curve includes a base point G of the elliptic curve and an order n of the base point G; the initiator stores a first private key d1 and a first public key P1; the collaboration end stores a second private key d2 and a second public key P2; when jointly generating a key pair of a user, the initiator and the collaboration end perform mutual verification through the first public key P1 and the second public key P2; The collaborative signature system comprises: The initiating end is used to determine the user public key PA according to the first private key d1, the second public key P2 and the base point G, and determine the elliptic curve point Q1 according to the order n and the base point G, and determine the first message digest e according to the message M to be signed, and determine the signature value component r' according to the first message digest e, the elliptic curve point Q1, the base point G and the order n, and determine the signature value component s' according to the first private key d1, the signature value component r' and the order n, and send the first message digest e, the elliptic curve point Q1, the signature value component r' and the signature value component s' to the collaboration end; The collaboration end is used to perform signature verification on the signature value component r' and the signature value component s' by using the first public key P1, and determine the signature value component r according to the first message digest e, the base point G, the second private key d2, the elliptic curve point Q1 and the order n, and determine the signature value component s2 according to the second private key d2, the signature value component r and the order n, and send the signature value component r and the signature value component s2 to the initiating end; The initiator is used to determine the signature value component s according to the signature value component r, the signature value component s2 and the order n, and to perform signature verification on the signature value component r and the signature value component s through the user public key PA; if the verification is successful, the collaborative signature is successful.
Citation Information
Patent Citations
SM2 cryptographic algorithm collaborative signature and decryption method for protecting user privacy
CN114186251A
Distributed signature method and system based on elliptical curve
CN106685648A
Collaborative signature method and device supporting trusted display
CN110505056A
Efficient two-party collaborative signature method based on SM2
CN112636918A
Collaborative signature method and collaborative signature system
CN114567448A
