A method, system, storage medium and terminal for implementing soft password module
By introducing a random number generation unit and a key management unit into the software cipher module, the SSL communication unit is used to obtain the working key, and the protection key is derived through the PIN code, the security calculation needs of the software cipher module in the cloud operating system are solved, and efficient random number generation and key management are realized.
Patent Information
- Application Number
- CN202210293415.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-03-24
AI Technical Summary
The existing software cipher modules operate in an uncontrolled environment, and the key protection measures are insufficient to meet the security computing needs within the cloud operating system, especially in terms of random number generation and key storage.
The random number generation unit provides random number support for the SSL communication unit, uses the key management unit to obtain and manage work keys from the security service platform, and uses PIN code and salt value to derive a private key protection key and HMAC key to ensure the confidentiality and integrity of the key.
It realizes secure random number generation and key management in the cloud operating system, ensures the authenticity of random numbers and the security of keys, and meets the information security needs in the fields of cloud services, Internet of Things terminals, etc.
Smart Images

Figure CN114866228B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of cryptographic technology, and in particular relates to a method, system, storage medium and terminal for implementing a soft cryptographic module. Background Art
[0002] At present, the relevant agencies and departments have proposed to promote national secret algorithms and strengthen network security construction from the long-term perspective of security strategy, and are vigorously developing government cloud. Cryptographic algorithms are the core technology to ensure information security. Especially in the era of big data, the demand for cryptographic applications is increasing under the demand for protecting computer and government cloud security systems. Data needs to be protected by cryptography to prevent unauthorized access. Cryptographic technology can realize security services such as entity authentication and non-repudiation, but the security and reliability of cryptography directly depends on the secure cryptographic modules that implement them.
[0003] In cryptographic application systems, how to protect and use sensitive key information has a crucial impact on the security strength of the entire cryptographic application system. Generally, there are two ways to use sensitive key information: software cryptographic modules use keys in host memory; hardware cryptographic modules, key storage and use are all performed in expansion boards or other embedded cryptographic devices, and the embedded device is embedded in the server for use.
[0004] There are some areas that need to be improved and deficiencies in the software cryptographic module. The software cryptographic module lacks the clear security boundary of the hardware module. The software cryptographic module runs in an uncontrolled and untrusted environment. There is a risk that the key protection measures will not meet the basic requirements of cryptographic applications.
[0005] With the popularization of government cloud and the rapid growth of the amount of business data that needs to be processed, the cryptographic calculations that rely on hardware cryptographic card modules cannot meet the requirements of data processing. First, the cost continues to increase, and second, the processing efficiency is low. For this reason, a soft cryptographic module that can be securely calculated in the cloud operating system is needed. The soft cryptographic module needs to solve two core problems:
[0006] The first is the issue of random sources and random numbers. The usual random numbers rely on the random number chip products of the hardware cryptographic module to produce true random numbers. In the software environment, how to select the entropy source and perform pseudo-random processing to ensure that the entropy value of the entropy source meets the requirements, and implement a random number generation method under this entropy source so that the generated random numbers meet the random number detection requirements;
[0007] The second is the key storage problem. Usually the device key or root key is stored in a secure storage chip. In an open system environment, how to generate the key protection key KEK in the soft password module, without storing the KEK, and generate the same KEY on schedule when the key needs to be decrypted. Summary of the invention
[0008] In view of the problems to be solved in the prior art, the present invention provides a method, system, storage medium and terminal for implementing a soft password module.
[0009] The present invention is implemented as follows: a method for implementing a soft cryptographic module includes: a random number generation unit provides random number support for an SSL communication unit, the soft cryptographic module obtains a working key from a security service platform, and the key management unit manages, protects and stores the working key, and the working key is used by a cryptographic service unit to provide cryptographic services for applications or services.
[0010] Specifically, the random number generation unit generates a random number and provides it to the key management unit, the SSL communication unit and the cryptographic service unit for use; the SSL communication unit uses the random number to establish an SSL communication security channel with the security service platform to obtain a working key from the security service platform;
[0011] The obtained working key is managed, protected and stored by the key management unit, and the obtained working key is used by the cryptographic service unit to provide cryptographic services for applications or services.
[0012] Furthermore, the method for implementing the soft password module also includes: a random number generation unit generates a random number and a public-private key pair, obtains a working key from a security service platform through an SSL communication unit, and a key management unit uses a PIN code and a salt value (a random number generated by the random number generation unit) to derive a private key protection key and an HMAC key respectively. The former is used to encrypt key security parameters (CSP) such as working keys, private keys and random numbers to ensure their confidentiality; the latter is used to perform MAC verification on public security parameters (PSP) such as public keys, salt values and thresholds of deterministic random bit generators (DRNGs) to ensure their integrity; the cryptographic service unit decrypts and obtains the working key to provide cryptographic services for the application, and then destroys the private key protection key and the HMAC key.
[0013] Furthermore, the method for implementing the soft password module also includes: in the initialization stage, the key administrator inputs the PIN code and imports the private key and public key certificate of the soft password module and the security service public key certificate; the random number generation unit obtains the entropy source and securely generates random numbers; the private key protection key and the HMAC key are derived using the input PIN code derivation function KDF and the salt value (the random number generated by the random number generation unit); the SSL communication unit uses the private key and public key certificate, the security service public key certificate and the random number generated by the random number generation unit to establish an SSL channel with the security service platform to obtain the working key, and uses the private key protection key to encrypt the private key and DRNG sensitive information in the working key, and store it in the CSP file; the public key, salt value and DRNG threshold information in the working key are stored in the PSP file, and the HMAC key is used to generate a MAC check value for it, and it is stored together in the PSP file. In the ready stage, the key administrator enters the PIN, and the HMAC key derived from the PIN performs MAC verification on the PSP file. If correct, the private key protection key is derived to decrypt the CSP file. The cryptographic service unit obtains the working key and provides cryptographic services to the application; the PIN code, private key protection key and HMAC key are immediately destroyed.
[0014] Furthermore, the key management unit includes:
[0015] 1) Enter the administrator PIN data, the administrator PIN is 8 bytes;
[0016] 2) Salt value S = SM3 (key type || random part); the key type of the HMAC key is 0x0001; the private key protection key type is 0x0002; the random part is the random number generated by the random number generation unit;
[0017] 3) Number of iterations c = 10000000;
[0018] 4) The length of the derived key dkLen = 16 bytes;
[0019] 5) According to GM / T 0091 Password-based Key Derivation Specification, use HMAC-SM3 function as PBKDF;
[0020] 6) Calculation: HMAC key = HMACSM3 pin (S1,c,dkLen);
[0021] 7) Calculation: Private key protection key = HMACSM3 pin (S2,c,dkLen);
[0022] 8) Calculation: CSP file content = SM4 私钥保护密钥(CSP of random number generation unit||CSP of cryptographic service unit||CSP of SSL communication unit), where the CSP of random number generation unit includes random numbers, entropy source information, internal sensitive information of DRNG, etc., the CSP of cryptographic service unit includes information such as symmetric keys in working keys, private keys of asymmetric keys and private keys of cryptographic modules, and the CSP of SSL communication unit includes information such as private keys required for SSL communication;
[0023] 9) Calculation: PSP file content = HMAC HMAC密钥 (PSP of the random number generation unit||PSP of the cryptographic service unit||PSP of the SSL communication unit)||MAC check value, wherein the PSP of the random number generation unit includes information such as the entropy value of the entropy source and the threshold value of the DRNG, the PSP of the cryptographic service unit includes information such as the public key of the asymmetric key in the working key and the public key of the cryptographic module, and the PSP of the SSL communication unit includes information such as the public key certificate required for SSL communication;
[0024] Furthermore, the random number generation unit performs entropy source management and random number generation including:
[0025] (1) Obtain the system time, CPU temperature, and CPU event interrupt time as the initial entropy source, and the random number generated by the system random number generator as the backup entropy source;
[0026] (2) Obtaining entropy source for entropy estimation test;
[0027] (3) Obtain entropy source to perform power-on health test and continuous health test. After passing, input entropy source into entropy pool. Each time the entropy source is input, the circular shift register is updated.
[0028] (4) Obtain all entropy sources from the entropy pool and compress them using a key expansion function based on the SM3 hash algorithm as the initial entropy source of the deterministic random bit generator DRNG. At the same time, the system random number can also be used as part of the initial entropy source of the DRNG;
[0029] (5) The personalized string and counter are used as the initial entropy source to obtain the backup options in case of failure, and the initial entropy source is input into the SM3-based RNG to obtain a random number;
[0030] (6) The SM3-based RNG outputs random numbers up to 2 20 Or when the time from the last random number output exceeds 600 seconds, a reseeding operation is performed to obtain a new entropy source, update the entropy pool, and increase the candidate counter by 1.
[0031] Further, the SSL communication unit includes:
[0032] The key administrator imports the private key and public key certificate configured for the cryptographic module. The SSL communication unit uses the random number generated by the random number generation unit to perform SSL communication with the security service platform to obtain the working key.
[0033] The cryptographic service unit provides data encryption and decryption, MAC calculation, signature verification and entity authentication services including:
[0034] 1) Call the random number generation unit to generate random numbers and provide random number services;
[0035] 2) Provide data or instruction encryption and decryption, MAC calculation, signature verification, entity identity authentication, integrity and integrity verification.
[0036] Another object of the present invention is to provide a system for implementing a soft cryptographic module, comprising a random number generation unit, a key management unit, an SSL communication unit and a cryptographic service unit; wherein the random number generation unit is used to manage an entropy source and generate random numbers;
[0037] The key management unit derives the KEK from the PIN code and stores the CSP and PSP securely;
[0038] An SSL communication unit is used to establish an SSL secure channel with the security service platform and obtain a working key from the security service platform;
[0039] The cryptographic service unit is used to provide entity authentication, data encryption and decryption, signature verification, and MAC calculation services.
[0040] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0041] The random number generation unit is used to manage the entropy source and generate random numbers; the key management unit is used to generate key pairs, generate KEK based on the PIN code derivation function KDF, and securely store CSPs such as working keys and perform MAC verification of PSPs; the SSL communication unit is used to establish an SSL secure channel with the security service platform and obtain multiple working keys from the security service platform; the cryptographic service unit provides cryptographic data encryption and decryption, MAC calculation, signature verification and entity authentication services.
[0042] Another object of the present invention is to provide an information data processing terminal, which is used to implement the functions of the system for implementing the soft password module.
[0043] Another object of the present invention is to provide a soft password module that realizes soft random number generation and generates CSP encryption keys and PSP MAC verification keys based on a PIN code derivation function KDF for application in information security in cloud services, Internet of Things terminals, industrial Internet and other fields.
[0044] In combination with the above technical solutions and the technical problems solved, please analyze the advantages and positive effects of the technical solutions to be protected by the present invention from the following aspects:
[0045] First, in view of the technical problems existing in the above-mentioned prior art and the difficulty of solving the problems, the technical solutions to be protected by the present invention and the results and data during the research and development process are closely combined to analyze in detail and deeply how the technical solutions of the present invention solve the technical problems, and some creative technical effects brought about after solving the problems. The specific description is as follows:
[0046] Aiming at the two core problems faced by the soft cryptographic module, the present invention provides a method and SDK for implementing the soft cryptographic module, especially involving the selection of random number entropy source and the generation of random numbers, key security storage and cryptographic services, etc.
[0047] Use system resources to collect entropy sources, perform entropy evaluation and health tests on the entropy sources, and select entropy sources with entropy values that meet the requirements to generate random numbers that meet the random number detection requirements;
[0048] The key protection key and HMAC key are generated based on the PIN code derivation function KDF, ensuring the confidentiality and integrity requirements of key storage.
[0049] Second, considering the technical solution as a whole or from the perspective of the product, the technical effects and advantages of the technical solution to be protected by the present invention are described in detail as follows:
[0050] The random numbers and secure storage required by the software cryptographic module of the present invention do not rely on hardware, and effectively solve the randomness of random numbers required for cryptographic applications in fields such as cloud services, Internet of Things terminals, and industrial Internet, the confidentiality of CSPs such as keys, and the integrity of PSPs such as public keys.
[0051] Third, the creativity of the present invention is also reflected in the following aspects:
[0052] The hardware cryptographic module (HSM) provides hardware-level security and a trusted key management system such as security chips and physical protection. It has always been a secure device for managing high-value keys. Although HSM can provide the necessary security, it also brings problems such as difficult integration and low performance in the production environment. The soft cryptographic module can ensure the first level of security or even the second level of security in a trusted execution environment (such as combined with TPM, TrustZone or SGX). It can be easily and quickly integrated into the production environment in the form of SDK, and the computing performance of high-performance CPUs or GPUs can be used to greatly improve the efficiency of key management. Therefore, the soft cryptographic module can replace the hardware cryptographic module at a certain security level.
[0053]
[0054] BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 is a flow chart of a method for implementing a soft password module provided by an embodiment of the present invention;
[0057] Figure 2 is a system structure block diagram of a soft password module provided by an embodiment of the present invention;
[0058] Figure 3 is a system schematic diagram for implementing a soft password module provided by an embodiment of the present invention;
[0059] Figure 4 is a schematic diagram of a method for implementing a soft password module provided by an embodiment of the present invention;
[0060] In the figure: 1. Random number generation unit; 2. Key management unit; 3. SSL communication unit; 4. Cryptographic service unit. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0062] In view of the problems existing in the prior art, the present invention provides a method, system, medium, device and terminal for implementing a soft password module. The present invention is described in detail below with reference to the accompanying drawings.
[0063] 1. In order to enable those skilled in the art to fully understand how to implement the present invention, this section provides an explanatory embodiment that describes the technical solution of the invention.
[0064] Example 1
[0065] like Figure 1 As shown, the method for implementing a soft password module provided by an embodiment of the present invention includes the following steps:
[0066] S101, managing entropy sources and generating random numbers using a random number generation unit;
[0067] S102, using the key management unit to generate a key pair, generate a KEK based on the PIN code derivation function KDF, and securely store the CSP such as the working key and the MAC verification of the PSP;
[0068] S103, using the SSL communication unit to establish an SSL communication security channel with the security service platform and obtain multiple working keys from the security service platform;
[0069] S104, using the cryptographic service unit to provide cryptographic data encryption and decryption, MAC calculation, signature verification and entity authentication services.
[0070] Example 2
[0071] like Figure 2 As shown, the system for implementing the soft password module provided by the present invention includes:
[0072] A random number generation unit 1, used for managing entropy sources and generating random numbers;
[0073] Key management unit 2, derives KEK from PIN code and securely stores CSP and PSP;
[0074] SSL communication unit 3, used to establish an SSL secure channel with the security service platform and obtain a working key from the security service platform;
[0075] The cryptographic service unit 4 is used to provide entity authentication, data encryption and decryption, signature verification and MAC calculation services.
[0076] Figure 3 This is the system principle for implementing the soft password module provided by the embodiment of the present invention.
[0077] Example 3
[0078] The method for implementing a soft password module provided by an embodiment of the present invention includes: a random number generation unit generates a random number and a public-private key pair, obtains a working key from a security service platform through an SSL communication unit, and a key management unit uses a PIN code and a salt value (a random number generated by the random number generation unit) to derive a private key protection key and an HMAC key respectively. The former is used to encrypt critical security parameters (CSP) such as the working key, private key and random number to ensure their confidentiality; the latter is used to perform MAC verification on public security parameters (PSP) such as the public key, salt value and threshold of a deterministic random bit generator (DRNG) to ensure their integrity; the cryptographic service unit decrypts and obtains the working key to provide cryptographic services for the application, and then destroys the private key protection key and the HMAC key.
[0079] Example 4
[0080] like Figure 4 As shown, the method for implementing a soft password module provided by an embodiment of the present invention includes: in an initialization phase, a key administrator inputs a PIN code and imports a private key and a public key certificate of the soft password module and a public key certificate of a security service; a random number generation unit obtains an entropy source and securely generates a random number; a private key protection key and an HMAC key are derived using a PIN code derivation function KDF and a salt value (a random number generated by a random number generation unit) inputted; an SSL communication unit uses a private key and a public key certificate, a security service public key certificate, and a random number generated by a random number generation unit to establish an SSL channel with a security service platform to obtain a working key, and uses a private key protection key to encrypt sensitive information of a private key and DRNG in the working key, and stores the information in a CSP file; information such as a public key, a salt value, and a threshold value of DRNG in the working key is stored in a PSP file, and a MAC check value is generated for it using an HMAC key, and stored together in the PSP file. In the ready stage, the key administrator enters the PIN, and the HMAC key derived from the PIN performs MAC verification on the PSP file. If correct, the private key protection key is derived to decrypt the CSP file. The cryptographic service unit obtains the working key and provides cryptographic services to the application; the PIN code, private key protection key and HMAC key are immediately destroyed.
[0081] Example 5
[0082] In a preferred embodiment of the present invention, the method for selecting an entropy source and generating soft random numbers comprises the following steps:
[0083] 1. Obtain the system time, CPU temperature, and interrupt time of CPU events as the initial entropy source, and the random number generated by the system random number generator as the backup entropy source.
[0084] 2. Obtain entropy source to perform entropy estimation test (according to NIST SP800-90B).
[0085] 3. Obtain the entropy source for power-on health test and continuous health test. After passing, input the entropy source into the entropy pool. Each time the entropy source is input, a circular shift register method update is performed.
[0086] 4. Obtain all entropy sources from the entropy pool and use a key expansion function based on the SM3 hash algorithm for compression as the initial entropy source of the deterministic random bit generator (DRNG). At the same time, the system random number can also be used as part of the initial entropy source of the DRNG.
[0087] 5. Personalized strings and counters are used as an alternative to initial entropy source acquisition in case of failure.
[0088] 6. Input the initial entropy source into an SM3-based RNG to obtain random numbers.
[0089] 7. The RNG based on SM3 outputs random numbers up to 2 20 When the time from the last random number output exceeds 600 seconds, a reseeding operation is performed, that is, a new entropy source is obtained, the entropy pool is updated, and the alternative counter is increased by 1.
[0090] Example 6
[0091] The key management unit provided in the embodiment of the present invention includes:
[0092] 1) Enter the administrator PIN data, the administrator PIN is 8 bytes;
[0093] 2) Salt value S = SM3 (key type || random part); the key type of the HMAC key is 0x0001; the private key protection key type is 0x0002; the random part is the random number generated by the random number generation unit;
[0094] 3) Number of iterations c = 10000000;
[0095] 4) The length of the derived key dkLen = 16 bytes;
[0096] 5) According to GM / T 0091 Password-based Key Derivation Specification, use HMAC-SM3 function as PBKDF;
[0097] 6) Calculation: HMAC key = HMACSM3 pin (S1,c,dkLen);
[0098] 7) Calculation: Private key protection key = HMACSM3 pin (S2,c,dkLen);
[0099] 8) Calculation: CSP file content = SM4 私钥保护密钥(CSP of random number generation unit||CSP of cryptographic service unit||CSP of SSL communication unit), where the CSP of random number generation unit includes random numbers, entropy source information, internal sensitive information of DRNG, etc., the CSP of cryptographic service unit includes information such as symmetric keys in working keys, private keys of asymmetric keys and private keys of cryptographic modules, and the CSP of SSL communication unit includes information such as private keys required for SSL communication;
[0100] 9) Calculation: PSP file content = HMAC HMAC密钥 (PSP of the random number generation unit||PSP of the cryptographic service unit||PSP of the SSL communication unit)||MAC check value, wherein the PSP of the random number generation unit includes information such as the entropy value of the entropy source and the threshold value of the DRNG, the PSP of the cryptographic service unit includes information such as the public key of the asymmetric key in the working key and the public key of the cryptographic module, and the PSP of the SSL communication unit includes information such as the public key certificate required for SSL communication;
[0101] Example 7
[0102] The SSL communication unit provided in the embodiment of the present invention includes:
[0103] The key administrator imports the private key and public key certificate configured for the cryptographic module. The SSL communication unit uses the random number generated by the random number generation unit to perform SSL communication with the security service platform to obtain the working key.
[0104] The cryptographic service unit provides data encryption and decryption, MAC calculation, signature verification and entity authentication services including:
[0105] 1) Call the random number generation unit to generate random numbers and provide random number services;
[0106] 2) Provide data or instruction encryption and decryption, MAC calculation, signature verification, entity identity authentication, integrity and integrity verification.
[0107] 2. In order to prove the creativity and technical value of the above technical solutions of the present invention, this section provides application examples of the technical solutions of the present invention on specific products or related technologies.
[0108] The methods for implementing the soft password module provided in embodiments 1 to 7 of the present invention can be applied in the fields of bank trunks, smart printing control equipment, smart charging piles, smart access control, etc.
[0109] Take the soft password module in the intelligent printing control device as an example. Every time the device is started, the administrator enters the PIN code to authenticate and manage the printing control device. The key derived from the PIN code and the random number generated by the soft password module communicate with the file management center through SSL, receive the corresponding files, and then perform operations such as printing and scanning.
[0110] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0111] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A method for implementing a soft password module, characterized in that: The method for implementing the soft password module includes: a random number generation unit generates a random number and provides it to a key management unit, an SSL communication unit and a password service unit for use; the SSL communication unit uses the random number to establish an SSL communication security channel with a security service platform to obtain a working key from the security service platform; The key management unit manages, protects and stores the acquired working key, and uses the acquired working key for the cryptographic service unit to provide cryptographic services for applications or services; The random number generation unit generates random numbers including: (1) Obtain the system time, CPU temperature, and CPU event interrupt time as the initial entropy source, and the random number generated by the system random number generator as the backup entropy source; (2) Obtaining entropy source for entropy estimation test; (3) Obtain entropy source to perform power-on health test and continuous health test. After passing, input entropy source into entropy pool. Each time the entropy source is input, the circular shift register is updated. (4) Obtain all entropy sources from the entropy pool and compress them using a key expansion function based on the SM3 hash algorithm as the initial entropy source of the deterministic random bit generator DRNG. At the same time, the system random number can also be used as part of the initial entropy source of the DRNG; (5) The personalized string and counter are used as the initial entropy source to obtain the backup options in case of failure, and the initial entropy source is input into the SM3-based RNG to obtain a random number; (6) The SM3-based RNG outputs random numbers up to 2 20 Or when the time from the last random number output exceeds 600 seconds, a reseeding operation is performed to obtain a new entropy source, update the entropy pool, and increase the candidate counter by 1.
2. The method for implementing a soft password module according to claim 1, characterized in that: The method for implementing the soft password module specifically includes the following steps: a random number generation unit generates a random number and a public-private key pair, obtains a working key from a security service platform through an SSL communication unit, a key management unit derives a private key protection key and an HMAC key using a PIN code and a salt value, respectively, the private key protection key is used to encrypt the working key, the private key and the random number critical security parameter (CSP); the HMAC key is used to perform MAC verification on the public key, the salt value and the threshold public security parameter (PSP) of the deterministic random bit generator (DRNG); the cryptographic service unit decrypts and obtains the working key to provide cryptographic services for the application, and then destroys the private key protection key and the HMAC key.
3. The method for implementing a soft password module according to claim 1, characterized in that: The method for implementing the soft password module also includes the following steps: During the initialization phase, the key administrator enters the PIN code and imports the private key and public key certificate of the soft password module and the public key certificate of the security service; the random number generation unit obtains the entropy source and securely generates random numbers; the private key protection key and HMAC key are derived using the input PIN code derivation function KDF and the salt value; the SSL communication unit uses the private key and public key certificate, the public key certificate of the security service and the random number generated by the random number generation unit to establish an SSL channel with the security service platform to obtain the working key, and uses the private key protection key to encrypt the private key and DRNG sensitive information in the working key and store them in the CSP file; the public key, salt value and DRNG threshold information in the working key are stored in the PSP file, and the HMAC key is used to generate a MAC check value for it, which is stored together in the PSP file; In the ready stage, the key administrator enters the PIN, and the HMAC key derived from the PIN performs MAC verification on the PSP file. If correct, the private key protection key is derived to decrypt the CSP file. The cryptographic service unit obtains the working key and provides cryptographic services to the application; the PIN code, private key protection key and HMAC key are immediately destroyed.
4. The method for implementing a soft password module according to claim 1, characterized in that: The key management unit comprises: 1) Enter the administrator PIN data, the administrator PIN is 8 bytes; 2) Salt value S = SM3 (key type || random part); the key type of the HMAC key is 0x0001; the private key protection key type is 0x0002; the random part is the random number generated by the random number generation unit; 3) Number of iterations c = 10000000; 4) The length of the derived key dkLen = 16 bytes; 5) According to GM / T 0091 Password-based Key Derivation Specification, use HMAC-SM3 function as PBKDF; 6) Calculation: HMAC key = HMACSM3 pin (S1,c,dkLen); 7) Calculation: Private key protection key = HMACSM3 pin (S2,c,dkLen); 8) Calculation: CSP file content = SM4 私钥保护密钥 (CSP of random number generation unit||CSP of cryptographic service unit||CSP of SSL communication unit), where the CSP of random number generation unit includes random numbers, entropy source information, internal sensitive information of DRNG, etc., the CSP of cryptographic service unit includes the symmetric key in the working key, the private key of the asymmetric key and the private key information of the cryptographic module, and the CSP of the SSL communication unit includes the private key information required for SSL communication; 9) Calculation: PSP file content = HMAC HMAC密钥 (PSP of the random number generation unit||PSP of the cryptographic service unit||PSP of the SSL communication unit)||MAC check value, wherein the PSP of the random number generation unit includes the entropy value of the entropy source and the threshold information of the DRNG, the PSP of the cryptographic service unit includes the public key of the asymmetric key in the working key and the public key of the cryptographic module and other information, and the PSP of the SSL communication unit includes the public key certificate information required for SSL communication.
5. The method for implementing a soft password module according to claim 1, characterized in that: The SSL communication unit comprises: The key administrator imports the private key and public key certificate configured for the cryptographic module. The SSL communication unit uses the random number generated by the random number generation unit to perform SSL communication with the security service platform to obtain the working key.
6. The method for implementing a soft password module according to claim 1, characterized in that: The cryptographic service unit is used to provide data encryption and decryption, MAC calculation, signature verification and entity authentication services, specifically including: 1) Call the random number generation unit to generate random numbers and provide random number services; 2) Provide data or instruction encryption and decryption, MAC calculation, signature verification, entity identity authentication, integrity and integrity verification.
7. A system for implementing a soft password module for implementing the method according to any one of claims 1 to 6, characterized in that: The system of the soft password module includes: a random number generation unit for managing entropy sources and generating random numbers; The key management unit derives the KEK from the PIN code and stores the CSP and PSP securely; The SSL communication unit is used to establish an SSL communication security channel with the security service platform and obtain a working key from the security service platform; The cryptographic service unit is used to provide entity authentication, data encryption and decryption, signature verification, and MAC calculation services.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the method according to any one of claims 1 to 6, comprising the following steps: The random number generation unit is used to manage the entropy source and generate random numbers; the key management unit is used to generate key pairs, generate KEK based on the PIN code derivation function KDF, and securely store CSPs such as working keys and perform MAC verification of PSPs; the SSL communication unit is used to establish an SSL secure channel with the security service platform and obtain multiple working keys from the security service platform; the cryptographic service unit provides cryptographic data encryption and decryption, MAC calculation, signature verification and entity authentication services.
Citation Information
Patent Citations
Data acquisition method and device and storage medium
CN111416807A
System and method for providing security services with multi-function supply chain hardware integrity for electronics defense (shield)
US20210182436A1