A lightweight cryptographic application method, device, and cryptographic application service system
By generating temporary certificates and keys on the lightweight hardware key storage medium of the user terminal, and using the SDK for encryption and decryption on the application server, the problem of traditional hardware cryptographic machines being unable to meet the dynamic changes of cloud services is solved and the flexibility of the cloud is achieved. performance and security, while reducing costs and operation and maintenance complexity.
Patent Information
- Application Number
- CN202410881713.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Traditionally configuring hardware encryption machines in application servers cannot meet the dynamic drift and elastic scaling characteristics of cloud services. Moreover, management and operation are complex, cross-cloud usage capabilities are limited, and security risks are high.
By implementing a lightweight hardware key storage medium in the user terminal, temporary certificates and keys are periodically generated and sent to the application server through the certificate issuing server. The password application SDK under the application server performs encryption and decryption operations. If the key expires, the Key management center interactively recovers keys.
It achieves flexibility and security in the cloud, meets the dynamic changing needs of cloud servers, and reduces usage costs and operation and maintenance complexity.
Smart Images

Figure CN118432946B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a lightweight cryptographic application method, device and cryptographic application service system. Background Art
[0002] Cloud applications are applications that are mainly implemented on the cloud side under the control of end-side users. Application functions can be realized through the interaction between the end and the cloud. Most of its functions need to be implemented through cloud-side servers, namely application servers. However, the operating environment of cloud applications is complex. The traditional solution of configuring hardware cryptographic machines in application servers for business processing is difficult to meet the dynamic drift and elastic scaling characteristics of cloud services. There are also problems such as complex management and operation, limited cross-cloud usage capabilities, and great security risks.
[0003] Therefore, how to implement business processing related to cryptographic services for end-side user data on the application side while meeting the flexibility required by large-scale applications on the cloud is an urgent problem to be solved. Summary of the invention
[0004] The present invention provides a lightweight cryptographic application method, device and cryptographic application service system, so that the cryptographic application SDK can interact with other modules in the key service system to realize encryption and decryption business processing of end-side user data.
[0005] According to one aspect of the present invention, a lightweight cryptographic application method is provided, which is executed by a cryptographic application service system, wherein the cryptographic application service system comprises: a user terminal, a certificate issuing server, at least one application server, a CA certification center, and a key management center; the user terminal comprises a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module periodically generates a temporary certificate and a temporary key using the lightweight hardware key storage medium, and sends them to the application server through the certificate issuing server; the cryptographic application SDK corresponding to the application system under the application server obtains and stores the latest temporary certificate and the latest temporary key sent by the user terminal, and performs signing, signature verification, encryption, and decryption operations based on the latest temporary certificate and the latest temporary key;
[0006] The method comprises:
[0007] The cryptographic application SDK corresponding to the application system under the application server responds to the encryption request for the target data, encrypts the target data according to the latest temporary key, and responds to the encryption request according to the encrypted target ciphertext;
[0008] The cryptographic application SDK corresponding to the application system under the application server responds to the decryption request for the target data, obtains the target ciphertext and the time parameters corresponding to the target ciphertext, determines whether the currently stored temporary key meets the decryption requirements, and if not, interacts with the key management center to determine the recovery of the temporary key, and decrypts the target ciphertext based on the recovered temporary key to respond to the decryption request.
[0009] According to another aspect of the present invention, there is provided a lightweight cryptographic application device, which is configured in a cryptographic application service system, wherein the cryptographic application service system comprises: a user terminal, a certificate issuing server, at least one application server, a CA certification center, and a key management center; the user terminal comprises a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module periodically generates a temporary certificate and a temporary key using the lightweight hardware key storage medium, and sends them to the application server through the certificate issuing server; the cryptographic application SDK corresponding to the application system under the application server obtains and stores the latest temporary certificate and the latest temporary key sent by the user terminal, and performs signing, signature verification, encryption, and decryption operations based on the latest temporary certificate and the latest temporary key;
[0010] The device comprises:
[0011] The encryption module is used to control the cryptographic application SDK to respond to the encryption request for the target data, encrypt the target data according to the latest temporary key, and respond to the encryption request according to the encrypted target ciphertext;
[0012] The decryption module is used to control the cryptographic application SDK to respond to the decryption request for the target data, obtain the target ciphertext and the time parameters corresponding to the target ciphertext, determine whether the currently stored temporary key meets the decryption requirements, and if not, interact with the key management center to determine the recovery of the temporary key, and decrypt the target ciphertext based on the recovered temporary key to respond to the decryption request.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the lightweight cryptographic application method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the lightweight cryptographic application method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the lightweight cryptographic application method of any embodiment of the present invention is implemented.
[0019] According to the technical solution of the embodiment of the present invention, the cryptographic application SDK corresponding to the application system under the application server responds to the decryption request for the target data, obtains the target ciphertext and the time parameters corresponding to the target ciphertext, determines whether the currently stored temporary key meets the decryption requirements, and if not, interacts with the key management center to determine to restore the temporary key, and decrypts the target ciphertext based on the restored temporary key to respond to the decryption request. By adopting the cryptographic application SDK to replace the hardware cryptographic machine, the application server uses the lightweight cryptographic application SDK to use temporary certificates and temporary keys in a general computing environment to complete the cryptographic application, so as to meet the dynamic drift and elastic scaling characteristics of the cloud server, while achieving the effect of unlimited computing power and reduced usage costs, and users can directly participate in the generation, storage and use of keys.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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.
[0022] Figure 1 This is a flow chart of a lightweight cryptographic application method provided by Embodiment 1 of the present invention;
[0023] Figure 2 is a schematic diagram of the structure of a cryptographic application service system provided in Embodiment 2 of the present invention;
[0024] Figure 3 This is a structural block diagram of a lightweight cryptographic application device provided by Embodiment 3 of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0028] It should be noted that, in the relevant technology, it is often necessary to configure a cryptographic machine in the application system to support local identity authentication and data encryption and decryption. The technical solution of the present invention, by adopting a lightweight cryptographic application SDK loaded with temporary certificates and temporary keys, can realize all the functions of the traditional cryptographic machine, that is, realize the issuance mechanism and management mechanism based on temporary certificates and temporary keys, and at the same time ensure that the security of using the cryptographic application SDK in a soft environment is not reduced. The specific implementation method will be introduced in detail in the subsequent embodiments.
[0029] Embodiment 1
[0030] Figure 1 It is a flow chart of a lightweight cryptographic application method provided in Example 1 of the present invention; this embodiment can be applicable to the situation where the cryptographic application SDK corresponding to the application system under the application server in the cryptographic application service system interacts with the key management center to perform cryptographic service businesses such as data encryption and decryption. The method can be executed by a lightweight cryptographic application device, which can be implemented in the form of hardware and / or software. The lightweight cryptographic application device can be configured in an electronic device, such as in the cryptographic application service system, and executed by the control unit of the cryptographic application service system.
[0031] The cryptographic application service system provided by the present invention may include: a user terminal, a certificate issuing server, at least one application server, a CA (Certificate Authority) authentication center and a key management center; the user terminal includes a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module uses the lightweight hardware key storage medium to periodically generate temporary certificates and temporary keys, and send them to the corresponding application server; the lightweight hardware key storage medium is specifically a hardware security module, and the lightweight hardware key storage medium is configured in a USBKEY, a token or a bracelet.
[0032] The cryptographic application SDK (Software Development Kit) corresponding to the application system under the application server is used to obtain and store the latest temporary certificate and the latest temporary key sent by the user terminal, and perform signing, signature verification, encryption and decryption operations based on the latest temporary certificate and the latest temporary key.
[0033] like Figure 1 As shown, the lightweight password application method includes:
[0034] S101. The cryptographic application SDK corresponding to the application system under the application server responds to an encryption request for target data, encrypts the target data according to the latest temporary key, and responds to the encryption request according to the encrypted target ciphertext.
[0035] Among them, the target data refers to the target data received by the client for encryption, the encryption request refers to the request sent by the client to the corresponding application server, the latest temporary key refers to the latest temporary key stored locally by the cryptographic application SDK corresponding to the application system under the application server, and the essence of the latest temporary key can be a symmetric key pair. The cryptographic application SDK can only store one temporary key locally, that is, the latest temporary key. If a new temporary key is detected by the user terminal through the certificate issuing server, the certificate deployment module on the application server can be used to update the latest temporary key and delete the old temporary key. In this way, the security of the digital certificate can be maximized, thereby ensuring the security of the entire cryptographic application system. The target ciphertext refers to the ciphertext generated after encrypting the target data with the latest temporary key.
[0036] Optionally, the cryptographic application SDK may periodically obtain and store the latest temporary certificate and the latest temporary key sent by the user terminal, and destroy the old temporary key stored locally, so that the cryptographic application SDK only stores the latest temporary key locally.
[0037] It should be noted that by setting the temporary key to a frequently updated mode, the losses caused by password leakage can be effectively reduced and the security of the data processing process can be improved.
[0038] Optionally, when the cryptographic application SDK detects a data encryption instruction issued by a client using the cryptographic service, it can determine that an encryption request for the target data has been detected, and further respond to the encryption request for the target data by obtaining a unique and latest temporary key, that is, the latest temporary key, from the local computer, encrypting the target data using the latest temporary key to obtain the target ciphertext, and sending the target ciphertext to the corresponding client to complete the response to the encryption request.
[0039] Optionally, the temporary certificate issuance module in the user terminal uses a lightweight hardware key storage medium to periodically generate a temporary certificate and a temporary key, and send them to the application server, including: obtaining the application public key generated by the lightweight hardware key storage medium, and applying for a long-term certificate from the CA certification center based on the application public key; applying for a master key from the key management center based on the long-term certificate, and storing it in the lightweight hardware key storage medium; according to the certificate update cycle in the pre-set certificate issuance policy, if it is detected that the cycle conditions are met, a temporary certificate and a temporary key are generated based on the long-term certificate and the master key in the lightweight hardware key storage medium; and sending the temporary certificate and the temporary key to the application server through the certificate issuance server.
[0040] Among them, the lightweight hardware key storage medium can be a USB KEY, a password card or other portable device with a hardware password chip (such as a token and a bracelet). The application public key refers to the public key generated by the lightweight hardware key storage medium for applying for a long-term certificate representing the identity of the application system. For example, a long-term certificate can be a long-validity X.509 format digital certificate with issuance standards. The master key refers to the master symmetric key generated by the key management center. The certificate issuance policy refers to a policy that characterizes the certificate issuance method generated in advance based on the configuration information entered by the application administrator. The configuration information may include at least one of the following: certificate update cycle, batch certificate generation quantity, application server address, certificate deployment component communication port, cryptographic application SDK installation path, and temporary certificate warning strategy. The certificate update cycle can be, for example, 24 hours. The cycle condition refers to the condition that characterizes whether the time interval between the current time and the last issuance of a temporary certificate and temporary key is greater than the certificate update cycle.
[0041] Optionally, the master symmetric key can be generated by the key management center, or the lightweight storage medium can generate a key itself as a symmetric key, i.e., the master key, without relying on the key management center. A long-term certificate can also be generated first, and the long-term certificate can be used to complete identity authentication at the key management center to obtain the master key.
[0042] Optionally, according to a certificate renewal cycle in a preset certificate issuance policy, if it is detected that the time interval between the current time and the last issuance of a temporary certificate and a temporary key is greater than the certificate renewal cycle, it is determined that the cycle condition is met.
[0043] Optionally, if it is determined that the periodic conditions are met, the temporary certificate issuance module can generate temporary certificate application information and submit it to the lightweight hardware key storage medium to apply for the use of a long-term certificate to issue a temporary certificate. The lightweight hardware key storage medium can call the long-term certificate private key to perform a temporary certificate data signature operation and feed the signature result back to the temporary certificate issuance module. Further, the temporary certificate issuance module can assemble the certificate application information and data signature results to generate the latest temporary certificate.
[0044] Optionally, the temporary certificate issuance module can call a lightweight hardware key storage medium to apply for a temporary key. Further, after receiving the temporary key generation request, the lightweight hardware key storage medium can call the local cryptographic chip to obtain the latest temporary key according to the key generation algorithm, wherein the generation formula of the latest temporary key (TK) is: TK=KDF(SSK,TF), wherein KDF is a secure key derivation function, TF is a time-related public variable, for example: the current date, SSK is the master key, further, the lightweight hardware key storage medium can send the generated latest temporary key to the temporary certificate issuance module to instruct the temporary certificate issuance module to securely pass the latest temporary certificate and the latest temporary key to the certificate issuing server.
[0045] Optionally, the certificate issuing server is specifically used to: regularly notify the user terminal to generate the latest temporary certificate and the latest temporary key according to the certificate generation policy; obtain the latest temporary certificate and the latest temporary key sent by the user terminal; and according to the certificate issuing policy, pass the latest temporary certificate and the latest temporary key to the cryptographic application SDK corresponding to the application system under the application server to instruct the cryptographic application SDK to destroy the old temporary key after automatically deploying the latest temporary certificate and the latest temporary key.
[0046] Optionally, after the certificate issuing server obtains the latest temporary certificate and the latest temporary key sent by the temporary certificate issuing module in the user terminal, it can be securely stored locally, preparing to execute the issuing action according to the certificate issuing policy later.
[0047] Optionally, the certificate publishing server can securely pass the latest temporary certificate and the latest temporary key to the certificate deployment module in the specified application server according to the certificate publishing policy, to instruct the certificate deployment module to securely deploy the received latest temporary certificate and the latest temporary key to the key storage area corresponding to the cryptographic application SDK on this server. Finally, the cryptographic application SDK can update and load the latest temporary certificate and the latest temporary encryption key to the local cryptographic computing environment according to the execution policy, and destroy the old temporary key at the same time.
[0048] S102. The cryptographic application SDK corresponding to the application system under the application server responds to the decryption request for the target data, obtains the target ciphertext and the time parameter corresponding to the target ciphertext, and determines whether the currently stored temporary key meets the decryption requirement.
[0049] Among them, the decryption request refers to a request to decrypt the target ciphertext corresponding to the target data to obtain the original target data. The time parameter corresponding to the target ciphertext is: the time parameter corresponding to the temporary key used when generating the target ciphertext. The temporary key is generated according to the master key and time parameter in the lightweight storage medium. The temporary key string contains the time parameter. The time parameter can specifically be the time when the corresponding temporary key is generated. That is to say, the ciphertext data of this application needs to be bound to the time when the temporary key is generated for easy recovery, and is specifically stored as a time parameter.
[0050] The currently stored temporary key may be the latest temporary key used for encryption, or it may be a new temporary key obtained after periodic update, that is, the latest temporary key used for encryption and the currently stored temporary key obtained in response to the decryption request may be the same or different. The decryption requirement refers to the requirement to determine whether the currently stored temporary key is the latest temporary key used for encryption.
[0051] Optionally, the generation time of the currently stored temporary key can be determined, and further determination can be made as to whether the generation time is consistent with the encryption time in the time parameters corresponding to the target ciphertext. If they are consistent, it is determined that the decryption requirements are met, and the currently stored temporary key can be used to directly decrypt the target ciphertext. If they are inconsistent, it is necessary to interact with the key management center to obtain the temporary key used to encrypt the target ciphertext, that is, to recover the temporary key.
[0052] S103: If not, interact with the key management center to determine to recover the temporary key, and decrypt the target ciphertext based on the recovered temporary key to respond to the decryption request.
[0053] The restored temporary key refers to a temporary key recovered from a key management center, and the restored temporary key is essentially the same as the latest temporary key used during encryption.
[0054] Optionally, the cryptographic application SDK corresponding to the application system under the application server interacts with the key management center to determine the recovery of the temporary key, including: (1) the cryptographic application SDK corresponding to the application system under the application server generates a key recovery request according to the time parameter corresponding to the target ciphertext and the latest temporary certificate, and uses the signature private key corresponding to the latest temporary certificate to perform a signature operation on the key recovery request to obtain signature data; (2) the cryptographic application SDK corresponding to the application system under the application server sends the key recovery request and the corresponding signature data to the key management center to instruct the key management center to verify and perform the key recovery operation after the verification is passed; (3) the cryptographic application SDK corresponding to the application system under the application server obtains the encrypted temporary key fed back by the key management center after the verification is passed, and decrypts the encrypted temporary key to obtain the recovery temporary key.
[0055] Among them, the key recovery request refers to a request to obtain the recovery temporary key, which can contain the previous temporary certificate and the time parameter corresponding to the target ciphertext. The key management center uses the long-term certificate to verify the application server; the encrypted temporary key refers to the key obtained by the key management center after encrypting the recovery temporary key. After the key application SDK obtains the encrypted temporary key, it must first decrypt it to obtain the recovery temporary key.
[0056] The signature private key refers to the private key used to sign the key recovery request. The signature private key and the signature public key are an asymmetric key pair, in which the public key is stored in the temporary certificate. The signature private key corresponding to the temporary certificate is also stored in the key application SDK along with the temporary certificate after it is generated. During the key recovery process, the key application SDK, as the key recovery initiator, first uses the signature private key corresponding to the latest temporary certificate stored in itself to sign the original key recovery data (including the temporary certificate), and sends the signed data along with the original key recovery data to the key management center.
[0057] The key management center can use the public key in the temporary certificate in the original key recovery data to verify the signature data of the key recovery request to determine whether the data has been tampered with;
[0058] The key management center can use the certificate information in the temporary certificate to find the corresponding long-term certificate identification stored therein and use the public key of the long-term certificate to verify the signature information in the temporary certificate.
[0059] After the key application SDK receives the recovery key ciphertext encrypted by the key management center using the temporary certificate public key, it can again use the signature private key corresponding to the temporary certificate to perform decryption to obtain the recovered key original data, that is, the recovery temporary key.
[0060] Optionally, the application server uses the signature private key corresponding to the latest temporary certificate to perform a signing operation on the key recovery request to obtain signature data, including: using a preset hash algorithm to process the key recovery request to obtain a signature hash value, and generating signature data based on the signature hash value and the signature private key based on preset operation rules.
[0061] Optionally, the application server can send the signature data and the key recovery request to the key management center. The key management center can use the same hash algorithm as the application server to process the key recovery request to generate a second verification result, and use the signature public key and the signature data to perform mathematical operations to obtain the first verification result. If the first verification result and the second verification result are the same, the verification is considered to be passed.
[0062] Optionally, the key management center uses a long-term certificate for verification, including: the cryptographic management center receives a key recovery request, uses the temporary certificate in the key recovery request to verify the signature data, obtains a first verification result, processes the key recovery request using a preset hash algorithm, determines a second verification result, and compares the first verification result and the second verification result; if the first verification result and the second verification result are consistent, determines the locally stored long-term certificate identifier based on the issuer information of the temporary certificate; determines the long-term certificate stored in the key management center based on the long-term certificate identifier, and determines the authenticity of the temporary certificate based on the long-term certificate.
[0063] The first verification result is the result of verifying the identity of the application server based on the temporary certificate. The second verification result refers to the result obtained by verifying based on the hash algorithm. The long-term certificate identifier can uniquely represent the corresponding long-term certificate.
[0064] Optionally, when the first verification result and the second verification result are consistent, the locally stored long-term certificate identifier can be determined based on the issuer information of the temporary certificate; the long-term certificate stored in the key management center can be determined based on the long-term certificate identifier, and finally, it is determined whether the certificate identifier carried in the temporary certificate is consistent with the long-term certificate identifier. If so, it can be determined that the temporary certificate is valid, that is, the authenticity of the temporary certificate is determined.
[0065] Optionally, the key management center performs a key recovery operation, including: determining the target master key corresponding to the long-term certificate identifier based on the long-term certificate identifier and the preset correspondence between the long-term certificate and the master key; generating a recovery temporary key based on the time parameters and target master key corresponding to the target ciphertext in the key recovery request, and encrypting the recovery temporary key using the public key in the temporary certificate to obtain the encrypted temporary key to feed back to the application server.
[0066] Among them, there is a one-to-one correspondence between the long-term certificate and the master key. Each application service can correspond to a long-term certificate and a master key. The target master key refers to the master key corresponding to the application server.
[0067] Optionally, a recovery temporary key may be generated according to the encryption time in the time parameter and the target master key based on the same temporary key generation method as provided in the above step S101.
[0068] It should be noted that the present invention completes the encryption and decryption operations of the application system on the client through a temporary key derived from the master key, so that the master key can be stored in a secure user terminal at all times, thereby protecting the security of the master key to the greatest extent. In addition, in view of the situation where the temporary key may have been updated during decryption due to frequent updates of the temporary key, a solution for interacting with the key management center to perform key recovery operations is provided, which can ensure the safe and effective data encryption and decryption process.
[0069] According to the technical solution of the embodiment of the present invention, the cryptographic application SDK corresponding to the application system under the application server responds to the decryption request for the target data, obtains the target ciphertext and the time parameters corresponding to the target ciphertext, determines whether the currently stored temporary key meets the decryption requirements, and if not, interacts with the key management center to determine to restore the temporary key, and decrypts the target ciphertext based on the restored temporary key to respond to the decryption request. By adopting the cryptographic application SDK to replace the hardware cryptographic machine, the cryptographic service of the application server can be implemented using a lightweight cryptographic application SDK to meet the dynamic drift and elastic scaling characteristics of the cloud server, while reducing the cost of use.
[0070] Embodiment 2
[0071] Figure 2 : is a structural diagram of a cryptographic application service system provided in Embodiment 2 of the present invention; the cryptographic application service system provided in this embodiment can execute the lightweight cryptographic application method provided in the above embodiment;
[0072] For example, Figure 2As shown, the cryptographic application service system specifically includes: a user terminal, a certificate issuing server, two application servers, a CA certification center and a key management center; the user terminal includes a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module uses the lightweight hardware key storage medium to periodically generate temporary certificates and temporary keys, and send them to the application server; the cryptographic application SDK corresponding to the application system under the application server obtains and stores the latest temporary certificate and the latest temporary key sent by the user terminal, that is, the latest temporary certificate and the latest temporary key, and performs signing, verification, encryption and decryption operations based on the latest temporary certificate and the latest temporary key; the application server includes a certificate deployment module; the certificate issuing server includes a certificate issuing system; the lightweight hardware key storage medium is used to store long-term certificates (i.e., long-term certificates) and master keys;
[0073] The cryptographic application SDK is specifically used to: respond to an encryption request for target data, encrypt the target data according to the latest temporary key, and respond to the encryption request according to the encrypted target ciphertext;
[0074] The cryptographic application SDK is also used to: respond to a decryption request for the target data, obtain the target ciphertext and the time parameters corresponding to the target ciphertext, determine whether the currently stored temporary key meets the decryption requirements, and if not, interact with the key management center to determine the recovery of the temporary key, and decrypt the target ciphertext based on the recovered temporary key to respond to the decryption request.
[0075] Furthermore, the password application SDK corresponding to the application system under the application server is specifically used for:
[0076] Generate a key recovery request according to the time parameter corresponding to the target ciphertext and the latest temporary certificate, and use the signature private key corresponding to the latest temporary certificate to perform a signature operation on the key recovery request to obtain signature data; send the key recovery request and the corresponding signature data to the key management center to instruct the key management center to verify and perform a key recovery operation after the verification is passed; the key management center uses the long-term certificate for verification; obtain the encrypted temporary key fed back by the key management center after the verification is passed, and decrypt the encrypted temporary key to obtain the restored temporary key. Among them, the key management center stores the corresponding relationship between the application identifier, the long-term certificate and the master key.
[0077] It should be noted that the cryptographic application SDK provided by the present invention can use temporary certificates and temporary keys to perform signing and signature verification operations, and also has random number generation, hashing and other calculation functions, that is, it is functionally equivalent to a hardware cryptographic machine device, and the entire system setting can also ensure that it is equivalent to a hardware cryptographic machine in terms of security, thereby realizing the replacement of the cryptographic machine.
[0078] Furthermore, the key management center is specifically used for:
[0079] Receive a key recovery request, verify the signature data using the temporary certificate in the key recovery request to obtain a first verification result, process the key recovery request using a preset hash algorithm, determine a second verification result, and compare the first verification result with the second verification result;
[0080] If the first verification result and the second verification result are consistent, determining the locally stored long-term certificate identifier according to the issuer information of the temporary certificate;
[0081] According to the long-term certificate identifier, the long-term certificate stored in the key management center is determined, and the authenticity of the temporary certificate is determined based on the long-term certificate.
[0082] Furthermore, the key management center is also used to:
[0083] According to the long-term certificate identifier and the preset correspondence between the long-term certificate and the master key, determine the target master key corresponding to the long-term certificate identifier;
[0084] A temporary recovery key is generated according to the time parameter and the target master key corresponding to the target ciphertext in the key recovery request, and the temporary recovery key is encrypted using the public key in the temporary certificate to obtain the encrypted temporary key to be fed back to the application server.
[0085] Furthermore, the temporary certificate issuance module in the user terminal is specifically used for:
[0086] Obtain the application public key generated by the lightweight hardware key storage medium, and apply for a long-term certificate from the CA certification center based on the application public key;
[0087] Apply to the key management center for the master key based on the long-term certificate and store it in a lightweight hardware key storage medium;
[0088] According to the certificate renewal cycle in the pre-set certificate issuance policy, if it is detected that the cycle conditions are met, a temporary certificate and temporary key are generated based on the long-term certificate and master key in the lightweight hardware key storage medium;
[0089] The temporary certificate and the temporary key are sent to the application server through the certificate issuing server.
[0090] Furthermore, the certificate issuing server is specifically used for:
[0091] Obtain the latest temporary certificate and the latest temporary key sent by the user terminal;
[0092] According to the certificate issuance policy, the latest temporary certificate and the latest temporary key are delivered to the cryptographic application SDK corresponding to the application system under the application server to instruct the cryptographic application SDK to destroy the old temporary key after automatically deploying the latest temporary certificate and the latest temporary key.
[0093] Embodiment 3
[0094] Figure 3 It is a structural block diagram of a lightweight cryptographic application device provided in the third embodiment of the present invention; this embodiment can be applied to the situation where the cryptographic application SDK corresponding to the application system under the application server in the cryptographic application service system interacts with the key management center to perform cryptographic services such as data encryption and decryption. The lightweight cryptographic application device provided in the embodiment of the present invention can execute the lightweight cryptographic application method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method; the lightweight cryptographic application device can be implemented in the form of hardware and / or software, and configured in an electronic device with lightweight cryptographic application functions, such as in a cryptographic application service system, and is executed by the control unit of the cryptographic application service system. Figure 3 As shown, the lightweight password application device specifically includes:
[0095] The encryption module 301 is used to control the cryptographic application SDK to respond to the encryption request for the target data, encrypt the target data according to the latest temporary key, and respond to the encryption request according to the encrypted target ciphertext;
[0096] The decryption module 302 is used to control the cryptographic application SDK to respond to the decryption request for the target data, obtain the target ciphertext and the time parameters corresponding to the target ciphertext, determine whether the currently stored temporary key meets the decryption requirements, and if not, interact with the key management center to determine the recovery of the temporary key, and decrypt the target ciphertext based on the recovered temporary key to respond to the decryption request.
[0097] According to the technical solution of the embodiment of the present invention, the cryptographic application SDK corresponding to the application system under the application server responds to the decryption request for the target data, obtains the target ciphertext and the time parameters corresponding to the target ciphertext, determines whether the currently stored temporary key meets the decryption requirements, and if not, interacts with the key management center to determine to restore the temporary key, and decrypts the target ciphertext based on the restored temporary key to respond to the decryption request. By adopting the cryptographic application SDK to replace the hardware cryptographic machine, the cryptographic service of the application server can be implemented using a lightweight cryptographic application SDK to meet the dynamic drift and elastic scaling characteristics of the cloud server, while reducing the cost of use.
[0098] Furthermore, the time parameter corresponding to the target ciphertext is: a time parameter corresponding to a temporary key used when generating the target ciphertext, and the temporary key is generated according to a master key and a time parameter in a lightweight storage medium.
[0099] Furthermore, the decryption module 302 may include:
[0100] The obtaining unit is used to control the cryptographic application SDK corresponding to the application system under the application server to generate a key recovery request according to the time parameter corresponding to the target ciphertext and the latest temporary certificate, and use the signature private key corresponding to the latest temporary certificate to perform a signing operation on the key recovery request to obtain signature data;
[0101] A sending unit, used to control the cryptographic application SDK corresponding to the application system under the application server to send a key recovery request and corresponding signature data to the key management center, so as to instruct the key management center to perform verification and execute the key recovery operation after the verification is passed; the key management center uses a long-term certificate for verification;
[0102] The decryption unit is used to control the cryptographic application SDK corresponding to the application system under the application server to obtain the encrypted temporary key fed back by the key management center after verification, and decrypt the encrypted temporary key to obtain the recovery temporary key.
[0103] Furthermore, the sending unit is specifically used for:
[0104] Control the password management center to receive the key recovery request, verify the signature data using the temporary certificate in the key recovery request, obtain a first verification result, process the key recovery request using a preset hash algorithm, determine a second verification result, and compare the first verification result with the second verification result;
[0105] If the first verification result and the second verification result are consistent, determining the locally stored long-term certificate identifier according to the issuer information of the temporary certificate;
[0106] According to the long-term certificate identifier, the long-term certificate stored in the key management center is determined, and the authenticity of the temporary certificate is determined based on the long-term certificate.
[0107] Furthermore, the sending unit is also used for:
[0108] The control key management center determines the target master key corresponding to the long-term certificate identifier according to the long-term certificate identifier and the preset correspondence between the long-term certificate and the master key;
[0109] A temporary recovery key is generated according to the time parameter and the target master key corresponding to the target ciphertext in the key recovery request, and the temporary recovery key is encrypted using the public key in the temporary certificate to obtain an encrypted temporary key to feed back to the application server.
[0110] Furthermore, the above device is also used for:
[0111] Control the temporary certificate issuance module in the user terminal to obtain the application public key generated by the lightweight hardware key storage medium, and apply for a long-term certificate from the CA certification center based on the application public key;
[0112] Apply to the key management center for the master key based on the long-term certificate and store it in a lightweight hardware key storage medium;
[0113] According to the certificate renewal cycle in the pre-set certificate issuance policy, if it is detected that the cycle conditions are met, a temporary certificate and temporary key are generated based on the long-term certificate and master key in the lightweight hardware key storage medium;
[0114] The temporary certificate and the temporary key are sent to the application server through the certificate issuing server.
[0115] Furthermore, the above device is also used for:
[0116] Control the certificate issuing server to regularly notify the user terminal to generate the latest temporary certificate and the latest temporary key according to the certificate generation policy;
[0117] Obtain the latest temporary certificate and the latest temporary key sent by the user terminal;
[0118] According to the certificate issuance policy, the latest temporary certificate and the latest temporary key are delivered to the cryptographic application SDK corresponding to the application system under the application server, so as to instruct the cryptographic application SDK to destroy the old temporary key after automatically deploying the latest temporary certificate and the latest temporary key;
[0119] Furthermore, the lightweight hardware key storage medium is specifically a hardware security module, and the lightweight hardware key storage medium is configured in a USBKEY, a token or a bracelet.
[0120] Embodiment 4
[0121] Figure 4 is a schematic diagram of the structure of an electronic device provided by Embodiment 4 of the present invention; Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0122] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0123] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0124] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a lightweight cryptographic application method.
[0125] In some embodiments, the lightweight cryptographic application method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the lightweight cryptographic application method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the lightweight cryptographic application method in any other appropriate manner (e.g., by means of firmware).
[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable lightweight cryptographic application device, so that the computer program, when executed by the processor, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or completely on a remote machine or server.
[0128] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0129] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0130] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0131] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0132] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the lightweight cryptographic application method of any embodiment of the present invention when executed by a processor.
[0133] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0134] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0135] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A lightweight key application method, characterized in that: Executed by a cryptographic application service system, the cryptographic application service system includes: a user terminal, a certificate issuing server, at least one application server, a CA certification center, and a key management center; the user terminal includes a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module uses the lightweight hardware key storage medium to periodically generate temporary certificates and temporary keys, and sends them to the application server through the certificate issuing server; the cryptographic application SDK corresponding to the application system under the application server obtains and stores the latest temporary certificate and the latest temporary key sent by the user terminal, and performs signing, verification, encryption, and decryption operations based on the latest temporary certificate and the latest temporary key; The method comprises: The cryptographic application SDK corresponding to the application system under the application server responds to the encryption request for the target data, encrypts the target data according to the latest temporary key, and responds to the encryption request according to the encrypted target ciphertext; The cryptographic application SDK corresponding to the application system under the application server responds to the decryption request for the target data, obtains the target ciphertext and the time parameter corresponding to the target ciphertext, determines whether the currently stored temporary key meets the decryption requirement, and if not, interacts with the key management center to determine to restore the temporary key, and decrypts the target ciphertext based on the restored temporary key to respond to the decryption request; Among them, the cryptographic application SDK corresponding to the application system under the application server interacts with the key management center to determine the recovery of the temporary key, including: the cryptographic application SDK corresponding to the application system under the application server generates a key recovery request according to the time parameter corresponding to the target ciphertext and the latest temporary certificate, and uses the signature private key corresponding to the latest temporary certificate to perform a signature operation on the key recovery request to obtain signature data; the cryptographic application SDK corresponding to the application system under the application server sends the key recovery request and the corresponding signature data to the key management center to instruct the key management center to verify and perform the key recovery operation after the verification is passed; the key management center uses a long-term certificate for verification; the cryptographic application SDK corresponding to the application system under the application server obtains the encrypted temporary key fed back by the key management center after the verification is passed, and decrypts the encrypted temporary key to obtain the recovery temporary key; Among them, the key management center uses the long-term certificate for verification, including: the password management center receives the key recovery request, uses the temporary certificate in the key recovery request to verify the signature data, obtains a first verification result, processes the key recovery request using a preset hash algorithm, determines a second verification result, and compares the first verification result and the second verification result; if the first verification result and the second verification result are consistent, determines the locally stored long-term certificate identifier according to the issuer information of the temporary certificate; determines the long-term certificate stored in the key management center according to the long-term certificate identifier, and determines the authenticity of the temporary certificate according to the long-term certificate; Among them, the key management center performs a key recovery operation, including: determining the target master key corresponding to the long-term certificate identifier according to the long-term certificate identifier and the preset correspondence between the long-term certificate and the master key; generating a recovery temporary key according to the time parameters and the target master key corresponding to the target ciphertext in the key recovery request, and encrypting the recovery temporary key using the public key in the temporary certificate to obtain the encrypted temporary key to feed back to the application server.
2. The method according to claim 1, wherein: The time parameter corresponding to the target ciphertext is: a time parameter corresponding to a temporary key used when generating the target ciphertext, and the temporary key is generated according to a master key and a time parameter in a lightweight storage medium.
3. The method according to claim 1, characterized in that The temporary certificate issuance module periodically generates a temporary certificate and a temporary key using a lightweight hardware key storage medium, and sends them to the application server through a certificate issuing server, including: Obtain the application public key generated by the lightweight hardware key storage medium, and apply for a long-term certificate from the CA certification center based on the application public key; Apply to the key management center for the master key based on the long-term certificate and store it in a lightweight hardware key storage medium; According to the certificate renewal cycle in the pre-set certificate issuance policy, if it is detected that the cycle conditions are met, a temporary certificate and temporary key are generated based on the long-term certificate and master key in the lightweight hardware key storage medium; The temporary certificate and the temporary key are sent to the application server through the certificate issuing server.
4. The method according to claim 1, characterized in that in, The certificate issuing server is specifically used for: According to the certificate generation policy, the user terminal is regularly notified to generate the latest temporary certificate and the latest temporary key; Obtain the latest temporary certificate and the latest temporary key sent by the user terminal; According to the certificate issuance policy, the latest temporary certificate and the latest temporary key are delivered to the cryptographic application SDK corresponding to the application system under the application server to instruct the cryptographic application SDK to destroy the old temporary key after automatically deploying the latest temporary certificate and the latest temporary key.
5. The method according to claim 1, wherein: The lightweight hardware key storage medium is specifically a hardware security module, and the lightweight hardware key storage medium is configured in a USBKEY, a token or a bracelet.
6. A lightweight cryptographic application device, characterized in that: The device is used to implement the lightweight cryptographic application method described in any one of claims 1-5 when executed, and is configured in a cryptographic application service system, which includes: a user terminal, a certificate issuing server, at least one application server, a CA certification center, and a key management center; the user terminal includes a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module uses the lightweight hardware key storage medium to periodically generate a temporary certificate and a temporary key, and sends them to the application server through the certificate issuing server; the cryptographic application SDK corresponding to the application system under the application server obtains and stores the latest temporary certificate and the latest temporary key sent by the user terminal, and performs signing, signature verification, encryption, and decryption operations based on the latest temporary certificate and the latest temporary key; The device comprises: The encryption module is used to control the cryptographic application SDK to respond to the encryption request for the target data, encrypt the target data according to the latest temporary key, and respond to the encryption request according to the encrypted target ciphertext; The decryption module is used to control the cryptographic application SDK to respond to the decryption request for the target data, obtain the target ciphertext and the time parameters corresponding to the target ciphertext, determine whether the currently stored temporary key meets the decryption requirements, and if not, interact with the key management center to determine the recovery of the temporary key, and decrypt the target ciphertext based on the recovered temporary key to respond to the decryption request.
7. A cryptographic application service system, characterized in that: The system is used to implement the lightweight cryptographic application method described in any one of claims 1 to 5 when executed, and specifically includes: a user terminal, a certificate issuing server, at least one application server, a CA certification center, and a key management center; the user terminal includes a temporary certificate issuing module and a lightweight hardware key storage medium; the temporary certificate issuing module uses the lightweight hardware key storage medium to periodically generate a temporary certificate and a temporary key, and sends them to the application server through the certificate issuing server; the cryptographic application SDK corresponding to the application system under the application server obtains and stores the latest temporary certificate and the latest temporary key sent by the user terminal, and performs signing, verification, encryption, and decryption operations based on the latest temporary certificate and the latest temporary key; The cryptographic application SDK is specifically used to: respond to an encryption request for target data, encrypt the target data according to the latest temporary key, and respond to the encryption request according to the encrypted target ciphertext; The cryptographic application SDK is also used to: respond to a decryption request for target data, obtain the target ciphertext and the time parameters corresponding to the target ciphertext, determine whether the currently stored temporary key meets the decryption requirements, and if not, interact with the key management center to determine the recovery of the temporary key, and decrypt the target ciphertext based on the recovered temporary key to respond to the decryption request.
Citation Information
Patent Citations
Dynamic intelligent security key generation, management and control system and method under WiFi environment
CN104580246A
A revocable identity public key encryption method
CN109873699A
Information transmission method and device, electronic equipment and computer readable storage medium
CN115913541A
Apparatus and method for certificate enrollment
US20180375667A1
