Key backup method and system of USB key

The ECDH algorithm generates a temporary symmetric key and transmits the encrypted key to be backed up, which solves the problem of key leakage during the U-shield key backup process and improves the security of the backup process.

CN119276489AActive Publication Date: 2025-01-07SHENZHEN SNOWBALL TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411423032.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-07
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

During the U-shield key backup process, how to improve the security of key backup and prevent key leakage?

Method used

The ECDH algorithm is used to generate temporary symmetric keys, and the encrypted key to be backed up is transmitted between the main U shield and the dungeon through the external key system agent, ensuring that only the main U shield and the dungeon can be decrypted, avoiding the plain text key transfer and storage.

Benefits of technology

It effectively prevents the risk of key leakage, improves the security of the key backup process, and ensures that only the main U-shield and the dungeon can decrypt and obtain the key to be backed up.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276489A_ABST
    Figure CN119276489A_ABST
Patent Text Reader

Abstract

The invention provides a key backup method and system of a USB key, and relates to the technical field of key backup of the USB key, and the method comprises the following steps: after an XKS-Proxy successfully establishes communication connection with a main USB key and a copy USB key, the main USB key obtains to-be-backed-up key information sent by a user through the XKS-Proxy; the main USB key obtains the encrypted public key of the copy USB key from the KMS through the XKS-Proxy; the main U shield generates a first temporary symmetric key based on the ECDH according to the public key of the copy U shield and the private key of the main U shield; the copy USB key obtains the encrypted public key of the main USB key from the KMS through the XKS-Proxy; the replica USB key generates a second temporary symmetric key based on the ECDH according to the public key of the main USB key and the private key of the replica USB key; the XKS-Proxy obtains the encrypted secret key to be backed up sent by the main USB key; the XKS-Proxy sends the encrypted secret key to be backed up to the copy USB key; the copy USB key uses the second temporary symmetric key to decrypt the encrypted key to be backed up; and the copy USB key stores the secret key to be backed up. According to the invention, the security of the key backup process can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of U-shield key backup, and in particular to a U-shield key backup method and system. Background Art

[0002] As a small hardware security module, the U shield provides functions such as key storage, encryption, decryption, signing and signature verification. Considering that the key is stored in a U shield, when the U shield is damaged due to hardware problems, the loss of the stored key will cause the encrypted data to be unable to be decrypted, etc., and it is often necessary to perform redundant backup of the key in the U shield to ensure the high availability of the key.

[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 key backup method and system for a U-shield.

[0006] The present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a key backup method for a U-shield, which is applied to a key backup system for a U-shield, wherein the key backup system for the U-shield comprises: a main U-shield, a replica U-shield, a computer end and a server end, wherein an external key system agent is installed in the computer end, and a key management system is installed in the server end; the key backup method for the U-shield comprises:

[0008] 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 secret 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 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; 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 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;

[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 secret key to be backed up.

[0017] Optionally, 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:

[0018] After determining that the main U shield has obtained the secret key information to be backed up, the external key system agent sends a request to obtain the copy U shield public key to the key management system;

[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 primary 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 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 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 main U shield, specifically including:

[0026] 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;

[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 U shield obtains the secret key information to be backed up sent by the user through the external key system agent, the key backup method of the U 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 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;

[0031] The external key system agent sends the target Token and the first U shield information to the key management system;

[0032] After the key management system verifies the target Token and the first U 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 AES algorithm according to the first random number and the first challenge random number;

[0034] The key management system sends the first server information to the main U shield through the external key system agent;

[0035] After the master U shield passes the first server information authentication, the master U 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 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;

[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 U 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 AES algorithm according to the second random number and the second challenge random number;

[0043] The key management system sends the second server information to the replica U shield through the external key system agent;

[0044] After the replica U shield authenticates the second server information, the replica U 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 main 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 the 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 main U shield;

[0051] 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 its generation time are encrypted using the CA public key of the main 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 replica 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 its generation time are encrypted using the CA public key of the replica 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, including: a main U-shield, a replica U-shield, a computer terminal and a server terminal;

[0060] An external key system agent is installed in the computer end, and a key management system is installed in the server end;

[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 scheme, 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 to-be-backed-up key information 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; the replica ... 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, a temporary symmetric key is generated 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 the temporary symmetric key is used to encrypt and decrypt the backup key, thereby avoiding the transmission and storage of plaintext keys, so that only the main U shield and the copy U shield can decrypt 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.

[0067] Figure 1 It is a structural diagram of a key backup system of a U-shield provided by an embodiment of the present invention;

[0068] Figure 2 It is a flowchart of a key backup method of a U-shield provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0069] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0070] Example

[0071] Figure 1 Schematic diagram 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. The personalized U shield specifically writes the device key, device certificate, CA (Certificate Authority, Electronic Certification Agency) public key, device serial number and PIN (Personal Identification Number) in the U shield. The device key can specifically be an ECC (Elliptic Curve Cryptography) key. The device serial number and public key of the U shield are stored in the server 14. 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 may be a personal computer (PC).

[0074] A key management system (KMS) is installed on the server side, which may be a cloud server side.

[0075] The main U shield 11 and the replica U shield 12 are plugged into the computer 13 through the USB interface, and the computer 13 is connected to the server 14. In the actual communication process, XKS-Proxy can communicate with the U shield and KMS. Therefore, XKS-Proxy can be used as a bridge to connect the U shield and KMS to achieve secure data transmission and effective key management. In addition, the U shield and XKS-Proxy communicate using the PC / SC (Personal Computer / Smart Card) protocol, and the XKS-Proxy and KMS communicate using the HTTPS (Hypertext Transfer Protocol Secure) protocol.

[0076] The main U shield 11, the replica U shield 12, the external key system agent and the key management system are used to execute the key backup method of the U shield provided by the present invention. The specific execution process is described in the subsequent description of the key backup method embodiment of the U shield, which will not be repeated here.

[0077] The key backup method of the U-shield provided by the present invention is described in detail below with reference to the accompanying drawings.

[0078] Figure 2 FIG. 1 is a flow chart of a key backup method of 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 replica U shield respectively, the main U shield obtains the secret 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 main 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 encrypted public key of the copy U shield here is specifically the ECC public key of the copy U shield.

[0083] In the embodiment of the present invention, the main 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 secret key information to be backed up to the main U shield, it determines that the main U shield has obtained the secret key information to be backed up. Then, the external key system agent sends a request to obtain the copy U shield public key to the key management system.

[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 copy U shield to the main U shield.

[0088] Step 203: The main U shield generates a first temporary symmetric key based on ECDH (Elliptic Curve Diffie-Hellman Key Exchange) according to the public key of the replica U shield and its own private key (ECC private key).

[0089] Specifically, after receiving the encrypted public key of the replica U shield, the main U shield decrypts the public key, and then uses the decrypted public key of the replica 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 the 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 the 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 U shield to the replica U shield.

[0097] Step 205: The replica 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 to be backed up information.

[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 U 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 main U 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 U 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 replica U shield saves the secret key to be backed up, the replica U shield can also send a third prompt to the external key system agent, and the third prompt is used to prompt whether the replica U shield successfully saves 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 the embodiment of the present invention, before the main U shield obtains the secret key information to be backed up sent by the user through the external key system agent, the key backup method of the U shield of the present invention may also include:

[0111] (1) 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 main USB shield; the first USB 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 the user account and password to the external key system agent, and the user account can be the user's email address. After receiving the user account and password, the external key system agent sends a user verification request carrying the user account and password to the key management system.

[0113] After receiving the user verification request, the key management system verifies the user account and password. After the user account and password are verified, the key management system generates a target Token and returns the target Token to the external key system agent. Among them, the Token is a token used for identity authentication and authorization, which is generated by the server and returned to the client. It is carried by the client every time it requests to prove its legal status.

[0114] After receiving the target Token, the external key system agent completes the user login and displays the home page 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 U shield information of the main U 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 determines that he / she has successfully logged into the external key system agent, the user 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 of obtaining the first U shield information; wherein the first random number in the first U shield information and its generation time are encrypted using the CA public key of the main U shield.

[0120] Specifically, after receiving the instruction to obtain the first U shield information, the main U shield generates a first random number and determines the current time. The byte length of the first random number is 8 bytes. Then, the main U shield uses its CA public key to encrypt the first random number and its generation time. Finally, the main U shield generates the first U 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. If the difference between the generation time of the first random number and the current system time does not exceed the preset time, the key management system determines that the verification passes the target Token and the first U shield information. Among them, the preset time can be set by relevant technical personnel according to actual conditions, for example, the preset time 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, the public key of the master U shield is used to encrypt the first challenge random number and its generation time, and the server certificate, and to generate 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 AES (Advanced Encryption Standard) algorithm according to the first random number and the first challenge random number. Subsequently, the communication data between the key management system and the main USB shield are encrypted using the first temporary session key.

[0127] (5) The key management system sends the first server information to the main USB shield through the external key system agent.

[0128] Specifically, the key management system sends the first server information to the external key system agent, and 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 primary USB shield authenticates the first server information, 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.

[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 main U shield passes the first server information authentication, 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. Then, the main U shield uses the first temporary session key to encrypt its device certificate, counter (Counter), and generate the first U shield signature. Among them, the signature algorithm used for the first U shield signature is the ECDSA-SHA256 algorithm, and the key used is the device private key of the main U shield. The corresponding signature data includes the first challenge random number, the device serial number of the main U shield 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 main 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 successful 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 U shield information of the duplicate U shield, which may specifically include:

[0140] (10.1) The external key system agent generates a command to obtain the second USB shield information carrying 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 replica 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 its generation time are encrypted using the CA public key of the replica U-Shield.

[0143] Specifically, after receiving the instruction to obtain the second U shield information, the replica U shield generates a second random number and determines the current time. Then, the replica U shield uses its CA public key to encrypt the second random number and its generation time. The byte length of the second random number can be 8 bytes. Finally, the replica U shield uses its device serial number and the encrypted second random number and its generation time to generate the second U 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 USB 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 U shield information, the key management system generates a second challenge random number and determines the current time. Then, the public key of the replica U shield is used to encrypt the second challenge random number and its generation time, and the server certificate, and generate a second cloud signature, thus obtaining the second server information. Among them, 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 U shield.

[0149] (13) The key management system 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. Subsequently, the communication data between the key management system and the replica USB shield are 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, and after receiving the second server information, the external key system agent forwards the second server information to the replica U shield.

[0152] (15) After the replica U shield authenticates the second server information, the replica U 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.

[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 U shield authenticates 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. Then, the replica U shield uses the second temporary session key to encrypt its device certificate, counter (Counter), and generate the second U shield signature. Among them, the signature algorithm used for the second U shield signature is the ECDSA-SHA256 algorithm, and the key used is the device private key of the replica U shield. The corresponding signature data includes the second challenge random number, the device serial number of the replica U 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 successful 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 challenge random number is generated through the server, 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 only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0167] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment 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 not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0168] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0169] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0170] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it 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] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0173] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary 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 applied to a U-shield, the key backup system of the U-shield comprising: a main U-shield, a replica U-shield, a computer end and a server end, the computer end is installed with an external key system agent, and the server end is installed with a key management system; the key backup method of the U-shield comprises: 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 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 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; 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 copy U shield uses the second temporary symmetric key to decrypt the encrypted key to be backed up; The copy U shield stores the secret key to be backed up.

2. The key backup method of U-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 secret key information to be backed up, the external key system agent sends a request to obtain the copy U shield public key to the key management system; 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 U-Shield according to claim 1, characterized in that: 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, specifically including: 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 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 U-Shield according to claim 1, characterized in that: The external key system agent obtains the encrypted key to be backed up sent by the main U shield, specifically including: 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; The master U shield encrypts the secret key to be backed up using the first temporary symmetric key according to the instruction to obtain the secret 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 secret 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 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; The external key system agent sends the target Token and the first U shield information to the key management system; After the key management system verifies the target Token and the first U 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 AES algorithm according to the first random number and the first challenge random number; The key management system sends the first server information to the main U shield through the external key system agent; After the master U shield passes the first server information authentication, the master U 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 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; 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 U 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 AES algorithm according to the second random number and the second challenge random number; The key management system sends the second server information to the replica U shield through the external key system agent; After the replica U shield authenticates the second server information, the replica U 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 main 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 the 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 main U shield; 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 its generation time are encrypted using the CA public key of the main 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 replica 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 its generation time are encrypted using the CA public key of the replica 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, replica USB shield, computer and server; An external key system agent is installed in the computer end, and a key management system is installed in the server end; 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 U-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

  • Secret key division method and secret key division management system for hardware password device

    CN113965327A

  • Authentication method and system based on key derived function, client and server

    CN116566705A

Cited By

  • Cloud password service platform and method for server

    CN120034332A