Method, device and system for signing based on hosting key authorization and storage medium
By generating escrow keys through a hardware cryptographic module and combining it with PIN code encryption technology, the convenience and security issues of existing authorization signature methods are resolved, high-security signature authorization is achieved without the need for dedicated equipment, and the risk of private key leakage is reduced.
Patent Information
- Application Number
- CN202110084764.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-21
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-01-21
AI Technical Summary
Existing authorization signature methods find it difficult to strike a balance between convenience and security. Dedicated hardware media are inconvenient to use and pose a risk of private key leakage. Collaborative cryptographic calculation methods pose a risk of penetration during device storage and calculation processes.
Generate a managed key through the hardware password module, use the first PIN code and key identifier to build an encryption key, re-encrypt the private key ciphertext and store it in the managed key library, and use the OTP code to verify the user's identity to ensure that the private key can only be decrypted under the hardware password module.
It enables signature authorization without the need for dedicated equipment, improves convenience, reduces the risk of private key leakage, prevents malicious individuals from forging signatures, and enhances system security.
Smart Images

Figure CN112765626B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of cryptography, in particular, to a method, device and system for authorization signature based on a managed key and a storage medium. BACKGROUND
[0002] There are generally two existing authorization signature methods. The first method is an electronic signature method through a special hardware medium (such as a USB key). This method has high security because the signature private key is controlled independently by the signer. However, mobile terminals such as mobile phones cannot use this method because they do not have a USB interface, which limits the use scenarios. In addition, this method further increases the inconvenience of use because the special hardware medium needs to be carried at all times and in all places.
[0003] The other authorization signature method is an electronic signature method using collaborative password calculation. This method generates and saves signature private key components at two nodes (or multiple nodes) of a terminal and a server, respectively, and independently performs password operations at the two nodes. The final signature result is obtained by integrating the calculation results of the two nodes. This method reduces the risk of private key leakage caused by attacks on a single node while completing electronic signature, thereby improving the convenience of operation. However, in the storage and calculation process of the private key components, the related devices have penetration risks, and the private key components are easily leaked. In particular, it is difficult to implement device defense for internal personnel who can directly access the user's managed key data, such as database administrators and internal network administrators. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a method, device and system for authorization signature based on a managed key and a storage medium, so as to enable a user to express a signature intention without using a special device and to authorize the use of a managed key, thereby improving the convenience of signature authorization and reducing the risk of private key leakage and improving the anti-counterfeiting property of the signature.
[0005] To this end, the first aspect of the present application discloses a method for authorization signature based on a managed key. The method is applied to a managed key signature system, wherein the managed key signature system includes a hardware cryptographic module. The method includes the following steps:
[0006] Obtaining key application information sent by a user terminal, wherein the key application information includes key algorithm information, user contact information and a first PIN code;
[0007] Calculating a digest value of the first PIN code and saving the digest value of the first PIN code;
[0008] Invoking the hardware cryptographic module to generate a public-private key pair and assigning a key identifier to the public-private key pair, wherein the public-private key pair includes a private key ciphertext and a public key plaintext, and the private key ciphertext is encrypted by a protection key in the hardware cryptographic module;
[0009] Constructing a first encryption key according to the first PIN code and the key identifier;
[0010] Encrypting the private key ciphertext according to the first encryption key and key algorithm information to obtain an escrow key;
[0011] The managed key, the key identifier, the public key plaintext, the user contact information, and the digest value of the first PIN code are stored in a managed key library.
[0012] The method of the first aspect of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting it through the hardware cryptographic module. In this way, even if an external attacker breaks through the system defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondary encrypted using the first PIN code. In this way, even if there are malicious personnel within the escrow party, since the malicious personnel do not have the first PIN code, they cannot use the user's signature private key to forge the user's signature.
[0013] On the other hand, the method of the first aspect of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support on the user terminal, that is, it does not rely on a dedicated client environment.
[0014] In the first aspect of the present application, as an optional implementation manner, constructing a first encryption key according to the first PIN code and the key identifier includes:
[0015] Concatenate the first PIN code and the key identifier to obtain concatenated data;
[0016] Calculating a summary of the spliced data;
[0017] Data of a preset length is intercepted from the summary of the spliced data as the first encryption key.
[0018] In this optional embodiment, the first PIN code and the key identifier are concatenated to obtain concatenated data, and a summary of the concatenated data can be calculated, so that data of a preset length can be intercepted from the summary of the concatenated data as the first encryption key.
[0019] In the first aspect of the present application, as an optional implementation, after storing the escrow key, the key identifier, the public key plaintext, the user contact information, and the digest value of the first PIN code in the escrow key store, the method further includes:
[0020] Receiving a signature authorization request sent by a user terminal and returning the signature authorization data to the user terminal;
[0021] Receiving a data signature application sent by the user terminal, the data signature application including: a key identifier to be applied for, a digest of the data to be signed, and the signature authorization data;
[0022] Verifying the signature authorization data and the digest of the data to be signed;
[0023] When the signature authorization data and the digest of the data to be signed are verified successfully, obtaining a pre-cached third PIN code;
[0024] decrypting the third PIN code according to the first encryption key of the hardware cryptographic module to obtain the plaintext PIN code;
[0025] Constructing a second encryption key based on the plaintext PIN code and the key identifier to be applied for;
[0026] Decrypting the pre-stored escrow key according to the second encryption key to obtain a private key ciphertext;
[0027] The digest of the data to be signed is signed according to the private key ciphertext, and the signature result is returned to the user terminal.
[0028] In this optional implementation, by returning the signature result to the user terminal, the user can authorize the signature of the designated data through the user terminal.
[0029] In the first aspect of the present application, as an optional implementation manner, the verifying the signature authorization data and the digest of the data to be signed includes:
[0030] Determine whether the signature authorization data is expired, and if not, determine that the signature authorization data verification is successful;
[0031] Determine whether the summary of the data to be signed has been tampered with, and if not, determine that the summary of the data to be signed has passed verification.
[0032] In this optional implementation, by determining whether the signature authorization data is expired, it can be determined that the signature authorization data verification has passed. On the other hand, by determining whether the summary of the data to be signed has been tampered with, it can be determined that the summary of the data to be signed has passed the verification.
[0033] In the first aspect of the present application, as an optional implementation manner, the receiving a signature authorization application sent by a user terminal and returning the signature authorization data to the user terminal includes:
[0034] Receive the signature authorization application sent by the user terminal, wherein the signature authorization application includes the key identifier to be applied for, the OTP code, the digest of the data to be signed, and the second PIN code;
[0035] Verifying the second PIN code and the OTP code;
[0036] When the second PIN code and the OTP code are verified, the second PIN code is encrypted according to the protection key of the hardware password module to obtain a third PIN code;
[0037] Construct signature authorization data according to the key identifier to be applied for, the digest of the data to be signed, the current time of the first system, and the protection key of the hardware cryptographic module;
[0038] Return the signature authorization data to the user terminal.
[0039] In this optional implementation, the user's ownership of the escrow key can be verified through the OTP code.
[0040] In the first aspect of the present application, as an optional implementation, the verifying the second PIN code and the OTP code includes:
[0041] Calculating a digest value of the second PIN code;
[0042] Comparing the digest value of the second PIN code with the digest value of the first PIN code stored in the escrow key store, and determining that the second PIN code verification is successful if they are the same;
[0043] Determine whether the validity period of the OTP code has expired, and if not, determine that the OTP code verification is successful.
[0044] In this optional embodiment, the digest value of the second PIN code is calculated and then compared with the digest value of the first PIN code stored in the escrow keystore to determine whether the second PIN code has been verified. Alternatively, the OTP code can be determined to have been verified by determining whether its validity period has expired.
[0045] In the first aspect of the present application, as an optional implementation manner, before receiving the signature authorization application sent by the user terminal and returning the signature authorization data to the user terminal, the method further includes:
[0046] Receiving an OTP code application sent by the user terminal, wherein the OTP code application includes the key identifier to be applied for;
[0047] Verifying the key identifier to be applied for;
[0048] When the key identifier to be applied for is verified, the OTP code is calculated based on the key identifier to be applied for, the current time of the second system, and the protection key in the hardware password module;
[0049] Return the OTP code to the user terminal.
[0050] In this optional implementation, the OTP code can be calculated based on the key identifier to be applied for, the current time of the second system, and the protection key in the hardware cryptographic module.
[0051] A second aspect of the present application discloses a device for authorizing signatures based on a managed key, the device being applied to a managed key signature system, wherein the managed key signature system includes a hardware cryptographic module, and the device includes:
[0052] An acquisition module, configured to acquire key application information sent by a user terminal, wherein the key application information includes key algorithm information, user contact information, and a first PIN code;
[0053] a calculation module, configured to calculate a digest value of the first PIN code and save the digest value of the first PIN code;
[0054] a generation module, configured to call the hardware cryptographic module to generate a public-private key pair and assign a key identifier to the public-private key pair, wherein the public-private key pair includes a private key ciphertext and a public key plaintext, and the private key ciphertext is encrypted by a protection key in the hardware cryptographic module;
[0055] A construction module, configured to construct a first encryption key according to the first PIN code and the key identifier;
[0056] an encryption module, configured to encrypt the private key ciphertext according to the first encryption key and key algorithm information, and obtain an escrow key;
[0057] The storage module is used to store the escrow key, the key identifier, the public key plaintext, the user contact information, and the summary value of the first PIN code in the escrow key library.
[0058] The device of the second aspect of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting the hardware cryptographic module. In this way, even if an external attacker breaks through the system defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondary encrypted through the first PIN code. In this way, even if there are malicious personnel within the escrow party, since the malicious personnel do not have the first PIN code, they cannot use the user's signature private key to forge the user's signature.
[0059] On the other hand, the device of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support in the user terminal, that is, it does not rely on a dedicated client environment.
[0060] The third aspect of the present application discloses a managed key authorization signature system, which includes a managed key library and a managed key authorization signature device, wherein the managed key authorization signature device includes a hardware encryption module, and the hardware encryption module is communicatively connected to the managed key library. The managed key authorization signature system is used to execute the managed key authorization signature method based on the first aspect of the present application.
[0061] The system of the third aspect of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting it through the hardware cryptographic module. In this way, even if an external attacker breaks through the system's defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondarily encrypted through the first PIN code. In this way, even if there are malicious personnel within the escrow party, since the malicious personnel do not have the first PIN code, they cannot use the user's signature private key to forge the user's signature.
[0062] On the other hand, the system of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support in the user terminal, that is, it does not rely on a dedicated client environment.
[0063] The fourth aspect of the present application discloses a storage medium, which stores a computer program, and the computer program is executed by a processor to execute the managed key-based authorization signature method described in the first aspect of the present application.
[0064] The storage medium of the fourth aspect of the present application can generate a hosting key through a hardware cryptographic module, wherein the private key ciphertext can be first re-encrypted by the hardware cryptographic module, so that the private key ciphertext can only be decrypted by the hardware cryptographic module, so that even if an external attacker breaks through the system defense boundary, the attacker can only obtain the hosting key, and cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform a signature operation. On the other hand, the private key plaintext can be secondarily encrypted through the first PIN code, so that even if there is a malicious person inside the hosting party, the malicious person cannot forge a user signature using the user's signature private key because the malicious person does not have the first PIN code.
[0065] On the other hand, the storage medium of the present application can implement key hosting, so that the user terminal does not need to support a dedicated cryptographic hardware (such as a USBKey) or other equipment (such as a mobile phone that must be registered), that is, does not depend on a dedicated client environment. BRIEF DESCRIPTION OF DRAWINGS
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be considered as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0067] Figure 1 is a flow diagram of a method for authorized signature based on a hosting key disclosed by an embodiment of the present application;
[0068] Figure 2 is a structural diagram of an apparatus for authorized signature based on a hosting key disclosed by an embodiment of the present application;
[0069] Figure 3 is a structural diagram of a system for authorized signature based on a hosting key disclosed by an embodiment of the present application. DETAILED DESCRIPTION
[0070] The technical solutions in the embodiments of the present application will be described below in combination with the drawings in the embodiments of the present application.
[0071] Embodiment One
[0072] Please refer to Figure 1 , Figure 1 is a flow diagram of a method for authorized signature based on a hosting key disclosed by an embodiment of the present application, wherein the method is applied to a hosting key signature system, and the hosting key signature system includes a hardware cryptographic module. As shown in Figure 1 the method of the present application includes the following steps:
[0073] 101. Obtain key application information sent by a user terminal, where the key application information includes key algorithm information, user contact information, and a first PIN code;
[0074] 102. Calculate a digest value of the first PIN code and save the digest value of the first PIN code;
[0075] 103. Invoke the hardware cryptographic module to generate a public-private key pair and assign a key identifier to the public-private key pair, wherein the public-private key pair includes a private key ciphertext and a public key plaintext, and the private key ciphertext is encrypted by a protection key in the hardware cryptographic module;
[0076] 104. Construct a first encryption key according to the first PIN code and the key identifier;
[0077] 105. Encrypt the private key ciphertext according to the first encryption key and the key algorithm information, and obtain the escrow key;
[0078] 106. Store the escrow key, key identifier, public key plaintext, user contact information, and the digest value of the first PIN code in the escrow key store.
[0079] In an embodiment of the present application, the key algorithm information is optionally associated with a symmetric encryption algorithm, that is, the key algorithm information can be used to determine the symmetric encryption algorithm used to encrypt the private key ciphertext.
[0080] In the embodiment of the present application, the user contact information can be the user's contact email address or the mobile phone number, which is not limited in the embodiment of the present application.
[0081] In an embodiment of the present application, optionally, in order to prevent the hardware cryptographic module from being obtained by malicious persons by physically disassembling the escrow key signing device, the escrow key signing device is provided with a corresponding anti-disassembly structure.
[0082] The method of the embodiment of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting the hardware cryptographic module. In this way, even if an external attacker breaks through the system defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondary encrypted using the first PIN code. In this way, even if there are malicious personnel within the escrow party, since the malicious personnel do not have the first PIN code, they cannot use the user's signature private key to forge the user's signature.
[0083] On the other hand, the method of the embodiment of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support on the user terminal, that is, it does not rely on a dedicated client environment.
[0084] In this embodiment of the present application, as an optional implementation, step 103: constructing a first encryption key according to the first PIN code and the key identifier includes the following sub-steps:
[0085] Concatenate the first PIN code and the key identifier to obtain concatenated data;
[0086] Calculate the summary of the spliced data;
[0087] Data of a preset length is intercepted from the summary of the spliced data as a first encryption key.
[0088] In this optional embodiment, the first PIN code and the key identifier are concatenated to obtain concatenated data, and a summary of the concatenated data can be calculated, so that data of a preset length can be intercepted from the summary of the concatenated data as the first encryption key.
[0089] In this embodiment of the present application, as an optional implementation, after step 105: storing the escrow key, key identifier, public key plaintext, user contact information, and the digest value of the first PIN code in the escrow key library, the method of this embodiment of the present application further includes the steps of:
[0090] Receive the signature authorization request sent by the user terminal and return the signature authorization data to the user terminal;
[0091] Receive a data signature application from a user terminal, which includes: a key identifier to be applied for, a summary of the data to be signed, and signature authorization data;
[0092] Verify the signature authorization data and the summary of the data to be signed;
[0093] When the signature authorization data and the digest of the data to be signed are verified, the pre-cached third PIN code is obtained;
[0094] decrypting the third PIN code according to the first encryption key of the hardware cryptographic module to obtain a plaintext PIN code;
[0095] Construct a second encryption key based on the plaintext PIN code and the key identifier to be applied for;
[0096] Decrypting the pre-stored escrow key according to the second encryption key to obtain a private key ciphertext;
[0097] The signature data summary is signed according to the private key ciphertext and the signature result is returned to the user terminal.
[0098] In this optional implementation, by returning the signature result to the user terminal, the user can authorize the signature of the designated data through the user terminal.
[0099] In this embodiment of the present application, as an optional implementation, the signature authorization data and the digest of the data to be signed are verified, including the following sub-steps:
[0100] Determine whether the signature authorization data has expired, and if not, determine that the signature authorization data verification has passed;
[0101] Determine whether the summary of the data to be signed has been tampered with. If not, determine that the summary of the data to be signed has been verified.
[0102] In this optional implementation, by determining whether the signature authorization data has expired, it can be determined that the signature authorization data has been verified. On the other hand, by determining whether the summary of the data to be signed has been tampered with, it can be determined that the summary of the data to be signed has been verified.
[0103] In an embodiment of the present application, the specific method of determining whether the signature authorization data has expired is to obtain the OTP codes of multiple signature authorization data under multiple time slices. If there is an OTP code under a time that meets the matching conditions, it is determined that the signature authorization data has not expired.
[0104] In an embodiment of the present application, as an optional implementation, the step of receiving a signature authorization request sent by a user terminal and returning signature authorization data to the user terminal includes:
[0105] Receive a signature authorization request sent by a user terminal, wherein the signature authorization request includes the key identifier to be applied for, the OTP code, the digest of the data to be signed, and the second PIN code;
[0106] Verify the second PIN code and OTP code;
[0107] When the second PIN code and OTP code are verified, the second PIN code is encrypted according to the protection key of the hardware password module to obtain the third PIN code;
[0108] Constructing signature authorization data based on the key identifier to be applied for, the summary of the data to be signed, the current time of the first system, and the protection key of the hardware cryptographic module;
[0109] Return the signed authorization data to the user terminal.
[0110] In this optional embodiment, the user's ownership of the escrow key can be verified through the OTP code.
[0111] In this optional implementation, after constructing the signature authorization data, the signature authorization data is bound to the hardware cryptographic module, the summary of the data to be signed, and the key identifier to be applied for based on the managed key authorization signature system. Then, through this binding relationship, the signature authorization data or the summary of the data to be signed submitted by subsequent users can be verified. For example, the binding relationship between the summary of the data to be signed and the signature authorization data can be used to determine whether the summary of the data to be signed has been tampered with.
[0112] In this optional implementation, OTP (One Time Password) refers to a one-time password.
[0113] In this optional implementation, further, after the signature authorization data is constructed, the signature authorization data is associated with a time, and then whether the signature authorization data is invalid can be determined based on the information associated with the signature authorization data.
[0114] In the embodiment of the present application, as an optional implementation, step: verifying the second PIN code and OTP code includes the following sub-steps:
[0115] Calculate the digest value of the second PIN code;
[0116] Compare the digest value of the second PIN code with the digest value of the first PIN code stored in the escrow key store, and if they are the same, determine that the second PIN code verification is successful;
[0117] Determine whether the validity period of the OTP code has expired, and if not, determine that the OTP code verification is successful.
[0118] In this optional embodiment, the digest value of the second PIN code is calculated and then compared with the digest value of the first PIN code stored in the escrow keystore to determine whether the second PIN code has been verified. Alternatively, the OTP code can be determined to have been verified by determining whether the validity period of the OTP code has expired.
[0119] In an embodiment of the present application, as an optional implementation, before the step of receiving the signature authorization application sent by the user terminal and returning the signature authorization data to the user terminal, the method of the embodiment of the present application further includes the steps of:
[0120] Receive an OTP code application sent by a user terminal, wherein the OTP code application includes a key identifier to be applied for;
[0121] Verify the key identifier to be applied for;
[0122] When the key identifier to be applied for is verified, the OTP code is calculated based on the key identifier to be applied for, the current time of the second system, and the protection key in the hardware password module;
[0123] Return the OTP code to the user terminal.
[0124] In this optional implementation, the OTP code can be calculated based on the key identifier to be applied for, the current time of the second system, and the protection key in the hardware cryptographic module.
[0125] In this optional embodiment, the OTP code is further optionally associated with a time, and then the time associated with the OTP code is used to determine whether the OTP code is invalid. The time associated with the OTP code can be the system time when the OTP code is generated.
[0126] In this optional implementation, further optionally, after the validity of the OTP code is judged, if the OTP code expires, the method of the embodiment of the present application also includes sending an update prompt message to the user terminal to prompt the user to update the OTP code.
[0127] In this optional embodiment, optionally, after the managed key authorization signature system generates the OTP code, the OTP code is bound to the hardware cryptographic module, the user's contact information, and the key identification information, and then when the user subsequently submits the OTP code, the legitimacy of the OTP code can be verified based on this binding relationship.
[0128] Example 2
[0129] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a device for authorizing signature based on a managed key disclosed in an embodiment of the present application, wherein the device is applied to a managed key signature system, wherein the managed key signature system includes a hardware cryptographic module. Figure 2 As shown, the device of the embodiment of the present application includes:
[0130] An acquisition module 201 is configured to acquire key application information sent by a user terminal, wherein the key application information includes key algorithm information, user contact information, and a first PIN code;
[0131] a calculation module 202, configured to calculate a digest value of the first PIN code and save the digest value of the first PIN code;
[0132] A generation module 203 is configured to call a hardware cryptographic module to generate a public-private key pair and assign a key identifier to the public-private key pair, wherein the public-private key pair includes a private key ciphertext and a public key plaintext, and the private key ciphertext is encrypted by a protection key in the hardware cryptographic module;
[0133] A construction module 204 is configured to construct a first encryption key according to the first PIN code and the key identifier;
[0134] The encryption module 205 is used to encrypt the private key ciphertext according to the first encryption key and the key algorithm information, and obtain the escrow key;
[0135] The storage module 206 is configured to store the escrow key, key identifier, public key plaintext, user contact information, and the digest value of the first PIN code in the escrow key library.
[0136] The device of the embodiment of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting the hardware cryptographic module. In this way, even if an external attacker breaks through the system defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondary encrypted through the first PIN code. In this way, even if there are malicious personnel within the escrow party, since the malicious personnel do not have the first PIN code, they cannot use the user's signature private key to forge the user's signature.
[0137] On the other hand, the device of the embodiment of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support on the user terminal, that is, it does not rely on a dedicated client environment.
[0138] It should be noted that for other detailed descriptions of the escrow key-based authorization signature device, please refer to Example 1 of this application, which will not be elaborated in this embodiment of the application.
[0139] Example 3
[0140] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a system for authorizing signatures based on managed keys disclosed in the embodiment of this application. Figure 3 As shown, the managed key authorization signature system includes a managed key library and a managed key authorization signature device, wherein the managed key authorization signature device includes a hardware encryption module, the hardware encryption module is communicated with the managed key library, and the managed key authorization signature system is used to execute the managed key authorization signature method based on the first aspect of this application.
[0141] The system of the embodiment of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting it through the hardware cryptographic module. In this way, even if an external attacker breaks through the system defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondarily encrypted using the first PIN code. In this way, even if there are malicious personnel within the escrow party, they cannot use the user's signature private key to forge the user's signature because they do not have the first PIN code.
[0142] On the other hand, the system of the embodiment of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support on the user terminal, that is, it does not rely on a dedicated client environment.
[0143] In an embodiment of the present application, the managed key authorization signature system can be connected to the business application, that is, connected to the user terminal. On the other hand, the managed key authorization signature system also includes an OTP sending module, wherein the OTP sending module can be an independent device or integrated into the managed key authorization signature device.
[0144] Example 4
[0145] An embodiment of the present application discloses a storage medium storing a computer program, which is executed by a processor to implement the managed key-based authorization signature method disclosed in the first embodiment of the present application.
[0146] The storage medium of the embodiment of the present application can generate an escrow key through a hardware cryptographic module, wherein the private key ciphertext can be first encrypted by the hardware cryptographic module, so that the private key ciphertext can only be obtained by decrypting the hardware cryptographic module. In this way, even if an external attacker breaks through the system defense boundary, they can only obtain the escrow key, but cannot obtain the private key plaintext without the hardware cryptographic module, and thus cannot perform signing operations. On the other hand, the private key plaintext can be secondary encrypted through the first PIN code. In this way, even if there are malicious personnel within the escrow party, since the malicious personnel do not have the first PIN code, they cannot use the user's signature private key to forge the user's signature.
[0147] On the other hand, the storage medium of the embodiment of the present application can realize key hosting, and thus does not require dedicated cryptographic hardware (such as USBKey) or other devices (such as mobile phones that must be registered) support on the user terminal, that is, it does not rely on a dedicated client environment.
[0148] In the embodiments of the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. The embodiments described above are merely exemplary, for example, the division of the units is only a logical function division, and there can be another division manner in actual implementation; for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0149] In addition, the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.
[0150] In addition, the functional modules in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0151] It should be noted that if the functions are realized in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0152] In this document, the terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations.
[0153] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for authorizing signature based on a managed key, characterized in that: The method is applied to a managed key signature system, wherein the managed key signature system includes a hardware cryptographic module, and the method includes: Obtain key application information sent by the user terminal, wherein the key application information includes key algorithm information, user contact information, and a first PIN code; Calculating a digest value of the first PIN code and saving the digest value of the first PIN code; Invoking the hardware cryptographic module to generate a public-private key pair and assigning a key identifier to the public-private key pair, wherein the public-private key pair includes a private key ciphertext and a public key plaintext, and the private key ciphertext is encrypted by a protection key in the hardware cryptographic module; Constructing a first encryption key according to the first PIN code and the key identifier; Encrypting the private key ciphertext according to the first encryption key and key algorithm information to obtain an escrow key; Storing the escrow key, the key identifier, the public key plaintext, the user contact information, and the digest value of the first PIN code in an escrow key library; Furthermore, after storing the escrow key, the key identifier, the public key plaintext, the user contact information, and the digest value of the first PIN code in the escrow key store, the method further includes: Receive a signature authorization request sent by a user terminal and return signature authorization data to the user terminal; Receiving a data signature application sent by the user terminal, the data signature application including: a key identifier to be applied for, a digest of the data to be signed, and the signature authorization data; Verifying the signature authorization data and the digest of the data to be signed; When the signature authorization data and the digest of the data to be signed are verified successfully, obtaining a pre-cached third PIN code; decrypting the third PIN code according to the first encryption key of the hardware cryptographic module to obtain a plaintext PIN code; Constructing a second encryption key based on the plaintext PIN code and the key identifier to be applied for; Decrypting the pre-stored escrow key according to the second encryption key to obtain a private key ciphertext; Sign the data digest to be signed according to the private key ciphertext, and return the signature result to the user terminal; And, the receiving the signature authorization application sent by the user terminal and returning the signature authorization data to the user terminal includes: Receive the signature authorization application sent by the user terminal, wherein the signature authorization application includes the key identifier to be applied for, the OTP code, the digest of the data to be signed, and the second PIN code; Verifying the second PIN code and the OTP code; When the second PIN code and the OTP code are verified, the second PIN code is encrypted according to the protection key of the hardware password module to obtain a third PIN code; Construct signature authorization data according to the key identifier to be applied for, the digest of the data to be signed, the current time of the first system, and the protection key of the hardware cryptographic module; Return the signature authorization data to the user terminal.
2. The method according to claim 1, wherein The constructing a first encryption key according to the first PIN code and the key identifier includes: Concatenate the first PIN code and the key identifier to obtain concatenated data; Calculating a summary of the spliced data; Data of a preset length is intercepted from the summary of the spliced data as the first encryption key.
3. The method according to claim 1, wherein The verification of the signature authorization data and the digest of the data to be signed includes: Determining whether the signature authorization data has expired, and if not, determining that the signature authorization data verification has passed; Determine whether the summary of the data to be signed has been tampered with, and if not, determine that the summary of the data to be signed has passed verification.
4. The method according to claim 1, wherein The verifying the second PIN code and the OTP code includes: Calculating a digest value of the second PIN code; Comparing the digest value of the second PIN code with the digest value of the first PIN code stored in the escrow key store, and determining that the second PIN code verification is successful if they are the same; Determine whether the validity period of the OTP code has expired, and if not, determine that the OTP code verification is successful.
5. The method according to claim 4, wherein Before receiving the signature authorization application sent by the user terminal and returning the signature authorization data to the user terminal, the method further includes: Receiving an OTP code application sent by the user terminal, wherein the OTP code application includes the key identifier to be applied for; Verifying the key identifier to be applied for; When the key identifier to be applied for is verified, the OTP code is calculated based on the key identifier to be applied for, the current time of the second system, and the protection key in the hardware password module; Return the OTP code to the user terminal.
6. A signature device based on managed key authorization, characterized in that: The device is applied to a escrow key signature system, wherein the escrow key signature system includes a hardware cryptographic module, and the device includes: An acquisition module, configured to acquire key application information sent by a user terminal, wherein the key application information includes key algorithm information, user contact information, and a first PIN code; a calculation module, configured to calculate a digest value of the first PIN code and save the digest value of the first PIN code; a generation module, configured to call the hardware cryptographic module to generate a public-private key pair and assign a key identifier to the public-private key pair, wherein the public-private key pair includes a private key ciphertext and a public key plaintext, and the private key ciphertext is encrypted by a protection key in the hardware cryptographic module; A construction module, configured to construct a first encryption key according to the first PIN code and the key identifier; an encryption module, configured to encrypt the private key ciphertext according to the first encryption key and key algorithm information, and obtain an escrow key; A storage module, configured to store the escrow key, the key identifier, the public key plaintext, the user contact information, and the digest value of the first PIN code in an escrow key library; Furthermore, after storing the escrow key, the key identifier, the public key plaintext, the user contact information, and the digest value of the first PIN code in the escrow key library, the apparatus is further configured to: Receive a signature authorization request sent by a user terminal and return signature authorization data to the user terminal; Receiving a data signature application sent by the user terminal, the data signature application including: a key identifier to be applied for, a digest of the data to be signed, and the signature authorization data; Verifying the signature authorization data and the digest of the data to be signed; When the signature authorization data and the digest of the data to be signed are verified successfully, obtaining a pre-cached third PIN code; decrypting the third PIN code according to the first encryption key of the hardware cryptographic module to obtain a plaintext PIN code; Constructing a second encryption key based on the plaintext PIN code and the key identifier to be applied for; Decrypting the pre-stored escrow key according to the second encryption key to obtain a private key ciphertext; Sign the data digest to be signed according to the private key ciphertext, and return the signature result to the user terminal; And, the receiving the signature authorization application sent by the user terminal and returning the signature authorization data to the user terminal includes: Receive the signature authorization application sent by the user terminal, wherein the signature authorization application includes the key identifier to be applied for, the OTP code, the digest of the data to be signed, and the second PIN code; Verifying the second PIN code and the OTP code; When the second PIN code and the OTP code are verified, the second PIN code is encrypted according to the protection key of the hardware password module to obtain a third PIN code; Construct signature authorization data according to the key identifier to be applied for, the digest of the data to be signed, the current time of the first system, and the protection key of the hardware cryptographic module; Return the signature authorization data to the user terminal.
7. A signature system based on managed key authorization, characterized in that: The system includes a managed key repository and a managed key authorization signature device, wherein the managed key authorization signature device includes a hardware encryption module, the hardware encryption module is communicatively connected to the managed key repository, and the managed key authorization signature system is used to execute the managed key authorization signature method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program is executed by a processor to implement the method for authorizing signature based on a managed key according to any one of claims 1 to 5.
Citation Information
Patent Citations
Password-based user signature private key management method
CN110943976A