A method and device for generating a signature, and a security authentication method and device

By generating and verifying the legitimacy of the user's private key in the alliance blockchain and generating signatures based on public parameters, the problem of tight resources of third-party certificate management agencies is solved, and security and convenience are improved.

CN115834085BActive Publication Date: 2025-08-19CETC BIGDATA RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211545380.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-08-19
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

The problem of requesting public key certificates from third-party certificate management agencies in the existing alliance chain has led to tight resource management.

Method used

By receiving the user's private key generated based on identity information and public parameters, verifying its legitimacy, obtaining public parameters from the alliance blockchain, generating signatures based on these parameters, and the receiver detects signature legality, avoiding the use of third-party public key certificates.

Benefits of technology

It improves the security of signature generation and the convenience of authentication, avoids the difficulties in certificate management, and enhances the legality and reliability of signatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834085B_ABST
    Figure CN115834085B_ABST
Patent Text Reader

Abstract

The disclosed embodiments provide a method for generating a signature. The specific implementation scheme comprises: receiving a user private key generated based on identity information and public parameters; determining the validity of the user private key in response to a correct verification result of the user private key; obtaining public parameters from a consortium blockchain in response to receiving data to be signed; generating a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user private key; and sending the signature to a recipient on the consortium blockchain, so that the recipient can verify the validity of the signature based on the public parameters. This embodiment improves the security of signature generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and apparatus for generating a signature, a security authentication method and apparatus, an electronic device, and a computer-readable storage medium. Background Art

[0002] Blockchain realizes services such as on-chain evidence storage, anti-counterfeiting traceability, and data supervision. It can be divided into public chain, consortium chain and private chain. The consortium chain is jointly maintained by institutional members, and usually a blockchain is jointly managed by multiple organizations. Nodes that want to join the consortium chain must obtain the consent of the organization, and only nodes in the consortium chain have the right to read and write data on the consortium chain.

[0003] The existing consensus authentication mechanism among alliance chain members is mostly based on the PKI (Public Key Infrastructure) system. When alliance nodes sign data, they need to request a public key certificate from a third-party certificate authority (CA), which may cause resource management problems for third-party certificate authorities. Summary of the Invention

[0004] The embodiments described herein provide a method and apparatus for generating a signature, a security authentication method and apparatus, an electronic device, and a computer-readable storage medium storing a computer program.

[0005] According to a first aspect of the present disclosure, a method for generating a signature is provided. In this method, a user private key generated based on identity information and public parameters is received; in response to a verification result that the user private key is correct, the user private key is determined to be legitimate; in response to receiving data to be signed, public parameters are obtained from a consortium blockchain; a signature including the data to be signed is generated based on the public parameters, the data to be signed, the signing time, and the user private key; and the signature is sent to a recipient on the consortium blockchain, so that the recipient can verify the legitimacy of the signature based on the public parameters.

[0006] In some embodiments of the present disclosure, in response to a verification result of a user private key being incorrect, the user private key is rejected and a request to re-apply for the private key is issued.

[0007] In some embodiments of the present disclosure, the above-mentioned public parameters include: public key parameters and hash functions, and the user private key is generated using the following steps: receiving a supervisory key sent by a supervisory node, the supervisory key including: an identity key and a random key; the identity key is generated based on identity information, public key parameters, and a randomly selected random integer; the random key is generated based on a hash function and a random integer; receiving a management key generated by a management node, the management key is generated based on identity information; and the supervisory key and the management key are used as the user private key. In some embodiments of the present disclosure, in response to the verification result of the user private key being correct, determining that the user private key is legitimate includes: determining the random key, identity key, and management key in the user private key; determining the user public key based on the management key; obtaining a first private key based on the user public key, identity key, and management key; obtaining a second private key based on the random key, public parameters, and identity information; detecting whether the first private key is equal to the second private key; and determining that the user private key is legitimate if the first private key is equal to the second private key.

[0008] In some embodiments of the present disclosure, the above-mentioned generation of a signature including the data to be signed based on the public parameters, the data to be signed, the signing time and the user's private key includes: using a hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; obtaining a signature random value; calculating a first signature based on the identity key, the signature random value and the signature message string; calculating a second signature based on the random key and the signature random value; calculating a third signature based on the signature random value and the first public key parameter; calculating a fourth signature based on the signature random value and the public key parameter; and using the data to be signed, the signing time, the first signature, the second signature, the third signature and the fourth signature as the signature including the data to be signed.

[0009] According to a second aspect of the present disclosure, a security authentication method is provided. The security authentication method includes: obtaining a signature sent by a member on a consortium blockchain and public parameters on the consortium blockchain, the signature being obtained based on any of the signature generation methods described in the first aspect; detecting the validity of the signature based on the public parameters; in response to detecting that the signature is valid, parsing the signature to obtain data to be signed; and executing a service corresponding to the data to be signed.

[0010] In some embodiments of the present disclosure, the above-mentioned public parameters include: a first public key, a second public key, a third public key, and a hash function, wherein the second public key is generated by the first public key, and the third public key is calculated from the first public key and the second public key; detecting the legitimacy of the signature based on the public parameters includes: dividing the data to be signed, the signing time, the first signature, the second signature, the third signature, and the fourth signature in the signature; using the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signed message string; calculating a first bilinear pairing value based on the pre-acquired user public key and the first signature; calculating a second bilinear pairing value based on the signed message string, identity information, the second signature, and the fourth signature; and determining that the signature is legal in response to detecting that the first bilinear pairing value is equal to the second bilinear pairing value.

[0011] According to a third aspect of the present disclosure, a device for generating a signature is provided. The device includes: a receiving unit configured to receive a user private key generated based on identity information and public parameters; a determining unit configured to determine the legitimacy of the user private key in response to a verification result of the user private key being correct; a parameter obtaining unit configured to obtain public parameters from a consortium blockchain in response to receiving data to be signed; a generating unit configured to generate a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user private key; and a sending unit configured to send the signature to a recipient on the consortium blockchain, so that the recipient can verify the legitimacy of the signature based on the public parameters.

[0012] In some embodiments of the present disclosure, the apparatus further comprises: a rejection unit configured to reject the user private key in response to an incorrect verification result of the user private key, and issue a request for re-applying for the private key.

[0013] In some embodiments of the present disclosure, the above-mentioned public parameters include: public key parameters and hash functions, and the user private key is generated using the following steps: receiving a supervisory key sent by a supervisory node, the supervisory key includes: an identity key and a random key; the identity key is generated based on identity information, public key parameters and a randomly selected random integer; the random key is generated based on a hash function and a random integer; receiving a management key generated by a management node, the management key is generated based on identity information; and using the supervisory key and the management key as the user private key.

[0014] In some embodiments of the present disclosure, the above-mentioned determination unit is configured to: determine the random key, identity key and management key in the user private key; determine the user public key based on the management key; obtain the first private key based on the user public key, identity key and management key; obtain the second private key based on the random key, public parameters and identity information; detect whether the first private key and the second private key are equal; if the first private key and the second private key are equal, determine that the user private key is legal.

[0015] In some embodiments of the present disclosure, the above-mentioned generation unit is further configured to: use a hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; obtain a signature random value; calculate a first signature based on the identity key, the management key, the signature random value and the signature message string; calculate a second signature based on the random key and the signature random value; calculate a third signature based on the signature random value and the first public key parameter; calculate a fourth signature based on the signature random value and the public key parameter; and use the data to be signed, the signing time, the first signature, the second signature, the third signature and the fourth signature as the signature including the data to be signed.

[0016] According to a fourth aspect of the present disclosure, a security authentication device is provided. The device includes: a data acquisition unit configured to acquire a signature sent by a member on a consortium blockchain and public parameters on the consortium blockchain, wherein the signature is obtained based on the device for generating a signature as described in any one of the third aspects; a detection unit configured to detect the legitimacy of the signature based on the public parameters; a parsing unit configured to, in response to detecting that the signature is legitimate, parse the signature to obtain data to be signed; and an execution unit configured to execute the service corresponding to the data to be signed.

[0017] In some embodiments of the present disclosure, the above-mentioned public parameters include: a first public key, a second public key, a third public key, and a hash function, wherein the second public key is generated by the first public key, and the third public key is calculated by the first public key and the second public key; the detection unit is further configured to: divide the data to be signed, the signing time, the first signature, the second signature, the third signature, and the fourth signature in the signature; use the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signed message string; calculate a first bilinear pairing value based on the pre-acquired user public key and the first signature; calculate a second bilinear pairing value based on the signed message string, identity information, the second signature, and the fourth signature; and determine that the signature is legal in response to detecting that the first bilinear pairing value is equal to the second bilinear pairing value.

[0018] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing a computer program; wherein, when the computer program is executed by the at least one processor, the device performs the steps of the method according to the first aspect or the second aspect of the present disclosure.

[0019] According to a sixth aspect of the present disclosure, a computer-readable storage medium storing a computer program is provided, wherein the computer program implements the steps of the method according to the first aspect or the second aspect of the present disclosure when executed by a processor.

[0020] The method and apparatus for generating a signature provided by the present disclosure first receives a user private key generated based on identity information and public parameters; secondly, in response to the verification result of the user private key being correct, determines that the user private key is legitimate; thirdly, in response to receiving the data to be signed, obtains the public parameters from the consortium blockchain; and thirdly, generates a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user private key; and finally, sends the signature to the recipient on the consortium blockchain so that the recipient can verify the legitimacy of the signature based on the public parameters. Thus, after the legitimacy of the user private key is verified, the user's signature is further obtained based on the public parameters and the user private key generated from the user's identity information, thereby improving the security of signature generation. The present disclosure no longer requires the use of a public key certificate provided by a third party, thus avoiding the problem of difficult certificate management. Furthermore, the signature is detected based on the public parameters, thereby improving the convenience of authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure and are not intended to limit the present disclosure.

[0022] Figure 1 is a flow chart of one embodiment of a method for generating a signature according to the present disclosure;

[0023] Figure 2 is a flow chart of an embodiment of a security authentication method according to the present disclosure;

[0024] Figure 3 is a schematic structural diagram of an embodiment of an apparatus for generating a signature according to the present disclosure;

[0025] Figure 4 is a structural diagram of an embodiment of a security authentication device according to the present disclosure; and

[0026] Figure 5 It is a block diagram of an electronic device used to implement the signature generation method or security authentication method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.

[0028] In order to solve the problem of traditional technology that requires requesting a third-party certificate authority public key certificate in a consortium blockchain, this disclosure provides a simple and efficient method for generating signatures. Figure 1 , which shows a process 100 of an embodiment of a method for generating a signature according to the present disclosure, the method for generating a signature includes the following steps:

[0029] Step 101: Receive a user private key generated based on identity information and public parameters.

[0030] In this embodiment, the execution entity on which the signature generation method runs may be a member of the alliance blockchain, and the members of the alliance blockchain join the alliance blockchain through the blockchain's admission mechanism.

[0031] In this embodiment, the user private key can be a private key generated by different objects based on the identity information of the execution subject and the public parameters in the alliance blockchain. Specifically, the object can be a supervision node of the alliance blockchain, or a management node of the alliance blockchain. Optionally, the object can also be a supervision node and a management node of the alliance blockchain.

[0032] Step 102: In response to the verification result of the user private key being correct, it is determined that the user private key is legal.

[0033] In this embodiment, after the execution entity on which the signature generation method runs receives the user private key, it can verify the user private key based on the content of the user private key to determine whether the user private key is legal, and only after the user private key is legal can the subsequent signing operation of the data to be signed be performed.

[0034] Step 103: In response to receiving the data to be signed, obtain public parameters from the alliance blockchain.

[0035] In this embodiment, the public parameters are generated by the consortium blockchain's supervisory node running an initialization algorithm to facilitate signing. The public parameters may include at least one public key parameter corresponding to different members of the consortium blockchain, such as a first public key, a second public key, and a third public key. The public parameters may also include a hash function or other hash functions.

[0036] Step 104: Generate a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user's private key.

[0037] In this embodiment, the signing time may be the current time when the execution subject generates the signature.

[0038] In this embodiment, the user private key can be a private key generated by the supervisory node for a member (i.e., a user) with different identity information. The execution subject of this disclosure can use a pre-designed signature algorithm corresponding to different parameters to input the data to be signed, the public parameters, the signing time, and the user's private key into the signature algorithm to obtain a signature.

[0039] Step 105: Send the signature to the recipient on the alliance blockchain so that the recipient can detect the legitimacy of the signature based on the public parameters.

[0040] In this embodiment, the signature obtained by the executing entity is a digital signature. After obtaining the signature, the executing entity uploads the digital signature to the alliance blockchain. The recipient of the signature can be a member of the alliance blockchain other than the executing entity, or a supervisory node or manager on the alliance blockchain.

[0041] The method for generating a signature provided in this embodiment first receives a user private key generated based on identity information and public parameters; secondly, in response to the verification result of the user private key being correct, determines that the user private key is legitimate; thirdly, in response to receiving the data to be signed, obtains the public parameters from the consortium blockchain; and thirdly, generates a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user private key; and finally, sends the signature to the recipient on the consortium blockchain so that the recipient can verify the legitimacy of the signature based on the public parameters. Thus, after the legitimacy of the user private key is verified, the user's signature is further obtained based on the public parameters and the user private key generated from the user's identity information, thereby improving the security of signature generation. The present disclosure no longer requires the use of a public key certificate provided by a third party, thus avoiding the problem of difficult certificate management. Furthermore, the signature is verified based on the public parameters, thereby improving the convenience of authentication.

[0042] In some embodiments of the present disclosure, the above method further includes: in response to an incorrect verification result of the user private key, rejecting the user private key and issuing a request to re-apply for the private key.

[0043] The method for generating a signature provided in this embodiment directly rejects the user private key when the user private key is incorrect, which can effectively ensure the legitimacy of the obtained user private key and improve the legitimacy of signature generation.

[0044] In some optional implementations of the present disclosure, the supervisory node and the administrator may jointly generate the user private key of each member in the consortium blockchain. Specifically, the user private key of each member may be generated using the following steps:

[0045] Receive the supervision key sent by the supervision node, which includes: identity key and random key; the identity key is generated based on identity information, public key parameters and randomly selected random integers; the random key is generated based on a hash function and a random integer; receive the management key generated by the management node, which is generated based on identity information; use the supervision key and management key as the user's private key.

[0046] In this optional implementation, a consortium blockchain is a cluster of multiple private chains, managed by multiple organizations. Each organization manages one or more nodes, and data is only accessible to the organizations within the system. The node that manages all organizations is called the supervisory node.

[0047] In this embodiment, the public parameters are parameters used when transmitting data in the alliance blockchain. The public parameters can be generated by the supervision node in the alliance blockchain. The supervision node can randomly generate public keys and private keys for managers and users of different institutions on the blockchain.

[0048] In this optional implementation, after the supervisory node generates public parameters, it invokes a smart contract to upload them to the consortium blockchain. For users at various institutions within the consortium blockchain, the supervisory node can generate a portion of the user's private key—the supervisory key—and then send this supervisory key to the user via a secure channel.

[0049] In this embodiment, a smart contract is a computer protocol designed to communicate, verify, or execute contracts in an information-based manner. Smart contracts allow for trusted transactions without a third party, and these transactions are traceable and irreversible.

[0050] After obtaining the public parameters and public key of the management node from the consortium blockchain, the management nodes of each institution in the consortium blockchain can run a key generation algorithm to generate a partial user private key—the management key—for each user in the consortium blockchain based on their identity. The management key is then sent to the user via a secure channel. The user then combines the supervisory key and the management key to obtain the complete user private key. Specifically, the key generation algorithm takes as input the supervisory node private key, the user's unique identity information, and the public parameters. The output of the key generation algorithm is the supervisory private key and the management key.

[0051] This optional implementation provides a method for obtaining a user's private key. The user obtains a supervisory key generated by a supervisory node, obtains a management key generated by a management node, and combines the supervisory key and the management key to obtain the user's private key. By verifying the legitimacy of the user's private key, the reliability of obtaining the user's private key is improved.

[0052] Optionally, the above-mentioned user private key can also be generated by the following steps: obtaining a regulatory key, which is a private key generated by the regulatory node of the alliance blockchain based on identity information; detecting the legitimacy of the regulatory key; and in response to detecting that the regulatory key is legitimate, using the regulatory key as the user private key.

[0053] In some optional implementations of the present disclosure, the above-mentioned response to the verification result of the user private key being correct, determining that the user private key is legal includes: determining the random key, identity key and management key in the user private key; determining the user public key based on the management key; obtaining a first private key based on the user public key, identity key and management key; obtaining a second private key based on the random key, public parameters and identity information; detecting whether the first private key and the second private key are equal; if the first private key and the second private key are equal, determining that the user private key is legal.

[0054] In this optional implementation, the identity key and the random key are keys generated by the supervisory node.

[0055] In this optional implementation, first, the public parameters include public key parameters and hash functions. For the identity information ID owned by the user, the supervision node generates a finite domain for each user. Randomly select an integer ζ and use the public key parameters and ζ to generate the identity key SK1, where SK1 = g α g(H(ID)) ζ Then, the supervisory node uses the hash function H and the integer ζ to perform a modular exponential operation to obtain the random key SK2, where SK2 = g ζ ,The supervisory node secretly sends the identity key and random key to the user ID.

[0056] The management node generates the management key SK3 in the finite field Randomly select the identity factor SK3 = λ id , and calculate the user's public key The private key generated by the comprehensive supervision node and the private key generated by the management node together constitute the user private key = (SK1, SK2, SK3).

[0057] After receiving the user private key (SK1, SK2, SK3) sent by the supervisory node and the management node, the alliance chain member can verify the correctness of the user private key by verifying the following equation (1). If the equation is true, the user private key is accepted; otherwise, the user private key is rejected and the user private key is re-applied to the supervisory node and the management node. In equation (1), the value obtained on the left is the first private key, and the value obtained on the right is the second private key.

[0058]

[0059] This optional implementation provides a method for determining the legitimacy of a user's private key. The method calculates the first private key and the second private key respectively through the user's public key, identity key, and management key. By determining whether the first private key and the second private key are equal, the legitimacy of the user's private key is detected, thereby improving the reliability of the legitimacy detection of the user's private key.

[0060] Optionally, the public parameters include: public key parameters and hash functions. The user's private key can also be generated by the supervisory node of the alliance blockchain using the following steps:

[0061] Establish public parameters; generate a random key based on identity information, public key parameters and a randomly selected random integer; generate an identity key based on identity information, a hash function and a random integer; use the random key and identity key as the user's private key.

[0062] In this optional implementation, the public parameters are generated by the consortium blockchain's supervisory node, which can then invoke a smart contract to upload the public parameters to the consortium blockchain. Specifically, the public parameter creation method includes: a method for creating public key parameters and a method for creating a hash function.

[0063] In this optional implementation, the public key parameters include at least one public key. The method for establishing the public key parameters varies depending on the number of public keys in the public key parameters. For example, when the number of public keys in the public key parameters is four, the method for establishing the public key parameters includes:

[0064] First, the supervisory node is in a finite domain An integer α is randomly selected as the system master key MSK (MasterKey), where q is greater than 2. 512 Then, the supervisory node randomly selects two cyclic multiplication groups G1 and G2 of order p and defines a bilinear map e:G1×G1→G2; Finally, the supervisory node randomly selects an element from the group G1 as the first public key g and calculates the second public key g using the master key MSK α ; finite field Randomly select an integer β and perform modular exponential operation to obtain the third public key g β ; Use the first public key and the second public key to perform a bilinear pairing operation to obtain the fourth public key z, where Z = e(g,g α ), thereby obtaining the public key parameters, public key parameters = (first public key, second public key, third public key, fourth public key).

[0065] In this optional implementation, the supervisory node defines the hash function. Specifically, the hash function establishment method includes: first, defining the file hash function H: m→G, where m→G is the hash operation mapping the file m to elements on the cyclic multiplication group G1; finally, the supervisory node uploads the hash function H to the consortium blockchain, and the hash function can be obtained by users at any time.

[0066] In this optional implementation, the supervisory node obtains public parameters on the alliance blockchain, and then generates a user private key for each user in the alliance chain based on their identity information by running a key generation algorithm.

[0067] In this optional implementation, the supervisory node generates and selects a first key algorithm and a second key algorithm, wherein the user's identity information, public key parameters, and random integer are input into the first key algorithm to obtain a random key output by the first key algorithm; and the hash function and the random integer are input into the second key algorithm to obtain an identity key output by the second key algorithm.

[0068] In this embodiment, identity information is information used to identify the identity of a user in the alliance blockchain, such as identity information including: user ID number, telephone number, social security number, etc.

[0069] Optionally, the above-mentioned user private key can also be generated by the supervision node of the alliance blockchain using the following steps: during the user private key generation process, the supervision node can generate a digital identity for each member based on the user's identity information, input the supervision node private key and the user's unique identity, output the user private key, and send the user private key to each user through a secure channel.

[0070] In this embodiment, the above-mentioned generation of the identity key based on the identity information, the hash function, and the random integer includes: using the hash function and the random integer to perform a modular exponential operation on the identity information to obtain the identity key. Specifically: for each user's identity information ID, the supervisory node uses the identity hash function H and the random integer ζ to perform a modular exponential operation to obtain the identity key SK2, and the identity key SK2 = H(ID) ζ .

[0071] The user private key generation method provided by this optional implementation method generates a random key based on user identity information and public key parameters; generates an identity key based on a hash function and a random integer; uses the random key and the identity key as the user private key, and can obtain the user's unique user private key based on the user identity information, thereby improving the security and reliability of the user private key.

[0072] Optionally, the public key parameters include: a first public key, a second public key, and a third public key, wherein the second public key and the third public key are generated from the first public key, and generating the random key based on the identity information, the public key parameters, and a randomly selected random integer includes:

[0073] Based on the identity information, a random integer is selected from a finite field; and based on the first public key, the second public key, the third public key, and the random integer, a random key is calculated.

[0074] In this optional implementation, for the identity information ID owned by the user, the supervision node provides each user with Randomly select a random integer ζ and use the first public key g and the second public key g α , the third public key g β And the random integer ζ generates a random key SK1, random key SK1 = g α gg βζ .

[0075] The method for obtaining a random key provided by this optional implementation is obtained by multiplying a random integer with the first public key, the second public key, and the third public key. The operation is simple and easy to implement.

[0076] In some optional implementations of the present disclosure, the above-mentioned generation of a signature including the data to be signed based on the public parameters, the data to be signed, the signing time and the user's private key includes: using a hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; obtaining a signature random value; calculating a first signature based on the identity key, the management key, the signature random value and the signature message string; calculating a second signature based on the random key and the signature random value; calculating a third signature based on the signature random value and the first public key parameter; calculating a fourth signature based on the signature random value and the public key parameter; and using the data to be signed, the signing time, the first signature, the second signature, the third signature and the fourth signature as the signature including the data to be signed.

[0077] In this embodiment, the alliance chain members use the hash function H to calculate the signature message string H(M||t) using the message to be signed M and the signing time t.

[0078] First, the alliance chain members calculate the first signature σ1. The signer selects a random number γ and uses key 1, management key, and signature message string H(M||t) to calculate the first signature.

[0079] Secondly, the alliance chain members use the random key and random number γ to calculate the second signature σ2=SK2 γ .

[0080] Again, the alliance chain members use the random number γ and the first public key to calculate the third signature σ3 = g γ .

[0081] Finally, the alliance chain members use the random number γ and the third public key to calculate the fourth signature σ3=Z γ .

[0082] The alliance chain members upload the generated signature (M, t, σ = (σ1, σ2, σ3, σ4)) including the data to be signed to the blockchain.

[0083] The method for obtaining a signature provided by this optional implementation obtains multiple parts of the signature of the data to be signed by calculating public parameters, the data to be signed, and the user's private key, providing an optional implementation method for the implementation of the signature, which is simple to operate and easy to implement.

[0084] Optionally, generating a signature including the data to be signed based on the public parameters, the data to be signed, and the user's private key includes:

[0085] A hash function is used to perform encryption calculation on the data to be signed to obtain a signature message string; a signature random value is obtained; a first signature is calculated based on the first public key, the second public key, the third public key, the signature random value and the signature message string; a second signature is calculated based on the user private key and the public parameter; a third signature is calculated based on the signature random value, the third public key and the signature message string; the first signature, the second signature and the third signature are used as the signature including the data to be signed.

[0086] In this optional implementation, when the signature includes multiple signature values, for example, a first signature, a second signature, and a third signature, signature operations can be performed on different parts of the data to be signed using each signature value, thereby improving the reliability of the signature of the data to be signed.

[0087] In this optional implementation, members of the consortium blockchain use the hash function H to calculate the signature message string H(M) using the data to be signed. When calculating the first signature σ1, the signer selects a signature random value γ and uses the random key SK1, the identity key SK2, the first public key g, and the signature message string H(M) to calculate the first signature σ1 = SK1 · SK2 · (gH(M)) γ .

[0088] The members of the alliance chain use the random key SK1, identity key SK2, and the second public key g α , calculate the second signature of the data to be signed, the second signature σ2=SK1·SK2·(gα) -1 .

[0089] The members of the alliance chain use the signature message string H(M) and the third public key g β , calculate the third signature of the signature of the data to be signed, the third signature σ3=(H(M)g β ) γ The generated signature σ=(σ1,σ2,σ3) is uploaded to the alliance blockchain.

[0090] The method for obtaining a signature provided by this optional implementation obtains multiple parts of the signature of the data to be signed by calculating the public parameters, the data to be signed, and the user's private key. The operation is simple and easy to implement.

[0091] Optionally, generating a signature including the data to be signed based on the public parameters, the data to be signed, and the user's private key may further include: members of the consortium blockchain obtaining the data to be signed on the chain, performing a first signature algorithm operation to obtain a signing key; and inputting the signing key, the public parameters, and the user's private key into a second signature algorithm to obtain an output signature of the second signature algorithm. The first signature algorithm and the second signature algorithm are two different signature algorithms.

[0092] In order to better authenticate the signatures of members on the alliance blockchain, this disclosure provides a secure authentication method, see Figure 2 , which shows a process 200 according to an embodiment of a security authentication method disclosed herein, the security authentication method comprising the following steps:

[0093] Step 201: Obtain the signature sent by the member on the alliance blockchain and the public parameters on the alliance blockchain.

[0094] In this embodiment, the signature is obtained based on the above-mentioned method for generating a signature.

[0095] In this embodiment, the execution entity on which the security authentication method is executed can be a member of the consortium blockchain, which has joined the consortium blockchain through the blockchain's admission mechanism. Optionally, the execution entity on which the security authentication method is executed can also be a supervisory node of the consortium blockchain.

[0096] Step 202: Detect the validity of the signature based on the public parameters.

[0097] In this embodiment, the execution subject may input the signature into a preset signature verification algorithm. The setting parameters of the signature verification algorithm are public parameters, and the output of the signature algorithm is the result of whether the signature is legal.

[0098] Step 203: In response to detecting that the signature is legitimate, the signature is parsed to obtain the data to be signed.

[0099] In this embodiment, parsing the signature means decrypting the signature according to a pre-agreed decryption algorithm. The decryption algorithm is the inverse algorithm of the encryption algorithm used to encrypt the data to be signed in the signature, and the data to be signed is obtained by decryption.

[0100] Step 204: Execute the service corresponding to the data to be signed.

[0101] In this embodiment, the business corresponding to the data to be signed can be determined based on specific business operations. It should be noted that different execution entities may have different business operations. When the execution entity is a member of a consortium blockchain, the business corresponding to the data to be signed may include operations such as data transmission and data cleansing. When the execution entity is a monitoring node of the consortium blockchain, the business corresponding to the data to be signed may include determining the identity information of the corresponding member based on the data to be signed.

[0102] The security authentication method provided in this embodiment obtains signatures and public parameters sent by members on a consortium blockchain, verifies the validity of the signature based on the public parameters, and, upon verification of the validity of the signature, parses the signature, obtains the data to be signed, and executes the corresponding service. Combined with identity-based signature technology, this method achieves efficient secure access control and expands the use cases of consortium blockchains.

[0103] In some optional implementations of this embodiment, the public parameters include: a first public key, a second public key, a third public key, and a hash function, wherein the second public key is generated by the first public key, and the third public key is calculated from the first public key and the second public key; detecting the legitimacy of the signature based on the public parameters includes: dividing the data to be signed, the signing time, the first signature, the second signature, the third signature, and the fourth signature in the signature; using the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signed message string; calculating a first bilinear pairing value based on the pre-acquired user public key and the first signature; calculating a second bilinear pairing value based on the signed message string, identity information, the second signature, the third signature, and the fourth signature; and determining that the signature is legal in response to detecting that the first bilinear pairing value is equal to the second bilinear pairing value.

[0104] In this optional implementation, the first signature, the second signature, and the third signature in the signature are divided, and a bilinear pairing operation is performed on the user public key and the first signature to obtain a first bilinear pairing value, specifically the value on the left side of equation (2); a bilinear pairing operation is performed on the signed message string, the identity information, the second signature, and the third signature, and then multiplied by the fourth public key to obtain a second bilinear pairing value, specifically the value on the right side of equation (2).

[0105] Specifically, first calculate the signature message string H(M||t) and H(ID) of the data to be signed M, and verify whether the signature is legal:

[0106] e(σ1,PK id )=e(σ2,H(ID))ge(H(M||t),σ3)gσ4 (2)

[0107] If both sides of equation (2) above are true, it means that the signature is legal; otherwise, it means that the signature is illegal. The correctness of equation (2) is derived as follows:

[0108]

[0109] The signature detection method provided by this optional implementation method calculates a first bilinear pairing value through the first signature in the signature and the user's public key; calculates a second bilinear pairing value based on the signed message string, identity information, the second signature, the third signature, and the fourth signature; and determines the legitimacy of the signature based on the relationship between the first bilinear pairing value and the second bilinear pairing value, thereby providing a reliable means for detecting the legitimacy of the signature.

[0110] Continue to see Figure 3 , as a response to the above Figure 1 The present application provides a device for generating a signature. Figure 1 Corresponding to the method embodiment shown, the device can be applied to various electronic devices.

[0111] like Figure 3 As shown, the signature generating apparatus 300 of this embodiment may include: a receiving unit 301, a determining unit 302, a parameter obtaining unit 303, a generating unit 304, and a sending unit 305. The receiving unit 301 may be configured to receive a user private key generated based on identity information and public parameters; the determining unit 302 may be configured to determine the validity of the user private key in response to a correct verification result of the user private key; the parameter obtaining unit 303 may be configured to obtain public parameters from the consortium blockchain in response to receiving the data to be signed. The generating unit 304 may be configured to generate a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user private key; and the sending unit 305 may be configured to send the signature to a recipient on the consortium blockchain, so that the recipient can verify the validity of the signature based on the public parameters.

[0112] In some embodiments of the present disclosure, the above-mentioned device 300 also includes: a rejection unit (not shown in the figure), which is configured to reject the user private key in response to the verification result of the user private key being incorrect, and issue a request to re-apply for the private key.

[0113] In some embodiments of the present disclosure, the above-mentioned public parameters include: public key parameters and hash functions, and the user private key is generated using the following steps: receiving a supervisory key sent by a supervisory node, the supervisory key includes: an identity key and a random key; the identity key is generated based on identity information, public key parameters and a randomly selected random integer; the random key is generated based on a hash function and a random integer; receiving a management key generated by a management node, the management key is generated based on identity information; and using the supervisory key and the management key as the user private key.

[0114] In some embodiments of the present disclosure, the above-mentioned determination unit 302 can be configured to: determine the random key, identity key and management key in the user private key; determine the user public key based on the management key; obtain the first private key based on the user public key, identity key and management key; obtain the second private key based on the random key, public parameters and identity information; detect whether the first private key and the second private key are equal; if the first private key and the second private key are equal, determine that the user private key is legal.

[0115] In some embodiments of the present disclosure, the above-mentioned generation unit 304 is further configured to: use a hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; obtain a signature random value; calculate a first signature based on the identity key, the management key, the signature random value and the signature message string; calculate a second signature based on the random key and the signature random value; calculate a third signature based on the signature random value and the first public key parameter; calculate a fourth signature based on the signature random value and the public key parameter; and use the data to be signed, the signing time, the first signature, the second signature, the third signature and the fourth signature as the signature including the data to be signed.

[0116] The device for generating a signature provided in this embodiment includes: first, a receiving unit 301 receives a user private key generated based on identity information and public parameters; second, a determining unit 302 determines that the user private key is legitimate in response to a correct verification result of the user private key; third, a parameter obtaining unit 303 obtains public parameters from the consortium blockchain in response to receiving the data to be signed; third, a generating unit 304 generates a signature including the data to be signed based on the public parameters, the data to be signed, the signing time, and the user private key; and finally, a sending unit 305 sends the signature to a recipient on the consortium blockchain, so that the recipient can verify the validity of the signature based on the public parameters. Thus, after the user private key is verified to be legitimate, the user's signature is obtained based on the public parameters and the user private key generated from the user's identity information, thereby improving the security of signature generation. The present disclosure eliminates the need for a public key certificate provided by a third party, thus avoiding the difficulty of certificate management. Furthermore, the signature is verified based on the public parameters, thereby improving the convenience of authentication.

[0117] Continue to see Figure 4 , as a response to the above Figure 2 The present application provides a device for generating a signature. Figure 1 Corresponding to the method embodiment shown, the device can be applied to various electronic devices.

[0118] like Figure 4As shown, the security authentication device 400 of this embodiment may include: a data acquisition unit 401, a detection unit 402, a parsing unit 403, and an execution unit 404. The data acquisition unit 401 may be configured to acquire signatures sent by members on the consortium blockchain and public parameters on the consortium blockchain. The signatures are obtained based on the signature generation device described in the above embodiment. The detection unit 402 may be configured to detect the validity of the signature based on the public parameters. The parsing unit 403 may be configured to parse the signature in response to detecting that the signature is valid, thereby obtaining the data to be signed. The execution unit 404 may be configured to execute the service corresponding to the data to be signed.

[0119] In some embodiments of the present disclosure, the above-mentioned public parameters include: a first public key, a second public key, a third public key, and a hash function, wherein the second public key is generated by the first public key, and the third public key is calculated by the first public key and the second public key; the detection unit 402 is further configured to: divide the data to be signed, the signing time, the first signature, the second signature, the third signature, and the fourth signature in the signature; use the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signed message string; calculate a first bilinear pairing value based on the pre-acquired user public key and the first signature; calculate a second bilinear pairing value based on the signed message string, identity information, the second signature, and the fourth signature; and determine that the signature is legal in response to detecting that the first bilinear pairing value is equal to the second bilinear pairing value.

[0120] In the security authentication device provided in this embodiment, data acquisition unit 401 obtains signatures and public parameters sent by members on the consortium blockchain. Detection unit 402 verifies the validity of the signature based on the public parameters. Parsing unit 403, in response to detecting the validity of the signature, parses the signature to obtain the data to be signed. Execution unit 404 executes the service corresponding to the data to be signed. Combined with identity-based signature technology, this achieves efficient secure access control and expands the use cases of consortium blockchains.

[0121] Figure 5 FIG. 1 is a block diagram of an electronic device showing a method for generating a signature or a security authentication method according to an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 may include a processor 501 and a memory 502 storing a computer program. When the computer program is executed by the processor 501, the electronic device 500 may perform the following operations: Figure 1 or Figure 2 In one example, the electronic device 500 may be a computer device or a cloud computing node.

[0122] In an embodiment of the present disclosure, the processor 501 may be, for example, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a processor based on a multi-core processor architecture, etc. The memory 502 may be any type of memory implemented using data storage technology, including but not limited to random access memory, read-only memory, semiconductor-based memory, flash memory, disk storage, etc.

[0123] Furthermore, in the embodiments of the present disclosure, the electronic device 500 may also include an input device 503, such as a microphone, keyboard, mouse, etc., for inputting information such as public parameters and user private keys. Furthermore, the electronic device 500 may also include an output device 504, such as a loudspeaker, display, etc., for outputting a signature.

[0124] In other embodiments of the present disclosure, a computer-readable storage medium storing a computer program is further provided, wherein the computer program can achieve the following when executed by a processor: Figure 1 or Figure 2 The steps of the method are shown.

[0125] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus and method according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0126] Unless the context clearly indicates otherwise, as used herein and in the appended claims, the singular includes the plural, and vice versa. Thus, when referring to the singular, the plural of the corresponding term is generally included. Similarly, the words "include" and "comprising" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it follows a group of terms, "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.

[0127] Further aspects and scope of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present disclosure can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended to be illustrative only and are not intended to limit the scope of the present disclosure.

[0128] Several embodiments of the present disclosure have been described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The scope of protection of the present disclosure is defined by the appended claims.

Claims

1. A method for generating a signature, the method comprising: Receive the user's private key generated based on identity information and public parameters; In response to a verification result of the user private key being correct, determining that the user private key is legitimate; In response to receiving the data to be signed, obtaining the public parameter from the consortium blockchain; Generate a signature including the data to be signed based on the public parameter, the data to be signed, the signing time, and the user private key; Sending the signature to a recipient on the consortium blockchain, so that the recipient can verify the validity of the signature based on the public parameters; The user private key is generated using the following steps: Receive a supervisory key sent by a supervisory node, the supervisory key comprising: an identity key and a random key; the identity key is generated based on the identity information, a public key parameter, and a randomly selected random integer; the random key is generated based on a hash function and the random integer; receiving a management key generated by a management node, wherein the management key is generated based on the identity information; Using the supervisory key and the management key as user private keys; In response to the verification result of the user private key being correct, determining that the user private key is legitimate includes: Determine the random key, identity key and management key in the user private key; Determine the user's public key based on the management key; Obtaining a first private key based on the user public key, the identity key, and the management key; Obtaining a second private key based on the random key, the public parameter, and the identity information; Detecting whether the first private key is equal to the second private key; If the first private key is equal to the second private key, the user private key is determined to be legitimate; Generating a signature including the data to be signed based on the public parameter, the data to be signed, the signing time, and the user private key includes: Using the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; Get the signature random value; Calculate a first signature based on the identity key, the management key, the signature random value, and the signature message character string; Calculate a second signature based on the random key and the signature random value; Calculate a third signature based on the signature random value and the first public key parameter; Calculate a fourth signature based on the signature random value and the public key parameter; The data to be signed, the signing time, the first signature, the second signature, the third signature and the fourth signature are taken as a signature including the data to be signed.

2. The method according to claim 1, further comprising: In response to the verification result of the user private key being incorrect, the user private key is rejected and a request for re-application of the private key is issued.

3. The method according to claim 1, wherein the public parameters include: Public key parameters and hash function.

4. A security authentication method, the method comprising: Obtaining a signature sent by a member on a consortium blockchain and public parameters on the consortium blockchain, wherein the signature is obtained based on the method for generating a signature according to any one of claims 1 to 3; Detecting the legitimacy of the signature based on the public parameters; In response to detecting that the signature is legitimate, parsing the signature to obtain data to be signed; Execute the business corresponding to the data to be signed.

5. The method according to claim 4, wherein The public parameters include: a first public key, a second public key, a third public key, and a hash function, wherein the second public key is generated by the first public key, and the third public key is calculated by the first public key and the second public key; The detecting the legitimacy of the signature based on the public parameter includes: Dividing the signature into the data to be signed, the signing time, the first signature, the second signature, the third signature, and the fourth signature; Using the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; Calculate a first bilinear pairing value based on the pre-acquired user public key and the first signature; Calculate a second bilinear pairing value based on the signed message string, the identity information, the second signature, and the fourth signature; In response to detecting that the first bilinear pairing value is equal to the second bilinear pairing value, the signature is determined to be legitimate.

6. A device for generating a signature, the device comprising: a receiving unit configured to receive a user private key generated based on the identity information and the public parameter; a determining unit configured to determine that the user private key is legitimate in response to a verification result of the user private key being correct; a parameter acquisition unit, configured to acquire the public parameter from the consortium blockchain in response to receiving the data to be signed; a generating unit configured to generate a signature including the data to be signed based on the public parameter, the data to be signed, the signing time, and the user private key; a sending unit configured to send the signature to a recipient on the consortium blockchain, so that the recipient detects the legitimacy of the signature based on the public parameters; The user private key is generated using the following steps: Receive a supervisory key sent by a supervisory node, the supervisory key comprising: an identity key and a random key; the identity key is generated based on the identity information, a public key parameter, and a randomly selected random integer; the random key is generated based on a hash function and the random integer; receiving a management key generated by a management node, wherein the management key is generated based on the identity information; Using the supervisory key and the management key as user private keys; In response to the verification result of the user private key being correct, determining that the user private key is legitimate includes: Determine the random key, identity key and management key in the user private key; Determine the user's public key based on the management key; Obtaining a first private key based on the user public key, the identity key, and the management key; Obtaining a second private key based on the random key, the public parameter, and the identity information; Detecting whether the first private key is equal to the second private key; If the first private key is equal to the second private key, the user private key is determined to be legitimate; Generating a signature including the data to be signed based on the public parameter, the data to be signed, the signing time, and the user private key includes: Using the hash function to perform signature calculation on the data to be signed and the signing time to obtain a signature message string; Get the signature random value; Calculate a first signature based on the identity key, the management key, the signature random value, and the signature message character string; Calculate a second signature based on the random key and the signature random value; Calculate a third signature based on the signature random value and the first public key parameter; Calculate a fourth signature based on the signature random value and the public key parameter; The data to be signed, the signing time, the first signature, the second signature, the third signature and the fourth signature are taken as a signature including the data to be signed.

7. A security authentication device, comprising: a data acquisition unit configured to acquire a signature sent by a member on a consortium blockchain and public parameters on the consortium blockchain, wherein the signature is obtained based on the apparatus for generating a signature according to claim 6; a detection unit configured to detect the legitimacy of the signature based on the public parameters; a parsing unit, configured to, in response to detecting that the signature is legitimate, parse the signature to obtain data to be signed; The execution unit is configured to execute the business corresponding to the data to be signed.

8. An electronic device comprising: at least one processor; and at least one memory storing a computer program; Wherein, when the computer program is executed by the at least one processor, the at least one processor is caused to perform the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium storing a computer program, wherein: The computer program implements the steps of the method according to any one of claims 1 to 5 when executed by a processor.

Citation Information

Patent Citations

  • Digital signature method based on identity

    CN101562524A

  • Cross-organization identity authentication method and system based on block chain and SM9 algorithm

    CN114499883A