U-Shield key backup method and system
The ECDH algorithm is used to generate temporary symmetric keys, which solves the problem of key leakage during the USB key backup process and realizes safe and efficient key backup.
Patent Information
- Application Number
- CN202411423032.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-10-12
AI Technical Summary
During the key backup process of the USB shield, how to improve the security of key backup to prevent key leakage.
The ECDH algorithm is used to generate a temporary symmetric key, and the public and private keys between the main USB shield and the replica USB shield are used to exchange keys. The temporary symmetric key is used to encrypt and decrypt the backup key to avoid the transmission and storage of plaintext keys.
It effectively prevents the risk of key leakage and improves the security of the key backup process.
Smart Images

Figure CN119276489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of USB-shield key backup, and in particular to a USB-shield key backup method and system. Background Art
[0002] As a small hardware security module, the USB Shield provides functions such as key storage, encryption, decryption, signing, and signature verification. Considering that the keys are stored in a USB Shield, if the USB Shield is damaged due to hardware problems, the loss of the stored keys will cause encrypted data to be unable to be decrypted. Therefore, it is often necessary to have redundant backups of the keys in the USB Shield to ensure high key availability.
[0003] However, in the process of redundantly backing up the key in the U-Shield, key leakage may occur. Therefore, the backup process needs to be securely processed to ensure that the key plain text does not appear anywhere other than the U-Shield.
[0004] Based on this, how to improve the security of the key backup process has become a technical problem that needs to be solved urgently. Summary of the Invention
[0005] In view of this, in order to solve the above technical problems, the present invention provides a USB-shield key backup method and system.
[0006] The present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a key backup method for a USB shield, which is applied to a key backup system for a USB shield. The key backup system for the USB shield includes: a master USB shield, a replica USB shield, a computer terminal, and a server terminal. The computer terminal is installed with an external key system agent, and the server terminal is installed with a key management system. The key backup method for the USB shield includes:
[0008] After the external key system agent successfully establishes communication connections with the master U shield and the replica U shield respectively, the master U shield obtains the key information to be backed up sent by the user through the external key system agent;
[0009] The master U shield obtains the encrypted public key of the replica U shield from the key management system through the external key system agent;
[0010] The master U shield generates a first temporary symmetric key based on ECDH according to the public key of the replica U shield and its own private key;
[0011] The replica U shield obtains the encrypted public key of the master U shield from the key management system through the external key system agent;
[0012] The replica USB shield generates a second temporary symmetric key based on ECDH according to the public key of the master USB shield and its own private key; the first temporary symmetric key is the same as the second temporary symmetric key;
[0013] The external key system agent obtains the encrypted key to be backed up sent by the master U shield; the key to be backed up is encrypted using the first temporary symmetric key, and the key to be backed up is determined according to the key to be backed up information;
[0014] The external key system agent sends the encrypted key to be backed up to the replica U shield;
[0015] The copy U shield uses the second temporary symmetric key to decrypt the encrypted key to be backed up;
[0016] The copy U shield stores the key to be backed up.
[0017] Optionally, the master USB shield obtains the encrypted public key of the replica USB shield from the key management system through the external key system agent, specifically including:
[0018] After determining that the main U shield has obtained the key information to be backed up, the external key system agent sends a request to the key management system to obtain the copy U shield public key;
[0019] The key management system sends the encrypted public key of the copy U shield to the external key system agent according to the request to obtain the copy U shield public key;
[0020] The external key system agent forwards the encrypted public key of the replica U shield to the master U shield.
[0021] Optionally, the replica USB shield obtains the encrypted public key of the master USB shield from the key management system through the external key system agent, specifically including:
[0022] After the external key system agent receives the first prompt sent by the master USB shield, the external key system agent sends a request to the key management system to obtain the master USB shield public key; the first prompt is a prompt for successfully generating a first temporary symmetric key;
[0023] The key management system sends the encrypted public key of the master U shield to the external key system agent according to the request to obtain the master U shield public key;
[0024] The external key system agent forwards the encrypted public key of the master U shield to the replica U shield.
[0025] Optionally, the external key system agent obtains the encrypted key to be backed up sent by the master USB shield, specifically including:
[0026] After receiving the second prompt sent by the replica USB shield, the external key system agent sends an instruction to obtain the key to be backed up to the master USB shield; the second prompt is a prompt for successfully generating a second temporary symmetric key;
[0027] The master U shield encrypts the key to be backed up using the first temporary symmetric key according to the instruction to obtain the key to be backed up;
[0028] The master U shield sends the encrypted key to be backed up to the external key system agent.
[0029] Optionally, before the main USB shield obtains the key information to be backed up sent by the user through the external key system agent, the key backup method of the USB shield of the present invention further includes:
[0030] After the user successfully logs in to the external key system agent, the external key system agent obtains the first USB shield information of the master USB shield; the first USB shield information includes the device serial number and the encrypted first random number and its generation time;
[0031] The external key system agent sends the target Token and the first USB shield information to the key management system;
[0032] After the key management system verifies the target token and the first USB shield information, the key management system generates first server information; the first server information includes the first cloud signature, the encrypted server certificate, and the encrypted first challenge random number and its generation time;
[0033] The key management system generates and caches a first temporary session key based on the first random number and the first challenge random number based on the AES algorithm;
[0034] The key management system sends the first server information to the master U shield through the external key system agent;
[0035] After the primary USB shield passes the first server information authentication, the primary USB shield generates and caches a first temporary session key based on the AES algorithm according to the first random number and the first challenge random number;
[0036] The master U shield sends first authentication result data to the key management system through the external key system agent; the encrypted data in the first authentication result data is encrypted using the first temporary session key;
[0037] The key management system verifies the first authentication result data and sends the first verification result to the external key system agent;
[0038] If the external key system agent determines that the first authentication result data verification is passed according to the first verification result, the external key system agent establishes a communication connection with the master U shield;
[0039] The external key system agent obtains the second U shield information of the copy U shield; the second U shield information includes the device serial number and the encrypted second random number and its generation time;
[0040] The external key system agent sends the target Token and the second U shield information to the key management system;
[0041] After the key management system verifies the target token and the second USB shield information, the key management system generates second server information; the second server information includes the second cloud signature, the encrypted server certificate, and the encrypted second challenge random number and its generation time;
[0042] The key management system generates and caches a second temporary session key based on the second random number and the second challenge random number based on the AES algorithm;
[0043] The key management system sends the second server information to the replica U shield through the external key system agent;
[0044] After the duplicate USB shield passes the second server information authentication, the duplicate USB shield generates and caches a second temporary session key based on the AES algorithm according to the second random number and the second challenge random number;
[0045] The duplicate U shield sends the second authentication result data to the key management system through the external key system agent; the encrypted data in the second authentication result data is encrypted using the second temporary session key;
[0046] The key management system verifies the second authentication result data and sends the second verification result to the external key system agent;
[0047] If the external key system agent determines that the second authentication result data verification is successful based on the second verification result, the external key system agent establishes a communication connection with the copy U shield.
[0048] Optionally, the external key system agent obtains the first USB shield information of the master USB shield, specifically including:
[0049] After the external key system agent receives the PIN code sent by the user, the external key system agent generates an instruction to obtain first U shield information carrying the PIN code;
[0050] The external key system agent sends the instruction to obtain the first U shield information to the master U shield;
[0051] The master U shield generates the first U shield information according to the instruction to obtain the first U shield information; wherein the first random number in the first U shield information and the time of its generation are encrypted using the CA public key of the master U shield;
[0052] The master U shield sends the first U shield information to the external key system agent;
[0053] The external key system agent obtains the second U shield information of the copy U shield, specifically including:
[0054] The external key system agent generates an instruction for obtaining the second U-shield information carrying the PIN code;
[0055] The external key system agent sends the instruction to obtain the second U-shield information to the copy U-shield;
[0056] The copy U shield generates the second U shield information according to the instruction to obtain the second U shield information; wherein the second random number in the second U shield information and the time of its generation are encrypted using the CA public key of the copy U shield;
[0057] The copy U shield sends the second U shield information to the external key system agent.
[0058] Optionally, the first cloud signature and the second cloud signature are both generated based on the ECDSA-SHA256 algorithm.
[0059] In a second aspect, the present invention provides a key backup system for a U-shield, comprising: a master U-shield, a replica U-shield, a computer terminal, and a server terminal;
[0060] An external key system agent is installed in the computer terminal, and a key management system is installed in the server terminal;
[0061] The master U shield, the copy U shield, the external key system agent and the key management system are used to execute the key backup method of the U shield as described above.
[0062] Optionally, the computer terminal is specifically a PC terminal;
[0063] The server side is specifically a cloud server side.
[0064] The present invention adopts the above technical solution, a key backup method of U shield, comprising: after the external key system agent successfully establishes communication connections with the main U shield and the replica U shield respectively, the main U shield obtains the key information to be backed up sent by the user through the external key system agent; the main U shield obtains the encrypted public key of the replica U shield from the key management system through the external key system agent; the main U shield generates a first temporary symmetric key based on ECDH according to the public key of the replica U shield and its own private key; the replica U shield obtains the encrypted public key of the main U shield from the key management system through the external key system agent ... In ECDH, a second temporary symmetric key is generated according to the public key of the main U shield and its own private key; the first temporary symmetric key is the same as the second temporary symmetric key; the external key system agent obtains the encrypted key to be backed up sent by the main U shield; the key to be backed up is encrypted using the first temporary symmetric key, and the key to be backed up is determined according to the key to be backed up information; the external key system agent sends the encrypted key to be backed up to the replica U shield; the replica U shield decrypts the encrypted key to be backed up using the second temporary symmetric key; the replica U shield saves the key to be backed up.
[0065] Based on this, by generating a temporary symmetric key based on ECDH (including the first temporary symmetric key and the second temporary symmetric key, and the first temporary symmetric key is the same as the second temporary symmetric key), the temporary symmetric key is used to encrypt and decrypt the backup key, avoiding the transmission and storage of the plaintext key, so that only the main U shield and the copy U shield can decrypt to obtain the backup key, effectively preventing the risk of key leakage and improving the security of the key backup process. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 paying any creative work.
[0067] Figure 1 This is a structural diagram of a key backup system for a USB shield provided by an embodiment of the present invention;
[0068] Figure 2 The present invention provides a method for backing up a USB key using a USB key. DETAILED DESCRIPTION
[0069] To make the objectives, technical solutions, and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other implementations obtained by those of ordinary skill in the art without inventive effort are within the scope of protection of the present invention.
[0070] Example
[0071] Figure 1 This is a schematic diagram of the structure of a key backup system for a USB shield provided by an embodiment of the present invention. Figure 1 As shown, the key backup system of this U shield includes: a main U shield 11, a copy U shield 12, a computer terminal 13 and a server terminal 14.
[0072] The main U-shield 11 and the copy U-shield 12 are two U-shield entities. Before the U-shield leaves the factory, the firmware program will be burned in the U-shield and the U-shield will be personalized. Personalizing the U-shield specifically means writing the device key, device certificate, CA (Certificate Authority, Electronic Certification Agency) public key, device serial number and PIN (Personal Identification Number) into the U-shield. The device key can specifically be an ECC (Elliptic Curve Cryptography, Elliptic Curve Cryptography) key. The server side 14 stores the device serial number and public key of the U-shield. The U-shield is bound to the corresponding tenant through its device serial number.
[0073] An external key storage proxy (XKS-Proxy) is installed in the computer terminal 13. The computer terminal can be a personal computer (PC).
[0074] A Key Management Service (KMS) is installed on the server side, which can be a cloud server side.
[0075] The master USB-Shield 11 and the replica USB-Shield 12 are plugged into a computer 13 via USB ports, establishing a communication connection between the computer 13 and the server 14. During actual communication, the XKS-Proxy can communicate with both the USB-Shield and the KMS. Therefore, the XKS-Proxy acts as a bridge, connecting the USB-Shield and the KMS for secure data transmission and effective key management. Furthermore, the USB-Shield and the XKS-Proxy communicate using the PC / SC (Personal Computer / Smart Card) protocol, while the XKS-Proxy and the KMS communicate using the HTTPS (Hypertext Transfer Protocol Secure) protocol.
[0076] The master USB-Shield 11, the replica USB-Shield 12, the external key system agent, and the key management system are used to execute the USB-Shield key backup method provided by the present invention. The specific execution process is described in the subsequent description of the USB-Shield key backup method embodiment, which will not be repeated here.
[0077] The following describes in detail the key backup method of the USB shield provided by the present invention with reference to the accompanying drawings.
[0078] Figure 2 This is a flowchart of a key backup method for a U-shield provided by an embodiment of the present invention. Figure 2 As shown, this process includes:
[0079] Step 201: After the external key system agent successfully establishes communication connections with the main U shield and the copy U shield respectively, the main U shield obtains the key information to be backed up sent by the user through the external key system agent.
[0080] Specifically, the backup key selection page of the external key system agent displays the various keys of the main U-shield. The user can select the key to be backed up in the backup key selection page according to the actual situation. The external key system agent responds to the user's key selection operation, generates the key information to be backed up, and sends the key information to the main U-shield.
[0081] Step 202: The master USB shield obtains the encrypted public key of the replica USB shield from the key management system through the external key system agent.
[0082] Specifically, the public key of the encrypted copy U shield here is specifically the ECC public key of the copy U shield.
[0083] In the embodiment of the present invention, the master USB shield obtains the encrypted public key of the replica USB shield from the key management system through the external key system agent, which may specifically include:
[0084] (202.1) After the external key system agent determines that the main U shield has obtained the key information to be backed up, it sends a request to the key management system to obtain the copy U shield public key.
[0085] Specifically, after the external key system agent sends the backup key information to the master USB shield, it determines that the master USB shield has obtained the backup key information. Then, the external key system agent sends a request to the key management system to obtain the copy USB shield public key.
[0086] (202.2) The key management system sends the encrypted public key of the copy U shield to the external key system agent based on the request to obtain the copy U shield public key.
[0087] (202.3) The external key system agent forwards the encrypted public key of the replica USB shield to the master USB shield.
[0088] Step 203: The master USB shield generates a first temporary symmetric key based on ECDH (Elliptic Curve Diffie-Hellman Key Exchange) according to the public key of the replica USB shield and its own private key (ECC private key).
[0089] Specifically, after receiving the public key of the encrypted copy U shield, the main U shield decrypts the public key, and then uses the decrypted public key of the copy U shield and its own private key to perform ECDH calculation to obtain the first temporary symmetric key.
[0090] Next, the main U shield sends a first prompt to the external key system agent, where the first prompt is a prompt for successfully generating a first temporary symmetric key.
[0091] Step 204: The replica USB shield obtains the encrypted public key of the master USB shield from the key management system through the external key system agent.
[0092] Specifically, the encrypted public key of the main U shield here is specifically the ECC public key of the main U shield.
[0093] In this embodiment of the present invention, the replica USB shield obtains the encrypted public key of the master USB shield from the key management system through an external key system agent, which may specifically include:
[0094] (204.1) After the external key system agent receives the first prompt sent by the master U shield, the external key system agent sends a request to the key management system to obtain the master U shield public key; the first prompt is a prompt for successfully generating the first temporary symmetric key.
[0095] (204.2) The key management system sends the encrypted public key of the master U shield to the external key system agent based on the request to obtain the master U shield public key.
[0096] (204.3) The external key system agent forwards the encrypted public key of the master USB shield to the replica USB shield.
[0097] Step 205: The copy U shield generates a second temporary symmetric key based on ECDH according to the public key of the main U shield and its own private key (ECC private key); the first temporary symmetric key is the same as the second temporary symmetric key.
[0098] Specifically, after receiving the encrypted public key of the main U shield, the copy U shield decrypts the public key, and uses the decrypted public key of the main U shield and its own private key to perform ECDH calculation to obtain a second temporary symmetric key.
[0099] Then, the copy U shield sends a second prompt to the external key system agent, and the second prompt is a prompt for successfully generating a second temporary symmetric key.
[0100] Step 206: The external key system agent obtains the encrypted key to be backed up sent by the main U shield; the key to be backed up is encrypted using the first temporary symmetric key, and the key to be backed up is determined according to the key information to be backed up.
[0101] In the embodiment of the present invention, the external key system agent obtains the encrypted key to be backed up sent by the main USB shield, which may specifically include:
[0102] (206.1) After receiving the second prompt sent by the replica U shield, the external key system agent sends an instruction to obtain the secret key to be backed up to the main U shield; the second prompt is a prompt for successfully generating a second temporary symmetric key.
[0103] (206.2) The main U shield encrypts the key to be backed up using the first temporary symmetric key according to the instruction to obtain the key to be backed up.
[0104] (206.3) The master USB shield sends the encrypted key to be backed up to the external key system agent.
[0105] Step 207: The external key system agent sends the encrypted key to be backed up to the replica USB shield.
[0106] Step 208: The copy U shield uses the second temporary symmetric key to decrypt the encrypted key to be backed up.
[0107] Step 209: The copy U shield saves the key to be backed up.
[0108] In addition, after the copy U shield saves the secret key to be backed up, the copy U shield can also send a third prompt to the external key system agent. The third prompt is used to prompt whether the copy U shield has successfully saved the secret key to be backed up.
[0109] The embodiment of the present invention adopts the above-mentioned technical solution, generates a temporary symmetric key based on ECDH (including a first temporary symmetric key and a second temporary symmetric key, and the first temporary symmetric key is the same as the second temporary symmetric key), and uses the temporary symmetric key to encrypt and decrypt the backup key, thereby avoiding the transmission and storage of the plaintext key, so that only the main U shield and the copy U shield can decrypt to obtain the backup key, effectively preventing the risk of key leakage and improving the security of the key backup process.
[0110] In an embodiment of the present invention, before the main USB shield obtains the key information to be backed up sent by the user through the external key system agent, the key backup method of the USB shield of the present invention may further include:
[0111] (1) After the user successfully logs in to the external key system agent, the external key system agent obtains the first U shield information of the master U shield; the first U shield information includes the device serial number and the encrypted first random number and its generation time.
[0112] Specifically, when a user needs to log in to the external key system agent, the user can enter their user account and password to the external key system agent. The user account can be their email address. After receiving the user account and password, the external key system agent sends a user verification request containing the user account and password to the key management system.
[0113] After receiving a user verification request, the key management system verifies the user's account and password. After the verification is successful, the key management system generates a target token and returns it to the external key system agent. A token is a token used for authentication and authorization. It is generated by the server and returned to the client. The client carries it with each request to prove its legitimacy.
[0114] After receiving the target token, the external key system agent completes the user login and displays the homepage after the user logs in. In this way, the user successfully logs in to the external key system agent.
[0115] In the embodiment of the present invention, the external key system agent obtains the first USB shield information of the main USB shield, which may specifically include:
[0116] (1.1) After the external key system agent receives the PIN code sent by the user, the external key system agent generates an instruction to obtain the first U-shield information carrying the PIN code.
[0117] Specifically, after the user confirms that he / she has successfully logged into the external key system agent, he / she enters a PIN code into the external key system agent, and then the external key system agent generates an instruction for obtaining the first U-shield information carrying the PIN code.
[0118] (1.2) The external key system agent sends a command to obtain the first U shield information to the main U shield.
[0119] (1.3) The main U shield generates the first U shield information according to the instruction to obtain the first U shield information; wherein, the first random number in the first U shield information and the time of its generation are encrypted using the CA public key of the main U shield.
[0120] Specifically, after receiving the command to obtain the first USB-Shield information, the master USB-Shield generates a first random number and determines the current time. The first random number is 8 bytes long. The master USB-Shield then encrypts the first random number and its generation time using its CA public key. Finally, the master USB-Shield generates the first USB-Shield information based on the encrypted first random number and its generation time.
[0121] (1.4) The main U shield sends the first U shield information to the external key system agent.
[0122] (2) The external key system agent sends the target Token and the first USB shield information to the key management system.
[0123] (3) After the key management system verifies the target Token and the first U-shield information, the key management system generates the first server information; the first server information includes the first cloud signature, the encrypted server certificate, and the encrypted first challenge random number and its generation time.
[0124] Specifically, after receiving the target Token and the first U-Shield information, the key management system verifies the target Token, uses the private key of the key management system (the server private key) to decrypt the first random number and its generation time in the first U-Shield information, and verifies whether the device serial number in the first U-Shield information belongs to the current user. If the device serial number in the first U-Shield information does not belong to the current user, the key management system returns a prompt that the first U-Shield information verification failed to the external key system agent and ends the current process; if the device serial number in the first U-Shield information belongs to the current user, the key management system determines whether the difference between the generation time of the first random number and the current system time exceeds the preset time length. If the difference between the generation time of the first random number and the current system time does not exceed the preset time length, the key management system determines that the verification has passed the target Token and the first U-Shield information. Among them, the preset time length can be set by relevant technical personnel according to actual conditions. For example, the preset time length is set to 5 minutes.
[0125] After the key management system verifies the target Token and the first U shield information, the key management system generates a first challenge random number and determines the current time. Then, it uses the public key of the master U shield to encrypt the first challenge random number and its generation time, and the server certificate, and generates the first cloud signature, thus obtaining the first server information. Among them, the byte length of the first challenge random number is 8 bytes. The signature algorithm used for the first cloud signature is ECDSA-SHA256 (Elliptic Curve Digital Signature Algorithm with SHA-256hashing function, the elliptic curve digital signature algorithm is used in combination with the SHA-256 hash function), the secret key used is the server private key, and the corresponding signature data is: the first random number, the first challenge random number and its generation time, and the device serial number of the master U shield.
[0126] (4) The key management system generates and caches a first temporary session key based on the first random number and the first challenge random number using the AES (Advanced Encryption Standard) algorithm. Subsequently, all communication data between the key management system and the master USB-Shield is encrypted using the first temporary session key.
[0127] (5) The key management system sends the first server information to the main U shield through the external key system agent.
[0128] Specifically, the key management system sends the first server information to the external key system agent. After receiving the first server information, the external key system agent forwards the first server information to the main U shield.
[0129] (6) After the main U shield passes the authentication of the first server information, the main U shield generates and caches the first temporary session key based on the AES algorithm according to the first random number and the first challenge random number.
[0130] Specifically, after receiving the first server information, the main U shield uses its private key to decrypt the server certificate, the first challenge random number and its generation time in the first server information, and then determines whether the difference between the generation time of the first challenge random number and the current system time exceeds the preset time length. If the difference between the generation time of the first challenge random number and the current system time does not exceed the preset time length, the main U shield uses its CA public key to verify the first cloud signature and the server certificate of the main U shield. After the first cloud signature and the server certificate of the main U shield are verified, the main U shield determines that the authentication has passed the first server information.
[0131] After the primary USB-Shield passes the first server authentication, the primary USB-Shield generates and caches the first temporary session key based on the first random number and the first challenge random number using the AES algorithm. The primary USB-Shield then uses the first temporary session key to encrypt its device certificate and counter, and to generate the first USB-Shield signature. The signature algorithm used for the first USB-Shield signature is the ECDSA-SHA256 algorithm, and the key used is the primary USB-Shield's device private key. The corresponding signature data includes the first challenge random number, the primary USB-Shield's device serial number, and the counter.
[0132] (7) The master U shield sends the first authentication result data to the key management system through the external key system agent; the encrypted data in the first authentication result data is encrypted using the first temporary session key.
[0133] Specifically, the first authentication result data includes the authentication result (used to determine whether the first server information has passed the authentication), the first U shield signature, and the encrypted device certificate, counter and device serial number of the main U shield.
[0134] The master U shield sends the first authentication result data to the external key system agent. After receiving the first authentication result data, the external key system agent sends the first authentication result data carrying the target Token to the key management system.
[0135] (8) The key management system verifies the first authentication result data and sends the first verification result to the external key system agent.
[0136] Specifically, the key management system uses its own cached first temporary session key to decrypt the encrypted data in the first authentication result data, and verifies the first authentication result data to obtain a first verification result, and sends the first verification result to the external key system agent.
[0137] (9) If the external key system agent determines that the first authentication result data verification is passed based on the first verification result, the external key system agent establishes a communication connection with the master U shield.
[0138] (10) The external key system agent obtains the second U-shield information of the copy U-shield; the second U-shield information includes the device serial number and the encrypted second random number and its generation time.
[0139] In the embodiment of the present invention, the external key system agent obtains the second USB shield information of the duplicate USB shield, which may specifically include:
[0140] (10.1) The external key system agent generates a command to obtain the second USB shield information with a PIN code.
[0141] (10.2) The external key system agent sends a command to obtain the second U-shield information to the copy U-shield.
[0142] (10.3) The copy U shield generates a second U shield information according to the instruction to obtain the second U shield information; wherein, the second random number in the second U shield information and the time of its generation are encrypted using the CA public key of the copy U shield.
[0143] Specifically, after receiving the instruction to obtain the second USB-Shield information, the replica USB-Shield generates a second random number and determines the current time. The replica USB-Shield then uses its CA public key to encrypt the second random number and its generation time. The second random number can be 8 bytes long. Finally, the replica USB-Shield uses its device serial number, the encrypted second random number, and its generation time to generate the second USB-Shield information.
[0144] (10.4) The copy U shield sends the second U shield information to the external key system agent.
[0145] (11) The external key system agent sends the target Token and the second U shield information to the key management system.
[0146] (12) After the key management system verifies the target Token and the second U-shield information, the key management system generates the second server information; the second server information includes the second cloud signature, the encrypted server certificate and the encrypted second challenge random number and its generation time.
[0147] Specifically, after receiving the target Token and the second U-Shield information, the key management system verifies the target Token, uses the private key of the key management system (server private key) to decrypt the second random number and its generation time in the second U-Shield information, and verifies whether the device serial number in the second U-Shield information belongs to the current user. If the device serial number in the second U-Shield information does not belong to the current user, the key management system returns a prompt that the second U-Shield information verification failed to the external key system agent and ends the current process; if the device serial number in the second U-Shield information belongs to the current user, the key management system determines whether the difference between the generation time of the second random number and the current system time exceeds the preset time length. If the difference between the generation time of the second random number and the current system time does not exceed the preset time length, the key management system determines that the verification has passed the target Token and the second U-Shield information.
[0148] After the key management system verifies the target token and the second USB shield information, it generates a second challenge random number and determines the current time. It then uses the public key of the replica USB shield to encrypt the second challenge random number, its generation time, and the server certificate, and generates a second cloud signature. Thus, the second server information is obtained. The byte length of the second challenge random number is 8 bytes. The signature algorithm used for the second cloud signature is the ECDSA-SHA256 algorithm, and the secret key used is the server private key. The corresponding signature data is: the second random number, the second challenge random number and its generation time, and the device serial number of the replica USB shield.
[0149] (13) The key management system generates and caches a second temporary session key based on the second random number and the second challenge random number using the AES algorithm. Subsequently, all communication data between the key management system and the replica USB-Shield is encrypted using the second temporary session key.
[0150] (14) The key management system sends the second server information to the replica U shield through the external key system agent.
[0151] Specifically, the key management system sends the second server information to the external key system agent. After receiving the second server information, the external key system agent forwards the second server information to the copy U shield.
[0152] (15) After the replica U-Shield passes the authentication of the second server information, the replica U-Shield generates and caches the second temporary session key based on the AES algorithm according to the second random number and the second challenge random number.
[0153] Specifically, after receiving the second server information, the copy U shield uses its private key to decrypt the server certificate, the second challenge random number and its generation time in the second server information, and then determines whether the difference between the generation time of the second challenge random number and the current system time exceeds the preset time length. If the difference between the generation time of the second challenge random number and the current system time does not exceed the preset time length, the copy U shield uses its CA public key to verify the second cloud signature and the server certificate of the copy U shield. After the second cloud signature and the server certificate of the copy U shield are verified, the copy U shield determines that the authentication has passed the second server information.
[0154] After the replica USB shield passes the second server authentication, the replica USB shield generates and caches the second temporary session key based on the second random number and the second challenge random number based on the AES algorithm. Then, the replica USB shield uses the second temporary session key to encrypt its device certificate and counter (Counter), and generates the second USB shield signature. Among them, the signature algorithm used by the second USB shield signature is the ECDSA-SHA256 algorithm, and the secret key used is the device private key of the replica USB shield. The corresponding signature data includes the second challenge random number, the device serial number of the replica USB shield, and the counter.
[0155] (16) The copy U shield sends the second authentication result data to the key management system through the external key system agent; the encrypted data in the second authentication result data is encrypted using the second temporary session key.
[0156] Specifically, the second authentication result data includes the authentication result (used to determine whether the second server information has passed the authentication), the second U shield signature, and the encrypted device certificate, counter and device serial number of the copy U shield.
[0157] The copy U shield sends the second authentication result data to the external key system agent. After receiving the second authentication result data, the external key system agent sends the second authentication result data carrying the target Token to the key management system.
[0158] (17) The key management system verifies the second authentication result data and sends the second verification result to the external key system agent.
[0159] Specifically, the key management system uses its own cached second temporary session key to decrypt the encrypted data in the second authentication result data, and verifies the second authentication result data to obtain a second verification result, and sends the second verification result to the external key system agent.
[0160] (18) If the external key system agent determines that the second authentication result data verification is passed based on the second verification result, the external key system agent establishes a communication connection with the replica U shield.
[0161] In addition, the present invention can also record detailed operation logs and audit information to facilitate real-time monitoring and tracing of system security.
[0162] The embodiment of the present invention adopts the above technical solution. After the user successfully logs in to the external key system agent, two-factor authentication is achieved through PIN code verification and encryption and decryption using the CA key, ensuring the uniqueness and legitimacy of the U-Shield, and effectively preventing malicious forgery or theft of the U-Shield.
[0163] In addition, a random challenge number is generated by the server, and the U-Shield uses the device private key to decrypt the server information and uses its CA public key to verify the cloud signature. After success, a temporary session key is generated. Subsequently, the communication data between the key management system and the U-Shield is encrypted using the temporary session key. This mechanism effectively prevents the risk of man-in-the-middle attacks and key leakage.
[0164] Furthermore, by using the ECDSA-SHA256 algorithm for signing, the integrity and non-repudiation of authentication and communication data are guaranteed.
[0165] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0166] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" is at least two.
[0167] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0168] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0169] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0170] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.
[0171] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0172] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0173] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for backing up a key of a USB shield, characterized in that: A key backup system for a USB-shield, comprising: a master USB-shield, a replica USB-shield, a computer, and a server. The computer is provided with an external key system agent, and the server is provided with a key management system. The key backup method for the USB-shield comprises: After the external key system agent successfully establishes communication connections with the master U shield and the replica U shield respectively, the master U shield obtains the key information to be backed up sent by the user through the external key system agent; The master U shield obtains the encrypted public key of the replica U shield from the key management system through the external key system agent; The master U shield generates a first temporary symmetric key based on ECDH according to the public key of the replica U shield and its own private key; The replica U shield obtains the encrypted public key of the master U shield from the key management system through the external key system agent; The replica USB shield generates a second temporary symmetric key based on ECDH according to the public key of the master USB shield and its own private key; the first temporary symmetric key is the same as the second temporary symmetric key; The external key system agent obtains the encrypted key to be backed up sent by the master U shield; the key to be backed up is encrypted using the first temporary symmetric key, and the key to be backed up is determined according to the key to be backed up information; The external key system agent sends the encrypted key to be backed up to the replica U shield; The copy U shield uses the second temporary symmetric key to decrypt the encrypted key to be backed up; The copy U shield stores the key to be backed up.
2. The key backup method of the USB shield according to claim 1, characterized in that: The master U shield obtains the encrypted public key of the replica U shield from the key management system through the external key system agent, specifically including: After determining that the main U shield has obtained the key information to be backed up, the external key system agent sends a request to the key management system to obtain the copy U shield public key; The key management system sends the encrypted public key of the copy U shield to the external key system agent according to the request to obtain the copy U shield public key; The external key system agent forwards the encrypted public key of the replica U shield to the master U shield.
3. The key backup method of the USB shield according to claim 1, characterized in that: The replica USB shield obtains the encrypted public key of the master USB shield from the key management system through the external key system agent, specifically including: After the external key system agent receives the first prompt sent by the master USB shield, the external key system agent sends a request to the key management system to obtain the master USB shield public key; the first prompt is a prompt for successfully generating a first temporary symmetric key; The key management system sends the encrypted public key of the master U shield to the external key system agent according to the request to obtain the master U shield public key; The external key system agent forwards the encrypted public key of the master U shield to the replica U shield.
4. The key backup method of the USB shield according to claim 1, characterized in that: The external key system agent obtains the encrypted key to be backed up sent by the master U shield, specifically including: After receiving the second prompt sent by the replica USB shield, the external key system agent sends an instruction to obtain the key to be backed up to the master USB shield; the second prompt is a prompt for successfully generating a second temporary symmetric key; The master U shield encrypts the key to be backed up using the first temporary symmetric key according to the instruction to obtain the key to be backed up; The master U shield sends the encrypted key to be backed up to the external key system agent.
5. The key backup method of U-Shield according to claim 1, characterized in that: Before the main U shield obtains the key information to be backed up sent by the user through the external key system agent, it also includes: After the user successfully logs in to the external key system agent, the external key system agent obtains the first USB shield information of the master USB shield; the first USB shield information includes the device serial number and the encrypted first random number and its generation time; The external key system agent sends the target Token and the first USB shield information to the key management system; After the key management system verifies the target token and the first USB shield information, the key management system generates first server information; the first server information includes the first cloud signature, the encrypted server certificate, and the encrypted first challenge random number and its generation time; The key management system generates and caches a first temporary session key based on the first random number and the first challenge random number based on the AES algorithm; The key management system sends the first server information to the master U shield through the external key system agent; After the primary USB shield passes the first server information authentication, the primary USB shield generates and caches a first temporary session key based on the AES algorithm according to the first random number and the first challenge random number; The master U shield sends first authentication result data to the key management system through the external key system agent; the encrypted data in the first authentication result data is encrypted using the first temporary session key; The key management system verifies the first authentication result data and sends the first verification result to the external key system agent; If the external key system agent determines that the first authentication result data verification is passed according to the first verification result, the external key system agent establishes a communication connection with the master U shield; The external key system agent obtains the second U shield information of the copy U shield; the second U shield information includes the device serial number and the encrypted second random number and its generation time; The external key system agent sends the target Token and the second U shield information to the key management system; After the key management system verifies the target token and the second USB shield information, the key management system generates second server information; the second server information includes the second cloud signature, the encrypted server certificate, and the encrypted second challenge random number and its generation time; The key management system generates and caches a second temporary session key based on the second random number and the second challenge random number based on the AES algorithm; The key management system sends the second server information to the replica U shield through the external key system agent; After the duplicate USB shield passes the second server information authentication, the duplicate USB shield generates and caches a second temporary session key based on the AES algorithm according to the second random number and the second challenge random number; The duplicate U shield sends the second authentication result data to the key management system through the external key system agent; the encrypted data in the second authentication result data is encrypted using the second temporary session key; The key management system verifies the second authentication result data and sends the second verification result to the external key system agent; If the external key system agent determines that the second authentication result data verification is successful based on the second verification result, the external key system agent establishes a communication connection with the copy U shield.
6. The key backup method of U-Shield according to claim 5, characterized in that: The external key system agent obtains the first U shield information of the master U shield, specifically including: After the external key system agent receives the PIN code sent by the user, the external key system agent generates an instruction to obtain first U shield information carrying the PIN code; The external key system agent sends the instruction to obtain the first U shield information to the master U shield; The master U shield generates the first U shield information according to the instruction to obtain the first U shield information; wherein the first random number in the first U shield information and the time of its generation are encrypted using the CA public key of the master U shield; The master U shield sends the first U shield information to the external key system agent; The external key system agent obtains the second U shield information of the copy U shield, specifically including: The external key system agent generates an instruction for obtaining the second U-shield information carrying the PIN code; The external key system agent sends the instruction to obtain the second U-shield information to the copy U-shield; The copy U shield generates the second U shield information according to the instruction to obtain the second U shield information; wherein the second random number in the second U shield information and the time of its generation are encrypted using the CA public key of the copy U shield; The copy U shield sends the second U shield information to the external key system agent.
7. The key backup method of U-Shield according to claim 5, characterized in that: The first cloud signature and the second cloud signature are both generated based on the ECDSA-SHA256 algorithm.
8. A U-Shield key backup system, characterized in that: include: Main USB shield, copy USB shield, computer and server; An external key system agent is installed in the computer terminal, and a key management system is installed in the server terminal; The master U shield, the copy U shield, the external key system agent and the key management system are used to execute the key backup method of the U shield as described in any one of claims 1 to 7.
9. The key backup system of the USB shield according to claim 8, characterized in that: The computer terminal is specifically a PC terminal; The server side is specifically a cloud server side.
Citation Information
Patent Citations
Encryption device and method
CN105847005A
Authentication method and system based on key derived function, client and server
CN116566705A