Certificate-based signature method and device, storage medium and electronic device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]有鉴于此,本发明实施例提供了涉及一种证书基签名方法、装置、存储介质及电子设备,以解决现有技术中无证书密码体制和证书基签名等技术存在计算效率较低的技术问题
[0048] The certificate-based signature method, apparatus, storage medium, and electronic device provided in this invention, based on certificate-based signature and combined with the Chinese national cryptographic algorithm SM2, realize a certificate-based signature method based on the SM2 national cryptographic signature algorithm. The user's signature process is essentially a single execution of the SM2 algorithm's signature phase, resulting in high computational efficiency. Furthermore, by using two signatures, the user's private key obtained from the first signature does not need to be transmitted via a secure channel, reducing the overall system overhead. Moreover, when verifying multiple signatures from the same user, the user's private key only needs to be transmitted once. Additionally, based on the SM2 algorithm, unlike the SM9 identity-based algorithm which requires bilinear pairing operations, computational efficiency is even higher.
Smart Images

Figure CN116599681B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of network communication and information security technology, specifically to a certificate-based signature method, apparatus, storage medium, and electronic device. Background Technology
[0002] Digital signature technology is an important branch of cryptography in information systems. It can be used to verify data integrity and ensure non-repudiation, and it also has wide applications in scenarios such as identity authentication. Traditional public key systems require the establishment and maintenance of Public Key Infrastructure (PKI), and rely on digital certificates issued by Certificate Authorities (CAs) to authenticate user identities, resulting in huge system overhead.
[0003] To simplify the aforementioned workflow and digital certificate management, Identity-Based Cryptography (IBC) has emerged. In an IBC system, users do not need to apply for digital certificates to authenticate their identity; instead, they request a private key from a trusted third party, and their identity can be directly used as a public key. This approach significantly reduces the overhead of public key infrastructure and certificates. However, it also introduces the issue of key escrow, where the trusted third party also possesses the user's private key. To address this problem, researchers have proposed certificateless cryptography and certificate-based signature technologies. These certificateless and certificate-based cryptography systems combine the characteristics of identity-based and traditional public key systems. Users have both their identity as publicly verifiable information and a corresponding public key. Unlike traditional public key systems, users do not need public key certificates to prove their identity. However, existing certificateless cryptography and certificate-based signature technologies suffer from low computational efficiency. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a certificate-based signature method, apparatus, storage medium, and electronic device to solve the technical problem of low computational efficiency in existing technologies such as certificateless cryptography and certificate-based signature.
[0005] The technical solution proposed in this invention is as follows:
[0006] The first aspect of this invention provides a certificate-based signature method, comprising: initializing using the Chinese national cryptographic algorithm SM2 to generate a master public key and a master private key; generating a key using the Chinese national cryptographic algorithm SM2 based on the user's identity and the master public key to obtain a user secret value and a user public key; signing using the Chinese national cryptographic algorithm SM2 based on the master public key, the master private key, the user public key, and the user's identity to obtain a partial user private key; signing using the Chinese national cryptographic algorithm SM2 based on the master public key, the partial user private key, the user secret value, the user's identity, and the message to be signed to obtain a partial signature, wherein the partial signature and the partial private key constitute a final signature; and verifying the final signature based on the master public key, the user's identity, the user public key, and the message to be signed.
[0007] Optionally, the national cryptographic algorithm SM2 is used to generate a key based on the user's identity and the master public key, resulting in a user secret value and a user public key. This includes: generating a user secret value based on the user's identity and the master public key using the national cryptographic algorithm SM2; and generating a user public key based on the master public key, the user's identity, and the user secret value.
[0008] Optionally, the national cryptographic algorithm SM2 is used to sign the user's partial private key based on the master public key, the master private key, the user's public key, and the user's identity, including: concatenating the user's public key and the user's identity into strings to obtain a concatenation result; and signing the concatenation result using the master public key and the master private key based on the national cryptographic algorithm SM2 to obtain the user's partial private key.
[0009] Optionally, the user's partial private key is calculated using the following formula:
[0010] e = SM3(ID||pk) ID )∈Z n
[0011] k∈[1, n-1]
[0012] [k]G = [x1, y1]
[0013] r = (e + x1) mod n
[0014] s=(1+α) -1 ·(k-rα))modn
[0015] D ID = (r, s)
[0016] In the formula, SM3 represents hash operation, ID represents user identity, and pk ID Z represents the user's public key. n H represents the hash function H: {0, 1} *k is a random number, n and G represent the public parameters in the master public key, and α∈Z n D ID This represents a portion of the user's private key.
[0017] Optionally, the partial signature is calculated using the following formula:
[0018] e=H( / D||m)∈Z n
[0019] k∈[1, n-1]
[0020] [k]G = [x1, y1]
[0021] r′=(e+x1)modn
[0022] s′=((1+x ID ) -1 ·(kr′x ID ))modn
[0023] In the formula, ID represents the user identity, m represents the message to be signed, and Z... n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and x ID (r′, s′) represents the user's secret value, and (r′, s′) represents the partial signature.
[0024] Optionally, verifying the final signature based on the master public key, the user identity, the user public key, and the message to be signed includes: verifying a portion of the user's private key based on the user identity, the user public key, and the master public key to obtain a first verification result; verifying a portion of the signature based on the user identity, the message to be signed, and the master public key to obtain a second verification result; when both the first verification result and the second verification result are passed, the signature verification result is passed.
[0025] A second aspect of this invention provides a certificate-based signature apparatus, comprising: an initialization module for initializing using the Chinese national cryptographic algorithm SM2 to generate a master public key and a master private key; a key generation module for generating a key using the Chinese national cryptographic algorithm SM2 based on the user's identity and the master public key to obtain a user secret value and a user public key; a first signature module for signing using the Chinese national cryptographic algorithm SM2 based on the master public key, the master private key, the user public key, and the user's identity to obtain a partial user private key; a second signature module for signing using the Chinese national cryptographic algorithm SM2 based on the master public key, the partial user private key, the user secret value, the user's identity, and the message to be signed to obtain a partial signature, wherein the partial signature and the partial private key constitute a final signature; and a signature verification module for verifying the final signature based on the master public key, the user's identity, the user public key, and the message to be signed.
[0026] Optionally, the key generation module is specifically used to: generate a user secret value based on the user's identity and the master public key using the national cryptographic SM2 algorithm; and generate a user public key based on the master public key, the user's identity, and the user secret value.
[0027] Optionally, the first signature module is specifically used to: concatenate the user's public key and the user's identity into a string to obtain a concatenation result; and, based on the national cryptographic SM2 algorithm, sign the concatenation result using the master public key and the master private key to obtain the user's partial private key.
[0028] Optionally, the user's partial private key is calculated using the following formula:
[0029] e = SM3(ID||pk) ID )∈Z n
[0030] k∈[1, n-1]
[0031] [k]G = [x1, y1]
[0032] r = (e + x1) mod n
[0033] s=(1+α) -1 ·(k-rα))modn
[0034] D ID = (r, s)
[0035] In the formula, SM3 represents hash operation, ID represents user identity, and pk ID Z represents the user's public key. n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and α∈Z n DID This represents a portion of the user's private key.
[0036] Optionally, the partial signature is calculated using the following formula:
[0037] e=H( / D||m)∈Z n
[0038] k∈[1, n-1]
[0039] [k]G = [x1, y1]
[0040] r′=(e+x1)modn
[0041] s′=((1+x ID ) -1 ·(kr′x ID ))modn
[0042] In the formula, ID represents the user identity, m represents the message to be signed, and Z... n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and x ID (r′, s′) represents the user's secret value, and (r′, s′) represents the partial signature.
[0043] Optionally, the signature verification module is specifically used to: verify the user's partial private key based on the user's identity, the user's public key, and the master public key to obtain a first verification result; verify the partial signature based on the user's identity, the message to be signed, and the master public key to obtain a second verification result; and when both the first verification result and the second verification result are passed, the signature verification result is passed.
[0044] A third aspect of this invention provides a certificate-based signature system, comprising: a key generation center, a user terminal, and a verification terminal. The key generation center initializes using the Chinese national cryptographic algorithm SM2 to generate a master public key and a master private key. The user terminal uses the Chinese national cryptographic algorithm SM2 to generate a key based on the user's identity and the master public key, obtaining a user secret value and a user public key. The key generation center uses the Chinese national cryptographic algorithm SM2 to sign based on the master public key, the master private key, the user public key, and the user's identity, obtaining a partial user private key. The user terminal uses the Chinese national cryptographic algorithm SM2 to sign based on the master public key, the partial user private key, the user secret value, the user's identity, and the message to be signed, obtaining a partial signature. The partial signature and the partial private key constitute the final signature. The verification terminal verifies the final signature based on the master public key, the user's identity, the user public key, and the message to be signed.
[0045] A fourth aspect of the present invention provides a computer-readable storage medium storing computer instructions for causing the computer to perform the certificate-based signature method as described in the first aspect and any one of the first aspects of the present invention.
[0046] A fifth aspect of the present invention provides an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the certificate-based signature method as described in the first aspect and any one of the first aspects of the present invention.
[0047] The technical solution provided by this invention has the following effects:
[0048] The certificate-based signature method, apparatus, storage medium, and electronic device provided in this invention, based on certificate-based signature and combined with the Chinese national cryptographic algorithm SM2, realize a certificate-based signature method based on the SM2 national cryptographic signature algorithm. The user's signature process is essentially a single execution of the SM2 algorithm's signature phase, resulting in high computational efficiency. Furthermore, by using two signatures, the user's private key obtained from the first signature does not need to be transmitted via a secure channel, reducing the overall system overhead. Moreover, when verifying multiple signatures from the same user, the user's private key only needs to be transmitted once. Additionally, based on the SM2 algorithm, unlike the SM9 identity-based algorithm which requires bilinear pairing operations, computational efficiency is even higher. Attached Figure Description
[0049] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0050] Figure 1 This is a flowchart of a certificate-based signature method according to an embodiment of the present invention;
[0051] Figure 2 This is a flowchart of a certificate-based signature method according to an embodiment of the present invention;
[0052] Figure 3 This is a structural block diagram of a certificate-based signature device according to an embodiment of the present invention;
[0053] Figure 4 This is a schematic diagram of the structure of a computer-readable storage medium provided according to an embodiment of the present invention;
[0054] Figure 5 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention. Detailed Implementation
[0055] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0056] The terms "first," "second," "third," "fourth," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0057] According to an embodiment of the present invention, a certificate-based signature method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0058] This embodiment provides a certificate-based signature method that can be used in electronic devices such as computers, mobile phones, and tablets. Figure 1 This is a flowchart of a certificate-based signature method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0059] Step S101: Initialize using the national cryptographic algorithm SM2 to generate the master public key and master private key; specifically, the national cryptographic algorithm SM2 is also called the SM2 elliptic curve public-key cryptography algorithm. The core of this algorithm is based on the difficult problem of elliptic curves. In multi-point operations, given the multi-point and the base point, the problem of finding the multiple is called the elliptic curve discrete logarithm problem. For the general elliptic curve discrete logarithm problem, currently only methods with exponential computational complexity exist. Compared to the large number factorization problem and the discrete logarithm problem over finite fields, the elliptic curve discrete logarithm problem is much more difficult to solve. Therefore, under the same security requirements, elliptic curve cryptography requires a much smaller key size than other public-key cryptography methods. Compared to the RSA algorithm's multiplied key length, SM2 keys in practical applications consume less CPU, less memory, consume less network power, have higher encryption efficiency, and are significantly more difficult to crack. In communication, a longer key means higher network consumption, so using a shorter key means shorter transmission time, which will result in lower network latency.
[0060] For the Chinese national cryptographic algorithm SM2, its initialization phase is used to define the parameters of the elliptic curve as the master public key, or in other words, as its public parameters. Specifically, the finite field F of the elliptic curve is defined. q The equation of the elliptic curve E(F) q A base point G of the elliptic curve point group and its order n, and a hash function H: {0, 1} * →Z n Randomly select α∈Z n Calculate G pub =[α]G, where [] represents scalar multiplication, and [α]G represents multiplying G by α. The master public key primarily uses the SM3 hash function algorithm, and thus, the master public key mpk and master private key msk are represented as follows:
[0061] mpk = {F q , E(F q ), n, G, G pub H, SM3}
[0062] msk = α
[0063] The initialization process is implemented by the key generation center, which generates the master public key and master private key using the initialization phase of the national cryptographic SM2 algorithm.
[0064] Step S102: Using the national cryptographic algorithm SM2, a key generation process is performed based on the user's identity and the master public key to obtain the user's secret value and user public key. Specifically, this key generation stage is mainly implemented by the user terminal, that is, the user terminal generates a public-private key pair as the user's public key and user secret value based on the user's identity using the key generation method of the national cryptographic algorithm SM2. The user identity ID is used to distinguish different users; that is, different users have different user identities. The user identity can be a user ID card or any other identifier that can uniquely identify the user. The public parameters in the master public key, i.e., the parameters in the defined elliptic curve, are made public after the initialization stage is completed for user convenience.
[0065] In one embodiment, the SM2 algorithm (a national cryptographic standard) is used to generate a key based on the user's identity and the master public key, resulting in a user secret value and a user public key. This includes: generating a user secret value based on the user's identity and the master public key using the SM2 algorithm; and generating a user public key based on the master public key, the user's identity, and the user secret value.
[0066] Specifically, the private key x and public key pk generated using the SM2 algorithm key generation method are represented as follows:
[0067] x = d
[0068] pk = [d]G
[0069] In the formula, the random number d∈[1, n-2]. Specifically, the private key x and public key pk are bound to the user's identity to obtain the user's secret value and user's public key, respectively. That is, the private key x is bound to the user's identity to obtain the user's secret value x. ID By binding the public key PK with the user's identity ID, the user's public key PK can be obtained. ID .
[0070] Step S103: Using the national cryptographic algorithm SM2, a signature is made based on the master public key, the master private key, the user public key, and the user identity to obtain the user's partial private key. Specifically, this signature process is implemented by the key generation center using the national cryptographic algorithm SM2. When this user's partial private key is transmitted to the user terminal, it can be publicly transmitted to the user terminal, reducing the reliance on secure channels.
[0071] Step S104: Using the SM2 national cryptographic algorithm, a partial signature is obtained by signing the message based on the master public key, the user's partial private key, the user's secret value, the user's identity, and the message to be signed. The partial signature and the partial private key constitute the final signature. Specifically, this signing process is implemented by the user terminal using the SM2 national cryptographic algorithm. The partial signature obtained in this signing process, together with the user's partial private key obtained in step S103, constitutes the final signature.
[0072] Step S105: Verify the final signature based on the master public key, the user identity, the user public key, and the message to be signed. Specifically, this verification process is run by a signature verifier, which can be another user or the system. Since the final signature consists of two parts, the user's partial private key can be used as the public part. That is, if multiple signatures of the same user need to be verified, the user can input partial signatures obtained by signing multiple messages to be signed, and simultaneously input a single user partial private key. In other words, the user partial private key only needs to be transmitted once.
[0073] The certificate-based signature method provided in this invention combines the national cryptographic algorithm SM2 with certificate-based signature to achieve a certificate-based signature method based on SM2. The user's signature process is essentially a single execution of the SM2 algorithm's signature phase, resulting in high computational efficiency. Furthermore, by using two signatures, the user's private key obtained from the first signature does not need to be transmitted via a secure channel, reducing overall system overhead. Moreover, when verifying multiple signatures from the same user, the user's private key only needs to be transmitted once. Additionally, based on the national cryptographic algorithm SM2, unlike the SM9 identity-based algorithm which requires bilinear pairing operations, computational efficiency is even higher.
[0074] In one embodiment, the national cryptographic algorithm SM2 is used to sign the user's partial private key based on the master public key, the master private key, the user public key, and the user identity. This includes: concatenating the user public key and the user identity into strings to obtain a concatenated result; and signing the concatenated result using the master public key and the master private key based on the national cryptographic algorithm SM2 to obtain the user's partial private key. The concatenated result is represented as ID||pk. ID The signature process is represented by the following formula:
[0075] e = SM3(ID||pk) ID )∈Z n
[0076] k∈[1, n-1]
[0077] [k]G = [x1, y1]
[0078] r = (e + x1) mod n
[0079] s=(1+α) -1 ·(k-rα))modn
[0080] D ID = (r, s)
[0081] In the formula, SM3 represents hash operation, ID represents user identity, and pk ID Z represents the user's public key.n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and α∈Z n D ID This represents a portion of the user's private key.
[0082] In one embodiment, the partial signature is calculated and determined using the following formula:
[0083] e=H(ID||m)∈Z n
[0084] k∈[1, n-1]
[0085] [k]G = [x1, y1]
[0086] r′=(e+x1)modn
[0087] s′=((1+x ID ) -1 ·(kr′x ID ))modn
[0088] In the formula, ID represents the user identity, m represents the message to be signed, and Z... n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and x ID (r′, s′) represents the user's secret value, and (r′, s′) represents the partial signature.
[0089] In one embodiment, verifying the final signature based on the master public key, the user identity, the user public key, and the message to be signed includes: verifying a portion of the user's private key based on the user identity, the user public key, and the master public key to obtain a first verification result; verifying a portion of the signature based on the user identity, the message to be signed, and the master public key to obtain a second verification result; and when both the first verification result and the second verification result are passed, the signature verification result is passed.
[0090] Since the final signature consists of a portion of the user's private key and a portion of the signature, the validity verification of the final signature involves verifying both the user's partial private key and the partial signature separately. The verification process for the user's partial private key includes: e′1=SM3(ID||pk ID )∈Z n Assume D ID = (r, s), calculate t1 = (r + s) mod n, calculate [s]G + [t1]G pub= (x′1, y′1), verify whether the equation r = (e′1 + x′1) mod n holds true. The partial signature verification process includes: e′2 = H(ID||m) ∈ Z n Assuming a partial signature is represented as (r′, s′), calculate t2 = (r′ + s′) mod n, and calculate [s′]G + [t2]pk. ID = (x′2, y′2), verify whether the equation r′ = (e′2 + x2′ mod n) is true. If both equations are true, output 1, indicating that the signature verification is successful; otherwise, output 0, indicating that the signature verification failed.
[0091] In one implementation, such as Figure 2 As shown, the certificate-based signature method is implemented using the following process:
[0092] Step 1: System Initialization Phase: The Key Generation Center (KGC) initializes using the national cryptographic algorithm SM2, outputting the master public key mpk and the master private key msk, i.e.
[0093] Setup→(mpk, msk).
[0094] Step 2: Secret Value Generation Stage: The user inputs the master public key mpk and the user's identity information ID, and the output is the user's secret value x. ID ,Right now
[0095] SecretValue(mpk, ID) → x ID .
[0096] Step 3: Public Key Generation Phase: The user inputs the master public key mpk, the user's identity ID, and the secret value x. ID The output is the user's public key pk. ID ,Right now
[0097] PublicKey(mpk, ID, x) ID → pk ID .
[0098] Step 4: Partial Private Key Generation Stage: The key generation center KGC inputs the master public key mpk, the master private key msk, a user's identity information ID, and the user-submitted public key pk. ID The output is a portion of the user's private key D. ID ,Right now
[0099] PartialKey(mpk, msk, ID, pk ID → D ID .
[0100] Step 5: Signature Phase: The user inputs the master public key mpk, the user's identity ID, and part of the user's private key D. IDThe user's secret value x ID The message m to be signed is output as a signature σ. m ,Right now
[0101] Sign(mpk, ID, D) ID x ID ,m)→σ m .
[0102] Step 6: Signature Verification Stage: The user enters the master public key mpk, the user's identity ID, and the user's public key pk. ID A message m and a signature σ m An output of "1" indicates successful verification, while an output of "0" indicates verification failure.
[0103]
[0104] This invention also provides a certificate-based signature device, such as... Figure 3 As shown, the device includes:
[0105] The initialization module is used to initialize using the national cryptographic SM2 algorithm to generate the master public key and master private key; for details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0106] The key generation module is used to generate a key based on the user's identity and the master public key using the national cryptographic SM2 algorithm, thereby obtaining the user's secret value and user public key; for details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0107] The first signature module is used to perform a signature based on the master public key, the master private key, the user public key, and the user identity using the national cryptographic SM2 algorithm, thereby obtaining a partial private key for the user; for details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0108] The second signature module is used to sign the message using the national cryptographic SM2 algorithm, based on the master public key, the user's partial private key, the user's secret value, the user's identity, and the message to be signed, to obtain a partial signature. The partial signature and the partial private key constitute the final signature. For details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0109] The signature verification module is used to verify the final signature based on the master public key, the user identity, the user public key, and the message to be signed. For details, please refer to the corresponding sections of the above method embodiments, which will not be repeated here.
[0110] The certificate-based signature device provided in this invention, based on certificate-based signature and combined with the Chinese national cryptographic algorithm SM2, implements a certificate-based signature method based on the SM2 algorithm. The user's signature process is essentially a single execution of the SM2 algorithm's signature phase, resulting in high computational efficiency. Furthermore, by using two signatures, the user's private key obtained from the first signature does not need to be transmitted via a secure channel, reducing the overall system overhead. Moreover, when verifying multiple signatures from the same user, the user's private key only needs to be transmitted once. Additionally, based on the SM2 algorithm, unlike the SM9 identity-based algorithm which requires bilinear pairing operations, computational efficiency is even higher.
[0111] For a detailed description of the function of the certificate-based signature device provided in the embodiments of the present invention, please refer to the description of the certificate-based signature method in the above embodiments.
[0112] Optionally, the key generation module is specifically used to: generate a user secret value based on the user's identity and the master public key using the national cryptographic SM2 algorithm; and generate a user public key based on the master public key, the user's identity, and the user secret value.
[0113] Optionally, the first signature module is specifically used to: concatenate the user's public key and the user's identity into a string to obtain a concatenation result; and, based on the national cryptographic SM2 algorithm, sign the concatenation result using the master public key and the master private key to obtain the user's partial private key.
[0114] Optionally, the user's partial private key is calculated using the following formula:
[0115] e = SM3(ID||pk) ID )∈Z n
[0116] k∈[1, n-1]
[0117] [k]G = [x1, y1]
[0118] r = (e + x1) mod n
[0119] s=(1+α) -1 ·(k-rα))modn
[0120] D ID = (r, s)
[0121] In the formula, SM3 represents hash operation, ID represents user identity, and pk ID Z represents the user's public key. n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and α∈Z n D IDThis represents a portion of the user's private key.
[0122] Optionally, the partial signature is calculated using the following formula:
[0123] e=H(ID||m)∈Z n
[0124] k∈[1, n-1]
[0125] [k]G = [x1, y1]
[0126] r′=(e+x1)modn
[0127] s′=((1+x ID ) -1 ·(kr′x ID ))modn
[0128] In the formula, ID represents the user identity, m represents the message to be signed, and Z... n H represents the hash function H: {0, 1} * k is a random number, n and G represent the public parameters in the master public key, and x ID (r′, s′) represents the user's secret value, and (r′, s′) represents the partial signature.
[0129] Optionally, the signature verification module is specifically used to: verify the user's partial private key based on the user's identity, the user's public key, and the master public key to obtain a first verification result; verify the partial signature based on the user's identity, the message to be signed, and the master public key to obtain a second verification result; and when both the first verification result and the second verification result are passed, the signature verification result is passed.
[0130] This invention also provides a certificate-based signature system, comprising: a key generation center, a user terminal, and a verification terminal. The key generation center initializes using the Chinese national cryptographic algorithm SM2 to generate a master public key and a master private key. The user terminal uses the Chinese national cryptographic algorithm SM2 to generate a key based on the user's identity and the master public key, obtaining a user secret value and a user public key. The key generation center uses the Chinese national cryptographic algorithm SM2 to sign based on the master public key, the master private key, the user public key, and the user's identity, obtaining a partial user private key. The user terminal uses the Chinese national cryptographic algorithm SM2 to sign based on the master public key, the partial user private key, the user secret value, the user's identity, and the message to be signed, obtaining a partial signature. The partial signature and the partial private key constitute the final signature. The verification terminal verifies the final signature based on the master public key, the user's identity, the user public key, and the message to be signed.
[0131] The certificate-based signature system provided in this invention, based on certificate-based signature and combined with the Chinese national cryptographic algorithm SM2, implements a certificate-based signature method based on the SM2 algorithm. The user's signature process is essentially a single execution of the SM2 algorithm's signature phase, resulting in high computational efficiency. Furthermore, by using two signatures, the user's private key obtained from the first signature does not need to be transmitted via a secure channel, reducing the overall system overhead. Moreover, when verifying multiple signatures from the same user, the user's private key only needs to be transmitted once. Additionally, based on the SM2 algorithm, unlike the SM9 identity-based algorithm which requires bilinear pairing operations, computational efficiency is even higher.
[0132] For a detailed description of the functions of the certificate-based signature system provided in the embodiments of the present invention, please refer to the description of the certificate-based signature method in the above embodiments.
[0133] This invention also provides a storage medium, such as... Figure 4 As shown, a computer program 601 is stored on it. When executed by a processor, this program implements the steps of the certificate-based signature method described in the above embodiments. The storage medium also stores audio and video stream data, feature frame data, interactive request signaling, encrypted data, and a preset data size. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0135] This invention also provides an electronic device, such as... Figure 5As shown, the electronic device may include a processor 51 and a memory 52, wherein the processor 51 and the memory 52 may be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0136] Processor 51 can be a central processing unit (CPU). Processor 51 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0137] The memory 52, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the corresponding program instructions / modules in the embodiments of the present invention. The processor 51 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory 52, that is, implementing the certificate-based signature method in the above method embodiments.
[0138] The memory 52 may include a program storage area and a data storage area. The program storage area may store applications required for operating the device and at least one function; the data storage area may store data created by the processor 51, etc. Furthermore, the memory 52 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 52 may optionally include memory remotely located relative to the processor 51, and these remote memories may be connected to the processor 51 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0139] The one or more modules are stored in the memory 52, and when executed by the processor 51, they perform the following: Figure 1 -2 shows the certificate-based signature method in the embodiment.
[0140] For specific details regarding the aforementioned electronic devices, please refer to the relevant documentation. Figures 1 to 2 The relevant descriptions and effects in the illustrated embodiments are for understanding purposes only and will not be repeated here.
[0141] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A certificate-based signature method, characterized in that, include: Initialize using the national cryptographic SM2 algorithm to generate the master public key and master private key; Using the national cryptographic SM2 algorithm, a key is generated based on the user's identity and the master public key to obtain the user's secret value and user public key; Using the national cryptographic algorithm SM2, a signature is made based on the master public key, the master private key, the user public key, and the user identity to obtain the user's partial private key; Using the national cryptographic algorithm SM2, a partial signature is obtained by signing the message to be signed based on the master public key, the user's partial private key, the user's secret value, the user's identity, and the message to be signed. The partial signature and the partial private key constitute the final signature. The final signature is verified based on the master public key, the user identity, the user public key, and the message to be signed.
2. The certificate-based signature method according to claim 1, characterized in that, Using the national cryptographic algorithm SM2, a key is generated based on the user's identity and the master public key to obtain the user's secret value and user public key, including: The SM2 algorithm (China's national cryptographic standard) is used to generate a user secret value based on the user's identity and the master public key. Generate a user public key based on the master public key, the user identity, and the user secret value.
3. The certificate-based signature method according to claim 1, characterized in that, Using the national cryptographic algorithm SM2, a signature is obtained based on the master public key, the master private key, the user public key, and the user identity, resulting in the user's partial private key, including: The user's public key and the user's identity are concatenated into a string to obtain the concatenated result; Based on the national cryptographic SM2 algorithm, the concatenated result is signed using the master public key and the master private key to obtain the user's partial private key.
4. The certificate-based signature method according to claim 1, characterized in that, The user's private key is calculated using the following formula: e=SM3(ID||pk ID )∈Z n k∈[1,n-1] [k]G=[x1,y1] r = (e + x1) mod n s=((1+α) -1 ·(k-rα))modn D ID =(r,s) In the formula, SM3 represents hash operation, ID represents user identity, and pk ID Z represents the user's public key. n H represents the hash function H:{0,1} * k is a random number, n and G represent the public parameters in the master public key, and α∈Z n D ID This represents a portion of the user's private key.
5. The certificate-based signature method according to claim 1, characterized in that, The partial signature is calculated and determined using the following formula: e=H(ID||m)∈Z n k∈[1,n-1] [k]G=[x1,y1] r′=(e+x1)modn s′=((1+x ID ) -1 ·(kr′x ID ))modern In the formula, ID represents the user identity, m represents the message to be signed, and Z... n H represents the hash function H:{0,1} * k is a random number, n and G represent the public parameters in the master public key, and x ID represents the user's secret value, and (′,s′) represents a partial signature.
6. The certificate-based signature method according to claim 1, characterized in that, Verify the final signature based on the master public key, the user identity, the user public key, and the message to be signed, including: The user's partial private key is verified based on the user's identity, the user's public key, and the master public key to obtain a first verification result; The partial signature is verified based on the user identity, the message to be signed, and the master public key to obtain a second verification result; The signature verification result is considered passed when both the first verification result and the second verification result are passed.
7. A certificate-based signature device, characterized in that, include: The initialization module is used to initialize using the national cryptographic SM2 algorithm to generate the master public key and master private key; The key generation module is used to generate a key based on the user's identity and the master public key using the national cryptographic SM2 algorithm, thereby obtaining the user's secret value and user's public key. The first signature module is used to sign based on the master public key, the master private key, the user public key, and the user identity using the national cryptographic SM2 algorithm to obtain the user's partial private key; The second signature module is used to sign the message using the national cryptographic SM2 algorithm based on the master public key, the user's partial private key, the user's secret value, the user's identity, and the message to be signed, to obtain a partial signature. The partial signature and the partial private key constitute the final signature. The signature verification module is used to verify the final signature based on the master public key, the user identity, the user public key, and the message to be signed.
8. The certificate-based signature device according to claim 7, characterized in that, The key generation module is specifically used to: generate a user secret value based on the user's identity and the master public key using the national cryptographic SM2 algorithm; and generate a user public key based on the master public key, the user's identity, and the user secret value.
9. The certificate-based signature device according to claim 7, characterized in that, The first signature module is specifically used to: concatenate the user's public key and the user's identity into a string to obtain a concatenation result; and, based on the national cryptographic SM2 algorithm, sign the concatenation result using the master public key and the master private key to obtain the user's partial private key.
10. The certificate-based signature device according to claim 7, characterized in that, The user's private key is calculated using the following formula: e=SM3(ID||pk ID )∈Z n k∈[1,n-1] [k]G=[x1,y1] r = (e + x1) mod n s=((1+α) -1 ·(k-rα))modn D ID =(r,s) In the formula, SM3 represents hash operation, ID represents user identity, and pk ID Z represents the user's public key. n H represents the hash function H:{0,1} * k is a random number, n and G represent the public parameters in the master public key, and α∈Z n D ID This represents a portion of the user's private key.
11. The certificate-based signature apparatus according to claim 7, characterized in that, The partial signature is calculated and determined using the following formula: e=H(ID||m)∈Z n k∈[1,n-1] [k]G=[x1,y1] r′=(e+x1)modn s′=((1+x ID ) -1 ·(kr′x ID ))modern In the formula, ID represents the user identity, m represents the message to be signed, and Z... n H represents the hash function H:{0,1} * k is a random number, n and G represent the public parameters in the master public key, and x ID (r′, s′) represents the user's secret value, and (r′, s′) represents the partial signature.
12. The certificate-based signature device according to claim 7, characterized in that, The signature verification module is specifically used to: verify the user's partial private key based on the user's identity, the user's public key, and the master public key to obtain a first verification result; and verify the partial signature based on the user's identity, the message to be signed, and the master public key to obtain a second verification result. The signature verification result is considered passed when both the first verification result and the second verification result are passed.
13. A certificate-based signature system, characterized in that, include: Key generation center, user terminal, and verification terminal. The key generation center is initialized using the national cryptographic SM2 algorithm to generate a master public key and a master private key. The user terminal uses the national cryptographic SM2 algorithm to generate a key based on the user's identity and the master public key, thereby obtaining the user's secret value and user's public key. The key generation center uses the national cryptographic SM2 algorithm to sign based on the master public key, the master private key, the user public key, and the user identity to obtain the user's partial private key; The user terminal uses the national cryptographic SM2 algorithm to sign the message based on the master public key, the user's partial private key, the user's secret value, the user's identity, and the message to be signed, thus obtaining a partial signature. The partial signature and the partial private key constitute the final signature. The verification terminal verifies the final signature based on the master public key, the user identity, the user public key, and the message to be signed.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the certificate-based signature method as described in any one of claims 1-6.
15. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the certificate-based signature method as described in any one of claims 1-6.
Citation Information
Patent Citations
Private key protection method, system and device based on key updating
CN107302438A
A node access and node authentication method based on edge computing
CN109861828A