Public key password management method, system and device, electronic equipment and storage medium

By storing only the root key seed in the SIM card or terminal and deriving the private key on demand for cryptographic operations, the problems of limited SIM card storage space and difficult key management are solved, achieving efficient and secure key management.

CN121815221APending Publication Date: 2026-04-07CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

SIM cards have limited storage space and cannot store a large number of keys. Furthermore, traditional blockchain digital wallets assign a uniform and standardized path to each blockchain, making key management difficult in digital identity scenarios.

Method used

The method of locally storing the root key seed, obtaining key parameters during operation, and dynamically deriving keys is adopted. The cryptographic module only stores the root key seed, generates private keys temporarily as needed for cryptographic operations, and derives the corresponding private keys through key parameters and root key seed.

Benefits of technology

It reduces the storage cost of cryptographic modules, improves the key management efficiency in digital identity scenarios, enables dynamic key generation and secure backup, and solves the problems of storage limitations and key management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121815221A_ABST
    Figure CN121815221A_ABST
Patent Text Reader

Abstract

The invention relates to the field of network security, and provides a public key password management method, system and device, electronic equipment and a storage medium, the method is applied to a password module, and the password module is arranged on a user side and integrated in an SIM card or a terminal; the method comprises the following steps: receiving a key parameter sent by an application; based on the key parameter and a locally stored root key seed, recovering to obtain a private key, and performing cryptographic operation by using the private key; the root key seed is a pre-generated fixed random number used for generating a key pair; and returning an operation result to the application and deleting the private key corresponding to the key parameter under the condition that the password operation is completed. According to the public key password management method provided by the invention, the password module does not need to store the key, the cost of the password module is reduced, and the key management efficiency of a digital identity scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network security, and in particular to a public key cryptography management method, system and device, electronic equipment and a storage medium. BACKGROUND

[0002] At present, distributed digital identity adopts public key cryptography technology for identity authentication and identity recognition, and the security of user private keys is the basis of the distributed digital identity system. Once the user private key is leaked, it can cause serious consequences such as identity forgery, so the user private key is generally stored in a secure manner. The operator has Subscriber Identity Module (SIM) card and mobile phone number resources, which can be naturally used for distributed digital identity system. The SIM card has a large storage capacity, supports public and private key cryptography algorithms, and has a very high security level, and can be used as a physical digital wallet.

[0003] The traditional blockchain digital wallet allocates a unified standardized path (identifier) for each blockchain, and generates the corresponding key according to the standardized path corresponding to the blockchain when the user applies for the key. The SIM card has a high security level and supports public and private key algorithms, and can be used as a physical digital wallet. The private key of the user entity is stored in the SIM card, and all operations involving the private key are performed in the SIM card to ensure the security of the user identity. However, due to the limitation of storage space, it cannot store too much data. In addition, the user may have more digital identities, and each digital identity needs a corresponding key. The traditional blockchain digital wallet allocates a unified standardized path for each blockchain, and generates the corresponding key according to the standardized path corresponding to the blockchain when the user applies for the key. However, for digital identity, it is difficult to form a unified standardized path for each type of identity, resulting in difficulty in key management in the digital identity scenario.

[0004] Therefore, there is an urgent need to provide an effective technical solution to solve the above problems. SUMMARY

[0005] In view of the above deficiencies in the prior art, the embodiments of the present application provide a public key cryptography management method, system, device, electronic equipment and storage medium, which adopts the mode of "local storage of root key seed + obtaining key parameters during operation + dynamic derivation of key", without the need for the password module to store the key, thereby reducing the cost of the password module and improving the key management efficiency in the digital identity scenario.

[0006] In a first aspect, the embodiments of the present application provide a public key cryptography management method, which is applied to a password module in a public key cryptography management system, the password module is arranged on the user side and integrated in a Subscriber Identity Module (SIM) card or a terminal; the method comprises: receiving a key parameter sent by an application; the key parameter comprises at least a first key identifier; the cryptographic operation comprises at least one of digital signature, signature verification, encryption and decryption; based on the key parameter and a locally stored root key seed, restoring a private key corresponding to the key parameter and performing the cryptographic operation using the private key corresponding to the key parameter; the root key seed is a fixed random number pre-generated for generating a key pair; in a case where the cryptographic operation is completed, returning an operation result to the application and deleting the private key corresponding to the key parameter.

[0007] In one embodiment, the public key cryptographic management system further comprises a cryptographic management module integrated in the SIM card or the terminal. The receiving of the key parameter sent by the application comprises: receiving the key parameter forwarded by the cryptographic management module; the key parameter is obtained by the cryptographic management module from a request for performing a cryptographic operation using a private key from the application, and then forwarded to the cryptographic module.

[0008] In one embodiment, the method further comprises a process of generating a key pair, comprising: receiving a key pair generation request sent by the cryptographic management module; the key pair generation request is sent by the application to the cryptographic management module; the key pair generation request comprises at least a second key identifier; based on the root key seed and the second key identifier, deriving a private key corresponding to the key pair generation request and a public key corresponding to the key pair generation request; sending the public key corresponding to the key pair generation request to the cryptographic management module, so that the cryptographic management module returns the public key corresponding to the key pair generation request to the application.

[0009] In one embodiment, the deriving of the private key corresponding to the key pair generation request and the public key corresponding to the key pair generation request based on the root key seed and the second key identifier comprises: based on the root key seed, the second key identifier and a first random number, deriving the private key corresponding to the key pair generation request and the public key corresponding to the key pair generation request; the first random number is generated by the cryptographic module, or generated by the application and carried in the key pair generation request; The sending of the public key corresponding to the key pair generation request to the cryptographic management module, so that the cryptographic management module returns the public key corresponding to the key pair generation request to the application, comprises: sending the public key corresponding to the key pair generation request and the first random number to the password management module, so that the password management module returns the public key corresponding to the key pair generation request and the first random number to the application.

[0010] In one embodiment, the method further comprises: receiving a signature request forwarded by the password management module; the signature request is forwarded to the password module by the password management module after receiving the signature request sent by the application; the signature request includes an unsigned identity document, an identity identifier, a public key, a key identifier, a key algorithm, and a signature algorithm; calling a private key corresponding to the public key in the signature request and the signature algorithm to sign the unsigned identity document; returning the signature result to the password management module, so that the password management module returns the signature result to the application, and deletes the private key corresponding to the public key in the signature request; the signature result is used by the application to publish the signed identity document to a blockchain or a public storage system.

[0011] In one embodiment, the public key password management system further comprises at least one key storage system deployed on the network side; the method further comprises: sending the root key seed to the first key storage system for backup; or, sending the root key seed to the second key storage system for backup, and sending a second random number to the third key storage system for backup, the second random number being generated by the password module during the key pair generation process and provided to the application, and backed up to the third key storage system by the application.

[0012] In one embodiment, the method further comprises: receiving the recovered root key seed sent by the password management module and storing it; the recovered root key seed is returned by the first key storage system in response to the root key recovery request sent by the password management module to the first key storage system after the application triggers the root key recovery; receiving the first key pair generation request sent by the password management module, the first key pair generation request containing at least a third key identifier; the first key pair generation request is generated by the application based on the third key identifier queried from a blockchain or a key server, and then sent to the password management module; generating a key pair corresponding to the first key pair generation request based on the recovered root key seed and the third key identifier; send the public key in the key pair corresponding to the first key pair generation request to the password management module, for the password management module to return the public key in the key pair corresponding to the first key pair generation request to the application.

[0013] In one embodiment, the method further comprises: receiving a second key pair generation request sent by the password management module; wherein the second key pair generation request comprises a fourth key identifier, a recovered root key seed, and the second random number; the fourth key identifier is sent by the application to the password management module based on a query to a blockchain or a key server; the recovered root key seed is obtained by the password management module from the second key storage system in response to the application triggering root key recovery and sending a cooperative root key recovery request to the second key storage system; and the second random number is obtained by the password management module from the third key storage system in response to the application triggering root key recovery and sending the cooperative root key recovery request to the third key storage system; generating a key pair corresponding to the second key pair generation request based on the recovered root key seed, the second random number, and the fourth key identifier; sending the public key in the key pair corresponding to the second key pair generation request to the password management module, for the password management module to return the public key in the key pair corresponding to the second key pair generation request to the application.

[0014] In a second aspect, the embodiments of the present application provide a public key password management system, which comprises a password module, a password management module, and an application, the password module is arranged on a user side and integrated in a SIM card or a terminal, the password management module is integrated in the SIM card or the terminal; The application is configured to send a request for password operation using a private key to the password management module, the request for password operation using a private key comprises a key parameter, and the password operation comprises at least one of digital signature, signature verification, encryption, and decryption. The password management module is configured to forward the key parameter to the password module in response to the request for password operation using a private key, and the key parameter at least comprises a first key identifier. The password module is configured to recover the private key corresponding to the key parameter based on the key parameter and a locally stored root key seed in response to the request for password operation using a private key, and perform the password operation using the private key corresponding to the key parameter, the root key seed is a fixed random number generated in advance for generating a key pair, and in the case of completing the password operation, the operation result is returned to the application and the private key corresponding to the key parameter is deleted.

[0015] In a third aspect, an embodiment of the present application provides a public key cryptography management device, which is applied to a cryptography module in a public key cryptography management system, the cryptography module being arranged at a user side and integrated into a SIM card or a terminal; the device comprises: a receiving module, configured to receive a key parameter sent by an application; the key parameter at least comprises a first key identifier; the cryptographic operation comprises at least one of digital signature, signature verification, encryption and decryption; a public key cryptography management module, configured to restore the private key corresponding to the key parameter based on the key parameter and a locally stored root key seed, and perform the cryptographic operation using the private key corresponding to the key parameter; the root key seed is a fixed random number pre-generated for generating a key pair; in the case where the cryptographic operation is completed, the operation result is returned to the application and the private key corresponding to the key parameter is deleted.

[0016] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, the processor implementing the steps of the public key cryptography management method of the first aspect or the second aspect when executing the program.

[0017] In a fifth aspect, an embodiment of the present application provides a non-transitory computer readable storage medium, which stores a computer program, the computer program implementing the steps of the public key cryptography management method of the first aspect or the second aspect when executed by a processor.

[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, the computer program implementing the steps of the public key cryptography management method of the first aspect or the second aspect when executed by a processor.

[0019] The public key cryptography management method, system, device, electronic device and storage medium provided by the embodiments of the present application, the method being applied to a cryptography module in a public key cryptography management system, the cryptography module being arranged at a user side and integrated into a SIM card or a terminal; the method comprises: receiving a key parameter sent by an application; the key parameter at least comprises a first key identifier, the cryptographic operation comprising at least one of digital signature, signature verification, encryption and decryption; then, restoring the private key corresponding to the key parameter based on the key parameter and a locally stored root key seed, and performing the cryptographic operation using the private key corresponding to the key parameter; the root key seed being a fixed random number pre-generated for generating a key pair; further, in the case where the cryptographic operation is completed, returning the operation result to the application and deleting the private key corresponding to the key parameter.

[0020] The password module in the application only stores a root key seed, does not store a private key, and the root key seed is a fixed random number generated in advance for generating a key pair. When a private key is needed for a password operation, the private key is derived according to a key parameter sent by an application and a locally stored root key seed and the password operation is performed, that is, the private key only exists during calculation and is deleted immediately after use. The application adopts the mode of “locally storing a root key seed + obtaining a key parameter during operation + dynamically deriving a key”, does not need the password module to store a key, reduces the cost of the password module, and improves the key management efficiency of a digital identity scene. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0022] Figure 1 is a flowchart of a public key password management method provided by an embodiment of the application.

[0023] Figure 2 is a timing flowchart of a private key signature method provided by an embodiment of the application.

[0024] Figure 3 is one of the method flowcharts of generating a key pair provided by an embodiment of the application.

[0025] Figure 4 is the second method flowchart of generating a key pair provided by an embodiment of the application.

[0026] Figure 5 is the third method flowchart of generating a key pair provided by an embodiment of the application.

[0027] Figure 6 is a flowchart of a method for generating an identity document provided by an embodiment of the application.

[0028] Figure 7 is one of the timing flowcharts of a root key seed recovery method provided by an embodiment of the application.

[0029] Figure 8 is the second timing flowchart of a root key seed recovery method provided by an embodiment of the application.

[0030] Figure 9 is a timing flowchart of a public key password management system provided by an embodiment of the application.

[0031] Figure 10FIG. 1 is a structural schematic diagram of a public key cryptography management device provided by an embodiment of the present application.

[0032] Figure 11 FIG. 2 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0034] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second" are generally a category and do not limit the number of objects, for example, the first node can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects before and after.

[0035] In order to more clearly understand the embodiments provided by the present application, first, the technical background related by the present application is introduced as follows: The prior art has the following problems: 1. The Subscriber Identity Module (SIM) card storage space is limited and cannot store a large number of keys.

[0036] 2. In the digital identity scenario, it is impossible to establish a standardized path for each type of identity, resulting in difficult key management.

[0037] The traditional scheme needs to store all private keys in the password module, which is high in cost and poor in scalability.

[0038] Based on the above deficiencies, the embodiments of the present application provide a public key cryptography management method, system, device, equipment and storage medium.

[0039] Figure 1 FIG. 1 is a structural schematic diagram of a public key cryptography management device provided by an embodiment of the present application. Figure 1The embodiment of the application provides a public key cryptography management method, which is applied to a cryptography module in a public key cryptography management system, the cryptography module is arranged on a user side and integrated into a user identification module (SIM) card or a terminal, and the method can comprise the following steps: In step 101, a key parameter sent by an application is received, and the key parameter at least comprises a first key identifier; and the cryptography operation comprises at least one of digital signature, signature verification, encryption and decryption.

[0040] Specifically, the execution subject of the embodiment is a cryptography module on the user side, and the cryptography module is integrated into a user identification module (SIM) card or a terminal. The public key cryptography management system comprises the cryptography module and a key storage system, and the key storage system is arranged on a network side.

[0041] The cryptography module is used for storing a root key seed and performing cryptography operation by using the root key seed (fixed random number) and the key parameter acquired from the application. In the embodiment of the application, the cryptography module only stores the root key seed, does not need to store a private key, and generates the private key temporarily on demand, so that the application range is wide and the versatility is strong.

[0042] In actual application, when the application needs to perform cryptography operation by using the private key, the key parameter sent by the application is received. The key parameter at least comprises a first key identifier Kid_n.

[0043] The cryptography operation comprises at least one of digital signature, signature verification, encryption and decryption. The four types of cryptography operation are core operations of public key cryptography (or asymmetric cryptography), and they jointly build the cornerstone of network security.

[0044] Digital signature is a technology for verifying the authenticity of information source and the integrity of content, and simultaneously providing non-repudiation. The signer performs operation by using a private key. In actual application, for example, a piece of information (such as a file or transaction data) is calculated to generate a unique, short and small "signature value". The signature value is like a combination of "personal seal" and "information fingerprint".

[0045] Signature verification is a matching verification process of digital signature. Any receiver performs operation by using the public key of the signer. The receiver obtains the original information and the attached "signature value", and performs specific calculation by using the public key of the signer. Two key problems are mainly verified: 1) whether the signature is generated by using the corresponding private key (verify the source); and 2) whether the original information is consistent with the signature (verify the integrity). If the signature verification is passed, the receiver can trust the information.

[0046] Encryption is a technique that converts plaintext information into unreadable ciphertext to protect confidentiality. The sender uses the public key of the receiver to perform the operation. The original information is "locked" with the receiver's public key, and a piece of ciphertext is output. After encryption, only the intended recipient can see the original content. Even if the ciphertext is intercepted during transmission, it cannot be decrypted without the receiver's private key. For example, user A can use the public key in user B's identity document to encrypt a private message that only B can read.

[0047] Decryption is the inverse process of encryption, which is used to restore the original information. The receiver uses its own private key to perform the operation (the receiver uses its own private key to "unlock" the received ciphertext and restore the original plaintext). In practical applications, when a user receives a message encrypted with their own public key, they can decrypt it using their own private key through the password module. The same security principle of "restoring private key on demand and deleting after use" is followed.

[0048] Step 102, based on the key parameter and the locally stored root key seed, the private key corresponding to the key parameter is restored and the password operation is performed using the private key corresponding to the key parameter; the root key seed is a fixed random number generated in advance for generating a key pair.

[0049] Specifically, after obtaining the key parameter, the password module uses the locally stored root key seed P0 and the obtained key parameter (such as the first key identifier Kid_n, the key algorithm, and the password operation identifier such as the signature algorithm identifier) to calculate the private key corresponding to the key parameter.

[0050] In practical applications, the root key seed can be a fixed random number P0. In the system initialization phase, the password module generates a random number P0 and stores it locally in secret, which is used as the root key seed. This random number is backed up by the password module in the cloud, for example, on the operator's key server. If the password module needs to be replaced, the new password module can restore P0 from the key server. The specific restoration method is not described in this patent. In particular, this random number can be replaced by the SIM root key K.

[0051] For example, the password module selects an algorithm KDFn corresponding to the key algorithm identifier to calculate the public and private key pair: (SKn, PKn) = KDFn(P0,Kid_n) Where SKn is the private key corresponding to the key parameter, PKn is the public key corresponding to the key parameter, KDFn is the algorithm identifier, P0 is the root key seed, and Kid_n is the first key identifier.

[0052] Then, the cryptographic module cryptographic operation algorithm (for example, a signature algorithm) performs a cryptographic operation (signs the to-be-signed information) using the private key SKn to obtain an operation result (for example, a signature result), for example, a signed document, signed transaction information, or the like.

[0053] In a case where the cryptographic operation is completed, the operation result is returned to the application, and the private key corresponding to the key parameter is deleted.

[0054] Specifically, in a case where the cryptographic operation is completed, the operation result is returned to the application, and the private key is immediately deleted. In each time when the private key is needed for signature and other cryptographic calculation, the key storage system sends a key parameter, and the private key is restored for calculation in combination with the root key seed. The advantage is that the cryptographic module does not need to store the key, and the cost of the cryptographic module is reduced.

[0055] The method provided in the embodiment is applied to a cryptographic module in a public key cryptographic management system. The cryptographic module is arranged on a user side and integrated in a SIM card or a terminal. The method comprises the following steps: receiving a key parameter sent by an application; the key parameter at least comprises a first key identifier, and the cryptographic operation comprises at least one of digital signature, signature verification, encryption, and decryption; then, based on the key parameter and a locally stored root key seed, a private key corresponding to the key parameter is restored, and the cryptographic operation is performed using the private key corresponding to the key parameter; the root key seed is a fixed random number generated in advance for generating a key pair; and further, in a case where the cryptographic operation is completed, an operation result is returned to the application, and the private key corresponding to the key parameter is deleted.

[0056] In the application, the cryptographic module only stores the root key seed and does not store the private key. The root key seed is a fixed random number generated in advance for generating a key pair. When the private key is needed for the cryptographic operation, the private key is derived based on the key parameter sent by the application and the locally stored root key seed, and the cryptographic operation is performed. That is, the private key exists only during the calculation, and is immediately deleted after being used. The application adopts the mode of “locally storing the root key seed + obtaining the key parameter during the operation + dynamically deriving the key”, does not need the cryptographic module to store the key, reduces the cost of the cryptographic module, and improves the key management efficiency in the digital identity scenario.

[0057] It should be noted that each embodiment of the application can be freely combined, the order can be changed, or each embodiment can be executed independently, and does not need to rely on or depend on a fixed execution order.

[0058] In one embodiment, the public key cryptographic management system further comprises a cryptographic management module, and the cryptographic management module is integrated in the SIM card or the terminal. The key parameter sent by the application comprises: The key parameter is forwarded by the password management module in response to a request for a password operation using the private key from the application.

[0059] In particular, in some embodiments, the public key password management system further comprises a password management module integrated in the SIM card or the terminal, i.e., integrated in the SIM card or the terminal together with the password module. The password module receives the key parameter or returns the operation result through the password management module, and the password module only stores the root key seed. Each application corresponds to an application key seed. Each time a key is needed or a key is used, the password module derives the application key according to the key parameter (such as the application key seed) and the root key seed.

[0060] The key parameter is received by the application, including: receiving the key parameter forwarded by the password management module.

[0061] That is, the password management module obtains the key parameter from the application in response to a request for a password operation using the private key from the application.

[0062] Then, the password module forwards the key parameter to the password module after receiving the key parameter, and the password module accepts the key parameter.

[0063] Exemplarily, Figure 2 is a timing flow diagram of the private key signature method provided by the application, as Figure 2 shown, the method comprises: The application sends a signature request to the password management module, the signature request comprising to-be-signed information, a key identifier Kid_n, a key algorithm, a signature algorithm, and a random number nonce_n. The password management module sends the signature request to the password module. The password module calculates a private key, signs using the private key to obtain a signature result, and sends the signature result to the password management module. The password management module sends the signature result to the application.

[0064] The method provided in this embodiment is that the application forwards the key parameter obtained from the key storage system to the password management module, and the password module sends the key parameter to the password module for private key calculation and password operation using the private key. Since the password module only stores the root key seed and does not need to store the private key, the private key is generated temporarily on demand, so the application range is wide and the versatility is strong.

[0065] In one embodiment, the method further comprises a process of generating a key pair, comprising: The application receives a key pair generation request sent by the password management module; the key pair generation request is sent by the application to the password management module; and the key pair generation request at least comprises a second key identifier. derives a private key corresponding to the key pair generation request and a public key corresponding to the key pair generation request based on the root key seed and the second key identifier; sends the public key corresponding to the key pair generation request to the password management module, so that the password management module returns the public key corresponding to the key pair generation request to the application.

[0066] Specifically, the method for generating a key pair in the method for generating a key pair adopts mode one: the business / application key seed is not split, and the key pair can be recovered by the password module alone, and the process of generating a key pair includes the following steps: First, the password module receives the key pair generation request sent by the password management module. The key pair generation request includes a second key identifier Kid_n and an algorithm identifier, and the key pair generation request is sent to the password management module after being generated by the application, and the password management module forwards it to the password module. In this mode, the application stores the second key identifier Kid_n, and backs up the key. The key identifier can be stored in a key server or publicly stored, such as a blockchain. Figure 3 is one of the method flowcharts for generating a key pair provided by the embodiments of the application, as shown in Figure 3 The application generates a key identifier (second key identifier), the application sends a key pair generation request to the password management module, and the password management module forwards the received key pair generation request to the password module.

[0067] Further, the password module derives a private key corresponding to the key pair generation request and a public key corresponding to the key pair generation request based on the root key seed and the second key identifier. For example, the password module calculates the private key and the public key corresponding to the key pair generation request by the following formula: (SKn,PKn) = KDFn(P0,Kid_n) Where SKn is the private key corresponding to the key pair generation request, PKn is the public key corresponding to the key pair generation request, KDFn is the algorithm corresponding to the algorithm identifier in the key pair generation request, P0 is the root key seed, and Kid_n is the second key identifier.

[0068] As shown in Figure 3 The password module receives the key pair generation request, generates the key pair, and then returns the public key corresponding to the key pair generation request to the password management module, so that the password management module returns to the application.

[0069] The method provided by the embodiment realizes the following technical effects: (1) on-demand dynamic generation, breaking through the physical storage limit: the cryptographic module does not need to store all possible private keys in advance, but only generates the private keys temporarily on receiving the request. This fundamentally solves the contradiction between the limited storage capacity of the hardware security module (such as a SIM card) and the large number of user digital identities. (2) ensuring the determinacy and reproducibility of the keys, supporting reliable backup and migration: the same combination of the "root key seed + key identifier" generates the same key pair through the same key derivation function (KDF). This makes it possible to backup, restore and synchronize the keys across devices. (3) realizing the logical isolation of the keys and the separation of the security domains: different key identifiers are allocated to different applications, services or identities, so that completely independent key pairs can be derived. Even if one private key is leaked, it will not affect other identities or services, because the root key seed is not directly exposed. (4) improving the generation and use security of the private keys: the entire life cycle (generation, use and destruction) of the private keys is completed within the security boundary of the cryptographic module. The private keys never leave the secure hardware in plaintext form (unless actively backed up), which greatly reduces the risk of interception by malicious software. The present application effectively solves a series of problems such as storage limit, key isolation, migration backup and decentralized management through the deterministic derivation model of "root key seed + identifier", ensures the highest security of cryptography, and provides a basic and key key management capability for large-scale, multi-scene distributed digital identity applications.

[0070] In one embodiment, the private key corresponding to the generation key pair request and the public key corresponding to the generation key pair request are derived based on the root key seed and the second key identifier, and the derivation includes: The private key corresponding to the generation key pair request and the public key corresponding to the generation key pair request are derived based on the root key seed, the second key identifier and the first random number; the first random number is generated by the cryptographic module or generated by the application and carried in the generation key pair request; The public key corresponding to the generation key pair request is sent to the password management module, so that the password management module returns the public key corresponding to the generation key pair request to the application, and the derivation includes: The public key corresponding to the generation key pair request and the first random number are sent to the password management module, so that the password management module returns the public key corresponding to the generation key pair request and the first random number to the application.

[0071] Specifically, in some embodiments, the process of generating a key pair includes the following steps: The password module derives the private key corresponding to the generation key pair request and the public key corresponding to the generation key pair request based on the root key seed, the second key identifier, and the first random number. The public key corresponding to the generation key pair request and the first random number are sent to the password management module, so that the password management module returns the public key corresponding to the generation key pair request and the first random number to the application. In this method, the random number is introduced, and compared with mode one, the key identifier can use characters that are easy to understand, and the security can be improved by adding the random number. The key identifier can be stored in the key server or publicly stored, for example, in a blockchain. The first random number nonce_n is stored in the key server.

[0072] The first random number can be generated by the password module or generated by the application and carried in the generation key pair request, corresponding to two different key pair generation modes (mode two and mode three): Mode two: business / application key seed segmentation, both parties jointly restore the key pair; the SIM participates in seed generation, and the first random number can be generated by the password module. Exemplarily, Figure 4 is a second generation key pair method flowchart provided by the embodiment of the application, as Figure 4 shown, the method comprises: 1. The business application generates a key identifier (second key identifier Kid_n), and sends a generation key pair request to the password management module, wherein the request carries an algorithm identifier and a key identifier (second key identifier Kid_n).

[0073] 2. The password management module sends a generation key pair request to the password module, wherein the request carries an algorithm identifier and a key identifier.

[0074] 3. The password module generates a (first) random number (nonce_n), wherein the random number nonce_n is a business / application key seed. The key pair is generated, an algorithm KDFn corresponding to the algorithm identifier is selected, and the following calculation is performed: (SKn, PKn) = KDFn(P0, Kid_n, nonce_n) Wherein, SKn is the private key corresponding to the generation key pair request, PKn is the public key corresponding to the generation key pair request, KDFn is the algorithm corresponding to the algorithm identifier in the generation key pair request, P0 is the root key seed, Kid_n is the second key identifier, and n, nonce_n is the first random number.

[0075] 4. The password module secretly stores the private key SKn (SKn is stored as optional), and returns the public key PKn, Kid_n, and the (first) random number nonce_n to the password management module.

[0076] 5. The password management module returns the public key PKn, Kid_n, and the (first) random number nonce_n to the application.

[0077] Method three (service / application key seed splitting, both parties jointly restore key pair; SIM card does not participate in seed generation): Exemplarily, Figure 5 is a third method flow diagram for generating a key pair provided by the embodiments of the present application, as Figure 5 shown, the method comprises: 1. The service application generates a key identifier (second key identifier Kid_n), generates a (first) random number nonce_n, and sends a key pair generation request to the password management module. The key pair generation request carries the algorithm identifier, the key identifier (second key identifier) Kid_n and the (first) random number nonce_n.

[0078] The key identifier can be stored in the key server, or publicly stored, for example, in a blockchain. The nonce_n is stored in the key server.

[0079] 2. The password management module sends a key pair generation request to the password module, which carries the algorithm identifier, the key identifier (second key identifier) Kid_n and the (first) random number nonce_n.

[0080] 3. The password module selects an algorithm KDFn corresponding to the algorithm identifier to generate a key pair, as follows: (SKn, PKn) = KDFn(P0,Kid_n,nonce_n) Wherein, SKn is the private key corresponding to the key pair generation request, PKn is the public key corresponding to the key pair generation request, KDFn is the algorithm corresponding to the algorithm identifier in the key pair generation request, P0 is the root key seed, Kid_n is the second key identifier, n, nonce_n is the first random number.

[0081] 4. The password module secretly stores the private key SKn (SKn is stored as optional), and returns the public key PKn, Kid_n and the (first) random number nonce_n to the password management module. The nonce_n is the service / application key seed.

[0082] 5. The password management module returns the public key PKn to the application.

[0083] This method stores the random number nonce_n by the application, and backs up the key. Both parties jointly participate to restore the key pair. Compared with method one, the key identifier can use characters that are easy to understand, and the random number can improve security. Compared with method two, the password module does not participate in the random number generation process and is not responsible for the randomness of the random number.

[0084] Compared with the first mode, the third mode can use easy-to-understand characters for key identification, and increase the random number to improve security. Compared with the second mode, the third mode does not involve the password module in the random number generation process, and is not responsible for the randomness of the random number.

[0085] In one embodiment, the method further comprises: receiving a signature request forwarded by the password management module; the signature request is forwarded to the password module by the password management module after receiving the signature request sent by the application; the signature request includes: an unsigned identity document, an identity identifier, a public key, a key identifier, a key algorithm, and a signature algorithm; calling the private key corresponding to the public key in the signature request and the signature algorithm to sign the unsigned identity document; returning the signature result to the password management module, so that the password management module returns the signature result to the application, and deleting the private key corresponding to the public key in the signature request; the signature result is used by the application to publish the signed identity document to the blockchain or the public storage system.

[0086] Specifically, the method further comprises generating a signed identity document, and the process is as follows: First, receiving a signature request forwarded by the password management module. The signature request is forwarded to the password module by the password management module after receiving the signature request sent by the application; the signature request includes: an unsigned identity document, an identity identifier, a public key, a key identifier, a key algorithm, and a signature algorithm. The identity identifier is an identity identifier generated by the application to represent the application, and the unsigned identity document is a document that needs to be signed.

[0087] Figure 6 is a flowchart of the method for generating an identity document provided by the embodiments of the present application, referring to Figure 6 The method comprises: The application generates an identity identifier and an identity document to be signed, which includes an identity identifier, a public key PKn, a key identifier Kid_n, and a key algorithm.

[0088] The application sends the identity document to be signed to the password management module for signature. The signature request includes the identity document to be signed, that is, the application sends a signature request to the password management module.

[0089] The password management module sends the signature request to the password module.

[0090] Further, the password module calls the private key corresponding to the public key in the signature request and the signature algorithm to sign the unsigned identity document, referring to Figure 6As shown, the method includes: the cryptographic module performing signing (see the signing process in the cryptographic operation for details); the cryptographic module returning the signing result to the cryptographic management module, the cryptographic management module returning the signing result to the application, and deleting the private key corresponding to the public key in the signing request.

[0091] Further, the application publishes the signed identity document to a blockchain or a public storage system, i.e., publishes the identity document, and realizes public storage of the key identifier Kid_n.

[0092] The method provided in this embodiment realizes "use and destroy" of the private key, as the private key is only within the secure boundary of the cryptographic module, is dynamically recovered for performing the specific signing task, and is deleted immediately after signing is completed. The generated signed identity document is a complete and self-verifiable data structure, which contains an identity identifier, a public key, a key identifier, an algorithm, and a signature value, and can be directly published to a public system such as a blockchain. In this application, the identity document signing process takes the hardware security module as the trust root, and through a set of clear rights and responsibilities and strictly defined boundaries, a distributed digital identity credential with the characteristics of "self-contained, verifiable, tamper-resistant, and anti-repudiation" is safely and efficiently produced. It not only protects the core asset of the private key, but also outputs a trusted identity declaration, which is a key bridge connecting the underlying key management system and the upper distributed identity application.

[0093] In one embodiment, the public key cryptographic management system further includes at least one key storage system, and the key storage system is deployed on the network side. The method further includes: sending the root key seed to the first key storage system for backup; or, sending the root key seed to the second key storage system for backup, and sending the second random number to the third key storage system for backup, the second random number being generated by the cryptographic module during the key pair generation process and provided to the application, and being backed up to the third key storage system by the application.

[0094] Specifically, in some embodiments, the public key cryptographic management system further includes at least one key storage system, and the key storage system is deployed on the network side. The key storage system is used to store parameters related to the key, such as a key identifier.

[0095] The method further includes backup and recovery of the root key seed, and the backup of the root key seed can be realized in the following two ways: Method one (key seed is not split): The root key seed P0 is sent to the first key storage system (such as a key server) for backup. For example, a complete backup session includes steps one to four: Step one: session initialization and mutual authentication 1. The key management module receives a backup instruction from the application and initiates a "prepare backup" command to the password module.

[0096] 2. The password module establishes a secure communication channel with the key server, for example, based on the Transport Layer Security (TLS) or Datagram Transport Layer Security (DTLS) protocol. In this process: the key server presents its server certificate; the password module uses a pre-installed client certificate or performs client authentication through a pre-shared key method; both parties complete mutual authentication and negotiate a temporary session key for this session.

[0097] Step 2: Backup request and key protection 3. After authentication, the password module performs: a. Read the securely stored root key seed P0.

[0098] b. Generate a random number as the data encryption key for this backup.

[0099] c. Encrypt P0 using the data encryption key, for example, using the AES-GCM algorithm, while obtaining an integrity verification tag.

[0100] d. Encrypt the data encryption key using a shared secret or the server's public key. This ensures that only the target server can decrypt the key.

[0101] e. Assemble the backup data packet, including: encrypted P0, encrypted data encryption key, password module ID, timestamp, algorithm identifier, and digital signature generated by the password module private key (for anti-repudiation).

[0102] 4. The password module sends the backup data packet to the key server through a secure channel.

[0103] Step 3: Server processing and secure storage 5. After receiving the data packet, the key server: a. Verify the password module's digital signature to confirm that the request is legitimate and the data has not been tampered with.

[0104] b. Decrypt the data encryption key using its own private key or shared secret.

[0105] c. Decrypt and verify the original root key seed P0 using the data encryption key.

[0106] d. The P0 is strongly associated with the corresponding password module ID, encrypted using the server's own high-security level key, and stored in a secure database. Redundant backup is usually performed when storing.

[0107] e. The backup operation is recorded in the server audit log (module ID, time, operator, etc.).

[0108] 6. The key server returns a backup success receipt to the password module, which is also signed for verification by the password module.

[0109] Step four: local confirmation and cleanup 7. The password module verifies the server's success receipt.

[0110] 8. According to the security policy, the password module can choose to locally delete or retain P0. However, the temporary data encryption key used for this transmission is immediately cleared from memory.

[0111] Method two (key seed splitting) The password module sends the root key seed P0 to the second key storage system (such as key server 1) for backup, and sends the second random number nonce_n to the third key storage system (such as key server 2) for backup. The second random number is generated by the password module during the key pair generation process and provided to the application, and backed up to the third key storage system (such as key server 2) by the application. That is, in one key generation process, the password module generates the second random number nonce_n and returns it to the application along with the public key PKn, which is backed up to the third key storage system (such as key server 2) by the application. By way of example, the process of implementing the backup mechanism by method two is implemented through the following two stages: First stage: backup trigger and preparation 1. Trigger backup strategy: The key management module or a dedicated backup coordination service automatically triggers the collaborative backup process upon detecting the successful generation of a new key pair (i.e., receiving the public key PKn and nonce_n). Or the application initiates a backup request to the key management module upon receiving PKn and nonce_n.

[0112] 2. Generate association identifier: To prevent confusion between the two backup data in future recovery, a globally unique backup session ID needs to be generated or the key identifier Kid_n is directly used as the association identifier. This association identifier will be used in both P0 and nonce_n backup data packets as a key for server-side association indexing.

[0113] Second stage: Root key seed P0 backup path (password module to key server 1) This path is similar to single-seed backup, but the association identifier is included, and the specific secure channel establishment, data packaging and protection process is similar, which is not described here. The password module sends the P0 backup data packet to the key server 1 through the established secure channel 1. The key server 1 verifies the signature, decrypts and securely stores P0, and stores P0 in the database with the association identifier and the password module ID.

[0114] Third stage: second random number nonce_n backup path (applied to key server 2) This path is applied as the execution subject, and the second random number nonce_n is the sensitive parameter, and its transmission must also be kept secret.

[0115] 1. Establish secure channel 2: The application (or client software representing the application) establishes a secure channel 2 with the key server 2. The authentication of the application can be based on user identity tokens, application certificates, etc.

[0116] 2. Second random number nonce_n data packaging and protection: The application executes: a. Obtain the second random number nonce_n that needs to be backed up.

[0117] b. Generate a temporary data encryption key K_data2.

[0118] c. Encrypt the second random number nonce_n using K_data2.

[0119] d. Use the public key of the key server 2 to encrypt K_data2.

[0120] e. Assemble the second random number nonce_n backup data packet, which should include: encrypted nonce_n, encrypted K_data2, the same association identifier (very important, used for association with P0) and application ID 3. Send and store with the server: The application sends the nonce_n backup data packet to the key server 2 through the secure channel 2.

[0121] The key server 2 verifies, decrypts and securely stores the second random number nonce_n, and stores the second random number nonce_n in the database with the association identifier and the user identifier.

[0122] In the second way, the same association identifier is the only technical link connecting two independent backup data, and the two backup paths should be as independent as possible in network, server, authentication system, truly realizing "split", avoiding single point failure leading to full disclosure.

[0123] The method provided by the embodiment solves the single-point loss risk through the root key backup mechanism. Whether the root key seed is backed up alone or is split and backed up with the second random number, the loss, damage or replacement of the user-side password module (such as a SIM card) is avoided, and the entire digital identity system is not available. In addition, the backup mechanism enables the root key of the user to be safely migrated to a new device or a new password module. This is a key to supporting the user to replace a mobile phone, a SIM card or a security hardware without rebuilding all digital identities.

[0124] In one embodiment, the method further comprises: receiving and storing the recovered root key seed sent by the password management module, wherein the recovered root key seed is returned by the first key storage system in response to the password management module sending a root key recovery request to the first key storage system after the application triggers root key recovery; receiving the first key pair generation request sent by the password management module, wherein the first key pair generation request at least contains the third key identifier; the first key pair generation request is sent to the password management module by the application based on the third key identifier queried from the blockchain or the key server; generating the key pair corresponding to the first key pair generation request based on the recovered root key seed and the third key identifier; sending the public key in the key pair corresponding to the first key pair generation request to the password management module, so that the password management module returns the public key in the key pair corresponding to the first key pair generation request to the application.

[0125] Specifically, first, the password module receives and stores the recovered root key seed sent by the password management module. The recovered root key seed is returned by the first key storage system in response to the password management module sending a root key recovery request to the first key storage system after the application triggers root key recovery.

[0126] Exemplarily, Figure 7 is one of the timing flow diagrams of the root key seed recovery method provided by the embodiment of the application, as Figure 7 shown, in response to the application triggering root key recovery, the password management module sends a key recovery request (root key recovery request) to the key server, the key server verifies the request, returns the (recovered) root key seed P0 to the password management module, the password management module returns the root key seed P0 to the password module, and the password module locally stores the (recovered) root key seed, thereby realizing root key seed recovery.

[0127] Further, the password module receives a first key pair generation request sent by the password management module, the first key pair generation request is generated based on a third key identifier queried to the blockchain or the key server, and is sent to the password management module; a key pair corresponding to the first key pair generation request is calculated according to the third key identifier Kid_n, the algorithm identifier KDFn and the recovered root key seed P0 stored locally by the password module, the key pair corresponding to the first key pair generation request includes a public key and a private key; further, the password module secretly stores the private key SKn (optional), and returns the public key PKn to the password management module, and the password management module returns the public key PKn to the application after receiving the public key PKn.

[0128] As shown in Figure 7 , the application queries the key identifier to the blockchain / key server, generates a key pair request (first key pair generation request) based on the queried key identifier (third key identifier Kid_n), and sends the generated key pair request (first key pair generation request) to the password management module, the generated key pair request (first key pair generation request) contains the key identifier (third key identifier Kid_n), the password management module sends the received generated key pair request (first key pair generation request) to the password module, the password module calculates the public and private key pair based on the key identifier (third key identifier Kid_n) in the generated key pair request (first key pair generation request) and the locally stored (recovered) root key seed, and returns the public key to the password management module, and the password management module sends the public key to the application.

[0129] Among them, the generated key pair request (first key pair generation request) also carries the algorithm identifier and. The process of calculating the public and private key pair by the password module is as follows: Select the algorithm KDFn corresponding to the algorithm identifier, and calculate the public and private key pair through the following formula: (SKn, PKn) = KDFn(P0, Kid_n) Among them, SKn is the private key, PKn is the public key, KDFn is the algorithm corresponding to the algorithm identifier, P0 is the recovered root key seed, and Kid_n is the third key identifier Kid_n.

[0130] The method provided by the embodiment can reliably solve the key loss problem caused by the physical failure of the hardware security module in the digital identity system in a relatively simple, efficient and low-cost manner, and ensure the basic availability and migratability of the system.

[0131] In one embodiment, the method further comprises: receive a second key pair generation request sent by the password management module; wherein the second key pair generation request comprises a fourth key identifier, a recovered root key seed, and a second random number; the fourth key identifier is sent to the password management module by the application after querying a blockchain or a key server; the recovered root key seed is obtained by the password management module from a second key storage system in response to the application triggering root key recovery and sending a collaborative root key recovery request to the second key storage system; and the second random number is obtained by the password management module from a third key storage system in response to the application triggering root key recovery and sending a collaborative root key recovery request to the third key storage system; generate a key pair corresponding to the second key pair generation request based on the recovered root key seed, the second random number, and the fourth key identifier; and send a public key in the key pair corresponding to the second key pair generation request to the password management module, so that the password management module returns the public key in the key pair corresponding to the second key pair generation request to the application.

[0132] Specifically, the password module receives a second key pair generation request sent by the password management module. Wherein the second key pair generation request comprises a fourth key identifier, a recovered root key seed, and a second random number.

[0133] Wherein, the fourth key identifier is obtained by the application sending to the password management module after querying a blockchain or a key server. The process of root key recovery includes obtaining the recovered root key seed and the second random number: 1. Recover the root key seed: The password management module sends a collaborative root key recovery request to the second key storage system (such as key server 1) in response to the application triggering root key recovery, and the second key storage system (such as key server 1) feeds back the root key seed to the password management module after receiving the collaborative root key recovery request.

[0134] 2. Recover the second random number: The password management module sends a collaborative root key recovery request to the third key storage system (such as key server 2) in response to the application triggering root key recovery, and the third key storage system (such as key server 2) feeds back the second random number to the password management module after receiving the collaborative root key recovery request.

[0135] Further, the password module generates a key pair corresponding to the second key pair generation request based on the recovered root key seed P0, the second random number nonce_n, and the fourth key identifier Kid_n, and the key pair is a public-private key pair. For example, the password module calculates the key pair corresponding to the second key pair generation request by the following formula: (SKn, PKn) = KDFn(P0, Kid_n, nonce_n) wherein SKn is a private key, PKn is a public key, KDFn is an algorithm corresponding to an algorithm identifier, P0 is a recovered root key seed, nonce_n is a second random number, and Kid_n is a fourth key identifier.

[0136] Further, the public key in the key pair corresponding to the second key pair generation request is sent to the password management module, and after receiving the public key, the password management module returns the public key in the key pair corresponding to the second key pair generation request to the application. The password module secretly stores the private key SKn (optional).

[0137] Exemplarily, Figure 8 is a timing flow diagram two of a root key seed recovery method provided by the embodiments of the application, as Figure 8 indicated, the method comprises: In response to the application triggering root key recovery, the password management module sends a (co-root) key recovery request to a key server 1 (second key storage system), and the key server 1 (second key storage system) feeds back a root key seed P0 to the password management module after receiving the (co-root) key recovery request. The password management module sends a (co-root) key recovery request to a key server 2 (third key storage system), and the key server 2 (third key storage system) feeds back a second random number (random number nonce_n) to the password management module after receiving the (co-root) key recovery request. The application initiates a key identifier query to a blockchain / key server.

[0138] The application sends a key pair generation request (second key pair request) to the password management module, and the key pair generation request (second key pair request) includes a key identifier (Kid_n), a second random number (nonce_n), and a (recovered) root key seed P0.

[0139] The password management module sends a key pair generation request (second key pair request) to the password module, and the key pair generation request (second key pair request) includes a key identifier (Kid_n), a second random number (nonce_n), and a (recovered) root key seed P0.

[0140] After receiving the key pair generation request (second key pair request), the password module stores the (recovered) root key seed P0, calculates a public-private key pair, sends the public key to the password management module, and the password management module sends the public key to the application.

[0141] The method provided by the embodiment realizes the qualitative improvement of security, attack resistance and trust model on the basis of availability through secret splitting and multi-party cooperation mechanism. The method is an innovative solution for higher security level and more complex cooperation requirement scenarios, and effectively solves the deep technical problem of "how to realize safe and reliable key life cycle management with clear authority and responsibility in a decentralized digital identity ecosystem".

[0142] Figure 9 is a timing flow chart of a public key cryptography management system provided by the embodiment of the application. The public key cryptography management system includes a cryptography module, a cryptography management module, a key storage system and an application. The cryptography module is arranged on a user side and integrated in a user identification module (SIM) card or a terminal. The cryptography management module is integrated in the SIM card or the terminal. The key storage system is deployed on a network side. The application is configured to send a request for cryptography operation using a private key to the cryptography management module. The request for cryptography operation using a private key includes the key parameter. The cryptography operation includes at least one of digital signature, signature verification, encryption and decryption. The cryptography management module is configured to forward the key parameter to the cryptography module in response to the request for cryptography operation using a private key. The key parameter at least includes a first key identifier. The cryptography module is configured to receive the key parameter, restore the private key corresponding to the key parameter based on the key parameter and a locally stored root key seed, perform the cryptography operation using the private key corresponding to the key parameter, return the operation result to the application and delete the private key corresponding to the key parameter in the case of completing the cryptography operation. The root key seed is a fixed random number for generating a key pair.

[0143] The system provided by the embodiment comprises a password module, a password management module and an application. The password module is arranged on a user side and integrated in a SIM card or a terminal. The password management module is integrated in the SIM card or the terminal. The application is configured to send a request for password operation using a private key to the password management module. The request for password operation using the private key comprises a key parameter. The password operation comprises at least one of digital signature, signature verification, encryption and decryption. The password management module is configured to forward the key parameter to the password module in response to the request for password operation using the private key. The key parameter at least comprises a first key identifier. The password module is configured to restore a private key corresponding to the key parameter based on the key parameter and a locally stored root key seed, and perform password operation using the private key corresponding to the key parameter in response to the request for password operation using the private key. The root key seed is a fixed random number generated in advance for generating a key pair. In the case of completing the password operation, the operation result is returned to the application and the private key corresponding to the key parameter is deleted.

[0144] In the application, the password module only stores the root key seed, but does not store the private key. The root key seed is a fixed random number generated in advance for generating a key pair. When the private key is needed for password operation, the private key is derived based on the key parameter sent by the key storage system and the locally stored root key seed, and the password operation is performed. That is, the private key only exists during calculation, and is deleted immediately after use. The application adopts the mode of "locally storing the root key seed + obtaining the key parameter during operation + dynamically deriving the key", so that the password module does not need to store the key, the cost of the password module is reduced, and the key management efficiency in the digital identity scene is improved.

[0145] The public key password management device provided by the embodiment of the application is described below. The public key password management device described below can be referred to in correspondence with the public key password management method described above.

[0146] Figure 10 FIG. 1 is a structural schematic diagram of the public key password management device provided by the embodiment of the application. The public key password management device 1000 is applied to a password module in a public key password management system. The password module is arranged on a user side and integrated in a SIM card or a terminal. The public key password management device 1000 comprises: The receiving module 1010 is configured to receive a key parameter sent by an application. The key parameter at least comprises a first key identifier. The password operation comprises at least one of digital signature, signature verification, encryption and decryption. The public key cryptography management module 1020 is configured to: based on the key parameter and the locally stored root key seed, restore the private key corresponding to the key parameter and perform the cryptographic operation by using the private key corresponding to the key parameter; the root key seed is a fixed random number generated in advance for generating a key pair; and in a case where the cryptographic operation is completed, return the operation result to the application and delete the private key corresponding to the key parameter.

[0147] The device provided by the embodiment is applied to a cryptographic module in a public key cryptography management system, the cryptographic module is arranged on a user side and integrated in a SIM card or a terminal; a receiving module 1010 receives a key parameter sent by an application; the key parameter at least includes a first key identifier, the cryptographic operation includes at least one of digital signature, signature verification, encryption and decryption, and a public key cryptography management module 1020 is configured to, based on the key parameter and a locally stored root key seed, restore a private key corresponding to the key parameter and perform the cryptographic operation by using the private key corresponding to the key parameter; the root key seed is a fixed random number generated in advance for generating a key pair; and in a case where the cryptographic operation is completed, the operation result is returned to the application and the private key corresponding to the key parameter is deleted.

[0148] In the application, the cryptographic module only stores the root key seed and does not store the private key, the root key seed is a fixed random number generated in advance for generating a key pair. When the private key needs to be used to perform the cryptographic operation, the private key is derived based on the key parameter sent by the application and the locally stored root key seed and the cryptographic operation is performed, that is, the private key only exists during the calculation and is deleted immediately after being used. The application adopts the mode of “locally storing the root key seed + obtaining the key parameter during the operation + dynamically deriving the key”, does not need the cryptographic module to store the key, reduces the cost of the cryptographic module, and improves the key management efficiency in the digital identity scenario.

[0149] Optionally, the public key cryptography management system further includes a cryptographic management module, and the cryptographic management module is integrated in the SIM card or the terminal. The receiving module 1010 is specifically configured to: receive the key parameter forwarded by the cryptographic management module; the key parameter is obtained by the cryptographic management module from a request for performing the cryptographic operation by using the private key, and the key parameter is forwarded to the cryptographic module.

[0150] Optionally, the public key cryptography management device 1000 further includes a key pair generation module. The key pair generation module is configured to: receive the generated key pair request sent by the password management module; the generated key pair request is sent by the application to the password management module; the generated key pair request at least includes a second key identifier; derive a private key corresponding to the generated key pair request and a public key corresponding to the generated key pair request based on the root key seed and the second key identifier; send the public key corresponding to the generated key pair request to the password management module, so that the password management module returns the public key corresponding to the generated key pair request to the application.

[0151] Optionally, the generated key pair module is further configured to: derive the private key corresponding to the generated key pair request and the public key corresponding to the generated key pair request based on the root key seed, the second key identifier and a first random number; the first random number is generated by the password module or is generated by the application and is carried in the generated key pair request; send the public key corresponding to the generated key pair request and the first random number to the password management module, so that the password management module returns the public key corresponding to the generated key pair request and the first random number to the application.

[0152] Optionally, the public key password module 1020 is further configured to: receive the signature request forwarded by the password management module; the signature request is forwarded to the password module by the password management module after the password management module receives the signature request sent by the application; the signature request includes: an unsigned identity document, an identity identifier, a public key, a key identifier, a key algorithm and a signature algorithm; call the private key corresponding to the public key in the signature request and the signature algorithm to sign the unsigned identity document; return the signature result to the password management module, so that the password management module returns the signature result to the application, and delete the private key corresponding to the public key in the signature request; the signature result is used for the application to publish the signed identity document to a blockchain or an open storage system.

[0153] Optionally, the public key password management system further comprises at least one key storage system, and the key storage system is deployed on a network side; the public key password device 1011 further comprises a root key seed backup and recovery module; The root key seed backup and recovery module is configured to: send the root key seed to a first key storage system for backup; or, sending the root key seed to a second key storage system for backup, and sending a second random number to a third key storage system for backup, the second random number being provided to the application by the cryptographic module after being generated in a key pair generation process and backed up to the third key storage system by the application.

[0154] Optionally, the root key seed backup and recovery module is further configured to: receive and store a recovered root key seed sent by the cryptographic management module, the recovered root key seed being returned by the first key storage system in response to the cryptographic management module sending a root key recovery request to the first key storage system after the application triggers root key recovery. receive a first key pair generation request sent by the cryptographic management module, the first key pair generation request at least including a third key identifier, the first key pair generation request being sent to the cryptographic management module by the application after generating based on the third key identifier queried from a blockchain or a key server; generate a key pair corresponding to the first key pair generation request based on the recovered root key seed and the third key identifier; send a public key in the key pair corresponding to the first key pair generation request to the cryptographic management module, for the cryptographic management module to return the public key in the key pair corresponding to the first key pair generation request to the application.

[0155] Optionally, the root key seed backup and recovery module is further configured to: receive a second key pair generation request sent by the cryptographic management module; wherein the second key pair generation request includes a fourth key identifier, a recovered root key seed, and a second random number, the fourth key identifier being sent to the cryptographic management module by the application after being queried from a blockchain or a key server, the recovered root key seed being obtained from the second key storage system by the cryptographic management module in response to the application triggering root key recovery and sending a collaborative root key recovery request to the second key storage system, and the second random number being obtained from the third key storage system by the cryptographic management module in response to the application triggering root key recovery and sending the collaborative root key recovery request to the third key storage system; generate a key pair corresponding to the second key pair generation request based on the recovered root key seed, the second random number, and the fourth key identifier; send a public key in the key pair corresponding to the second key pair generation request to the cryptographic management module, for the cryptographic management module to return the public key in the key pair corresponding to the second key pair generation request to the application.

[0156] Figure 11 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 11 As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 can call a computer program in the memory 1130 to execute the steps of a public-key cryptography management method. This method is applied to a cryptographic module in a public-key cryptography management system, and the cryptographic module is located on the user side and integrated into a SIM card or terminal; for example, it includes: The application receives key parameters; the key parameters include at least a first key identifier; the cryptographic operations include at least one of digital signature, signature verification, encryption, and decryption. Based on the key parameters and the locally stored root key seed, the private key corresponding to the key parameters is recovered and the cryptographic operation is performed using the private key corresponding to the key parameters; the root key seed is a pre-generated fixed random number used to generate key pairs; Upon completion of the cryptographic operation, the result is returned to the application and the private key corresponding to the key parameter is deleted.

[0157] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0158] In another aspect, the embodiments of the present application further provide a computer program product, which comprises a computer program stored in a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the public key cryptography management method provided by the above-mentioned embodiments. The method is applied to a cryptography module in a public key cryptography management system. The cryptography module is arranged at a user side and integrated in a SIM card or a terminal. For example, the method comprises: receiving a key parameter sent by an application; the key parameter at least comprises a first key identifier; the cryptographic operation comprises at least one of digital signature, signature verification, encryption and decryption; based on the key parameter and a locally stored root key seed, restoring a private key corresponding to the key parameter and performing the cryptographic operation by using the private key corresponding to the key parameter; the root key seed is a fixed random number pre-generated for generating a key pair; in a case where the cryptographic operation is completed, returning an operation result to the application and deleting the private key corresponding to the key parameter.

[0159] In another aspect, the embodiments of the present application further provide a processor-readable storage medium, which stores a computer program. The computer program is used for making a processor execute the steps of the method provided by the above-mentioned embodiments. The method is applied to a cryptography module in a public key cryptography management system. The cryptography module is arranged at a user side and integrated in a SIM card or a terminal. For example, the method comprises: receiving a key parameter sent by an application; the key parameter at least comprises a first key identifier; the cryptographic operation comprises at least one of digital signature, signature verification, encryption and decryption; based on the key parameter and a locally stored root key seed, restoring a private key corresponding to the key parameter and performing the cryptographic operation by using the private key corresponding to the key parameter; the root key seed is a fixed random number pre-generated for generating a key pair; in a case where the cryptographic operation is completed, returning an operation result to the application and deleting the private key corresponding to the key parameter.

[0160] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. Those skilled in the art can understand and implement without creative labor.

[0161] Those skilled in the art can clearly understand the implementation of the various embodiments by means of software and the necessary general hardware platform from the above description of the embodiments, and of course, the embodiments can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that contributes to the technical solutions can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, 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 the methods described in the various embodiments or some parts of the methods.

[0162] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A public-key cryptography management method, characterized in that, A cryptographic module used in a public key cryptography management system, wherein the cryptographic module is located on the user side and integrated into a user identification module SIM card or terminal; the method includes: The application receives key parameters; the key parameters include at least a first key identifier; the cryptographic operations include at least one of digital signature, signature verification, encryption, and decryption. Based on the key parameters and the locally stored root key seed, the private key corresponding to the key parameters is recovered and the cryptographic operation is performed using the private key corresponding to the key parameters; the root key seed is a pre-generated fixed random number used to generate key pairs; Upon completion of the cryptographic operation, the result is returned to the application and the private key corresponding to the key parameter is deleted.

2. The public-key cryptography management method according to claim 1, characterized in that, The public key cryptography management system also includes a cryptography management module, which is integrated into the SIM card or the terminal; The key parameters sent by the receiving application include: The key parameter is received by the password management module. The key parameter is obtained by the password management module in response to the request from the application to perform cryptographic operations using the private key, and then forwarded to the password module.

3. The public-key cryptography management method according to claim 2, characterized in that, The method also includes a process for generating key pairs, including: Receive a key pair generation request sent by the password management module; the key pair generation request is sent by the application to the password management module; the key pair generation request includes at least a second key identifier; Based on the root key seed and the second key identifier, the private key and the public key corresponding to the key pair generation request are derived. The public key corresponding to the key pair generation request is sent to the cryptography management module, which then returns the public key to the application.

4. The public-key cryptography management method according to claim 3, characterized in that, The process of deriving the private key and the public key corresponding to the key pair generation request based on the root key seed and the second key identifier includes: The private key and the public key corresponding to the key pair generation request are derived based on the root key seed, the second key identifier, and the first random number; the first random number is generated by the cryptographic module or by the application and carried in the key pair generation request. The step of sending the public key corresponding to the key pair generation request to the cryptography management module, so that the cryptography management module can return the public key corresponding to the key pair generation request to the application, includes: The public key corresponding to the key pair generation request and the first random number are sent to the password management module, so that the password management module can return the public key corresponding to the key pair generation request and the first random number to the application.

5. The public-key cryptography management method according to any one of claims 1-4, characterized in that, The method further includes: The system receives a signature request forwarded by the password management module. The signature request is forwarded to the password module by the password management module after receiving the signature request sent by the application. The signature request includes: an unsigned identity document, an identity identifier, a public key, a key identifier, a key algorithm, and a signature algorithm. The unsigned identity document is signed by invoking the private key corresponding to the public key in the signature request and the signature algorithm. The signature result is returned to the cryptography management module, which then returns the signature result to the application and deletes the private key corresponding to the public key in the signature request. The signature result is used by the application to publicly publish the signed identity document to the blockchain or a public storage system.

6. The method according to any one of claims 1-4, characterized in that, The public-key cryptography management system further includes at least one key storage system, which is deployed on the network side; the method further includes: The root key seed is sent to the first key storage system for backup. Alternatively, the root key seed can be sent to a second key storage system for backup, and the second random number can be sent to a third key storage system for backup. The second random number is generated by the cryptographic module during the key pair generation process and provided to the application, and then backed up by the application to the third key storage system.

7. The method according to claim 6, characterized in that, The method further includes: The system receives and stores the recovered root key seed sent by the password management module; the recovered root key seed is returned by the first key storage system after the password management module sends a root key recovery request to the first key storage system in response to the application triggering root key recovery. The application receives a first key pair generation request sent by the cryptographic management module, wherein the first key pair generation request contains at least a third key identifier; the first key pair generation request is generated by the application based on the third key identifier queried from the blockchain or key server and then sent to the cryptographic management module. Based on the recovered root key seed and the third key identifier, generate the key pair corresponding to the first key pair generation request; The public key in the key pair corresponding to the first key pair generation request is sent to the cryptography management module, so that the cryptography management module can return the public key in the key pair corresponding to the first key pair generation request to the application.

8. The method according to claim 6, characterized in that, The method further includes: The system receives a second key pair generation request sent by the cryptographic management module. The second key pair generation request includes a fourth key identifier, a recovered root key seed, and a second random number. The fourth key identifier is sent by the application to the cryptographic management module after querying the blockchain or key server. The recovered root key seed is obtained by the cryptographic management module from the second key storage system after sending a collaborative root key recovery request to the second key storage system in response to the application triggering root key recovery. The second random number is obtained by the cryptographic management module from the third key storage system after sending the collaborative root key recovery request to the third key storage system in response to the application triggering root key recovery. Based on the recovered root key seed, the second random number, and the fourth key identifier, generate the key pair corresponding to the second key pair generation request; The public key in the key pair corresponding to the second key pair generation request is sent to the cryptography management module, so that the cryptography management module can return the public key in the key pair corresponding to the second key pair generation request to the application.

9. A public-key cryptography management system, characterized in that, The public key cryptography management system includes a cryptographic module, a cryptographic management module, and an application. The cryptographic module is located on the user side and integrated into the SIM card or the terminal, and the cryptographic management module is integrated into the SIM card or the terminal. The application is used to send a request to the password management module that requires the use of a private key for cryptographic operations; the request includes a key parameter; the cryptographic operations include at least one of digital signature, signature verification, encryption, and decryption; The password management module is used to forward the key parameters to the password module in response to a request that requires the use of a private key for cryptographic operations; the key parameters include at least a first key identifier; The cryptographic module is configured to receive the key parameters, recover the private key corresponding to the key parameters based on the key parameters and the locally stored root key seed, and perform the cryptographic operation using the private key corresponding to the key parameters; the root key seed is a pre-generated fixed random number used to generate key pairs; upon completion of the cryptographic operation, the operation result is returned to the application and the private key corresponding to the key parameters is deleted.

10. A public-key cryptography management device, characterized in that, A cryptographic module used in a public key cryptography management system, wherein the cryptographic module is located on the user side and integrated into a user identification module SIM card or terminal; the device includes: The receiving module is configured to: receive key parameters sent by the application; the key parameters include at least a first key identifier; the cryptographic operations include at least one of digital signature, signature verification, encryption, and decryption; The public-key cryptography management module is used to: recover the private key corresponding to the key parameters based on the key parameters and the locally stored root key seed, and use the private key corresponding to the key parameters to perform the cryptographic operation; the root key seed is a pre-generated fixed random number used to generate key pairs; and after completing the cryptographic operation, return the operation result to the application and delete the private key corresponding to the key parameters.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the public key cryptography management method as described in any one of claims 1 to 8.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the public key cryptography management method as described in any one of claims 1 to 8.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the public key cryptography management method as described in any one of claims 1 to 8.