CN113315641A - Seed key backup method, electronic equipment and system - Google Patents

Seed key backup method, electronic equipment and system Download PDF

Info

Publication number
CN113315641A
CN113315641A CN202110878256.2A CN202110878256A CN113315641A CN 113315641 A CN113315641 A CN 113315641A CN 202110878256 A CN202110878256 A CN 202110878256A CN 113315641 A CN113315641 A CN 113315641A
Authority
CN
China
Prior art keywords
card
public key
key
client
temporary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110878256.2A
Other languages
Chinese (zh)
Other versions
CN113315641B (en
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN202110878256.2A priority Critical patent/CN113315641B/en
Publication of CN113315641A publication Critical patent/CN113315641A/en
Application granted granted Critical
Publication of CN113315641B publication Critical patent/CN113315641B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage
    • H04L9/0897Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage involving additional devices, e.g. trusted platform module [TPM], smartcard or USB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Abstract

The invention provides a seed key backup method, electronic equipment and a seed key backup system, and belongs to the field of information safety. The method comprises the steps that a client side obtains a card equipment public key certificate and a card temporary public key from a backup card, receives a backup card and sends the card equipment public key certificate, a first temporary public key and a first signature result, sends a PIN code generation instruction to hardware equipment, sends a PIN code displayed by the hardware equipment and input by a user, the card equipment public key certificate, the first temporary public key and the first signature result to the hardware equipment, receives a second data packet containing first ciphertext data and sent by the hardware equipment, prompts the user to input the card PIN code, sends the card PIN code input by the user to the backup card for verification, and sends the second data packet to the backup card after the verification PIN passes so that the backup card decrypts the first ciphertext data in the second data packet to obtain a hardware equipment seed key ciphertext. The invention improves the safety of the backup hardware equipment seed key.

Description

Seed key backup method, electronic equipment and system
Technical Field
The present invention relates to the field of information security, and in particular, to a method, an electronic device, and a system for seed key backup.
Background
The hardware device stores the private key in a chip independently, is isolated from the Internet and is plug-and-play, so that the private key is prevented from being stolen, and the safety of the hardware device is further ensured. The private key in the hardware device is generated from the seed key, so the user usually needs to perform a separate backup on the seed key in order to recover the private key through the backup seed key after the hardware device is damaged or lost. In the prior art, the seed key is usually backed up on paper or is obtained by a client through an instruction and then stored. The former is extremely difficult to keep, such as paper mildews and loses, which can cause the loss of the seed key, and the latter has the risk that the seed key is stolen or tampered by a malicious client. Therefore, how to provide a method for safely backing up the seed key becomes a technical problem to be solved urgently.
Disclosure of Invention
In order to solve the defects of the prior art, a seed key backup method, electronic equipment and system are provided.
In a first aspect, the present invention provides a method for seed key backup, including the following steps:
step S1: the client sends a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
step S2: the backup card generates and stores a first temporary key pair, signs the first temporary public key by using a preset card equipment private key to obtain a first signature result, obtains a preset card equipment public key certificate, and sends a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
step S3: the client analyzes the received response to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result, and sends a PIN code generating instruction to the hardware equipment to prompt a user to input a PIN code displayed by the hardware equipment;
step S4: the client receives a PIN code displayed by hardware equipment input by a user, organizes the PIN code displayed by the hardware equipment, the card equipment public key certificate, the first temporary public key and the first signature result to obtain a first data packet, sends the first data packet to the hardware equipment, and receives a second data packet sent by the hardware equipment; the second data packet comprises a hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data;
step S5: the client prompts a user to input a card PIN code and sends the card PIN code input by the user to the backup card;
step S6: the backup card receives a card PIN code sent by the client, verifies the card PIN code, generates a first PIN checking result, and sends the first PIN checking result to the client;
step S7: the client side judges whether the card PIN code is successfully verified according to a first PIN verification result sent by the backup card, and when the card PIN code is successfully verified, the second data packet is sent to the backup card;
step S8: and the backup card analyzes the second data packet to obtain and store a hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data, verifies the hardware equipment public key certificate and the second signature result respectively, generates a second session key according to the stored first temporary private key and the second temporary public key when the verification is passed, and decrypts the first ciphertext data by using the second session key to obtain and store a hardware equipment seed key ciphertext.
The invention also provides a seed key backup method, which comprises the following steps:
step 101: the client sends a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
step 102: the client receives and analyzes the response sent by the backup card to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result;
step 103: the client side sends a PIN code generation instruction to the hardware equipment, prompts a user to input a PIN code displayed by the hardware equipment, organizes the PIN code displayed by the hardware equipment and input by the user, the card equipment public key certificate, the first temporary public key and the first signature result to obtain a first data packet, and sends the first data packet to the hardware equipment;
step 104: the client receives and stores a second data packet containing first ciphertext data sent by the hardware equipment, prompts a user to input a card PIN code, and sends the card PIN code input by the user to the backup card for verification;
step 105: the client receives a first PIN checking result sent by the backup card and judges whether the card PIN code is successfully verified according to the first PIN checking result, if so, the step 106 is executed, otherwise, the operation is finished;
step 106: and the client sends the second data packet to the backup card, so that the backup card obtains and stores a hardware equipment seed key ciphertext by decrypting the first ciphertext data in the second data packet.
The invention also provides a seed key backup method, which comprises the following steps:
when the backup card receives a request for obtaining a card equipment public key certificate and a card temporary public key sent by a client, obtaining a preset card equipment public key certificate, generating and storing a first temporary key pair, signing the first temporary public key by using a preset card equipment private key to obtain a first signature result, and sending a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
when the backup card receives a card PIN code sent by the client, verifying the card PIN code to generate a first PIN checking result, and sending the first PIN checking result to the client;
when the backup card receives a second data packet sent by the client, the second data packet is analyzed to obtain a hardware device public key certificate, a second temporary public key, a second signature result and first ciphertext data and stored, the hardware device public key certificate and the second signature result are verified respectively, when the verification is passed, a second session key is generated according to the stored first temporary private key and the received second temporary public key, and the second session key is used for decrypting the first ciphertext data to obtain a hardware device seed key ciphertext and storing the hardware device seed key ciphertext.
In a second aspect, the present invention provides a client, including a first sending module, a first receiving module, an analyzing module, a first prompting module, an organizing module, a second sending module, a second receiving module, a second prompting module, a third sending module, a first determining module, and a fourth sending module;
the first sending module is used for sending a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
the first receiving module is used for receiving and analyzing the response sent by the backup card to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result;
the first prompting module is used for sending a PIN code generating instruction to the hardware equipment and prompting a user to input the PIN code displayed by the hardware equipment;
the organization module is used for organizing the PIN code displayed by the hardware equipment and input by the user, the card equipment public key certificate, the first temporary public key and the first signature result to obtain a first data packet;
the second sending module is configured to send the first data packet to the hardware device;
the second receiving module is configured to receive and store a second data packet that includes the first ciphertext data and is sent by the hardware device;
the second prompting module is used for prompting a user to input a card PIN code;
the third sending module is used for sending the card PIN code input by the user to the backup card for verification;
the first judging module is used for receiving a first PIN checking result sent by the backup card, judging whether the card PIN code is successfully verified according to the first PIN checking result, if so, triggering the fourth sending module, and if not, finishing the verification;
the fourth sending module is configured to send the second data packet to the backup card, so that the backup card obtains a hardware device seed key ciphertext by decrypting the first ciphertext data in the second data packet and stores the hardware device seed key ciphertext.
In a third aspect, the present invention provides a backup card, including a receiving, acquiring, generating, sending module, a receiving, verifying, sending module, and a receiving, analyzing, verifying, and storing module;
the system comprises a harvesting generation and sending module, a card device public key certificate acquisition module, a card temporary public key acquisition module, a card device public key verification module, a card verification module and a verification module, wherein the harvesting generation and sending module is used for receiving a request sent by a client for acquiring the card device public key certificate and the card temporary public key, acquiring a preset card device public key certificate, generating and storing a first temporary key pair, signing the first temporary public key by using a preset card device private key to obtain a first signature result, and sending a response containing the card device public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
the receiving, verifying and sending module is used for receiving the card PIN code sent by the client, verifying the card PIN code, generating a first PIN verification result, and sending the first PIN verification result to the client;
the receiving, analyzing, verifying and storing module is configured to, when receiving a second data packet sent by the client, analyze the second data packet to obtain and store a hardware device public key certificate, a second temporary public key, a second signature result, and first ciphertext data, verify the hardware device public key certificate and the second signature result respectively, when the verification passes, generate a second session key according to the stored first temporary private key and the received second temporary public key, and decrypt the first ciphertext data using the second session key to obtain and store a hardware device seed key ciphertext.
In a fourth aspect, the present invention provides a seed key backup system, including: the application relates to a client and a backup card.
In a fifth aspect, the present invention provides an electronic device, comprising: a processor and a memory;
a memory for storing a computer program;
and the processor is used for operating the computer program stored in the memory to realize the seed key backup method in the application.
In a sixth aspect, the present invention provides a computer-readable storage medium for storing a computer program, which, when run on a computer, causes the computer to perform the method for seed key backup in the present application.
The invention provides a seed key backup method, electronic equipment and a system, wherein a hardware equipment seed key ciphertext is backed up in a backup card through a client, and the client and the backup card cannot decrypt the hardware equipment seed key ciphertext in the backup process, so that the hardware equipment seed key cannot be obtained even if the client is maliciously attacked or the backup card is lost, the safe export and import of the hardware equipment seed key are realized, and the safety of the backup hardware equipment seed key is improved.
Drawings
Fig. 1 is a flowchart of a seed key backup method according to embodiment 1 of the present invention;
fig. 2 is a flowchart of a seed key backup method according to embodiment 2 of the present invention;
fig. 3 is a flowchart of a method for backing up seed keys according to embodiment 3 of the present invention;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present application provides a method, an electronic device and a system for seed key backup, and the following detailed description is provided with reference to the accompanying drawings. Examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
Example 1
The embodiment 1 of the present invention provides a seed key backup method, which is applicable to a system including a client and a backup card, and includes a process of exporting a seed key ciphertext of a hardware device from the hardware device to the backup card, including the following steps:
step S1: the client sends a request for acquiring a card equipment public key certificate and a card temporary public key to the backup card;
step S2: the backup card generates and stores a first temporary key pair, signs the first temporary public key by using a preset card equipment private key to obtain a first signature result, obtains a preset card equipment public key certificate, and sends a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
step S3: the client analyzes the received response to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result, sends a PIN code generating instruction to the hardware equipment and prompts a user to input the PIN code displayed by the hardware equipment;
step S4: the method comprises the steps that a client receives a PIN code displayed by hardware equipment and input by a user, organizes the PIN code displayed by the hardware equipment, a card equipment public key certificate, a first temporary public key and a first signature result to obtain a first data packet, sends the first data packet to the hardware equipment and receives a second data packet sent by the hardware equipment; the second data packet comprises a hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data;
step S5: the client prompts a user to input a card PIN code and sends the card PIN code input by the user to the backup card;
step S6: the backup card receives a card PIN code sent by the client, verifies the card PIN code, generates a first PIN checking result, and sends the first PIN checking result to the client;
step S7: the client side judges whether the card PIN code is successfully verified according to a first PIN verification result sent by the backup card, and sends a second data packet to the backup card when the card PIN code is successfully verified;
step S8: and the backup card analyzes the second data packet to obtain and store a hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data, verifies the hardware equipment public key certificate and the second signature result respectively, generates a second session key according to the stored first temporary private key and the second temporary public key when the verification is passed, and decrypts the first ciphertext data by using the second session key to obtain and store a hardware equipment seed key ciphertext.
Optionally, in this embodiment, the method further includes:
step W1: the client sends a request for obtaining a public key certificate of the card device to the backup card;
step W2: the backup card sends a card device public key certificate to the client;
step W3: the client receives a card equipment public key certificate sent by a backup card, acquires a card equipment public key from the card equipment public key certificate, and sends a preset client equipment public key certificate to the backup card;
step W4: the backup card receives a client device public key certificate sent by a client, verifies the client device public key certificate by using a preset client root public key, extracts and stores the client device public key from the client device public key certificate if the client device public key certificate passes the verification, and sends a receiving response containing information of successful receiving to the client, or sends a receiving response containing information of failed receiving to the client if the client device public key certificate fails the verification;
step W5: the client receives a receiving response sent by the backup card, generates and stores a fifth temporary key pair when the receiving response contains information of successful receiving, and sends the fifth temporary public key to the backup card; the fifth temporary secret key comprises a fifth temporary public key and a fifth temporary private key;
step W6: the backup card receives a fifth temporary public key sent by the client, generates a first key factor according to the fifth temporary public key and a card equipment private key, generates a second key factor according to the client equipment public key and the card equipment private key, generates and stores a receipt key, a fifth session key, an MAC key, a DEK key, a verification key and a receipt according to the first key factor and the second key factor, and sends the receipt to the client;
step W7: and the client receives and stores the receipt sent by the backup card, generates a third key factor according to the fifth temporary private key and the card equipment public key, generates a fourth key factor according to the client equipment private key and the card equipment public key, and generates and stores a receipt key, a fifth session key, an MAC key, a DEK key and a verification key according to the third key factor and the fourth key factor.
Optionally, in this embodiment, the card PIN code input by the user is sent to the backup card, specifically: the client encrypts the card PIN code by using the fifth session key to obtain a card PIN code ciphertext, calculates the card PIN code ciphertext by using the MAC key to obtain an MAC value of the card PIN code ciphertext, and sends the card PIN code ciphertext and the MAC value of the card PIN code ciphertext to the backup card;
verifying the card PIN code, which specifically comprises the following steps: and the backup card verifies the MAC value of the received card PIN cipher text by using the stored MAC key, and when the verification is passed, the received card PIN cipher text is decrypted by using the stored fifth session key to obtain a card PIN code, and the card PIN code is verified.
Optionally, in this embodiment, the verifying the public key certificate of the hardware device and the second signature result respectively includes:
step q 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step q2 when the verification is passed;
step q 2: and the backup card acquires the hardware equipment public key from the hardware equipment public key certificate, and verifies the received second signature result by using the hardware equipment public key.
Optionally, in this embodiment, the method further includes: the process of importing the hardware device seed key ciphertext from the backup card to the hardware device specifically includes the following steps:
step N1: the client sends a request for acquiring the temporary public key of the hardware equipment to the hardware equipment and receives a third data packet sent by the hardware equipment; the third data packet comprises a third temporary public key, a third signature result and a hardware device public key certificate;
step N2: the method comprises the steps that a PIN code generating instruction is sent to hardware equipment by a client, a user is prompted to input a PIN code displayed by the hardware equipment, and the PIN code displayed by the hardware equipment input by the user is sent to a backup card;
step N3: the backup card verifies the PIN code displayed by the hardware equipment, generates a second PIN checking result and sends the second PIN checking result to the client;
step N4: the client side judges whether the PIN code displayed by the hardware equipment is successfully verified according to the first PIN verification result sent by the backup card, and sends a third data packet to the backup card when the PIN code displayed by the hardware equipment is successfully verified;
step N5: the backup card receives and analyzes the third data packet to obtain and store a hardware device public key certificate, a third temporary public key and a third signature result, the hardware device public key certificate and the third signature result are verified respectively, and when the verification is passed, the step N6 is executed;
step N6: the backup card generates a fourth temporary key pair, and the fourth temporary public key is signed according to a preset card equipment private key to obtain a fourth signature result; the fourth temporary key pair comprises a fourth temporary public key and a fourth temporary private key;
step N7: the backup card generates a third session key according to the fourth temporary private key and the third temporary public key, obtains a stored seed key ciphertext, performs hash calculation on the seed key ciphertext to obtain a hash value of the seed key ciphertext, and encrypts the seed key ciphertext and the hash value of the seed key ciphertext according to the third session key to obtain second ciphertext data;
step N8: the backup card sends a fourth data packet containing a fourth temporary public key, a fourth signature result and second ciphertext data to the client;
step N9: the client receives a fourth data packet sent by the backup card, analyzes the fourth data packet to obtain a fourth temporary public key, a fourth signature result and second ciphertext data, sends a PIN code generating instruction to the hardware equipment, and prompts a user to input a PIN code displayed by the hardware equipment;
step N10: the client receives a PIN code displayed by the hardware equipment and input by a user, acquires a card equipment public key certificate, sends a fifth data packet containing the PIN code displayed by the hardware equipment, the card equipment public key certificate, a fourth temporary public key, a fourth signature result and second ciphertext data to the hardware equipment, so that the hardware equipment verifies the PIN code displayed by the hardware equipment in the fifth data packet, the card equipment public key certificate, the fourth temporary public key and the fourth signature result, and decrypts the second ciphertext data in the fifth data packet after the verification is passed to obtain a seed key ciphertext.
Optionally, in this embodiment, the verifying the public key certificate of the hardware device and the third signature result respectively includes:
step r 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step r2 when the verification is passed;
step r 2: and the backup card acquires the hardware equipment public key from the hardware equipment public key certificate, and verifies the signature of the third signature result by using the hardware equipment public key.
Optionally, in this embodiment, a PIN code generation instruction is sent to the hardware device, and the user is prompted to input the PIN code displayed by the hardware device, specifically: and the client sends a PIN code generation instruction to the hardware equipment, generates and displays a random password keyboard, and prompts a user to select numbers consistent with the PIN codes displayed by the hardware equipment on the random password keyboard.
The embodiment also provides a seed key backup method, which is applicable to a client, and the method includes a process of exporting a hardware device seed key from a hardware device to a backup card, as shown in fig. 1, including the following steps:
step 101: the client sends a request for acquiring a card equipment public key certificate and a card temporary public key to the backup card;
step 102: the client receives and analyzes the response sent by the backup card to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result;
step 103: the method comprises the steps that a client side sends a PIN code generation instruction to the hardware equipment, prompts a user to input a PIN code displayed by the hardware equipment, organizes the PIN code displayed by the hardware equipment and input by the user, a card equipment public key certificate, a first temporary public key and a first signature result to obtain a first data packet, and sends the first data packet to the hardware equipment;
step 104: the client receives and stores a second data packet which is sent by the hardware equipment and contains the first ciphertext data, prompts a user to input a card PIN code, and sends the card PIN code input by the user to the backup card for verification;
step 105: the client receives a first PIN checking result sent by the backup card and judges whether the card PIN code is successfully verified according to the first PIN checking result, if so, the step 106 is executed, otherwise, the operation is finished;
step 106: and the client sends the second data packet to the backup card, so that the backup card obtains and stores the seed key ciphertext of the hardware device by decrypting the first ciphertext data in the second data packet.
Optionally, in this embodiment, step 101 specifically includes:
the client sends a request for obtaining the card equipment public key certificate to the backup card, receives a response for obtaining the card equipment public key certificate sent by the backup card, and obtains and stores the card equipment public key certificate from the response for obtaining the card equipment public key certificate;
the client sends a request for obtaining the temporary public key of the card to the backup card, receives and analyzes the response of obtaining the temporary public key of the card sent by the backup card to obtain and store a first temporary public key and a first signature result.
Optionally, in this embodiment, before sending the card PIN code input by the user to the backup card for verification, the method further includes:
step b 1: the client sends a preset client device public key certificate to the backup card, receives a receiving response sent by the backup card, and executes the step b3 when the receiving response contains information of successful receiving;
step b 2: the client generates and stores a fifth temporary key pair, and sends the fifth temporary public key to the backup card; the fifth temporary key pair comprises a fifth temporary public key and a fifth temporary private key;
step b3: the client receives and stores the receipt sent by the backup card, generates a third key factor according to the fifth temporary private key and the card device public key, generates a fourth key factor according to the client device private key and the card device public key, and generates a receipt key, a fifth session key, an MAC key, a DEK key and a verification key according to the third key factor and the fourth key factor;
step b 4: and the client verifies the stored receipt by using the receipt key, and stores the receipt key, the fifth session key, the MAC key, the DEK key and the verification key when the verification is passed.
Optionally, in this embodiment, the card PIN code input by the user is sent to the backup card for verification, specifically: and the client encrypts the card PIN code by using the fifth session key to obtain a card PIN code ciphertext, calculates the card PIN code ciphertext by using the MAC key to obtain an MAC value of the card PIN code ciphertext, and sends the card PIN code ciphertext and the MAC value of the card PIN code ciphertext to the backup card for verification.
Optionally, in this embodiment, the second data packet includes: the first ciphertext data, the hardware equipment public key certificate, the second temporary public key and the second signature result;
step 106 specifically includes: and the client sends the stored second data packet to the backup card so that the backup card verifies the hardware device public key certificate, the second temporary public key and the second signature result in the second data packet, and decrypts the first ciphertext data in the second data to the hardware device seed key ciphertext after the verification is passed.
Optionally, in this embodiment, the method further includes a process of importing the hardware device seed key ciphertext from the backup card to the hardware device, including the following steps:
step M1: the client sends a request for acquiring the temporary public key of the hardware equipment to the hardware equipment and receives a third data packet sent by the hardware equipment; the third data packet comprises a third temporary public key, a third signature result and a hardware device public key certificate;
step M2: the method comprises the steps that a PIN code generating instruction is sent to hardware equipment by a client, a user is prompted to input a PIN code displayed by the hardware equipment, and the PIN code displayed by the hardware equipment input by the user is sent to a backup card for verification;
step M3: the client receives a first PIN checking result sent by the backup card, whether the PIN code displayed by the hardware equipment is successfully verified is judged according to the first PIN checking result, if so, the step M4 is executed, otherwise, the operation is finished;
step M4: the client sends the third data packet to the backup card for verification, receives a fourth data packet sent by the backup card, sends a PIN code generation instruction to the hardware equipment, and prompts a user to input the PIN code displayed by the hardware equipment; the fourth data packet includes second ciphertext data;
step M5: the client receives the PIN code displayed by the hardware equipment input by the user, sends a fifth data packet containing the PIN code displayed by the hardware equipment and the second ciphertext data to the hardware equipment, so that the hardware equipment verifies the PIN code displayed by the hardware equipment in the fifth data packet, and decrypts the second ciphertext data in the fifth data packet to obtain the seed key ciphertext and stores the seed key ciphertext when the verification is passed.
Optionally, in this embodiment, a PIN code generation instruction is sent to the hardware device, and the user is prompted to input the PIN code displayed by the hardware device, specifically: and the client sends a PIN code generation instruction to the hardware equipment, generates and displays a random password keyboard, and prompts a user to select numbers consistent with the PIN codes displayed by the hardware equipment on the random password keyboard.
The embodiment also provides a seed key backup method, which is applicable to a backup card, and the method comprises a process of exporting a seed key ciphertext of a hardware device from the hardware device to the backup card, and comprises the following steps:
when the backup card receives a request for obtaining a card equipment public key certificate and a card temporary public key sent by a client, obtaining a preset card equipment public key certificate, generating and storing a first temporary key pair, signing the first temporary public key by using a preset card equipment private key to obtain a first signature result, and sending a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
when the backup card receives a card PIN code sent by a client, the card PIN code is verified, a first PIN checking result is generated, and the first PIN checking result is sent to the client;
when the backup card receives a second data packet sent by the client, the second data packet is analyzed to obtain a hardware device public key certificate, a second temporary public key, a second signature result and first ciphertext data and stored, the hardware device public key certificate and the second signature result are verified respectively, when the verification is passed, a second session key is generated according to the stored first temporary private key and the received second temporary public key, and the second session key is used for decrypting the first ciphertext data to obtain a hardware device seed key ciphertext and storing the hardware device seed key ciphertext.
Optionally, in this embodiment, the method further includes: when the backup card receives a request for obtaining the card equipment public key certificate sent by the client, sending the card equipment public key certificate to the client;
when the backup card receives a client device public key certificate sent by a client, a preset client root public key is used for verifying the client device public key certificate, if the client device public key certificate passes the verification, the client device public key is extracted from the client device public key certificate and stored, a receiving response containing information of successful receiving is sent to the client, and if the client device public key certificate fails the verification, a receiving response containing information of failed receiving is sent to the client;
when the backup card receives a fifth temporary public key sent by the client, a first key factor is generated according to the fifth temporary public key and the card device private key, a second key factor is generated according to the client device public key and the card device private key, a receipt key, a fifth session key, an MAC key, a DEK key, a verification key and a receipt are generated and stored according to the first key factor and the second key factor, and the receipt is sent to the client for verification.
Optionally, in this embodiment, when the backup card receives a card PIN code sent by the client, the card PIN code is verified, a first PIN verification result is generated, and the first PIN verification result is sent to the client, which specifically includes: when the backup card receives the card PIN cipher text sent by the client, the fifth session key is used for decrypting the received card PIN cipher text to obtain a card PIN, the card PIN is verified to generate a first PIN verification result, and the first PIN verification result is sent to the client.
Optionally, in this embodiment, the hardware device public key certificate and the second signature result are respectively verified, when the verification passes, a second session key is generated according to the stored first temporary private key and the received second temporary public key, and the second session key is used to decrypt the first ciphertext data to obtain a hardware device seed key ciphertext and store the hardware device seed key ciphertext, which specifically is:
step c 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step c2 when the verification is passed;
step c 2: the backup card acquires the hardware device public key from the hardware device public key certificate, the hardware device public key is used for verifying the second signature result, and when the verification passes, the step c3 is executed;
step c 3: the backup card generates a second session key according to the stored first temporary private key and the received second temporary public key, and decrypts the first ciphertext data by using the second session key to obtain a hardware device seed key ciphertext and a hash value of the hardware device seed key ciphertext;
step c 4: and the backup card performs Hash calculation on the hardware equipment seed key ciphertext to obtain a first abstract value, judges whether the Hash value of the hardware equipment seed key ciphertext is the same as the first abstract value or not, if so, stores the hardware equipment seed key ciphertext, sends a backup success response to the client, and otherwise, clears the first temporary key pair.
Optionally, in this embodiment, the method further includes a process of importing the hardware device seed key ciphertext from the backup card to the hardware device, including the following steps:
when the backup card receives the PIN code displayed by the hardware equipment sent by the client, the PIN code displayed by the hardware equipment is verified, a second PIN checking result is generated, and the second PIN checking result is sent to the client;
when the backup card receives the third data packet sent by the client, executing the step d1 to the step d 4;
step d 1: the backup card analyzes the third data packet to obtain and store a hardware device public key certificate, a third temporary public key and a third signature result, the hardware device public key certificate and the third signature result are verified respectively, and when the verification is passed, the step d2 is executed;
step d 2: the backup card generates a fourth temporary key pair, and a preset card device private key is used for signing the fourth temporary public key to obtain a fourth signature result; the fourth temporary key pair comprises a fourth temporary public key and a fourth temporary private key;
step d 3: the backup card generates a third session key according to the fourth temporary private key and the third temporary public key, obtains a stored seed key ciphertext, performs hash calculation on the seed key ciphertext to obtain a hash value of the seed key ciphertext, and encrypts the seed key ciphertext and the hash value of the seed key ciphertext according to the third session key to obtain second ciphertext data;
step d 4: and the backup card sends a fourth data packet containing the fourth temporary public key, the fourth signature result and the second ciphertext data to the client, so that the client sends the second ciphertext data in the fourth data packet to the hardware equipment for decryption after verifying the fourth temporary public key and the fourth signature result in the fourth data packet, and the seed key ciphertext is obtained.
Optionally, in this embodiment, the verifying the public key certificate of the hardware device and the third signature result respectively includes:
step e 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step e2 when the verification is passed;
step e 2: and the backup card acquires the hardware equipment public key from the hardware equipment public key certificate, and verifies the signature of the received third signature result by using the hardware equipment public key.
In the method for backing up the seed key, the hardware device seed key ciphertext is backed up in the backup card by the client, and both the client and the backup card cannot decrypt the hardware device seed key ciphertext in the backup process, so that the hardware device seed key cannot be obtained even if the client is maliciously attacked or the backup card is lost, the secure export and import of the hardware device seed key are realized, and the security of the backup hardware device seed key is improved.
Example 2
Embodiment 2 of the present invention provides a seed key backup method, including a process of exporting a seed key ciphertext of a hardware device from the hardware device to a backup card, as shown in fig. 2, including the following steps:
step 201: the client sends a request for obtaining a public key certificate of the card device to the backup card;
for example: the request for obtaining the card device public key certificate specifically comprises the following steps: 80 CA BF 2106A 60483021518;
step 202: the backup card sends a card equipment public key certificate acquisition response containing the card equipment public key certificate to the client;
for example: the response of obtaining the card device public key certificate specifically comprises the following steps: BF2181DC7F2181D8931042584E46433230303532353030303031420D6A75626974657277616C6C65745F200D6A75626974657277616C6C65749501825F2504202005255F24042025052453007F4946B0410479704BDB2D3DA2E547EB6DE66E0073F6E61AE32076AF007973B5FA1DBE07E0EF38BD84D85F 1E1410FF743E659691B36361C76BEE2FAC44FD888257592
68CEF001005F37483046022100B076674C9F0EA1DDEE84517E2A53CB392AC2C8B25CA3A7D56558570A051737020221008A982E267FFCEF5309A272EA492BE489A233381C477E8803034A8F6789F2BBD99000;
Step 203: the client acquires and stores the card equipment public key certificate from the card equipment public key certificate acquisition response, and sends a card temporary public key acquisition request to the backup card;
for example: the card device public key certificate specifically includes: 7F2181D8931042584E46433230303532353030303031420D6A75626974657277616C6C65745F200D6A75626974657277616C6C65749501825F2504202005255F24042025052453007F4946B0410479704BDB2D3DA2E547EB6DE66E0073F6E61AE32076AF007973B5FA1DBE07E0EF38BD84D85F1FE 1410 743E659691B36361C76BEE2FAC44FD88825759268CEF001005F37483046022100B076674C9F0EA1DDEE 517E2A53CB392AC2C 8CA 3A7D56558570A051737020221008A982E267 CEFFF 5309A272EA BE489A233381C477E8803034A8F6789F2BBD 9;
step 204: the backup card acquires a card temporary public key acquisition request, generates and stores a first temporary secret key pair, signs the first temporary public key by using a preset card equipment private key to obtain a first signature result, and sends a card temporary public key acquisition response containing the first temporary public key and the first signature result to the client;
in this embodiment, the first temporary key pair includes a first temporary public key and a first temporary private key;
for example: the first temporary public key is specifically: 041B7A2FB8CA946A3C9A0F6DFD931DAA19E85C340AECEA9F5C545DFFF575D517D4F260F61681A1BF6D1C9F08F0CCF0DCCCFAE7F5CAD517AF923251347CFC06A8E 2;
the card device private key specifically includes: B9F7E211B8829C78D833D51E47475A3B749487FB515AD499AE1D83422870a 190;
the first signature result specifically includes: 3045022036AFD1B478C22922E45F71ECBE5440A9E76DFD72284EA3DE79843B408113B83A022100A542DD5CB43A49F23504FA7F40EB04CF69985159059E286FB53EE45A7D32DA 60;
the obtaining of the card temporary public key response specifically includes: 41041B7A2FB8CA946A3C9A0F6DFD931DAA19E85C340AECEA9F5C545DFFF575D517D4F260F61681A1BF6D1C9F08F0CCF0DCCCFAE7F5CAD517AF923251347CFC06A8E2473045022036AFD1B478C22922E45F71ECBE5440A9E76DFD72284EA3DE79843B408113B83A022100A542DD5CB43A49F23504FA7F40EB04CF69985159059E FB53EE45A7D 609000;
step 205: the client receives and analyzes the response of the acquired card temporary public key to obtain and store a first temporary public key and a first signature result, and sends a PIN code generation instruction to the hardware equipment to prompt a user to input the PIN code displayed by the hardware equipment;
step 206: the method comprises the steps that a client receives a PIN code displayed by hardware equipment and input by a user, organizes the PIN code displayed by the hardware equipment and input by the user, a card equipment public key certificate, a first temporary public key and a first signature result to obtain a first data packet, and sends the first data packet to the hardware equipment;
for example: the PIN code displayed by the hardware device input by the user is specifically: 35353535, respectively;
the first data packet specifically includes: 00F9000000016800DC7F2181D8931042584E46433230303532353030303031420D6A75626974657277616C6C65745F200D6A75626974657277616C6C65749501825F2504202005255F24042025052453007F4946B0410479704BDB2D3DA2E547EB6DE66E0073F6E61AE32076AF007973B5FA1DBE07E0EF38BD84D85F1FE 1410FF743E659691B36361C76BEE2FAC44FD88825759268CEF 88825759268F 88825759268B 88825759268C 9F0EA1 DD84517E 2A53 AC2C8B25CA 3D 7A 88825759268A 982E267FFCEF5309A272 BE489A 88825759268C 477E 88825759268A 88825759268F 35F 88825759268F 35F 33C 9F 3A 3D 3643F 88825759268F 3643F 2D 88825759268F 2 DE 3A 7A 3D 3643F 3A 3643F 3D 3678A 3D 3A 3D 78A 3D 3A 3D 3F 3D 3A 3D 3A 3D 3A 3D 3A 3D 3A 3D 3;
optionally, in this embodiment, after the hardware device receives a first data packet that includes a PIN code, a card device public key certificate, a first temporary public key, and a first signature result, which are displayed on the hardware device and input by a user, sent by the client, the following steps are performed:
step A1: the hardware device verifies the PIN code displayed by the hardware device and executes the step A2 when the verification is passed;
step A2: the hardware equipment acquires a preset card root public key, verifies the received card equipment public key certificate by using the card root public key, and executes the step A3 when the verification is passed;
step A3: the hardware equipment acquires a card equipment public key from the card equipment public key certificate, checks the received first signature result by using the card equipment public key, and executes the step A4 when the check passes;
step A4: the hardware equipment generates and stores a second temporary key pair, and signs the second temporary public key by using a preset private key of the wallet equipment to obtain a second signature result; the second temporary key pair comprises a second temporary public key and a second temporary private key;
step A5: the hardware equipment generates a first session key according to the second temporary private key and the received first temporary public key, obtains a hardware equipment seed key ciphertext, and performs hash calculation on the hardware equipment seed key ciphertext to obtain a hash value of the hardware equipment seed key ciphertext;
step A6: the hardware equipment encrypts the hardware equipment seed key ciphertext and the hash value of the hardware equipment seed key ciphertext according to the first session key to obtain first ciphertext data;
optionally, in this embodiment, step a6 specifically includes: the hardware equipment encrypts a hardware equipment seed key ciphertext and a hash value of the hardware equipment seed key ciphertext by using a first session key according to a first preset algorithm to obtain first ciphertext data;
optionally, in this embodiment, the first preset algorithm specifically includes: the SHA256 algorithm;
step A7: the hardware equipment acquires a preset hardware equipment public key certificate and sends a second data packet containing the hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data to the client;
step 207: the client receives a second data packet sent by the hardware equipment and prompts a user to input a card PIN code;
in this embodiment, the second data packet includes a hardware device public key certificate, a second temporary public key, a second signature result, and first ciphertext data;
step 208: the client receives a card PIN code input by a user, encrypts the card PIN code input by the user by using a fifth session key negotiated with the backup card to obtain a card PIN code ciphertext, and sends the card PIN code ciphertext to the backup card;
optionally, in this embodiment, the card PIN code is encrypted by using a fifth session key negotiated with the backup card to obtain a card PIN code ciphertext, and the card PIN code ciphertext is sent to the backup card, which specifically includes:
step W1: the client sends a request for obtaining a public key certificate of the card device to the backup card;
step W2: the backup card sends a card device public key certificate to the client;
step W3: the client receives a card equipment public key certificate sent by a backup card, acquires a card equipment public key from the card equipment public key certificate, and sends a preset client equipment public key certificate to the backup card;
step W4: the backup card receives a client device public key certificate sent by a client, verifies the client device public key certificate by using a preset client root public key, extracts and stores the client device public key from the client device public key certificate if the client device public key certificate passes the verification, and sends a receiving response containing information of successful receiving to the client, or sends a receiving response containing information of failed receiving to the client if the client device public key certificate fails the verification;
step W5: the client receives a receiving response sent by the backup card, generates and stores a fifth temporary key pair when the receiving response contains information of successful receiving, and sends the fifth temporary public key to the backup card; the fifth temporary secret key comprises a fifth temporary public key and a fifth temporary private key;
step W6: the backup card receives a fifth temporary public key sent by the client, generates a first key factor according to the fifth temporary public key and a card equipment private key, generates a second key factor according to the client equipment public key and the card equipment private key, generates and stores a receipt key, a fifth session key, an MAC key, a DEK key, a verification key and a receipt according to the first key factor and the second key factor, and sends the receipt to the client;
step W7: the client receives and stores the receipt sent by the backup card, generates a third key factor according to the fifth temporary private key and the card device public key, generates a fourth key factor according to the client device private key and the card device public key, and generates and stores a receipt key, a fifth session key, an MAC key, a DEK key and a verification key according to the third key factor and the fourth key factor;
step W8: the client verifies the stored receipt by using the receipt key, when the verification is passed, the card PIN code is encrypted by using the fifth session key to obtain a card PIN code ciphertext, the card PIN code ciphertext is calculated by using the MAC key to obtain an MAC value of the card PIN code ciphertext, and the card PIN code ciphertext and the MAC value of the card PIN code ciphertext are sent to the backup card;
for example: the card PIN code is specifically: 35353535, respectively;
the fifth session key specifically includes: C8318C83E30B6A625D47D187C6861FC5
EC4BAD603FA6CA7BDCCF022B263BACB9;
The card PIN code ciphertext specifically comprises: 4B 251C 59210B 674D EE 52C 580D 8 EF 0177 MAC CD B67E F605 BF 67 FF;
step 209: the backup card decrypts the received card PIN cipher text by using a fifth session key negotiated with the client to obtain a card PIN, verifies the card PIN to generate a first PIN verification result, and sends the first PIN verification result to the client;
optionally, in this embodiment, the backup card decrypts the received card PIN code ciphertext using a fifth session key negotiated with the client to obtain a card PIN code, which specifically includes: the backup card verifies the MAC value of the received card PIN code ciphertext by using the stored MAC key, and when the verification is passed, the received card PIN code ciphertext is decrypted by using the stored fifth session key to obtain a card PIN code;
optionally, in this embodiment, the card PIN code is verified, specifically: the backup card acquires a stored card PIN code, judges whether the card PIN code is consistent with the stored card PIN code, generates a first verification success result if the card PIN code is consistent with the stored card PIN code, and generates a first verification failure result if the card PIN code is not consistent with the stored card PIN code;
specifically, the first PIN verification result is a first verification success result or a first verification failure result;
step 210: the client judges whether the card PIN code is successfully verified according to the received first PIN verification result, if so, the stored second data packet is sent to the backup card, and the step 211 is executed, otherwise, the operation is finished;
optionally, in this embodiment, the client determines whether the card PIN code is successfully verified according to the received first PIN verification result, specifically: the client judges the type of the received first PIN checking result, if the first PIN checking result is a successful verification result, the verification is successful, and if the first PIN checking result is a failed verification result, the verification is failed;
step 211: the backup card receives and analyzes the second data packet to obtain and store a hardware device public key certificate, a second temporary public key, a second signature result and first ciphertext data, a preset hardware device root public key is obtained, the hardware device root public key is used for verifying the received hardware device public key certificate, and when the verification is passed, step 212 is executed;
for example: the hardware device root public key is specifically: 042146E7941C2EBEBDC47A1BFA529A815F2C3C55757862C378236021D499C32ED52F9354B70D8138AD527476B726212B97D67877D55F459CB7E2D5F85EF9D 79302;
step 212: the backup card acquires the hardware device public key from the hardware device public key certificate, checks the signature of the received second signature result by using the hardware device public key, and executes the step 213 when the signature passes;
optionally, in this embodiment, the verifying the received second signature result by using the public key of the hardware device specifically includes: the client uses the hardware equipment public key to sign the second temporary public key to obtain a second temporary public key signature value, whether the second temporary public key signature value is consistent with a second signature result or not is judged, if yes, the signature verification is judged to be passed, and if not, the signature verification is judged to be not passed;
for example: the hardware device public key is specifically: 049BCD55F731B7BD6465B90D88021346F2E97AE5106D5CB31E833C25088B0889702158F05C98BC2DB590F058668570FEF338F10914AA06B66E7CC4F7CD013B1B 0E;
step 213: the backup card generates a second session key according to the stored first temporary private key and the received second temporary public key, and decrypts the first ciphertext data by using the second session key to obtain a hardware device seed key ciphertext and a hash value of the hardware device seed key ciphertext;
for example: the second temporary public key is specifically: 041B7A2FB8CA946A3C9A0F6DFD931DAA19E85C340AECEA9F5C545DFFF575D517D4F260F61681A1BF6D1C9F08F0CCF0DCCCFAE7F5CAD517AF923251347CFC06A8E 2;
the hardware device seed key ciphertext specifically comprises: a8463BCCE975E164FCD3F9813A0BB 149;
the hash value of the hardware device seed key ciphertext specifically is: D8E6A191A4082930E65D948A6571F3AF0F9156E6C0A02448EBBEB7A918B360B 6;
step 214: and the backup card performs Hash calculation on the hardware equipment seed key ciphertext to obtain a first abstract value, judges whether the Hash value of the hardware equipment seed key ciphertext is the same as the first abstract value or not, stores the hardware equipment seed key ciphertext if the Hash value of the hardware equipment seed key ciphertext is the same as the first abstract value, sends a backup success response to the client, and otherwise, clears the first temporary key pair.
For example: the first digest value is specifically: D8E6A191A4082930E65D948A6571F3AF0F9156E6C0A02448EBBEB7A918B360B 6;
therefore, the hash value of the hardware device seed key ciphertext is the same as the first digest value, and the hardware device seed key ciphertext is stored.
The embodiment provides a seed key backup method, a hardware device seed key ciphertext is backed up in a backup card through a client, and both the client and the backup card cannot decrypt the hardware device seed key ciphertext in a backup process, so that the hardware device seed key cannot be obtained even if the client is maliciously attacked or the backup card is lost, the secure export and import of the hardware device seed key are realized, and the security of the backup hardware device seed key is improved.
Example 3
Embodiment 3 of the present invention provides a seed key backup method, where in this embodiment, a process of importing a seed key ciphertext from a backup card to a hardware device, as shown in fig. 3, includes the following steps:
step 301: the client sends a request for acquiring the temporary public key of the hardware equipment to the hardware equipment;
for example: the request for obtaining the temporary public key of the hardware device specifically comprises the following steps: 00F 8010100;
optionally, in this embodiment, when the hardware device receives a request for obtaining the temporary public key of the hardware device sent by the client, the following steps are performed:
step C1: the hardware equipment generates and stores a third temporary key pair; the third ephemeral key pair includes a third ephemeral public key and a third ephemeral private key;
step C2: the hardware device signs the third temporary public key by using a preset wallet device private key to obtain a third signature result, obtains a preset hardware device public key certificate, and sends a third data packet containing the third temporary public key, the third signature result and the hardware device public key certificate to the client;
step 302: the client receives a third data packet sent by the hardware equipment, sends a PIN code generating instruction to the hardware equipment and prompts a user to input the PIN code displayed by the hardware equipment;
in this embodiment, the third data packet includes a third temporary public key, a third signature result, and a hardware device public key certificate;
for example: the third data packet is specifically: 01A33082019f30820146a003020102020204d2300a06082a8648ce3d040302308196310b300906035504061302434e3110300e06035504080c074265694a696e673110300e06035504070c 06035504070 e311e301c 06035504070 a0c 06035504070 e06035504070c 4f42414c20434f2e2c204c 06035504070 e06035504070 b0c 06035504070c 6f 06035504070 b0c 06035504070c 06035504070 f 06035504070 b0c 06035504070 e4b 06035504070 e301c 06035504070c 4f42414c20434f2e2c204c 06035504070 e170d 06035504070 a170d 06035504070 a301b 06035504070c 06035504070 e 8648 a3d 06035504070c 8648 a8648 d3d 06035504070 b 731b 55f731b7b 6465b90d 06035504070 f2e 5106d 31e c 833c 06035504070c 35 d 06035504070 a 06035504070 d 06035504070c b 35 c 06035504070c b 35 c3c 06035504070c b 35 c3c b 35 c b 3c b 863 d 06035504070c 3d 06035504070 f 3d 06035504070c 3d b 35 e 3c 3e 3c 3e 3c 3e 3c 3b 3c 3b 3c 3b 3c 3b 3c 3b 3c 3b 3c 3b 3c 3e 3c 3b 3c 3b 3c 3b 3e 3c 3e 3c 3b 3c 3e 3c 3b 3c 3e 3c 3e 3c 3e 3c 3b 3c 3b 3c 3b 3c 3b 3c 3b 3c 3
41049BCD55F731B7BD6465B90D88021346F2E97AE5106D5CB31E833C25088B0889702158F05C98BC2DB590F058668570FEF338F10914AA06B66E7CC4F7CD013B1B0E
473045022100AAFACCE072710785AA0251209C5E101135FF8925BAC47F1A4582A6A13BDBA72502207BF2C22BFD2DD6F4133820E62C6A9CE923999C31EFAE9A8C87E69BD636294A25;
Step 303: the method comprises the steps that a client receives a PIN code displayed by hardware equipment input by a user, and the received PIN code displayed by the hardware equipment is sent to a backup card;
for example: the PIN code displayed by the hardware device input by the user is specifically: 35353535, respectively;
step 304: the backup card verifies the received PIN code displayed by the hardware equipment, generates a second PIN checking result and sends the second PIN checking result to the client;
optionally, in this embodiment, the verifying, by the backup card, the received PIN code displayed by the hardware device specifically includes: the backup card acquires the stored PIN code displayed by the hardware equipment, judges whether the PIN code displayed by the hardware equipment input by the user is consistent with the stored PIN code displayed by the hardware equipment, generates a second verification success result if the PIN code displayed by the hardware equipment input by the user is consistent with the stored PIN code displayed by the hardware equipment, and generates a second verification failure result if the PIN code displayed by the hardware equipment input by the user is not consistent with the stored PIN code displayed by the hardware equipment;
specifically, the second PIN verification result is a second verification success result or a second verification failure result;
for example, in this embodiment, the second PIN verification result specifically includes: verifying a successful result;
step 305: the client judges whether the PIN code displayed by the hardware equipment is successfully verified according to the received second PIN verification result, if so, a third data packet is sent to the backup card, the step 306 is executed, and if not, the process is ended;
optionally, in this embodiment, the client determines whether the PIN code displayed by the hardware device is successfully verified according to the received second PIN verification result, specifically: the client judges the type of the received second PIN checking result, if the type is a second verification success result, the verification is successful, and if the type is a second verification failure result, the verification is failed;
step 306: the backup card receives and analyzes the third data packet to obtain and store a hardware device public key certificate, a third temporary public key and a third signature result, a preset hardware device root public key is obtained, the hardware device root public key is used for verifying the received hardware device public key certificate, and when the verification is passed, the step 307 is executed;
for example: the third temporary public key is specifically: 04995165ECC2458162190F5130FAC9A0868BB611F60E96F42D9C7AC55070F8F6A57BB79A4DC5984A778738212C2B5168FF2C617388D64B3FC34AB05109BF32BA 62;
the third signature result specifically is:
3045022100DCFA02C4888209952377384FE2FC5B6689E6AA0C42C85A6990C8DF759A4C871802200132B6EDD482FA61E1F9E23A75ACFC38A805BE45AAF46ECF0CC8EAA251C2137D;
the hardware device root public key is specifically: 042146E7941C2EBEBDC47A1BFA529A815F2C3C55757862C378236021D499C32ED52F9354B70D8138AD527476B726212B97D67877D55F459CB7E2D5F85EF9D 79302;
step 307: the backup card acquires a hardware device public key from the hardware device public key certificate, checks the signature of the received third signature result by using the hardware device public key, and executes the step 308 when the signature passes;
optionally, in this embodiment, the verifying the received third signature result by using the public key of the hardware device specifically includes: the backup card uses the hardware equipment public key to sign the third temporary public key to obtain a third temporary public key signature value, whether the third temporary public key signature value is consistent with a third signature result or not is judged, if yes, the verification is judged to be passed, and if not, the verification is judged to be not passed;
for example: the hardware device public key is specifically: 049BCD55F731B7BD6465B90D88021346F2E97AE5106D5CB31E833C25088B0889702158F05C98BC2DB590F058668570FEF338F10914AA06B66E7CC4F7CD013B1B 0E;
step 308: the backup card generates a fourth temporary key pair, and the fourth temporary public key is signed according to a preset card equipment private key to obtain a fourth signature result;
in this embodiment, the fourth temporary key pair includes a fourth temporary public key and a fourth temporary private key;
for example: the card device private key specifically includes: B9F7E211B8829C78D833D51E47475A3B749487FB515AD499AE1D83422870a 190;
the fourth temporary public key is specifically: 04995165ECC2458162190F5130FAC9A0868BB611F60E96F42D9C7AC55070F8F6A57BB79A4DC5984A778738212C2B5168FF2C617388D64B3FC34AB05109BF32BA 62;
the fourth signature result specifically is: 3045022100DCFA02C4888209952377384FE2FC5B6689E6AA0C42C85A6990C8DF759A4C871802200132B6EDD482FA61E1F9E23A75ACFC38A805BE45AAF46ECF0CC8EAA251C 2137D;
step 309: the backup card generates a third session key according to the fourth temporary private key and the received third temporary public key, obtains a stored seed key ciphertext, and performs hash calculation on the seed key ciphertext to obtain a hash value of the seed key ciphertext;
optionally, in this embodiment, the hash calculation is performed on the seed key ciphertext to obtain a hash value of the seed key ciphertext, and specifically: the backup card performs Hash calculation on the seed key ciphertext by using a first preset algorithm to obtain a Hash value of the seed key ciphertext;
optionally, in this embodiment, the first preset algorithm specifically includes: the SHA256 algorithm;
step 310: the backup card encrypts the seed key ciphertext and the hash value of the seed key ciphertext according to the third session key to obtain second ciphertext data;
step 311: the backup card sends a fourth data packet containing a fourth temporary public key, a fourth signature result and second ciphertext data to the client;
for example: the fourth data packet specifically includes: 4104995165ECC2458162190F5130FAC9
A0868BB611F60E96F42D9C7AC55070F8F6A57BB79A4DC5984A778738212C2B5168FF2C617388D64B3FC34AB05109BF32BA62473045022100DCFA02C4888209952377384FE2FC5B6689E6AA0C42C85A6990C8DF759A4C871802200132B6EDD482FA61E1F9E23A75ACFC38A805BE45AAF46ECF0CC8EAA251C2137D609ABD8DD2AB6497152DF1CD3AE56F691DC3B0FBB84E33DFE8F64C1E7ED54C54A601FD9CFE7E56438F1CADFF382EE5FADC9551265477F881D7D918B1C21E4A6B4656D608C8EAF417F062ACCC8E2A8992CD5C4C01EF2FDECE29F9E55199343A3CB39000;
Step 312: the client receives a fourth data packet sent by the backup card, analyzes the fourth data packet to obtain a fourth temporary public key, a fourth signature result and second ciphertext data, sends a PIN code generating instruction to the hardware equipment, and prompts a user to input a PIN code displayed by the hardware equipment;
optionally, in this embodiment, a PIN code generation instruction is sent to the hardware device, and the user is prompted to input the PIN code displayed by the hardware device, specifically: the client sends a PIN code generation instruction to the hardware equipment, generates and displays a random password keyboard, and prompts a user to select numbers consistent with the PIN codes displayed by the hardware equipment on the random password keyboard;
step 313: the client receives a PIN code displayed by the hardware equipment and input by a user, acquires a card equipment public key certificate, sends a fifth data packet containing the PIN code displayed by the hardware equipment and input by the user, the card equipment public key certificate, a fourth temporary public key, a fourth signature result and second ciphertext data to the hardware equipment, so that the hardware equipment verifies the PIN code displayed by the hardware equipment in the fifth data packet, the card equipment public key certificate, the fourth temporary public key and the fourth signature result, and decrypts the second ciphertext data in the fifth data packet after the verification is passed to obtain a seed key ciphertext.
For example: the PIN code displayed by the hardware device input by the user is specifically: 35353535, respectively;
the fifth data packet specifically includes: 00F901000001C 900C 7F2181D8931042584E46433230303532353030303031420D6A75626974657277616C6C65745F200D6A75626974657277616C6C 75626974657277616F 75626974657277616F 75626974657277616F 4946B 75626974657277616 BDB2D3DA2E547EB6DE66E0073F6E61AE32076AF 75626974657277616B 5FA1DBE07E0 BD84D85F1FE1 FF743E 75626974657277616B 75626974657277616C 76BEE2FAC44FD 75626974657277616F 75626974657277616F 75626974657277616B 75626974657277616C 9F0EA1DDEE84517E2A53CB392AC2C8B25CA3A7D 75626974657277616A 982E267FFCEF5309A272EA 489 BE489A 75626974657277616C 75626974657277616F 35D 3633F 35C 3633F 35F 7D 3633F 35C 35F 8F 7C 3D 3633F 35F 7C 3D 3633F 7F 35F 7F 35F 7C 3D 6F 7F 35F 3D 6F 7C 3D 6F 35F 7C 6D F35F 7C 3D 6D F7F 3D F7D F35F 7D F7F 35F 7D 6D 3619C 3D F35F 7D 6D F35F 7D 6D F35F 7D F35F 3D F7C 3D F7C 3D 6D F3D 6F 3D F35F 3D 6D F35F 7F 35F 7C 6D 6F 35F 7F 35F 3D 6F 7D 6D F3D F3F 35F 7C 3D 6D F3D 6F 3D F3D B F3D F3D F3D B F3D F3D F7F 3D F3D F3F 7F 3D 6F 3D F3F 7C 3F 3D 6D F3D F35F 3D 6F 3D 6F 3D 6F 7F 3F;
optionally, in this embodiment, the process of obtaining the seed key ciphertext by the hardware device through parsing and verifying the fifth data packet includes the following steps:
step B1: the hardware device analyzes the received fifth data packet to obtain a PIN code displayed by the hardware device and input by the user, a card device public key certificate, a fourth temporary public key, a fourth signature result and second ciphertext data, verifies the PIN code displayed by the hardware device and input by the user, and executes the step B2 when the verification is passed;
step B2: the hardware equipment acquires a preset card root public key, verifies the received card equipment public key certificate by using the card root public key, and executes the step B3 when the verification is passed;
b3, the hardware device acquires the card device public key from the card device public key certificate, uses the card device public key to check the received fourth signature result, and executes the step B4 when the check passes;
step B4: the hardware equipment generates a fourth session key according to the stored third temporary private key and the received fourth temporary public key, and decrypts the second ciphertext data by using the fourth session key to obtain a seed key ciphertext and a hash value of the seed key ciphertext;
step B5: the hardware equipment acquires the hash value of the stored hardware equipment seed key ciphertext, hash calculation is carried out on the seed key ciphertext to obtain a second abstract value, whether the second abstract value is the same as the hash value of the hardware equipment seed key ciphertext is judged, if yes, the seed key ciphertext is stored, and if not, an error is reported.
The embodiment provides a seed key backup method, a hardware device seed key ciphertext is backed up in a backup card through a client, and both the client and the backup card cannot decrypt the hardware device seed key ciphertext in a backup process, so that the hardware device seed key cannot be obtained even if the client is maliciously attacked or the backup card is lost, the secure export and import of the hardware device seed key are realized, and the security of the backup hardware device seed key is improved.
Example 4
The embodiment 4 of the present invention provides a seed key backup method, which is applicable to a client, wherein a process of exporting a seed key ciphertext of a hardware device from the hardware device to a backup card includes the following steps:
step 401: the client sends a request for obtaining a public key certificate of the card device to the backup card;
step 402: the client receives a card equipment public key certificate acquisition response sent by the backup card, acquires and stores a card equipment public key certificate from the card equipment public key certificate acquisition response, and sends a card temporary public key acquisition request to the backup card;
step 403: the client receives and analyzes the card temporary public key obtaining response sent by the backup card to obtain and store a first temporary public key and a first signature result;
step 404: the method comprises the steps that a client side sends a PIN code generation instruction to hardware equipment, prompts a user to input a PIN code displayed by the hardware equipment, receives the PIN code displayed by the hardware equipment and input by the user, organizes the PIN code displayed by the hardware equipment, a card equipment public key certificate, a first temporary public key and a first signature result to obtain a first data packet, and sends the first data packet to the hardware equipment;
step 405: the client receives and stores a second data packet which is sent by the hardware equipment and contains the hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data, and prompts a user to input a card PIN code;
step 406: the client receives a card PIN code input by a user, encrypts the card PIN code by using a fifth session key negotiated with the backup card to obtain a card PIN code ciphertext, and sends the card PIN code ciphertext to the backup card;
optionally, in this embodiment, the card PIN code is encrypted by using a fifth session key negotiated with the backup card to obtain a card PIN code ciphertext, and the card PIN code ciphertext is sent to the backup card, which specifically includes:
step K1: the client sends a request for obtaining a public key certificate of the card device to the backup card;
step K2: the client receives a card equipment public key certificate sent by a backup card, acquires a card equipment public key from the card equipment public key certificate, and sends a preset client equipment public key certificate to the backup card;
step K3: the client receives a receiving response sent by the backup card, generates and stores a fifth temporary key pair when the receiving response contains information of successful receiving, and sends the fifth temporary public key to the backup card; the fifth temporary secret key comprises a fifth temporary public key and a fifth temporary private key;
step K4: the client receives and stores the receipt sent by the backup card, generates a third key factor according to the fifth temporary private key and the card device public key, generates a fourth key factor according to the client device private key and the card device public key, and generates and stores a receipt key, a fifth session key, an MAC key, a DEK key and a verification key according to the third key factor and the fourth key factor;
step K5: and the client verifies the stored receipt by using the receipt key, encrypts the card PIN code by using the fifth session key to obtain a card PIN code ciphertext when the verification is passed, calculates the card PIN code ciphertext by using the MAC key to obtain an MAC value of the card PIN code ciphertext, and sends the card PIN code ciphertext and the MAC value of the card PIN code ciphertext to the backup card.
Step 407: the client receives a first PIN checking result sent by the backup card, whether the card PIN code is successfully verified is judged according to the first PIN checking result, if so, the step 408 is executed, otherwise, the operation is finished;
optionally, in this embodiment, the client determines whether the card PIN code is successfully verified according to the received first PIN verification result, specifically: the client judges the type of the received first PIN checking result, if the first PIN checking result is a successful verification result, the verification is successful, and if the first PIN checking result is a failed verification result, the verification is failed;
step 408: and the client sends the stored second data packet to the backup card, so that the backup card verifies the hardware device public key certificate, the second temporary public key and the second signature result in the second data packet, and decrypts the first ciphertext data in the second data to obtain the hardware device seed key ciphertext.
Embodiment 4 of the present invention further provides a seed key backup method, which is applicable to a backup card, where a process of exporting a seed key ciphertext of a hardware device from the hardware device to the backup card includes the following steps:
step 501: when the backup card receives a card-taking device public key certificate request sent by a client, sending a card-obtaining device public key certificate response containing a card device public key certificate to the client;
step 502: when the backup card receives a card temporary public key acquisition request sent by a client, a first temporary secret key pair is generated and stored, a preset card equipment private key is used for signing the first temporary public key to obtain a first signature result, and an acquisition card temporary public key response containing the first temporary public key and the first signature result is sent to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
step 503: when the backup card receives a card PIN cipher text sent by the client, the received card PIN cipher text is decrypted by using a fifth session key negotiated with the client to obtain a card PIN, the card PIN is verified to generate a first PIN checking result, and the first PIN checking result is sent to the client;
optionally, in this embodiment, before step 503, the method further includes:
when the backup card receives a request for obtaining the card equipment public key certificate sent by the client, sending the card equipment public key certificate to the client;
when the backup card receives a client device public key certificate sent by a client, a preset client root public key is used for verifying the client device public key certificate, if the client device public key certificate passes the verification, the client device public key is extracted from the client device public key certificate and stored, a receiving response containing information of successful receiving is sent to the client, and if the client device public key certificate fails the verification, a receiving response containing information of failed receiving is sent to the client;
when the backup card receives a fifth temporary public key sent by the client, generating a first key factor according to the fifth temporary public key and a card equipment private key, generating a second key factor according to a client equipment public key and a card equipment private key, generating and storing a receipt key, a fifth session key, an MAC key, a DEK key, a verification key and a receipt according to the first key factor and the second key factor, and sending the receipt to the client for verification;
further, in this embodiment, the backup card decrypts the received card PIN code ciphertext using a fifth session key negotiated with the client to obtain a card PIN code, which specifically includes: the backup card verifies the MAC value of the received card PIN code ciphertext by using the stored MAC key, and when the verification is passed, the received card PIN code ciphertext is decrypted by using the stored fifth session key to obtain a card PIN code;
step 504: when the backup card receives a second data packet sent by the client, the second data packet is analyzed to obtain and store a hardware device public key certificate, a second temporary public key, a second signature result and first ciphertext data, a preset hardware device root public key is obtained, the hardware device root public key is used for verifying the received hardware device public key certificate, and when the verification is passed, step 505 is executed;
step 505: the backup card acquires the hardware device public key from the hardware device public key certificate, checks the signature of the received second signature result by using the hardware device public key, and executes the step 506 when the signature passes;
step 506: the backup card generates a second session key according to the stored first temporary private key and the received second temporary public key, and decrypts the first ciphertext data by using the second session key to obtain a hardware device seed key ciphertext and a hash value of the hardware device seed key ciphertext;
step 507: the backup card performs hash calculation on the hardware equipment seed key ciphertext to obtain a first digest value, judges whether the hash value of the hardware equipment seed key ciphertext is the same as the first digest value, if so, executes step 508, otherwise, clears the first temporary key pair, and ends;
step 507: and the backup card stores the seed key ciphertext of the hardware equipment and sends a backup success response to the client.
The embodiment provides a seed key backup method, a hardware device seed key ciphertext is backed up in a backup card through a client, and both the client and the backup card cannot decrypt the hardware device seed key ciphertext in a backup process, so that the hardware device seed key cannot be obtained even if the client is maliciously attacked or the backup card is lost, the secure export and import of the hardware device seed key are realized, and the security of the backup hardware device seed key is improved.
Example 5
Embodiment 5 of the present invention provides a method for backing up a seed key, which is applicable to a client, and in this embodiment, the method includes: the process of importing the seed key ciphertext into the hardware equipment from the backup card comprises the following steps:
step 601: the client sends a request for acquiring the temporary public key of the hardware equipment to the hardware equipment;
step 602: the client receives a third data packet sent by the hardware equipment, sends a PIN code generating instruction to the hardware equipment and prompts a user to input the PIN code displayed by the hardware equipment; the third data packet comprises a third temporary public key, a third signature result and a hardware device public key certificate;
step 603: the method comprises the steps that a PIN code displayed on hardware equipment input by a user is received by a client, and the PIN code displayed on the hardware equipment is sent to a backup card;
step 604: the client receives a second PIN checking result sent by the backup card, judges whether the PIN code displayed by the hardware equipment is successfully verified according to the first PIN checking result, if so, sends a third data packet to the backup card for verification, and otherwise, ends;
step 605: the client receives a fourth data packet sent by the backup card, analyzes the fourth data packet to obtain a fourth temporary public key, a fourth signature result and second ciphertext data, sends a PIN code generating instruction to the hardware equipment, and prompts a user to input a PIN code displayed by the hardware equipment;
optionally, in this embodiment, a PIN code generation instruction is sent to the hardware device, and the user is prompted to input the PIN code displayed by the hardware device, specifically: the client sends a PIN code generation instruction to the hardware equipment, generates and displays a random password keyboard, and prompts a user to select a PIN code displayed by the hardware equipment on the random password keyboard;
step 606: the client receives a PIN code displayed by the hardware equipment and input by a user, acquires a card equipment public key certificate, sends a fifth data packet containing the PIN code displayed by the hardware equipment, the card equipment public key certificate, a fourth temporary public key, a fourth signature result and second ciphertext data to the hardware equipment, so that the hardware equipment verifies the PIN code displayed by the hardware equipment in the fifth data packet, the card equipment public key certificate, the fourth temporary public key and the fourth signature result, and analyzes the second ciphertext data in the fifth data packet after the verification is passed to obtain a seed key ciphertext and store the seed key ciphertext.
Embodiment 5 of the present invention further provides a seed key backup method, which is applicable to a backup card, and in this embodiment, a process of importing a seed key ciphertext from the backup card to a hardware device includes the following steps:
step 701: when the backup card receives the PIN code displayed by the hardware equipment sent by the client, the PIN code displayed by the hardware equipment is verified, a second PIN checking result is generated, and the second PIN checking result is sent to the client;
optionally, in this embodiment, the verifying, by the backup card, the PIN code displayed by the received hardware device specifically includes: the backup card acquires the stored PIN code displayed by the hardware equipment, judges whether the PIN code displayed by the hardware equipment is consistent with the stored PIN code displayed by the hardware equipment or not, generates a second verification success result if the PIN code displayed by the hardware equipment is consistent with the stored PIN code displayed by the hardware equipment, and generates a second verification failure result if the PIN code displayed by the hardware equipment is not consistent with the stored PIN code displayed by the hardware equipment;
specifically, the second PIN verification result is a second verification success result or a second verification failure result;
for example, in this embodiment, the second PIN verification result specifically includes: verifying a successful result;
step 702: when the backup card receives a third data packet sent by the client, the third data packet is analyzed to obtain and store a hardware device public key certificate, a third temporary public key and a third signature result, a preset hardware device root public key is obtained, the hardware device root public key is used for verifying the received hardware device public key certificate, and when the verification is passed, the step 703 is executed;
step 703: the backup card acquires a hardware device public key from the hardware device public key certificate, checks the received third signature result by using the hardware device public key, and executes step 704 when the check passes;
optionally, in this embodiment, the verifying the received third signature result by using the public key of the hardware device specifically includes: the backup card uses the hardware equipment public key to sign the third temporary public key to obtain a third temporary public key signature value, whether the third temporary public key signature value is consistent with a third signature result or not is judged, if yes, the verification is judged to be passed, and if not, the verification is judged to be not passed;
step 704: the backup card generates a fourth temporary key pair, and the fourth temporary public key is signed according to a preset card equipment private key to obtain a fourth signature result; the fourth temporary key pair comprises a fourth temporary public key and a fourth temporary private key;
step 705: the backup card generates a third session key according to the fourth temporary private key and the received third temporary public key, obtains a stored seed key ciphertext, and performs hash calculation on the seed key ciphertext to obtain a hash value of the seed key ciphertext;
optionally, in this embodiment, the hash calculation is performed on the seed key ciphertext to obtain a hash value of the seed key ciphertext, and specifically: the backup card performs Hash calculation on the seed key ciphertext by using a first preset algorithm to obtain a Hash value of the seed key ciphertext;
optionally, in this embodiment, the first preset algorithm specifically includes: the SHA256 algorithm;
step 706: the backup card encrypts the seed key ciphertext and the hash value of the seed key ciphertext according to the third session key to obtain second ciphertext data;
step 707: and the backup card sends a fourth data packet containing a fourth temporary public key, a fourth signature result and second ciphertext data to the client, so that the client sends the second ciphertext data in the fourth data packet to the hardware equipment for decryption after the fourth temporary public key and the fourth signature result in the fourth data packet are verified, and the seed key ciphertext is obtained.
The embodiment provides a seed key backup method, a hardware device seed key ciphertext is backed up in a backup card through a client, and both the client and the backup card cannot decrypt the hardware device seed key ciphertext in a backup process, so that the hardware device seed key cannot be obtained even if the client is maliciously attacked or the backup card is lost, the secure export and import of the hardware device seed key are realized, and the security of the backup hardware device seed key is improved.
The invention also provides a client, which comprises a first sending module, a first receiving module, an analysis module, a first prompt module, an organization module, a second sending module, a second receiving module, a second prompt module, a third sending module, a first judgment module and a fourth sending module;
the first sending module is used for sending a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
the first receiving module is used for receiving and analyzing the response sent by the backup card to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result;
the first prompting module is used for sending a PIN code generating instruction to the hardware equipment and prompting a user to input the PIN code displayed by the hardware equipment;
the organization module is used for organizing the PIN code, the card equipment public key certificate, the first temporary public key and the first signature result which are input by the user and displayed on the hardware equipment to obtain a first data packet;
the second sending module is used for sending the first data packet to the hardware equipment;
the second receiving module is used for receiving and storing a second data packet which contains the first ciphertext data and is sent by the hardware equipment;
the second prompting module is used for prompting the user to input the PIN code of the card;
the third sending module is used for sending the card PIN code input by the user to the backup card for verification;
the first judgment module is used for judging whether the card PIN code is successfully verified according to the first PIN checking result sent by the backup card, if so, the fourth sending module is triggered, and if not, the process is finished;
and the fourth sending module is used for sending the second data packet to the backup card so that the backup card obtains and stores the hardware device seed key ciphertext by decrypting the first ciphertext data in the second data packet.
The invention also provides a backup card, which comprises a receiving, acquiring, generating and sending module, a receiving, verifying and sending module and a receiving, analyzing, verifying and storing module;
the system comprises a harvesting generation and sending module, a first temporary key pair generation and sending module and a second temporary key generation and sending module, wherein the harvesting generation and sending module is used for receiving a request sent by a client for obtaining a card equipment public key certificate and a card temporary public key, obtaining a preset card equipment public key certificate, generating and storing a first temporary key pair, using a preset card equipment private key to sign the first temporary public key to obtain a first signature result, and sending a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
the receiving, verifying and sending module is used for receiving the card PIN code sent by the client, verifying the card PIN code, generating a first PIN verification result, and sending the first PIN verification result to the client;
and the receiving, analyzing, verifying and storing module is used for analyzing the second data packet to obtain and store the hardware device public key certificate, the second temporary public key, the second signature result and the first ciphertext data when receiving the second data packet sent by the client, respectively verifying the hardware device public key certificate and the second signature result, when the verification is passed, generating a second session key according to the stored first temporary private key and the received second temporary public key, and decrypting the first ciphertext data by using the second session key to obtain and store a hardware device seed key ciphertext.
The invention also provides a seed key backup system, which comprises: a client as referred to in the present application and a backup card as referred to in the present application.
The present invention further provides an electronic device, as shown in fig. 4, which shows a schematic structural diagram of an electronic device (e.g., a client or a backup card in embodiment 1) 400 suitable for implementing embodiments of the present application. The devices in the embodiments of the present application may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, the apparatus 400 may include a processing device (e.g., central processing unit, graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the device 400 to communicate with other devices, either wirelessly or by wire, to exchange data. While fig. 4 illustrates an apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program, when executed by the processing device 401, performs the above-described functions defined in the methods of the embodiments of the present application.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the apparatus; or may be separate and not incorporated into the device.
The computer readable medium carries one or more programs which, when executed by the apparatus, enable the apparatus to perform the method for hardware device seed key backup in the above embodiments.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The electronic device provided by the present application is applicable to any embodiment of the method for backing up a seed key of a hardware device of the present application, and is not described herein again.
The invention provides electronic equipment, wherein a seed key ciphertext of hardware equipment is backed up in a backup card through a client, and the seed key ciphertext of the hardware equipment cannot be decrypted by both the client and the backup card in the backup process, so that the seed key of the hardware equipment cannot be obtained even if the client is attacked maliciously or the backup card is lost, the safe export and import of the seed key of the hardware equipment are realized, and the safety of the seed key of the backup hardware equipment is improved.
The present application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for backing up a seed key of a hardware device as shown in the above embodiments.
The computer-readable storage medium provided in the present application is applicable to any embodiment of the above method for backing up a seed key of a hardware device, and is not described herein again.
The present application provides a computer program product, which when run on a computer, causes the computer to execute the method for implementing backup of a hardware device seed key in the present application.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all such changes or substitutions should be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (25)

1. A seed key backup method is characterized by comprising a process of exporting a seed key ciphertext of hardware equipment from the hardware equipment to a backup card, and specifically comprises the following steps:
step S1: the client sends a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
step S2: the backup card generates and stores a first temporary key pair, signs the first temporary public key by using a preset card equipment private key to obtain a first signature result, obtains a preset card equipment public key certificate, and sends a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
step S3: the client analyzes the received response to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result, and sends a PIN code generating instruction to the hardware equipment to prompt a user to input a PIN code displayed by the hardware equipment;
step S4: the client receives a PIN code displayed by hardware equipment input by a user, organizes the PIN code displayed by the hardware equipment, the card equipment public key certificate, the first temporary public key and the first signature result to obtain a first data packet, sends the first data packet to the hardware equipment, and receives a second data packet sent by the hardware equipment; the second data packet comprises a hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data;
step S5: the client prompts a user to input a card PIN code and sends the card PIN code input by the user to the backup card;
step S6: the backup card receives a card PIN code sent by the client, verifies the card PIN code, generates a first PIN checking result, and sends the first PIN checking result to the client;
step S7: the client side judges whether the card PIN code is successfully verified according to a first PIN verification result sent by the backup card, and when the card PIN code is successfully verified, the second data packet is sent to the backup card;
step S8: and the backup card analyzes the second data packet to obtain and store a hardware equipment public key certificate, a second temporary public key, a second signature result and first ciphertext data, verifies the hardware equipment public key certificate and the second signature result respectively, generates a second session key according to the stored first temporary private key and the second temporary public key when the verification is passed, and decrypts the first ciphertext data by using the second session key to obtain and store a hardware equipment seed key ciphertext.
2. The method of claim 1, further comprising:
step W1: the client sends a request for obtaining a public key certificate of the card equipment to the backup card;
step W2: the backup card sends a card device public key certificate to the client;
step W3: the client receives a card equipment public key certificate sent by the backup card, acquires a card equipment public key from the card equipment public key certificate, and sends a preset client equipment public key certificate to the backup card;
step W4: the backup card receives a client device public key certificate sent by the client, verifies the client device public key certificate by using a preset client root public key, extracts and stores a client device public key from the client device public key certificate if the client device public key certificate passes the verification, and sends a receiving response containing receiving success information to the client, or sends a receiving response containing receiving failure information to the client if the client device public key certificate fails the verification;
step W5: the client receives a receiving response sent by the backup card, generates and stores a fifth temporary key pair when the receiving response contains information of successful receiving, and sends the fifth temporary public key to the backup card; the fifth temporary secret key comprises a fifth temporary public key and a fifth temporary private key;
step W6: the backup card receives the fifth temporary public key sent by the client, generates a first key factor according to the fifth temporary public key and the card device private key, generates a second key factor according to the client device public key and the card device private key, generates and stores a receipt key, a fifth session key, an MAC key, a DEK key, a verification key and a receipt according to the first key factor and the second key factor, and sends the receipt to the client;
step W7: and the client receives and stores the receipt sent by the backup card, generates a third key factor according to the fifth temporary private key and the card equipment public key, generates a fourth key factor according to the client equipment private key and the card equipment public key, and generates and stores a receipt key, a fifth session key, an MAC key, a DEK key and a verification key according to the third key factor and the fourth key factor.
3. The method according to claim 2, wherein said sending the card PIN code entered by the user to the backup card is specifically: the client encrypts the card PIN code by using the fifth session key to obtain a card PIN code ciphertext, calculates the card PIN code ciphertext by using the MAC key to obtain an MAC value of the card PIN code ciphertext, and sends the card PIN code ciphertext and the MAC value of the card PIN code ciphertext to the backup card;
the verification of the card PIN code specifically comprises the following steps: and the backup card verifies the MAC value of the received card PIN cipher text by using the stored MAC key, and when the verification is passed, the received card PIN cipher text is decrypted by using the stored fifth session key to obtain a card PIN code, and the card PIN code is verified.
4. The method of claim 1, wherein the verifying the public key certificate of the hardware device and the second signature result respectively comprises:
step q 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step q2 when the verification is passed;
step q 2: and the backup card acquires a hardware device public key from the hardware device public key certificate, and verifies the received second signature result by using the hardware device public key.
5. The method of claim 1, wherein the method further comprises: the process of importing the hardware device seed key ciphertext from the backup card to the hardware device specifically includes the following steps:
step N1: the client sends a request for acquiring a temporary public key of the hardware equipment to the hardware equipment and receives a third data packet sent by the hardware equipment; the third data packet comprises a third temporary public key, a third signature result and a hardware device public key certificate;
step N2: the client sends a PIN code generating instruction to the hardware equipment, prompts a user to input a PIN code displayed by the hardware equipment, and sends the PIN code displayed by the hardware equipment input by the user to the backup card;
step N3: the backup card verifies the PIN code displayed by the hardware equipment, generates a second PIN checking result and sends the second PIN checking result to the client;
step N4: the client side judges whether the PIN code displayed by the hardware equipment is successfully verified according to the first PIN verification result sent by the backup card, and sends the third data packet to the backup card when the PIN code displayed by the hardware equipment is successfully verified;
step N5: the backup card receives and analyzes the third data packet to obtain and store a hardware device public key certificate, a third temporary public key and a third signature result, the hardware device public key certificate and the third signature result are verified respectively, and when the verification is passed, the step N6 is executed;
step N6: the backup card generates a fourth temporary key pair, and signs the fourth temporary public key according to a preset card equipment private key to obtain a fourth signature result; the fourth temporary key pair comprises a fourth temporary public key and a fourth temporary private key;
step N7: the backup card generates a third session key according to the fourth temporary private key and the third temporary public key, obtains a stored seed key ciphertext, performs hash calculation on the seed key ciphertext to obtain a hash value of the seed key ciphertext, and encrypts the seed key ciphertext and the hash value of the seed key ciphertext according to the third session key to obtain second ciphertext data;
step N8: the backup card sends a fourth data packet containing the fourth temporary public key, the fourth signature result and the second ciphertext data to the client;
step N9: the client receives a fourth data packet sent by the backup card, analyzes the fourth data packet to obtain a fourth temporary public key, a fourth signature result and second ciphertext data, sends a PIN code generating instruction to the hardware equipment, and prompts a user to input a PIN code displayed by the hardware equipment;
step N10: the client receives a PIN code displayed by hardware equipment input by a user, acquires a card equipment public key certificate, and sends a fifth data packet containing the PIN code displayed by the hardware equipment, the card equipment public key certificate, a fourth temporary public key, a fourth signature result and second ciphertext data to the hardware equipment, so that the hardware equipment verifies the PIN code displayed by the hardware equipment in the fifth data packet, the card equipment public key certificate, the fourth temporary public key and the fourth signature result, and decrypts the second ciphertext data in the fifth data packet after the verification is passed to obtain a seed key ciphertext.
6. The method according to claim 5, wherein the verifying the hardware device public key certificate and the third signature result respectively comprises:
step r 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step r2 when the verification is passed;
step r 2: and the backup card acquires a hardware device public key from the hardware device public key certificate, and verifies the third signature result by using the hardware device public key.
7. The method according to claim 5, wherein the step of sending a PIN code generation instruction to the hardware device prompts a user to input a PIN code displayed by the hardware device includes: and the client sends a PIN code generation instruction to the hardware equipment, generates and displays a random password keyboard, and prompts a user to select numbers consistent with the PIN codes displayed by the hardware equipment on the random password keyboard.
8. A seed key backup method is characterized by comprising a process of exporting a seed key ciphertext of a hardware device from the hardware device to a backup card, and comprises the following steps:
step 101: the client sends a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
step 102: the client receives and analyzes the response sent by the backup card to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result;
step 103: the client side sends a PIN code generation instruction to the hardware equipment, prompts a user to input a PIN code displayed by the hardware equipment, organizes the PIN code displayed by the hardware equipment and input by the user, the card equipment public key certificate, the first temporary public key and the first signature result to obtain a first data packet, and sends the first data packet to the hardware equipment;
step 104: the client receives and stores a second data packet containing first ciphertext data sent by the hardware equipment, prompts a user to input a card PIN code, and sends the card PIN code input by the user to the backup card for verification;
step 105: the client receives a first PIN checking result sent by the backup card and judges whether the card PIN code is successfully verified according to the first PIN checking result, if so, the step 106 is executed, otherwise, the operation is finished;
step 106: and the client sends the second data packet to the backup card, so that the backup card obtains and stores a hardware equipment seed key ciphertext by decrypting the first ciphertext data in the second data packet.
9. The method according to claim 8, wherein the step 101 is specifically:
the client sends a request for obtaining a card equipment public key certificate to the backup card, receives a response for obtaining the card equipment public key certificate sent by the backup card, and obtains and stores the card equipment public key certificate from the response for obtaining the card equipment public key certificate;
and the client sends a card temporary public key acquisition request to the backup card, receives and analyzes a card temporary public key acquisition response sent by the backup card to obtain and store a first temporary public key and a first signature result.
10. The method of claim 8, wherein prior to sending the card PIN code entered by the user to the backup card for verification, further comprising:
step b 1: the client sends a preset client device public key certificate to the backup card, receives a receiving response sent by the backup card, and executes step b3 when the receiving response contains information of successful receiving;
step b 2: the client generates and stores a fifth temporary key pair, and sends a fifth temporary public key to the backup card; the fifth temporary key pair comprises a fifth temporary public key and a fifth temporary private key;
step b3: the client receives and stores the receipt sent by the backup card, generates a third key factor according to the fifth temporary private key and the card device public key, generates a fourth key factor according to a client device private key and the card device public key, and generates a receipt key, a fifth session key, an MAC key, a DEK key and a verification key according to the third key factor and the fourth key factor;
step b 4: and the client verifies the stored receipt by using the receipt key, and stores the receipt key, the fifth session key, the MAC key, the DEK key and the verification key when the verification is passed.
11. The method according to claim 10, wherein the card PIN code entered by the user is sent to the backup card for verification, specifically: and the client encrypts the card PIN code by using the fifth session key to obtain a card PIN code ciphertext, calculates the card PIN code ciphertext by using the MAC key to obtain an MAC value of the card PIN code ciphertext, and sends the card PIN code ciphertext and the MAC value of the card PIN code ciphertext to the backup card for verification.
12. The method of claim 8, wherein the second packet comprises: the first ciphertext data, the hardware device public key certificate, the second temporary public key and the second signature result;
the step 106 specifically includes: and the client sends the stored second data packet to the backup card, so that the backup card verifies the hardware device public key certificate, the second temporary public key and the second signature result in the second data packet, and decrypts the first ciphertext data in the second data to obtain a hardware device seed key ciphertext after the verification is passed.
13. The method of claim 8, wherein the method further comprises a process for importing a hardware device seed key cryptogram from the backup card to the hardware device, comprising the steps of:
step M1: the client sends a request for acquiring a temporary public key of the hardware equipment to the hardware equipment and receives a third data packet sent by the hardware equipment; the third data packet comprises a third temporary public key, a third signature result and a hardware device public key certificate;
step M2: the client sends a PIN code generation instruction to the hardware equipment, prompts a user to input the PIN code displayed by the hardware equipment, and sends the PIN code displayed by the hardware equipment input by the user to the backup card for verification;
step M3: the client receives a first PIN checking result sent by the backup card, whether the PIN code displayed by the hardware equipment is successfully verified is judged according to the first PIN checking result, if so, the step M4 is executed, otherwise, the operation is finished;
step M4: the client sends the third data packet to the backup card for verification, receives a fourth data packet sent by the backup card, sends a PIN code generating instruction to the hardware equipment, and prompts a user to input a PIN code displayed by the hardware equipment; the fourth data packet includes second ciphertext data;
step M5: the client receives a PIN code displayed by hardware equipment input by a user, sends a fifth data packet containing the PIN code displayed by the hardware equipment and the second ciphertext data to the hardware equipment, so that the hardware equipment verifies the PIN code displayed by the hardware equipment in the fifth data packet, and decrypts the second ciphertext data in the fifth data packet to obtain a seed key ciphertext and stores the seed key ciphertext when the verification is passed.
14. The method according to claim 13, wherein the sending a PIN code generation instruction to the hardware device prompts a user to input a PIN code displayed by the hardware device, specifically: and the client sends a PIN code generation instruction to the hardware equipment, generates and displays a random password keyboard, and prompts a user to select numbers consistent with the PIN codes displayed by the hardware equipment on the random password keyboard.
15. A seed key backup method is characterized by comprising a process of exporting a seed key ciphertext of a hardware device from the hardware device to a backup card, and comprises the following steps:
when the backup card receives a request for obtaining a card equipment public key certificate and a card temporary public key sent by a client, obtaining a preset card equipment public key certificate, generating and storing a first temporary key pair, signing the first temporary public key by using a preset card equipment private key to obtain a first signature result, and sending a response containing the card equipment public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
when the backup card receives a card PIN code sent by the client, verifying the card PIN code to generate a first PIN checking result, and sending the first PIN checking result to the client;
when the backup card receives a second data packet sent by the client, the second data packet is analyzed to obtain a hardware device public key certificate, a second temporary public key, a second signature result and first ciphertext data and stored, the hardware device public key certificate and the second signature result are verified respectively, when the verification is passed, a second session key is generated according to the stored first temporary private key and the received second temporary public key, and the second session key is used for decrypting the first ciphertext data to obtain a hardware device seed key ciphertext and storing the hardware device seed key ciphertext.
16. The method of claim 15, wherein the method further comprises: when the backup card receives a request for obtaining the public key certificate of the card equipment sent by the client, sending the public key certificate of the card equipment to the client;
when the backup card receives a client device public key certificate sent by the client, verifying the client device public key certificate by using a preset client root public key, if the client device public key certificate passes the verification, extracting the client device public key from the client device public key certificate and storing the client device public key, and sending a receiving response containing information of successful receiving to the client, if the client device public key certificate fails the verification, sending a receiving response containing information of failed receiving to the client;
when the backup card receives a fifth temporary public key sent by the client, a first key factor is generated according to the fifth temporary public key and a card device private key, a second key factor is generated according to the client device public key and the card device private key, a receipt key, a fifth session key, an MAC key, a DEK key, a verification key and a receipt are generated and stored according to the first key factor and the second key factor, and the receipt is sent to the client for verification.
17. The method according to claim 16, wherein when the backup card receives the card PIN code sent by the client, the card PIN code is verified to generate a first PIN verification result, and the first PIN verification result is sent to the client, specifically: and when the backup card receives the card PIN cipher text sent by the client, the fifth session key is used for decrypting the received card PIN cipher text to obtain a card PIN, the card PIN is verified to generate a first PIN checking result, and the first PIN checking result is sent to the client.
18. The method according to claim 15, wherein the verifying the hardware device public key certificate and the second signature result respectively, and when the verification passes, generating a second session key according to the stored first temporary private key and the received second temporary public key, and decrypting the first ciphertext data using the second session key to obtain a hardware device seed key ciphertext and storing the hardware device seed key ciphertext, specifically:
step c 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step c2 when the verification is passed;
step c 2: the backup card acquires a hardware device public key from the hardware device public key certificate, uses the hardware device public key to check the signature of the second signature result, and executes the step c3 when the signature passes;
step c 3: the backup card generates a second session key according to the stored first temporary private key and the received second temporary public key, and decrypts the first ciphertext data by using the second session key to obtain a hardware device seed key ciphertext and a hash value of the hardware device seed key ciphertext;
step c 4: and the backup card performs hash calculation on the hardware equipment seed key ciphertext to obtain a first digest value, judges whether the hash value of the hardware equipment seed key ciphertext is the same as the first digest value, if so, stores the hardware equipment seed key ciphertext, sends a backup success response to the client, and otherwise, clears the first temporary key pair.
19. The method of claim 15, wherein the method further comprises a process for importing a hardware device seed key cryptogram from the backup card to the hardware device, comprising the steps of:
when the backup card receives the PIN code displayed by the hardware equipment sent by the client, the PIN code displayed by the hardware equipment is verified, a second PIN checking result is generated, and the second PIN checking result is sent to the client;
when the backup card receives the third data packet sent by the client, executing the steps d1 to d 4;
step d 1: the backup card analyzes the third data packet to obtain a hardware device public key certificate, a third temporary public key and a third signature result, stores the hardware device public key certificate, the third temporary public key and the third signature result, verifies the hardware device public key certificate and the third signature result respectively, and executes the step d2 when the verification is passed;
step d 2: the backup card generates a fourth temporary key pair, and a preset card device private key is used for signing the fourth temporary public key to obtain a fourth signature result; the fourth temporary key pair comprises a fourth temporary public key and a fourth temporary private key;
step d 3: the backup card generates a third session key according to the fourth temporary private key and the third temporary public key, obtains a stored seed key ciphertext, performs hash calculation on the seed key ciphertext to obtain a hash value of the seed key ciphertext, and encrypts the seed key ciphertext and the hash value of the seed key ciphertext according to the third session key to obtain second ciphertext data;
step d 4: and the backup card sends a fourth data packet containing the fourth temporary public key, the fourth signature result and the second ciphertext data to the client, so that the client sends the second ciphertext data in the fourth data packet to the hardware equipment for decryption after verifying the fourth temporary public key and the fourth signature result in the fourth data packet, and a seed key ciphertext is obtained.
20. The method according to claim 19, wherein the verifying the hardware device public key certificate and the third signature result respectively comprises:
step e 1: the backup card acquires a preset hardware device root public key, verifies the received hardware device public key certificate by using the hardware device root public key, and executes the step e2 when the verification is passed;
step e 2: and the backup card acquires a hardware device public key from the hardware device public key certificate, and verifies the signature of the received third signature result by using the hardware device public key.
21. A client is characterized by comprising a first sending module, a first receiving module, an analysis module, a first prompt module, an organization module, a second sending module, a second receiving module, a second prompt module, a third sending module, a first judgment module and a fourth sending module;
the first sending module is used for sending a request for obtaining a card equipment public key certificate and a card temporary public key to the backup card;
the first receiving module is used for receiving and analyzing the response sent by the backup card to obtain and store a card equipment public key certificate, a first temporary public key and a first signature result;
the first prompting module is used for sending a PIN code generating instruction to the hardware equipment and prompting a user to input the PIN code displayed by the hardware equipment;
the organization module is used for organizing the PIN code displayed by the hardware equipment and input by the user, the card equipment public key certificate, the first temporary public key and the first signature result to obtain a first data packet;
the second sending module is configured to send the first data packet to the hardware device;
the second receiving module is configured to receive and store a second data packet that includes the first ciphertext data and is sent by the hardware device;
the second prompting module is used for prompting a user to input a card PIN code;
the third sending module is used for sending the card PIN code input by the user to the backup card for verification;
the first judging module is used for receiving a first PIN checking result sent by the backup card, judging whether the card PIN code is successfully verified according to the first PIN checking result, if so, triggering the fourth sending module, and if not, finishing the verification;
the fourth sending module is configured to send the second data packet to the backup card, so that the backup card obtains a hardware device seed key ciphertext by decrypting the first ciphertext data in the second data packet and stores the hardware device seed key ciphertext.
22. A backup card is characterized by comprising a receiving, acquiring, generating and sending module, a receiving, verifying and sending module and a receiving, analyzing, verifying and storing module;
the system comprises a harvesting generation and sending module, a card device public key certificate acquisition module, a card temporary public key acquisition module, a card device public key verification module, a card verification module and a verification module, wherein the harvesting generation and sending module is used for receiving a request sent by a client for acquiring the card device public key certificate and the card temporary public key, acquiring a preset card device public key certificate, generating and storing a first temporary key pair, signing the first temporary public key by using a preset card device private key to obtain a first signature result, and sending a response containing the card device public key certificate, the first temporary public key and the first signature result to the client; the first temporary key pair comprises a first temporary public key and a first temporary private key;
the receiving, verifying and sending module is used for receiving the card PIN code sent by the client, verifying the card PIN code, generating a first PIN verification result, and sending the first PIN verification result to the client;
the receiving, analyzing, verifying and storing module is configured to, when receiving a second data packet sent by the client, analyze the second data packet to obtain and store a hardware device public key certificate, a second temporary public key, a second signature result, and first ciphertext data, verify the hardware device public key certificate and the second signature result respectively, when the verification passes, generate a second session key according to the stored first temporary private key and the received second temporary public key, and decrypt the first ciphertext data using the second session key to obtain and store a hardware device seed key ciphertext.
23. A system for seed key backup, comprising: the client of claim 21 and the backup card of claim 22.
24. An electronic device, comprising: a processor and a memory;
a memory for storing a computer program;
a processor for executing a computer program stored in the memory to perform the method of any of claims 8-14 or any of claims 15-20.
25. A computer-readable storage medium for storing a computer program which, when run on a computer, causes the computer to perform the method of any one of claims 8-14 or any one of claims 15-20.
CN202110878256.2A 2021-08-02 2021-08-02 Seed key backup method, electronic equipment and system Active CN113315641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110878256.2A CN113315641B (en) 2021-08-02 2021-08-02 Seed key backup method, electronic equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110878256.2A CN113315641B (en) 2021-08-02 2021-08-02 Seed key backup method, electronic equipment and system

Publications (2)

Publication Number Publication Date
CN113315641A true CN113315641A (en) 2021-08-27
CN113315641B CN113315641B (en) 2021-10-08

Family

ID=77382416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110878256.2A Active CN113315641B (en) 2021-08-02 2021-08-02 Seed key backup method, electronic equipment and system

Country Status (1)

Country Link
CN (1) CN113315641B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070203957A1 (en) * 2006-02-03 2007-08-30 Emc Corporation Automatic authentication of backup clients
JP2010226366A (en) * 2009-03-23 2010-10-07 Fuji Xerox Co Ltd Key producing program, key recording program, key producing device, pki card, and key recording system
CN102223364A (en) * 2011-05-09 2011-10-19 飞天诚信科技股份有限公司 Method and system for accessing e-book data
CN109257332A (en) * 2018-08-15 2019-01-22 飞天诚信科技股份有限公司 The creation method and device for the exit passageway that digital cash hardware wallet application updates
CN110190964A (en) * 2019-05-16 2019-08-30 苏州科达科技股份有限公司 Identity identifying method and electronic equipment
CN111342955A (en) * 2018-12-19 2020-06-26 北京沃东天骏信息技术有限公司 Communication method and device thereof, and computer storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070203957A1 (en) * 2006-02-03 2007-08-30 Emc Corporation Automatic authentication of backup clients
JP2010226366A (en) * 2009-03-23 2010-10-07 Fuji Xerox Co Ltd Key producing program, key recording program, key producing device, pki card, and key recording system
CN102223364A (en) * 2011-05-09 2011-10-19 飞天诚信科技股份有限公司 Method and system for accessing e-book data
CN109257332A (en) * 2018-08-15 2019-01-22 飞天诚信科技股份有限公司 The creation method and device for the exit passageway that digital cash hardware wallet application updates
CN111342955A (en) * 2018-12-19 2020-06-26 北京沃东天骏信息技术有限公司 Communication method and device thereof, and computer storage medium
CN110190964A (en) * 2019-05-16 2019-08-30 苏州科达科技股份有限公司 Identity identifying method and electronic equipment

Also Published As

Publication number Publication date
CN113315641B (en) 2021-10-08

Similar Documents

Publication Publication Date Title
CN111080295B (en) Electronic contract processing method and device based on blockchain
CN110414190B (en) Signature method of application installation package, related device, storage medium and electronic equipment
CN110661814A (en) Bidding file encryption and decryption method, device, equipment and medium
CN110362990A (en) Using the security processing of installation, apparatus and system
CN113872770A (en) Security verification method, system, electronic device and storage medium
CN111030827A (en) Information interaction method and device, electronic equipment and storage medium
CN110545542B (en) Main control key downloading method and device based on asymmetric encryption algorithm and computer equipment
CN112149168A (en) File data encryption method and device and electronic equipment
CN114745207B (en) Data transmission method, device, equipment, computer readable storage medium and product
CN113315641B (en) Seed key backup method, electronic equipment and system
CN112202794A (en) Transaction data protection method and device, electronic equipment and medium
CN115296807B (en) Key generation method, device and equipment for preventing industrial control network viruses
CN114499893B (en) Bidding file encryption and evidence storage method and system based on block chain
CN115147103A (en) Payment method and device of digital RMB and electronic equipment
CN112825093B (en) Security baseline checking method, host, server, electronic device and storage medium
CN114584355A (en) Security authentication method, device and system for digital currency transaction
CN111130805B (en) Secure transmission method, electronic device, and computer-readable storage medium
CN102420829A (en) Service data signature method, device, system and digital certification terminal
CN113660100B (en) Method, system and electronic equipment for generating soft token seed
CN112926076B (en) Data processing method, device and system
CN114710358B (en) Security authentication information acquisition method, device, vehicle, system and storage medium
CN113505364B (en) Password protection method, electronic device and computer-readable storage medium
CN115879135B (en) Bid data processing method, device, equipment and storage medium
CN116821941B (en) Data encryption and decryption method, device, equipment and storage medium
CN114297682A (en) Method, system and electronic device for generating business record

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant