WO2020073314A1 - 密钥生成方法、获取方法、私钥更新方法、芯片和服务器 - Google Patents

密钥生成方法、获取方法、私钥更新方法、芯片和服务器 Download PDF

Info

Publication number
WO2020073314A1
WO2020073314A1 PCT/CN2018/110053 CN2018110053W WO2020073314A1 WO 2020073314 A1 WO2020073314 A1 WO 2020073314A1 CN 2018110053 W CN2018110053 W CN 2018110053W WO 2020073314 A1 WO2020073314 A1 WO 2020073314A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
private key
chip
updated
random number
Prior art date
Application number
PCT/CN2018/110053
Other languages
English (en)
French (fr)
Inventor
严可
李庆斌
Original Assignee
深圳市汇顶科技股份有限公司
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 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2018/110053 priority Critical patent/WO2020073314A1/zh
Priority to CN201880002098.0A priority patent/CN111344996B/zh
Priority to EP18919399.8A priority patent/EP3664362B1/en
Priority to US16/706,624 priority patent/US11190351B2/en
Publication of WO2020073314A1 publication Critical patent/WO2020073314A1/zh

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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • 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/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • 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/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes
    • 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/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • 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

Definitions

  • the present application relates to the field of chip security technology, in particular to a key generation method, acquisition method, private key update method, chip and server.
  • each chip is implanted with a different public and private key pair, where the private key is stored in the chip, and the public key is signed and protected by CA (Certificate Authority) signature.
  • CA Certificate Authority
  • the certificate chain and signature are sent to the other party to verify the device's credibility.
  • the prior art has at least the following problems: when the chip changes users, performs maintenance or the original private key is leaked, the private key needs to be updated in time to ensure user privacy.
  • the private key is usually updated by returning to the factory for maintenance, which will consume more manpower and material resources, and requires the trusted center to master the updated private key, which violates the principle that the security chip private key is only known by the chip, and there is security. Hidden dangers.
  • the purpose of some embodiments of the present application is to provide a key generation method, an acquisition method, a private key update method, a chip, and a server, so that when the chip's private key is updated, more manpower and material resources can be saved, and it is more secure and reliable.
  • An embodiment of the present application provides a key generation method, which is applied to a chip, and the chip stores an internal key, including the following steps: acquiring a first random number and a second random number; according to the first random number and the internal key Generate the initial private key of the chip, and generate the updated private key of the chip according to the second random number and the internal key; generate the initial public key corresponding to the initial private key according to the initial private key, and generate the corresponding private key according to the updated private key The updated public key; send the initial public key, the updated public key and the second random number to the server for the server to send the second random number to the chip when receiving the chip's private key update request, triggering the chip's private key update .
  • An embodiment of the present application also provides a private key update method, which is applied to a chip, and includes: sending a private key update request to a server; the server stores the update random number of the chip, the update public key, and the third private key A public key; the first private key is the private key requested by the private key update request; the update random number received by the server is received, and the update private key is generated according to the update random number and the stored internal key; the update private key is generated and updated Update the public key corresponding to the private key, and use the updated private key to sign the signature information; where the information to be signed includes at least the update public key; send the signed information to the server for the server to use the stored update public key to receive The signed information is verified, and after the verification is passed, the first public key is updated to update the public key.
  • An embodiment of the present application also provides a key acquisition method, which is applied to a server and includes: receiving and storing an updated random number sent by a chip, an updated public key, and a first public key corresponding to a first private key; wherein, the first The private key is the private key currently used by the chip; after receiving the private key update request of the chip, the stored update random number is fed back to the chip for the chip to generate the update private key and the corresponding private key according to the update random number and the internal key of the chip Update the public key and sign the signature information with the updated private key; where the information to be signed includes at least the updated public key; receive the signed information sent by the chip; use the stored updated public key to verify the received signed information , And after the verification is passed, update the first public key to update the public key.
  • An embodiment of the present application further provides a chip including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are The at least one processor executes to enable the at least one processor to execute the above-mentioned key generation method or private key update method.
  • An embodiment of the present application further provides a server including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and Is executed by the at least one processor to enable the at least one processor to execute the above-mentioned key acquisition method.
  • the second random number and the internal key are also used.
  • the key generates the updated private key and the updated public key of the chip, and sends the initial public key, the updated public key and the second random number to the server, so that the server can send the second random number when receiving the chip's private key update request To the chip, trigger the chip's private key update.
  • the private key of the chip is generated by the random number and the internal key stored in the chip, which realizes the decomposition of the private key of the chip, that is, the private key is divided into the internal key and the random number.
  • the internal key is stored in the chip, the outside world has no way of knowing it, so when updating the private key, it can be achieved by updating the external random number, because only the chip itself can be updated using the second random number and internal key sent from the server
  • the private key which conforms to the principle that the private key of the chip is known only by the chip, is more secure and reliable. Moreover, since the private key in the embodiment of the present application does not need to be updated by means of returning to the factory for maintenance, more manpower and material resources are saved.
  • the chip When the private key needs to be updated, the chip sends a private key update request to the server. Since the server stores the update random number of the chip, the updated public key, and the first public key corresponding to the first private key, the first private key is the The private key update request requests the updated private key, so after receiving the private key update request, the server feeds back the stored update random number to the chip.
  • the chip generates an updated private key based on the updated random number and the stored internal key, that is, the updated private key of the chip can only be obtained by the chip itself, which is more secure and reliable in accordance with the principle that the private key of the chip is known only by the chip.
  • the chip generates an updated public key corresponding to the updated private key based on the updated private key, and uses the updated private key to sign the signature information; where the information to be signed includes at least the updated public key and the updated private key is used to sign, even if the initial private key is leaked, It can also ensure communication security.
  • the chip sends the signed information to the server, so that the server can use the stored update public key to verify the received signed information, and after the verification is passed, update the first public key to the update public key.
  • the method for updating the private key according to the embodiment of the present application eliminates the need to use the method of returning to the factory for maintenance, saving a lot of manpower and material resources. When updating, the private key is always in the chip to ensure the security of the update.
  • the updated public key and the second random number after sending the initial public key, the updated public key and the second random number to the server, it also includes: destroying the second random number, updating the private key and updating the public key, the second random number generated by the chip, updating the private key and updating
  • the public key is the data that will be used in the next update request, so after sending the initial public key, update public key and second random number to the server, destroy the second random number, update private key and update public key, It is beneficial to avoid storing too much data in the chip, and the second random number needed to generate the updated private key will not be stored in the chip, so that the attacker cannot crack the chip to obtain the updated private key, which further enhances security.
  • the initial private key of the chip is generated based on the first random number and the internal key
  • the updated private key of the chip is generated based on the second random number and the internal key, which specifically includes: obtaining the internal key by the firmware;
  • the key and the first random number generate the initial private key of the chip, and generate the updated private key of the chip according to the obtained internal key and the second random number;
  • the key generation method of the chip further includes: After updating the public key and the second random number to the server, close the firmware's access to the internal key to achieve irreversible operation, prevent attackers from using firmware vulnerabilities to obtain the chip's internal key, and further enhance security.
  • the initial private key and the updated private key are both ECC private keys; or, the initial private key and the updated private key are both RSA private keys; or, one of the initial private key and the updated private key is the ECC private key , The other is the RSA private key, which provides multiple implementations of the initial private key and the updated private key.
  • the internal key is stored in the read-only storage area of the chip, thereby ensuring that the internal key is not modified.
  • the updated public key with the updated private key before signing the updated public key with the updated private key, it also includes: obtaining a third random number; generating a second private key of the chip based on the third random number and the internal key, and generating a The second public key corresponding to the two private keys; in the step of signing the signature information to be updated using the updated private key, the information to be signed also includes: a third random number and a second public key; the third random number and the second public key are used After the verification is passed, the server replaces the stored update random number with the third random number, and replaces the stored update public key with the second public key.
  • the second public key and the third random number that will be used in the next update are generated, and the information to be signed that also contains the second public key and the third random number is signed with the updated private key.
  • the signed information is sent to the server, so that after the server passes the verification of the received signed information, it can complete the update of the currently used first public key and first private key, and can also store the next update will be used.
  • the received second public key and third random number facilitate the next update.
  • the second public key corresponding to the second private key according to the second private key after generating the second public key corresponding to the second private key according to the second private key, it also includes: destroying the second private key, that is, the chip will not store the second private key after the next update, making the attacker unable to By cracking the chip to obtain the second private key after the next update.
  • the updated private key to sign the signature information before using the updated private key to sign the signature information, it also includes: receiving a challenge code fed back by the server, where the challenge code is a challenge code generated when the server receives the update request; and using the updated private key to sign the signature information
  • the information to be signed also includes a challenge code, which is beneficial to ensure that the information is not leaked during the transmission process of sending the signed information to the server.
  • the chip after receiving the private key update request of the chip and before feeding back the stored update random number to the chip, it also includes verifying the private key update request; if the verification is passed, then executing the feedback of the stored chip update random number Give the chip to further ensure the security of the update.
  • FIG. 1 is a flowchart of a key generation method according to the first embodiment of the present application
  • FIG. 2 is a schematic diagram of generating an ECC private key according to the first embodiment of the present application
  • FIG. 3 is a schematic diagram of generating an RSA private key according to the first embodiment of the present application.
  • FIG. 5 is a schematic diagram of an application scenario according to the private key update method in the third embodiment of the present application.
  • FIG. 6 is a flowchart of a private key update method according to the third embodiment of the present application.
  • FIG. 7 is a flowchart of a method for updating a private key according to the fourth embodiment of the present application.
  • FIG. 8 is a schematic diagram of the interaction between the chip and the server in the private key update method according to the fourth embodiment of the present application.
  • FIG. 9 is a flowchart of a key acquisition method according to the fifth embodiment of the present application.
  • FIG. 10 is a flowchart of a key acquisition method according to the sixth embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a chip according to a seventh embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a server according to an eighth embodiment of the present application.
  • the first embodiment of the present application relates to a key generation method applied to a chip.
  • the chip stores an internal key, including: acquiring a first random number and a second random number; generating a chip based on the first random number and the internal key The initial private key, and the updated private key of the chip is generated according to the second random number and the internal key; the initial public key corresponding to the initial private key is generated according to the initial private key, and the updated public key corresponding to the updated private key is generated according to the updated private key Key; send the initial public key, the updated public key, and the second random number to the server, for the server to send the second random number to the chip when it receives the chip's private key update request, triggering the chip's private key update, so that When the private key of the chip is updated, more manpower and material resources are saved, and it is more safe and reliable.
  • the implementation details of the key generation method of this embodiment are described below in detail. The following content is only for the implementation details provided for easy understanding, and is not necessary for implementing
  • the key generation method in this embodiment can be carried out by downloading test firmware in a safe and trusted environment during the chip production process.
  • the chip stores an internal key.
  • the internal key can be stored in the chip's read-only storage In the area.
  • the key_internal of each chip may be different.
  • FIG. 1 The specific process of the key generation method in this embodiment is shown in FIG. 1 and includes:
  • Step 101 Obtain a first random number and a second random number.
  • test firmware can call the random number module to generate two random numbers, including the first random number used to generate the initial private key and the second random number random2 that will be used for the initial private key update next time.
  • Step 102 Generate an initial private key of the chip based on the first random number and the internal key, and generate an updated private key of the chip based on the second random number and the internal key.
  • the key_internal can be obtained from the firmware.
  • the firmware can be the test firmware downloaded in a safe and trusted environment.
  • the test firmware can read the key_internal and use the Elliptic Curve Cryptography (Elliptic Curves Cipher for short for "ECC") scheme or the RSA scheme ,
  • Elliptic Curves Cipher for short for "ECC” Elliptic Curves Cipher for short for "ECC”
  • ECC Elliptic Curves Cipher for short for "ECC”
  • the initial private key key_device of the chip is generated based on the first random number random and the internal key key_internal
  • the updated private key key_device2 of the chip is generated based on the second random number random2 and the internal key key_internal.
  • the initial private key key_device and the updated private key key_device2 may both be ECC private keys, that is, both are generated through the ECC scheme.
  • the initial private key key_device and the updated private key key_device2 may be both RSA private keys, that is, both are generated through the RSA scheme; or, one of the initial private key key_device and the updated private key key_device2 is the ECC private key, and the other RSA private key.
  • the ECC scheme requires that the private key is less than the order of the curve, so the key establishment algorithm can be used directly: the chip's internal key key_internal and the first random number random get the unique initial private key of the chip through the key derivation function KDF
  • the key key_device that is, the initial private key key_device is obtained by the following formula (1):
  • key_device KDF (key_interal, random) (1)
  • the KDF function can use the key establishment function specified in NIST SP800-108 [4]. If the generated initial private key key_device is greater than the curve order, execute the following formula (2) until the initial private key key_device is less than the curve order.
  • the initial private key obtained through the ECC scheme is the ECC private key.
  • the updated private key key_device2 may also be passed through the ECC scheme described above. To avoid duplication, this embodiment will not repeat them here.
  • the RSA scheme requires that the p and q that generate the private key must be prime numbers, and the generation of p and q depends on the random number generator.
  • a deterministic random number generator can be used for random number generation.
  • the following description uses the initial private key as the RSA private key: the deterministic random number generator uses the internal key key_internal and the first random number as seeds, and does not introduce other entropy sources to ensure the certainty of generating random number sequences, namely For the same key_internal and random, the generated random number sequence is determined. Therefore, the result obtained by the RSA private key generation algorithm is also determined.
  • the deterministic random number generator can use the SHA algorithm. For example, the nth generated random number rndn can be calculated by the following formula (3):
  • a deterministic random number generation algorithm can also be used, but does not have a continuous sampling entropy source, and key_internal and random are used as initial values of the deterministic random number generator.
  • the initial private key obtained through the RSA scheme is the RSA private key.
  • updating the private key key_device2 may also be through the above RSA scheme. To avoid duplication, this embodiment will not repeat them here.
  • Step 103 Generate an initial public key corresponding to the initial private key according to the initial private key, and generate an updated public key corresponding to the updated private key according to the updated private key.
  • the chip can generate the corresponding initial public key pubkey_device according to the initial private key key_device, and generate the corresponding updated public key pubkey_device2 according to the updated private key key_device2.
  • Step 104 Send the initial public key, the updated public key, and the second random number to the server.
  • the chip can first send a triple consisting of the initial public key pubkey_device, the updated public key pubkey_device2, and the second random number random2 to the host computer.
  • the host computer can be a master device that directly controls the chip.
  • the host computer receives the After the triplet, the triplet is sent to the server.
  • the server can be a CA server, and the CA server can save the triplet to the database.
  • the CA server may send the second random number random2 stored in the database to the chip to trigger the update of the private key of the chip.
  • the private key of the chip is generated from the random number and the internal key stored in the chip, which realizes the decomposition of the private key of the chip, that is, the private key is divided into the internal key
  • the random number part because the internal key is stored in the chip, the outside world has no way of knowing, so that when updating the private key, it can be achieved by updating the external random number, because only the chip itself can use the second random number sent from the server and
  • the internal key is updated with the private key, which conforms to the principle that the private key of the chip is known only by the chip, which is more secure and reliable.
  • the private key in the embodiment of the present application does not need to be updated by means of returning to the factory for maintenance, more manpower and material resources are saved.
  • the second embodiment of the present application relates to a key generation method.
  • the second embodiment is a further improvement based on the first embodiment.
  • the main improvement is that in the second embodiment, after the initial public key, the updated public key and the second random number are sent to the server, the second Random number, update private key and update public key are helpful to avoid storing too much data in the chip, and the second random number needed to generate the update private key will not be saved in the chip, making it impossible for attackers to obtain updates by cracking the chip
  • the private key further enhances security.
  • FIG. 4 The specific flow of the key generation method in this embodiment is shown in FIG. 4 and includes:
  • Step 201 Obtain a first random number and a second random number.
  • Step 202 Generate an initial private key of the chip based on the first random number and the internal key, and generate an updated private key of the chip based on the second random number and the internal key.
  • Step 203 Generate an initial public key corresponding to the initial private key according to the initial private key, and generate an updated public key corresponding to the updated private key according to the updated private key.
  • Step 204 Send the initial public key, the updated public key and the second random number to the server.
  • Steps 201 to 204 are substantially the same as steps 101 to 104 in the first embodiment. To avoid repetition, they will not be repeated here.
  • Step 205 Destroy the second random number, update the private key and update the public key.
  • the second random number random2, update private key key_device2, and update public key pubkey_device2 are all data that will be used when the chip's private key is updated, which is sensitive information that will not be used temporarily for the chip. Therefore, the above-mentioned sensitive information can be directly destroyed after sending the triplet to the server.
  • the first random number does not belong to sensitive information and can be stored in the memory chip flash.
  • the second random number, the updated private key and the updated public key are destroyed, which is beneficial to avoid storing Multiple data, and the second random number needed to generate the updated private key will not be stored in the chip, so that the attacker can not crack the chip to obtain the updated private key, which further enhances security.
  • the third embodiment of the present application relates to a private key update method, which is applied to a chip, such as the fingerprint identification chip shown in FIG. 5.
  • the private key update method of this embodiment includes: sending a private key update request to the server; the server stores the update random number of the chip, the update public key, and the first public key corresponding to the first private key; the first private key is private
  • the key update request requests the updated private key; receives the updated random number fed back by the server, and generates the updated private key based on the updated random number and the stored internal key; generates the updated public key corresponding to the updated private key based on the updated private key, and uses Update the private key to sign the signature information; where the information to be signed at least includes the update public key, send the signed information to the server, for the server to use the stored update public key to verify the received signed information, and verify After the update, the first public key is updated to the updated public key, so that when the private key of the chip is updated, more manpower and material resources are saved, and it is more secure
  • the specific process of the private key update method in this embodiment is shown in FIG. 6 and includes:
  • Step 301 Send a private key update request to the server.
  • the chip can send a private key update request to the server through the host computer.
  • the server stores the update random number of the chip, the update public key, and the first public key corresponding to the first private key.
  • the first private key is the update request
  • the private key currently used by the chip requesting update may be either the initial private key or the private key that has been updated several times.
  • the server receives the private key update request of the chip, it can look up the stored update random number of the chip.
  • the server may store update random numbers, update public keys, and first public keys of several chips, different chips may have different identification numbers to distinguish the update random numbers and update public numbers of different chips. Key and first public key.
  • the chip sends the private key update request, it can carry the identification number of the chip, so that the server can search for the update random number corresponding to the identification number according to the identification number carried in the received private key update request.
  • Step 302 Receive the updated random number fed back by the server, and generate an updated private key according to the updated random number and the stored internal key.
  • the chip can receive the updated random number fed back by the server through the upper computer, that is, the server can first send the updated random number to the upper computer, and then the upper computer sends the updated random number to the chip.
  • the chip can save the updated random number and restart into the bootloader.
  • the bootloader has the right to read the internal key, so that the updated private key can be generated based on the read internal key and the updated random number.
  • the update of the private key may be specifically generated through the ECC scheme or the RSA scheme.
  • the ECC scheme or the RSA scheme has been specifically described in the first embodiment, and will not be repeated here one by one in order to avoid repetition.
  • Step 303 Generate an updated public key corresponding to the updated private key according to the updated private key, and use the updated private key to sign the signature information.
  • the chip may generate an updated public key corresponding to the updated private key according to the updated private key.
  • the chip uses the updated private key to sign the signed information, that is to say, the updated private key is used to encrypt the signed information.
  • the information to be signed can be the updated public key pubkey_device2, the signature can be recorded as sig, and the signed information can be expressed It is: (pubkey_device2, sig).
  • the chip can send the signed information to the upper computer first, and then the upper computer to the server.
  • the server can use the stored update public key pubkey_device2 to verify the received signed information (pubkey_device2, sig), that is, the server can use the stored pubkey_device2 to decrypt the sig, if the decrypted data is pubkey_device2, it can be considered as verified.
  • the first public key currently used by the chip is updated to the updated public key.
  • the server may make a certificate or sign based on the updated public key, send it to the chip, and revoke the original first public key certificate of the chip.
  • the chip can save the certificate or signature sent by the server to update the public key, and complete the update of the private key after restarting. If the verification fails, stop the update.
  • the embodiment of the present application sends the private key update request to the server. Since the server stores the update random number of the chip, the updated public key and the first public key corresponding to the first private key, the first The private key is the private key that the private key update request requests to update. Therefore, after receiving the private key update request, the server can feed back the stored update random number to the chip.
  • the chip generates an updated private key based on the updated random number and the stored internal key, that is, the updated private key of the chip can only be obtained by the chip itself, which is more secure and reliable in accordance with the principle that the private key of the chip is known only by the chip.
  • the chip generates an updated public key corresponding to the updated private key according to the updated private key, and uses the updated private key to sign the signature information; the information to be signed includes at least the updated public key, and the updated private key is used to sign, even if the initial private key is leaked. Ensure communication security.
  • the chip sends the signed information to the server, so that the server can use the stored update public key to verify the received signed information, and after the verification is passed, update the first public key to the update public key.
  • the method for updating the private key of the embodiment of the present application ensures that when the user is replaced, repaired and the original private key is leaked, the chip's private key is updated online safely. This method avoids the traditional defect of returning to the factory for renewal or directly revoking the security of the public key guide chip, and has practicality.
  • the fourth embodiment of the present application relates to a private key update method.
  • the fourth embodiment is a further improvement based on the third embodiment.
  • the main improvement is that, in this fourth embodiment, at this update, the second public key and the third Random number, after signing the information to be signed that also contains the second public key and the third random number with the updated private key, the signed information is sent to the server, so that the server verifies the received signed information After passing, it can not only update the currently used first public key and first private key, but also store the second public key and third random number that will be used in the next update, which facilitates the next update.
  • the specific flow of the key generation method in this embodiment is shown in FIG. 7 and includes:
  • Step 401 Send a private key update request to the server.
  • Step 402 Receive the updated random number fed back by the server, and generate an updated private key according to the updated random number and the stored internal key.
  • step 402 is substantially the same as step 302 in the third embodiment.
  • the chip when the chip receives the update random number fed back by the server, it indicates that the chip's private key update request has passed the server. Verification.
  • the server may verify the update request; if the verification is passed, then the stored updated random number of the chip is fed back to the chip.
  • the server can use other auxiliary authentication methods, such as passwords, SMS, emails, usernames and passwords, or other authentication methods; or analyze the chip for abnormal behavior, such as applying for private key update multiple times in a short period of time. The alarm can be made, which further improves the security of the update.
  • Step 403 Obtain a third random number.
  • the chip can call the random number generation module to generate the third random number random3.
  • Step 404 Generate a second private key of the chip according to the third random number and the internal key, and generate a second public key corresponding to the second private key according to the second private key.
  • the second private key may be generated by the ECC scheme or the RSA scheme.
  • the ECC scheme or the RSA scheme has been specifically described in the first embodiment, and will not be repeated here one by one to avoid repetition.
  • the chip may calculate the second public key corresponding to the second private key according to the second private key, where the second private key and the second public key are the private key and the public key obtained by the next update, respectively.
  • the second private key may be destroyed, so that an attacker cannot obtain the second private key by cracking the chip.
  • Step 405 Generate an updated public key corresponding to the updated private key according to the updated private key, and use the updated private key to sign the signature information.
  • the chip can generate an updated public key corresponding to the updated private key according to the updated private key, and use the updated private key to sign the signature information.
  • the information to be signed in this embodiment includes: updated public key pubkey_device2, the third random number Random3 and the second public key pubkey_device3, the chip uses the updated private key to sign the pubkey_device2, random3 and pubkey_device3 stitched message, the signed information can be expressed as: (pubkey_device2, random3, pubkey_device3, sig)
  • the information to be signed may also include a challenge code challenge.
  • the server receives the private key update request, if it finds the update random number random2 corresponding to the identification number of the chip, it can generate a challenge code challenge and send the challenge code to the chip.
  • the challenge code is a random number that is not repeated every time.
  • the chip can receive the challenge code fed back by the server through the host computer.
  • the chip uses the updated private key to sign the message composed of pubkey_device2, random3, pubkey_device3, and challenge, and the signed information can be expressed as: (pubkey_device2, random3, pubkey_device3, challenge, sig).
  • Step 406 Send the signed information to the server.
  • the chip can send the signed information to the host computer first, and then send it to the server.
  • the server can use the stored pubkey_device2 to verify the received signed information (pubkey_device2, random3, pubkey_device3, sig), that is, the server uses the stored pubkey_device2 to decrypt the sig, if the decrypted data is pubkey_device2, random3, pubkey_device3, it can be Think that verification has passed.
  • the first public key currently used by the chip is updated to the updated public key, the stored update random number random2 is replaced with the third random number random3, and the stored update public key pubkey_device2 is replaced with the second public key pubkey_device3.
  • this embodiment provides a schematic diagram of the interaction between the CA server and the security chip as shown in FIG. 8.
  • the CA server and the security chip cooperate with each other to update the private key. Due to the content in steps 401 to 406 The interaction between the server and the chip has been covered. To avoid repetition, I will not repeat them here.
  • this embodiment of the present application has the following effects: (1) The private key never comes out of the chip: only the chip can recover the private key and the private key to be updated, even the CA server cannot calculate the chip private Key (including the previous private key and the private key to be updated); (2) Communication security: using the new private key signature, even if the original private key is leaked, it can ensure communication security.
  • Chip security guarantee generate new private key The random number required for the key is not stored in the chip, and the attacker cannot crack the chip to obtain the updated private key;
  • the update is controllable: the private key update is controlled by the CA server, so the server can use other auxiliary authentication Means, such as passwords, e-mail, mobile phone verification code, etc., to further confirm the security of the update.
  • the fifth embodiment of the present application relates to a key acquisition method, which is applied to a server and includes: receiving and storing an updated random number sent by a chip, an updated public key, and a first public key corresponding to a first private key; wherein, the first private key It is the private key currently used by the chip; after receiving the private key update request from the chip, the stored update random number is fed back to the chip for the chip to generate the update private key and corresponding update public key according to the update random number and the chip's internal key Key, and sign the signature information with the updated private key; where the information to be signed includes at least the updated public key; receive the signed information sent by the chip; use the stored updated public key to verify the received signed information, and After the verification is passed, the first public key is updated to the updated public key, so that when the private key of the chip is updated, more manpower and material resources are saved, and it is more secure and reliable.
  • the implementation details of the key generation method of this embodiment are described below in detail. The following content is only for the implementation details provided
  • FIG. 9 The specific process of the key generation method in this embodiment is shown in FIG. 9 and includes:
  • Step 501 Receive and store the updated random number, the updated public key and the first public key corresponding to the first private key sent by the chip.
  • Step 502 After receiving the private key update request of the chip, the stored update random number is fed back to the chip.
  • Step 503 Receive the signed information sent by the chip.
  • Step 504 Use the stored updated public key to verify the received signed information.
  • Step 505 determine whether the verification of the signed information is passed; if the verification is passed, step 506 is executed; otherwise, step 507 is executed.
  • Step 506 Update the first public key to update the public key.
  • Step 507 Stop updating.
  • the key acquisition method of this embodiment is applied to the server, and the private key update method of the third embodiment is applied to the chip.
  • the chip and the server can cooperate with each other to complete the update of the private key of the chip. Therefore, the embodiment on the private key update method in the third embodiment can be implemented in cooperation with this embodiment.
  • the relevant technical details mentioned in the third embodiment are still valid in this embodiment, and in order to reduce repetition, they will not be repeated here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied in the third embodiment.
  • the sixth embodiment of the present application relates to a private key update method.
  • the sixth embodiment is a further improvement based on the fifth embodiment.
  • the main improvement is that, in the sixth embodiment, after receiving the private key update request of the chip, the stored update random number is fed back to the chip Before, the update request is verified; if the verification is passed, the updated random number of the stored chip is fed back to the chip, which further improves the security of the update.
  • FIG. 10 The flowchart of the key acquisition method in this embodiment is shown in FIG. 10, and specifically includes:
  • Step 601 Receive and store the updated random number, the updated public key and the first public key corresponding to the first private key sent by the chip.
  • Step 602 After receiving the private key update request of the chip, verify the private key update request.
  • Step 603 Determine whether the verification of the private key update request is passed, if yes, go to step 604, otherwise go to step 609.
  • Step 604 Feedback the stored updated random number to the chip.
  • Step 605 Generate a challenge code and send the challenge code to the chip.
  • step 604 the server can send the update random number random2 and the challenge code challenge to the chip at the same time, or send the challenge code first and then send the update random number
  • the server only takes the example of sending the update random number first, but it is not limited to this in practical applications.
  • Step 606 Receive the signed information sent by the chip.
  • Step 607 Use the stored updated public key to verify the received signed information.
  • Step 608 Determine whether the verification of the signed information is passed. If the verification is passed, step 609 is performed, otherwise step 610 is performed.
  • Step 609 Update the first public key to the updated public key, replace the stored updated random number with the third random number, and replace the stored updated public key with the second public key.
  • Step 610 Stop updating.
  • the key acquisition method of this embodiment is applied to the server, and the private key update method of the fourth embodiment is applied to the chip.
  • the chip and the server can cooperate with each other to complete the update of the private key of the chip. Therefore, the embodiment on the private key update method in the fourth embodiment can be implemented in cooperation with this embodiment.
  • the relevant technical details mentioned in the fourth embodiment are still valid in this embodiment, and in order to reduce repetition, they will not be repeated here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied in the fourth embodiment.
  • the seventh embodiment of the present invention relates to a chip, as shown in FIG. 11, including: at least one processor 801; and a memory 802 in communication connection with the at least one processor 801; wherein the memory 802 stores at least one processing Instructions executed by the processor 801, the instructions are executed by at least one processor, so that the at least one processor 801 can execute the above-mentioned key generation method or private key update method.
  • the bus may include any number of interconnected buses and bridges.
  • the bus connects one or more processors 801 and various circuits of the memory 802 together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and therefore, they will not be further described herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor 801 is transmitted on the wireless medium through the antenna. Further, the antenna also receives the data and transmits the data to the processor 801.
  • the processor 801 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 802 may be used to store data used by the processor 801 when performing operations.
  • An eighth embodiment of the present invention relates to a server, as shown in FIG. 12, including: at least one processor 901; and a memory 902 in communication connection with the at least one processor 901; wherein the memory 902 stores at least one processing Instructions executed by the processor 901, the instructions are executed by at least one processor 901, so that the at least one processor 901 can execute the above-mentioned key acquisition method.
  • the bus may include any number of interconnected buses and bridges.
  • the bus connects one or more processors 901 and various circuits of the memory 902 together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and therefore, they will not be further described herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor 901 is transmitted on the wireless medium through the antenna. Further, the antenna also receives the data and transmits the data to the processor 901.
  • the processor 901 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 902 may be used to store data used by the processor 901 when performing operations.
  • a program which is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Abstract

本申请实施例涉及芯片安全领域,公开了一种密钥生成方法、获取方法、私钥更新方法、芯片和服务器。密钥生成方法,应用于芯片,芯片存储有内部密钥,包括以下步骤:获取第一随机数与第二随机数(101);根据第一随机数与所述内部密钥生成芯片的初始私钥,并根据第二随机数与内部密钥生成芯片的更新私钥(102);根据初始私钥生成与初始私钥对应的初始公钥,并根据更新私钥生成与更新私钥对应的更新公钥(103);将初始公钥、更新公钥和第二随机数发送至服务器(104),供服务器在接收到芯片的私钥更新请求时,将第二随机数发送至芯片,触发芯片的私钥更新,使得对芯片的私钥进行更新时,节省了较多的人力物力,更加安全可靠。

Description

密钥生成方法、获取方法、私钥更新方法、芯片和服务器 技术领域
本申请涉及芯片安全技术领域,特别涉及一种密钥生成方法、获取方法、私钥更新方法、芯片和服务器。
背景技术
物联网技术的飞速发展,极大的方便了人们的生活,然而带来的安全与隐私问题也受到日益关注。为保障设备的可信性,通常采用基于证书链的认证方式。即在生产时,每颗芯片都植入不同的公私钥对,其中私钥存储在芯片内,公钥由CA(Certificate Authority)签名保护。在通信时,将证书链及签名发送至对方,实现设备可信性的验证。
发明人发现现有技术至少存在以下问题:当芯片更换使用者、进行维修维护或者原私钥泄露时,需要及时更新私钥,以保障用户隐私安全。现有技术中,私钥通常采用返厂维修的方式更新,将消耗较多的人力物力,而且要求可信中心掌握更新后的私钥,违背了安全芯片私钥只有芯片知道的原则,存在安全隐患。
发明内容
本申请部分实施例的目的在于提供一种密钥生成方法、获取方法、私钥 更新方法、芯片和服务器,使得对芯片的私钥进行更新时,可节省较多的人力物力,更加安全可靠。
本申请实施例提供了一种密钥生成方法,应用于芯片,芯片存储有内部密钥,包括以下步骤:获取第一随机数与第二随机数;根据第一随机数与所述内部密钥生成芯片的初始私钥,并根据第二随机数与内部密钥生成芯片的更新私钥;根据初始私钥生成与初始私钥对应的初始公钥,并根据更新私钥生成与更新私钥对应的更新公钥;将初始公钥、更新公钥和第二随机数发送至服务器,供服务器在接收到芯片的私钥更新请求时,将第二随机数发送至芯片,触发芯片的私钥更新。
本申请实施例还提供了一种私钥更新方法,应用于芯片,包括:向服务器发送私钥更新请求;服务器中存储有芯片的更新随机数、更新公钥和与第一私钥对应的第一公钥;第一私钥为私钥更新请求请求更新的私钥;接收服务器反馈的更新随机数,并根据更新随机数和存储的内部密钥生成更新私钥;根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名;其中,待签名信息至少包括更新公钥;将签名后的信息发送至服务器,供服务器利用存储的更新公钥对接收的签名后的信息进行验证,并在验证通过后将第一公钥,更新为更新公钥。
本申请实施例还提供了一种密钥获取方法,应用于服务器,包括:接收并存储芯片发送的更新随机数、更新公钥和与第一私钥对应的第一公钥;其中,第一私钥为芯片当前使用的私钥;在接收到芯片的私钥更新请求后,将存储的更新随机数反馈给芯片,供芯片根据更新随机数与芯片的内部密钥生成更新私钥和对应的更新公钥,并以更新私钥对待签名信息进行签名;其中,待签名信 息至少包括更新公钥;接收芯片发送的签名后的信息;利用存储的更新公钥对接收的签名后的信息进行验证,并在验证通过后将第一公钥,更新为更新公钥。
本申请实施例还提供了一种芯片,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使至少一个处理器能够执行上述的密钥生成方法或私钥更新方法。
本申请实施例还提供了一种服务器,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使至少一个处理器能够执行上述的密钥获取方法。
本申请实施例相对于现有技术而言,利用第一随机数和内部密钥在生成芯片的初始私钥和与初始私钥对应的初始公钥时,还会利用第二随机数和内部密钥生成芯片的更新私钥和更新公钥,并将初始公钥、更新公钥和第二随机数发送至服务器,使得服务器可以在收到芯片的私钥更新请求时,将第二随机数发送至芯片,触发芯片的私钥更新。本申请实施例中,芯片的私钥由随机数和芯片内存储的内部密钥生成,实现了对芯片的私钥的分解,也就是说,将私钥分为内部密钥和随机数两部分,由于内部密钥存储在芯片中,外界无从得知,使得在更新私钥时,可以通过更新外部随机数实现,由于只有芯片本身可以利用来自服务器发送的第二随机数和内部密钥得到更新私钥,符合芯片的私钥只有芯片知道的原则,更加更加安全可靠。而且,由于本申请实施例中私钥无需采用返厂维修的方式更新,节省了较多的人力物力。
在需要更新私钥时,芯片向服务器发送私钥更新请求,由于服务器中存 储有芯片的更新随机数、更新公钥和与第一私钥对应的第一公钥,第一私钥为所述私钥更新请求请求更新的私钥,因此服务器在接收到私钥更新请求后,向芯片反馈存储的更新随机数。芯片根据更新随机数和存储的内部密钥生成更新私钥,即芯片的更新私钥只有芯片本身可以得到,符合芯片的私钥只有芯片知道的原则,更加更加安全可靠。芯片根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名;其中,待签名信息至少包括更新公钥,采用更新私钥签名,即使初始私钥泄漏,也能保证通信安全。芯片将签名后的信息发送至服务器,使得服务器可以利用存储的更新公钥对接收的签名后的信息进行验证,并在验证通过后将所述第一公钥,更新为更新公钥。本申请实施例的私钥更新方法,使得私钥无需采用返厂维修的方式更新,节省了较多的人力物力,在更新时,私钥一直在芯片中,确保了更新的安全性。
例如,将初始公钥、更新公钥和第二随机数发送至服务器之后,还包括:销毁第二随机数、更新私钥和更新公钥,芯片生成的第二随机数、更新私钥和更新公钥均为下次有更新请求会用到的数据,因此,在将初始公钥、更新公钥和第二随机数发送至服务器之后,销毁第二随机数、更新私钥和更新公钥,有利于避免芯片中存储过多的数据,而且生成更新私钥需要的第二随机数不会保存在芯片中,使得攻击者无法通过破解芯片以获得更新私钥,进一步增强了安全性。
例如,根据第一随机数与内部密钥生成芯片的初始私钥,并根据第二随机数与内部密钥生成芯片的更新私钥,具体包括:由固件获取内部密钥;固件根据获取的内部密钥和第一随机数生成芯片的初始私钥,并根据获取的内部密钥和第二随机数生成所述芯片的更新私钥;芯片的密钥生成方法,还包括:在 将初始公钥、更新公钥和第二随机数发送至服务器后,关闭固件对内部密钥的访问权限,以实现操作的不可逆,防止攻击者利用固件漏洞获得芯片的内部密钥,进一步增强了安全性。
例如,初始私钥和更新私钥,均为ECC私钥;或者,初始私钥和更新私钥,均为RSA私钥;或者,初始私钥和更新私钥中的一者,为ECC私钥,另一者为RSA私钥,提供了初始私钥和更新私钥的多种实现方式。
例如,内部密钥存储于芯片的只读存储区域中,从而保证内部密钥不被修改。
例如,在采用更新私钥对更新公钥进行签名之前,还包括:获取第三随机数;根据第三随机数和内部密钥生成芯片的第二私钥,并根据第二私钥生成与第二私钥对应的第二公钥;在采用更新私钥对待签名信息进行签名的步骤中,待签名信息还包括:第三随机数和第二公钥;第三随机数和第二公钥用于供服务器在验证通过后将存储的更新随机数替换为第三随机数,并将存储的更新公钥替换为第二公钥。在本次更新时,生成下次更新会用到的第二公钥、第三随机数,对还包含有第二公钥和第三随机数的待签名信息采用更新私钥进行签名后,将签名后的信息发送至服务器,使得服务器对接收到的签名后的信息的验证通过后,既可以完成对当前使用的第一公钥和第一私钥的更新,还可以存储下次更新会用到的第二公钥和第三随机数,方便了下一次的更新。
例如,在根据第二私钥生成与第二私钥对应的第二公钥之后,还包括:销毁第二私钥,即芯片不会存储下次更新后的第二私钥,使得攻击者无法通过破解芯片以获得下次更新后的第二私钥。
例如,采用更新私钥对待签名信息进行签名之前,还包括:接收服务器 反馈的挑战码,其中,挑战码为服务器在接收到更新请求时生成的挑战码;在采用更新私钥对待签名信息进行签名的步骤中,待签名信息还包括挑战码,有利于在将签名后的信息发送至服务器的传输过程中保证信息不被泄露。
例如,在接收到芯片的私钥更新请求后,将存储的更新随机数反馈给芯片之前,还包括对私钥更新请求进行验证;如果验证通过,则再执行将存储的芯片的更新随机数反馈给芯片,进一步确保更新的安全性。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定。
图1是根据本申请第一实施例中的密钥生成方法的流程图;
图2是根据本申请第一实施例中的生成ECC私钥的示意图;
图3是根据本申请第一实施例中的生成RSA私钥的示意图;
图4是根据本申请第二实施例中的密钥生成方法的流程图;
图5是根据本申请第三实施例中的私钥更新方法的应用场景的示意图;
图6是根据本申请第三实施例中的私钥更新方法的流程图;
图7是根据本申请第四实施例中的私钥更新方法的流程图;
图8是根据本申请第四实施例中的私钥更新方法中芯片与服务器的交互示意图;
图9是根据本申请第五实施例中的密钥获取方法的流程图;
图10是根据本申请第六实施例中的密钥获取方法的流程图;
图11是根据本申请第七实施例中的芯片的结构示意图;
图12是根据本申请第八实施例中的服务器的结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请部分实施例进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请第一实施例涉及一种密钥生成方法,应用于芯片,芯片存储有内部密钥,包括:获取第一随机数与第二随机数;根据第一随机数与内部密钥生成芯片的初始私钥,并根据第二随机数与内部密钥生成芯片的更新私钥;根据初始私钥生成与初始私钥对应的初始公钥,并根据更新私钥生成与更新私钥对应的更新公钥;将初始公钥、更新公钥和第二随机数发送至服务器,供服务器在接收到芯片的私钥更新请求时,将第二随机数发送至芯片,触发芯片的私钥更新,使得对芯片的私钥进行更新时,节省了较多的人力物力,更加安全可靠。下面对本实施例的密钥生成方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本实施例中的密钥生成方法可以在芯片生产流程中,在安全可信的环境通过下载测试固件进行,芯片存储有内部密钥,较佳的,内部密钥可以存储于芯片的只读存储区域中。比如说,将内部密钥key_internal在芯片生产时直接写入芯片中Efuse、只读存储器ROM等不可修改的设备中,每块芯片的key_internal可以均不相同。
本实施例中密钥生成方法的具体流程如图1所示,包括:
步骤101:获取第一随机数与第二随机数。
具体的说,测试固件可以调用随机数模块,生成两个随机数,包括用于生成初始私钥的第一随机数random和下次更新初始私钥会用到的第二随机数random2。
步骤102:根据第一随机数与内部密钥生成芯片的初始私钥,并根据第二随机数与内部密钥生成芯片的更新私钥。
具体的说,可以由固件获取key_internal,固件可以为在安全可信的环境下载的测试固件,测试固件可以读取key_internal,并利用椭圆曲线密码学(Elliptic Curves Cipher简称“ECC”)方案或RSA方案,根据第一随机数random与内部密钥key_internal生成芯片的初始私钥key_device,根据第二随机数random2与内部密钥key_internal生成芯片的更新私钥key_device2。初始私钥key_device和更新私钥key_device2可以均为ECC私钥,即均通过ECC方案生成。或者,初始私钥key_device和更新私钥key_device2可以均为RSA私钥,即均通过RSA方案生成;或者,初始私钥key_device和更新私钥key_device2中的一者,为ECC私钥,另一者为RSA私钥。
下面以初始私钥为ECC私钥为例说明,生成ECC私钥的示意图如图2所示:
具体而言,ECC方案要求私钥小于曲线的阶,因此直接采用密钥建立算法即可:由芯片内部密钥key_internal和第一随机数random通过密钥派生函数KDF得到该芯片独有的初始私钥key_device,即通过以下的公式(1)得到初始私钥key_device:
key_device=KDF(key_int eral,random)       (1)
其中KDF函数可采用NIST SP800-108[4]规定的密钥建立函数,若生成的初始私钥key_device大于曲线的阶,执行以下公式(2)式直到初始私钥key_device 小于曲线的阶为止。
key_device=KDF(key_device,random)      (2)
通过ECC方案得到的初始私钥即为ECC私钥,在实际应用中,更新私钥key_device2也可以通过上述的ECC方案,为避免重复本实施方式对此不再赘述。
下面以初始私钥为RSA私钥为例说明,生成RSA私钥的示意图如图3所示:
具体而言,RSA方案要求生成私钥的p、q必须为素数,而p、q的生成依赖随机数发生器。为保证私钥更新的确定性,随机数生成可以采用确定性随机数生成器。下面以初始私钥为RSA私钥进行说明:确定性随机数生成器以内部密钥key_internal和第一随机数random作为种子,不再引入其它熵源,以保证生成随机数序列的确定性,即同样的key_internal和random,生成的随机数序列是确定的,因此,通过RSA私钥生成算法得到的结果也是确定的。确定性随机数生成器可以采用SHA算法,例如第n次生成的随机数rndn可通过以下公式(3)计算:
rnd n=SHA(key_int ernal||random||rnd n-1)       (3)
也可采用确定性随机数生成算法,但不具备连续采样的熵源,key_internal和random作为确定性随机数生成器的初始值。通过RSA方案得到的初始私钥即为RSA私钥,在实际应用中,更新私钥key_device2也可以通过上述的RSA方案,为避免重复本实施方式对此不再赘述
步骤103:根据初始私钥生成与初始私钥对应的初始公钥,并根据更新私钥生成与更新私钥对应的更新公钥。
也就是说,芯片可以根据初始私钥key_device生成对应的初始公钥 pubkey_device,并根据更新私钥key_device2生成对应的更新公钥pubkey_device2。
步骤104:将初始公钥、更新公钥和第二随机数发送至服务器。
具体的说,芯片可以先将由初始公钥pubkey_device、更新公钥pubkey_device2和第二随机数random2组成的三元组发送至上位机,上位机可以为直接控制芯片的主控装置,上位机在接收到三元组后,将三元组发送至服务器,服务器可以为CA服务器,CA服务器可以将三元组保存到数据库中。CA服务器在接收到芯片的私钥更新请求时,可以将存储在数据库中的第二随机数random2发送至芯片,触发芯片的私钥更新。
在实际应用中在将三元组发送至服务器后,可以关闭测试固件对内部密钥key_internal的访问权限,关闭访问权限可以通过关闭GPIO口或熔断Efuse中相应控制位等方式实现,从而实现操作的不可逆,还可以防止攻击者利用测试固件的漏洞获得key_internal。在芯片生产结束后可以仅保留bootloader对key_internal具备访问权限,如果后续过程需要生成私钥,则可以在bootloader阶段生成。
本实施例相对于现有技术而言,芯片的私钥由随机数和芯片内存储的内部密钥生成,实现了对芯片的私钥的分解,也就是说,将私钥分为内部密钥和随机数两部分,由于内部密钥存储在芯片中,外界无从得知,使得在更新私钥时,可以通过更新外部随机数实现,由于只有芯片本身可以利用来自服务器发送的第二随机数和内部密钥得到更新私钥,符合芯片的私钥只有芯片知道的原则,更加更加安全可靠。而且,由于本申请实施例中私钥无需采用返厂维修的方式更新,节省了较多的人力物力。
本申请第二实施例涉及一种密钥生成方法。第二实施例是在第一实施例的基础上做的进一步改进,主要改进之处在于,第二实施例中将初始公钥、更新公钥和第二随机数发送至服务器之后,销毁第二随机数、更新私钥和更新公钥,有利于避免芯片中存储过多的数据,而且生成更新私钥需要的第二随机数不会保存在芯片中,使得攻击者无法通过破解芯片以获得更新私钥,进一步增强了安全性。
本实施例中密钥生成方法的具体流程如图4所示,包括:
步骤201:获取第一随机数与第二随机数。
步骤202:根据第一随机数与所述内部密钥生成芯片的初始私钥,并根据第二随机数与内部密钥生成芯片的更新私钥。
步骤203:根据初始私钥生成与初始私钥对应的初始公钥,并根据更新私钥生成与更新私钥对应的更新公钥。
步骤204:将初始公钥、更新公钥和第二随机数发送至服务器。
步骤201至步骤204与第一实施例中步骤101至步骤104大致相同,为避免重复,此处不再一一赘述。
步骤205:销毁第二随机数、更新私钥和更新公钥。
具体的说,第二随机数random2、更新私钥key_device2和更新公钥pubkey_device2,均为对芯片的私钥进行更新时,才会使用的数据,对于芯片来说属于暂时不会使用的敏感信息,因此,在将三元组发送至服务器后可以直接将上述的敏感信息销毁。第一随机数不属于敏感信息,可以保存在存储芯片flash中。
本实施例相对于现有技术而言,将初始公钥、更新公钥和第二随机数发 送至服务器之后,销毁第二随机数、更新私钥和更新公钥,有利于避免芯片中存储过多的数据,而且生成更新私钥需要的第二随机数不会保存在芯片中,使得攻击者无法通过破解芯片以获得更新私钥,进一步增强了安全性。
本申请第三实施例涉及私钥更新方法,应用于芯片,如图5所示的指纹识别芯片。本实施例的私钥更新方法包括:向服务器发送私钥更新请求;服务器中存储有芯片的更新随机数、更新公钥和与第一私钥对应的第一公钥;第一私钥为私钥更新请求请求更新的私钥;接收服务器反馈的更新随机数,并根据更新随机数和存储的内部密钥生成更新私钥;根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名;其中,待签名信息至少包括更新公钥,将签名后的信息发送至服务器,供服务器利用存储的更新公钥对接收的签名后的信息进行验证,并在验证通过后将第一公钥,更新为更新公钥,使得对芯片的私钥进行更新时,节省了较多的人力物力,更加安全可靠。下面对本实施例的密钥生成方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本实施例中私钥更新方法的具体流程如图6所示,包括:
步骤301:向服务器发送私钥更新请求。
具体的说,芯片可以通过上位机向服务器发送私钥更新请求,服务器中存储有芯片的更新随机数、更新公钥和与第一私钥对应的第一公钥,第一私钥为更新请求请求更新的芯片当前使用的私钥,即可以为初始私钥,也可以为已经更新过几次的私钥。服务器在接收到芯片的私钥更新请求时,可以查找存储的该芯片的更新随机数。
较佳的,由于服务器中可能存储有若干个芯片的更新随机数、更新公钥 和第一公钥,因此不同的芯片可以具有不同的识别号,以区分不同的芯片的更新随机数、更新公钥和第一公钥。芯片在发送私钥更新请求时,可以携带该芯片的识别号,使得服务器可以根据接收的私钥更新请求携带的识别号查找与识别号对应的更新随机数。
步骤302:接收服务器反馈的更新随机数,并根据更新随机数和存储的内部密钥生成更新私钥。
具体的说,芯片可以通过上位机接收服务器反馈的更新随机数,即服务器可以先将更新随机数发送至上位机,上位机再将更新随机数发送至芯片。芯片可以将更新随机数保存,重启进入bootloader,bootloader具有读取内部密钥权限,使得可以根据读取的内部密钥和更新随机数生成更新私钥。更新私钥具体可以通过ECC方案或RSA方案生成,关于ECC方案或RSA方案已在第一实施例进行过具体阐述,为避免重复此处不再一一赘述。
步骤303:根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名。
具体的说,芯片可以根据更新私钥生成与更新私钥对应的更新公钥。芯片采用更新私钥对待签名信息进行签名,也就是说采用更新私钥对待签名信息进行加密,本实施例中待签名信息可以为更新公钥pubkey_device2,签名可以记为sig,签名后的信息可以表示为:(pubkey_device2,sig)。
将签名后的信息发送至服务器。
具体的说,芯片可以将签名后的信息先发送至上位机,由上位机再发送至服务器。服务器可以利用存储的更新公钥pubkey_device2对接收的签名后的信息(pubkey_device2,sig)进行验证,即服务器可以利用存储的 pubkey_device2对sig进行解密,如果解密后的数据为pubkey_device2,则可认为验证通过。验证通过后,则将芯片当前使用的第一公钥,更新为更新公钥。进一步的,服务器可以基于更新公钥制作证书或进行签名,发送至芯片,并吊销芯片原来的第一公钥的证书。芯片可以保存服务器发来的更新公钥的证书或签名,重启后完成私钥的更新。如果验证不通过则停止更新。
本申请实施例相对于现有技术而言,芯片向服务器发送私钥更新请求,由于服务器中存储有芯片的更新随机数、更新公钥和与第一私钥对应的第一公钥,第一私钥为所述私钥更新请求请求更新的私钥,因此服务器在接收到私钥更新请求后,可以向芯片反馈存储的更新随机数。芯片根据更新随机数和存储的内部密钥生成更新私钥,即芯片的更新私钥只有芯片本身可以得到,符合芯片的私钥只有芯片知道的原则,更加安全可靠。芯片根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名;待签名信息至少包括更新公钥,采用更新私钥签名,即使初始私钥泄漏,也能保证通信安全。芯片将签名后的信息发送至服务器,使得服务器可以利用存储的更新公钥对接收的签名后的信息进行验证,并在验证通过后将所述第一公钥,更新为更新公钥。本申请实施例的私钥更新方法,确保芯片的在更换使用者、维修及原私钥泄露时,实现芯片私钥在线的安全更新。该方法避免传统的返厂更新或直接吊销公钥导芯片安全不可用的缺陷,具备实用性。
本申请第四实施例涉及一种私钥更新方法。第四实施例是在第三实施例的基础上做的进一步改进,主要改进之处在于,第四实施例中在本次更新时,生成下次更新会用到的第二公钥、第三随机数,对还包含有第二公钥和第三随机数的待签名信息采用更新私钥进行签名后,将签名后的信息发送至服务器, 使得服务器在对接收到的签名后的信息的验证通过后,既可以完成对当前使用第一公钥和第一私钥的更新,还可以存储下次更新会用到的第二公钥和第三随机数,方便了下一次的更新。
本实施例中密钥生成方法的具体流程如图7所示,包括:
步骤401:向服务器发送私钥更新请求。
步骤402:接收服务器反馈的更新随机数,并根据更新随机数和存储的内部密钥生成更新私钥。
具体的说,步骤402与第三实施例中步骤302大致相同,不同之处在于,本实施例中芯片在接收到服务器反馈的更新随机数时,表示芯片的私钥更新请求已经通过了服务器额外的验证。服务器将存储的更新随机数反馈给芯片之前,可以对更新请求进行验证;如果验证通过,则再将存储的芯片的更新随机数反馈给芯片。服务器可以使用其它辅助身份验证手段,如口令,短信、邮件、用户名密码等身份验证方式;或者分析该芯片是否存在异常行为,如短时间内多次申请私钥更新,如果验证不通过,还可以进行报警,使得进一步提高了更新的安全性。
步骤403:获取第三随机数。
具体的说,为保障下次更新可以进行,芯片可以调用随机数生成模块生成第三随机数random3。
步骤404:根据第三随机数和内部密钥生成芯片的第二私钥,并根据第二私钥生成与第二私钥对应的第二公钥。
具体的说,第二私钥可以通过ECC方案或RSA方案生成,关于ECC方案或RSA方案已在第一实施例进行过具体阐述,为避免重复此处不再一一赘述。 在得到第二私钥后芯片可以根据第二私钥计算得到与第二私钥对应的第二公钥,第二私钥和第二公钥分别为下次更新得到的私钥和公钥。
在实际应用中,在生成与第二私钥对应的第二公钥之后,可以销毁第二私钥,使得攻击者无法通过破解芯片以获得第二私钥。
步骤405:根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名。
具体的说,芯片可以根据更新私钥生成与更新私钥对应的更新公钥,并采用更新私钥对待签名信息进行签名,本实施例的待签名信息包括:更新公钥pubkey_device2,第三随机数random3和第二公钥pubkey_device3,芯片利用更新私钥对pubkey_device2、random3和pubkey_device3拼接成的消息进行签名,签名后的信息可以表示为:(pubkey_device2,random3,pubkey_device3,sig)。
在实际应用中,为进一步保证将签名后的信息发送至服务器的传输过程中信息不被泄露,待签名信息还可以包括挑战码challenge。服务器在接收到私钥更新请求时,如果查找到芯片的识别号对应的更新随机数random2,可以生成挑战码challenge,并将挑战码发送至芯片,挑战码为每次均不重复的随机数。芯片可以通过上位机接收到服务器反馈的挑战码。芯片利用更新私钥对pubkey_device2、random3、pubkey_device3和challenge拼接成的消息进行签名,带有签名后的信息可以表示为:(pubkey_device2,random3,pubkey_device3,challenge,sig)。
步骤406:将签名后的信息发送至服务器。
具体的说,芯片可以将签名后的信息先发送至上位机,由上位机再发送 至服务器。服务器可以利用存储的pubkey_device2对接收的签名后的信息(pubkey_device2,random3,pubkey_device3,sig)进行验证,即服务器利用存储的pubkey_device2对sig进行解密,如果解密后的数据为pubkey_device2,random3,pubkey_device3,则可认为验证通过。验证通过后,将芯片当前使用的第一公钥,更新为更新公钥,将存储的更新随机数random2替换为第三随机数random3并将存储的更新公钥pubkey_device2替换为第二公钥pubkey_device3。也就是说,如果验证通过,则进行以下操作:(a)更新芯片的公钥,pubkey_device=pubkey_device2;(b)更新下次更新私钥后对应的公钥,pubkey_device2=pubkey_device3;(c)更新下次更新私钥应下发的随机数,random2=random3;(d)吊销芯片原来的证书/公钥;(e)基于新公钥pubkey_device2制作证书或进行签名,发送至芯片。芯片保存服务器发来的新证书或签名,重启后完成私钥的更新。
为进一步方便理解,本实施例提供如图8所示的,CA服务器与安全芯片之间的交互示意图,CA服务器与安全芯片相互配合以实现私钥的更新,由于步骤401至步骤406中的内容已经涵盖服务器与芯片之间的交互,为避免重复,此处不再一一赘述。
本申请实施例相对于现有技术而言,本实施例具有以下效果,(1)私钥永不出芯片:只有芯片能恢复私钥及待更新的私钥,即使CA服务器也无法计算芯片私钥(包括以前的私钥和待更新的私钥);(2)通信安全:采用新私钥签名,即使原私钥泄漏,也能保证通信安全.(3)芯片安全的保障:生成新私钥需要的随机数未保存在芯片中,攻击者无法通过破解芯片以获得更新后的私钥;(4)更新具备可控性:私钥更新由CA服务器控制,因此服务器可以使 用其它辅助身份验证手段,如口令,电子邮箱、手机验证码等,以进一步确认更新的安全性。
本申请第五实施例涉及密钥获取方法,应用于服务器,包括:接收并存储芯片发送的更新随机数、更新公钥和与第一私钥对应的第一公钥;其中,第一私钥为芯片当前使用的私钥;在接收到芯片的私钥更新请求后,将存储的更新随机数反馈给芯片,供芯片根据更新随机数与芯片的内部密钥生成更新私钥和对应的更新公钥,并以更新私钥对待签名信息进行签名;其中,待签名信息至少包括更新公钥;接收芯片发送的签名后的信息;利用存储的更新公钥对接收的签名后的信息进行验证,并在验证通过后将第一公钥,更新为更新公钥,使得对芯片的私钥进行更新时,节省了较多的人力物力,更加安全可靠。下面对本实施例的密钥生成方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本实施例中密钥生成方法的具体流程如图9所示,包括:
步骤501:接收并存储芯片发送的更新随机数、更新公钥和与第一私钥对应的第一公钥。
步骤502:在接收到芯片的私钥更新请求后,将存储的更新随机数反馈给芯片。
步骤503:接收芯片发送的签名后的信息。
步骤504:利用存储的更新公钥对接收的签名后的信息进行验证。
步骤505:判断对签名后的信息的验证是否通过,如果验证通过则执行步骤506,否则执行步骤507。
步骤506:将第一公钥,更新为更新公钥。
步骤507:停止更新。
不难发现,本实施例的密钥获取方法,应用于服务器,第三实施例的私钥更新方法,应用于芯片,芯片与服务器可以互相配合,以完成对于芯片的私钥的更新。因此,第三实施例中关于私钥更新方法的实施例可以与本实施例互相配合实施。第三实施例中提到的相关技术细节在本实施例中依然有效,为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在第三实施例中。
本申请第六实施例涉及一种私钥更新方法。第六实施例是在第五实施例的基础上做的进一步改进,主要改进之处在于,第六实施例中,在接收到芯片的私钥更新请求后,将存储的更新随机数反馈给芯片之前,对更新请求进行验证;如果验证通过,则再将存储的芯片的更新随机数反馈给芯片,使得进一步提高了更新的安全性。
本实施例中的密钥获取方法的流程示意图如图10所示,具体包括:
步骤601:接收并存储芯片发送的更新随机数、更新公钥和与第一私钥对应的第一公钥。
步骤602:在接收到芯片的私钥更新请求后,对私钥更新请求进行验证。
步骤603:判断对私钥更新请求的验证是否通过,如果是则执行步骤604,否则执行步骤609。
步骤604:将存储的更新随机数反馈给芯片。
步骤605:生成挑战码,并将挑战码发送至芯片。
需要说明的是,步骤604与步骤605并无明显的先后关系,在实际应 用中服务器可以将更新随机数random2和挑战码challenge同时发送给芯片,或者先发送挑战码,再发送更新随机数,本实施例只是以先发送更新随机数为例,但在实际应用中并不以此为限。
步骤606:接收芯片发送的签名后的信息。
步骤607:利用存储的更新公钥对接收的签名后的信息进行验证。
步骤608:判断对签名后的信息的验证是否通过,如果验证通过则执行步骤609,否则执行步骤610。
步骤609:将第一公钥更新为更新公钥,将存储的更新随机数替换为第三随机数并将存储的更新公钥替换为第二公钥。
步骤610:停止更新。
不难发现,本实施例的密钥获取方法,应用于服务器,第四实施例的私钥更新方法,应用于芯片,芯片与服务器可以互相配合,以完成对于芯片的私钥的更新。因此,第四实施例中关于私钥更新方法的实施例可以与本实施例互相配合实施。第四实施例中提到的相关技术细节在本实施例中依然有效,为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在第四实施例中。
本发明第七实施例涉及一种芯片,如图11所示,包括:至少一个处理器801;以及,与至少一个处理器801通信连接的存储器802;其中,存储器802存储有可被至少一个处理器801执行的指令,指令被至少一个处理器执行,以使至少一个处理器801能够执行上述的密钥生成方法或私钥更新方法。
其中,存储器802和处理器801采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器801和存储器802的各种 电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器801处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器801。
处理器801负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器802可以被用于存储处理器801在执行操作时所使用的数据。
本发明第八实施例涉及一种服务器,如图12所示,包括:至少一个处理器901;以及,与至少一个处理器901通信连接的存储器902;其中,存储器902存储有可被至少一个处理器901执行的指令,指令被至少一个处理器901执行,以使至少一个处理器901能够执行上述的密钥获取方法。
其中,存储器902和处理器901采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器901和存储器902的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器901处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器901。
处理器901负责管理总线和通常的处理,还可以提供各种功能,包括 定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器902可以被用于存储处理器901在执行操作时所使用的数据。
另外,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。

Claims (17)

  1. 一种密钥生成方法,其特征在于,应用于芯片,所述芯片存储有内部密钥,所述方法包括:
    获取第一随机数与第二随机数;
    根据所述第一随机数与所述内部密钥生成所述芯片的初始私钥,并根据所述第二随机数与所述内部密钥生成所述芯片的更新私钥;
    根据所述初始私钥生成与所述初始私钥对应的初始公钥,并根据所述更新私钥生成与所述更新私钥对应的更新公钥;
    将所述初始公钥、所述更新公钥和所述第二随机数发送至服务器,供所述服务器在接收到所述芯片的私钥更新请求时,将所述第二随机数发送至所述芯片,触发所述芯片的私钥更新。
  2. 如权利要求1所述的密钥生成方法,其特征在于,所述将所述初始公钥、所述更新公钥和所述第二随机数发送至服务器之后,还包括:
    销毁所述第二随机数、所述更新私钥和所述更新公钥。
  3. 如权利要求1所述的密钥生成方法,其特征在于,所述根据所述第一随机数与所述内部密钥生成所述芯片的初始私钥,并根据所述第二随机数与所述内部密钥生成所述芯片的更新私钥,包括:
    由固件获取所述内部密钥;
    所述固件根据获取的所述内部密钥和所述第一随机数生成所述芯片的初始私钥,并根据获取的所述内部密钥和所述第二随机数生成所述芯片的更新私钥;
    所述的芯片的密钥生成方法,还包括:
    在所述将所述初始公钥、所述更新公钥和所述第二随机数发送至服务器后,关闭所述固件对所述内部密钥的访问权限。
  4. 如权利要求1所述的密钥生成方法,其特征在于,所述第一随机数与所述第二随机数均为由内置于所述芯片内的随机数模块,生成的随机数。
  5. 如权利要求1至4中任一项所述的密钥生成方法,其特征在于,所述初始私钥和所述更新私钥,均为ECC私钥;或者,
    所述初始私钥和所述更新私钥,均为RSA私钥;或者,
    所述初始私钥和所述更新私钥中的一者,为ECC私钥,另一者为RSA私钥。
  6. 如权利要求1至4中任一项所述的密钥生成方法,其特征在于,所述内部密钥存储于所述芯片的只读存储区域中。
  7. 一种私钥更新方法,其特征在于,应用于芯片,包括:
    向服务器发送私钥更新请求;所述服务器中存储有所述芯片的更新随机数、更新公钥和与第一私钥对应的第一公钥;所述第一私钥为所述私钥更新请求请求更新的私钥;
    接收所述服务器反馈的所述更新随机数,并根据所述更新随机数和存储的内部密钥生成更新私钥;
    根据所述更新私钥生成与所述更新私钥对应的更新公钥,并采用所述更新私钥对待签名信息进行签名;其中,所述待签名信息至少包括所述更新公钥;
    将所述签名后的信息发送至所述服务器,供所述服务器利用所述存储的更新公钥对接收的所述签名后的信息进行验证,并在验证通过后将所述第一公钥,更新为所述更新公钥。
  8. 根据权利要求7所述的私钥更新方法,其特征在于,在所述采用所述更 新私钥对待签名信息进行签名之前,还包括:
    获取第三随机数;
    根据所述第三随机数和所述内部密钥生成所述芯片的第二私钥,并根据所述第二私钥生成与所述第二私钥对应的第二公钥;
    所述待签名信息还包括:所述第三随机数和所述第二公钥;
    所述第三随机数和所述第二公钥用于供所述服务器在验证通过后将存储的所述更新随机数替换为所述第三随机数,并将存储的所述更新公钥替换为所述第二公钥。
  9. 根据权利要求8所述的私钥更新方法,其特征在于,在所述根据所述第二私钥生成与所述第二私钥对应的第二公钥之后,还包括:
    销毁所述第二私钥。
  10. 根据权利要求8所述的私钥更新方法,其特征在于,在所述采用所述更新私钥对待签名信息进行签名之前,还包括:
    接收所述服务器反馈的挑战码,其中,所述挑战码为所述服务器在接收到所述更新请求生成的挑战码;
    所述待签名信息还包括所述挑战码。
  11. 根据权利要求7至10中任一项所述的私钥更新方法,其特征在于,所述更新请求携带所述芯片的识别号,以供所述服务器根据所述识别号,查找到所述芯片的更新随机数。
  12. 一种密钥获取方法,其特征在于,应用于服务器,包括:
    接收并存储芯片发送的更新随机数、更新公钥和与第一私钥对应的第一公钥;其中,所述第一私钥为所述芯片当前使用的私钥;
    在接收到所述芯片的私钥更新请求后,将所述存储的更新随机数反馈给所述芯片,供所述芯片根据所述更新随机数与所述芯片的内部密钥生成更新私钥和对应的更新公钥,并以所述更新私钥对待签名信息进行签名;其中,所述待签名信息至少包括所述更新公钥;
    接收所述芯片发送的所述签名后的信息;
    利用所述存储的更新公钥对接收的所述签名后的信息进行验证,并在验证通过后将所述第一公钥,更新为所述更新公钥。
  13. 根据权利要求12所述的密钥获取方法,其特征在于,所述待签名信息还包括:第三随机数和第二公钥,所述第二公钥为所述芯片根据第二私钥生成的对应的公钥,所述第二私钥为所述芯片根据所述第三随机数和所述内部密钥生成的私钥。
    所述密钥获取方法,还包括:
    在所述验证通过后,将存储的所述更新随机数替换为所述第三随机数,并将存储的所述更新公钥替换为所述第二公钥。
  14. 根据权利要求13所述的密钥获取方法,其特征在于,在接收到所述芯片的私钥更新请求后,还包括:
    生成挑战码,并将所述挑战码发送至所述芯片;
    所述待签名信息还包括所述挑战码。
  15. 根据权利要求11至14中任一项所述的密钥获取方法,其特征在于,在所述接收到所述芯片的私钥更新请求后,将所述存储的更新随机数反馈给所述芯片之前,还包括:
    对所述私钥更新请求进行验证;
    如果验证通过,则再执行所述将存储的所述芯片的更新随机数反馈给所述芯片。
  16. 一种芯片,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至6中任一所述的密钥生成方法或如权利要求7至11中任一所述的私钥更新方法。
  17. 一种服务器,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求12至15中任一所述的密钥获取方法。
PCT/CN2018/110053 2018-10-12 2018-10-12 密钥生成方法、获取方法、私钥更新方法、芯片和服务器 WO2020073314A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/CN2018/110053 WO2020073314A1 (zh) 2018-10-12 2018-10-12 密钥生成方法、获取方法、私钥更新方法、芯片和服务器
CN201880002098.0A CN111344996B (zh) 2018-10-12 2018-10-12 密钥生成方法、获取方法、私钥更新方法、芯片和服务器
EP18919399.8A EP3664362B1 (en) 2018-10-12 2018-10-12 Key generation method, acquisition method, private key update method, chip and server
US16/706,624 US11190351B2 (en) 2018-10-12 2019-12-06 Key generation method and acquisition method, private key update method, chip, and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/110053 WO2020073314A1 (zh) 2018-10-12 2018-10-12 密钥生成方法、获取方法、私钥更新方法、芯片和服务器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/706,624 Continuation US11190351B2 (en) 2018-10-12 2019-12-06 Key generation method and acquisition method, private key update method, chip, and server

Publications (1)

Publication Number Publication Date
WO2020073314A1 true WO2020073314A1 (zh) 2020-04-16

Family

ID=70160512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110053 WO2020073314A1 (zh) 2018-10-12 2018-10-12 密钥生成方法、获取方法、私钥更新方法、芯片和服务器

Country Status (4)

Country Link
US (1) US11190351B2 (zh)
EP (1) EP3664362B1 (zh)
CN (1) CN111344996B (zh)
WO (1) WO2020073314A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112989370B (zh) * 2021-02-09 2023-06-30 腾讯科技(深圳)有限公司 密钥灌装方法、系统、装置、设备以及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888243A (zh) * 2014-04-15 2014-06-25 飞天诚信科技股份有限公司 一种种子密钥安全传输的方法
US20140208117A1 (en) * 2011-09-30 2014-07-24 Toshiba Solutions Corporation Server apparatus and program
US20140219443A1 (en) * 2011-06-17 2014-08-07 Universite Libre De Bruxelles Generation of cryptographic keys
US20150016606A1 (en) * 2013-07-12 2015-01-15 Kabushiki Kaisha Toshiba Generating device, re-encrypting device, method, and computer program product
CN106161017A (zh) * 2015-03-20 2016-11-23 北京虎符科技有限公司 标识认证安全管理系统
WO2017060675A1 (en) * 2015-10-07 2017-04-13 Westgate Cyber Security Limited Public key infrastructure & method of distribution
CN108347334A (zh) * 2017-01-24 2018-07-31 恩智浦有限公司 生成加密密钥对的方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004032001A (ja) * 2002-05-10 2004-01-29 Sony Corp データ暗号化,復号化もしくは暗号化・復号化方法及び装置
US20060179305A1 (en) * 2004-03-11 2006-08-10 Junbiao Zhang WLAN session management techniques with secure rekeying and logoff
US8989390B2 (en) * 2005-12-12 2015-03-24 Qualcomm Incorporated Certify and split system and method for replacing cryptographic keys
JP5390844B2 (ja) * 2008-12-05 2014-01-15 パナソニック株式会社 鍵配布システム、鍵配布方法
US8768843B2 (en) * 2009-01-15 2014-07-01 Igt EGM authentication mechanism using multiple key pairs at the BIOS with PKI
US8826042B2 (en) * 2009-04-14 2014-09-02 Megachips Corporation Memory controller, memory control apparatus, memory device, memory information protection system, control method for memory control apparatus, and control method for memory device
CN102355351B (zh) * 2011-07-21 2014-11-05 华为技术有限公司 一种基于可信计算的密钥生成、备份和迁移方法及系统
WO2013020172A1 (en) * 2011-08-08 2013-02-14 Mikoh Corporation Radio frequency identification technology incorporating cryptographics
CN105490997B (zh) * 2014-10-10 2019-05-14 阿里巴巴集团控股有限公司 安全校验方法、装置、终端及服务器
US9774579B2 (en) * 2015-07-27 2017-09-26 Duo Security, Inc. Method for key rotation
US20180019870A1 (en) * 2016-07-15 2018-01-18 Qualcomm Incorporated Device to limit access to storage to authenticated actors only
CN107819571A (zh) * 2017-09-29 2018-03-20 广东中科南海岸车联网技术有限公司 私钥的生成方法及装置
CN108599928B (zh) * 2018-03-27 2022-07-29 苏州科达科技股份有限公司 密钥管理方法及装置
JP7174237B2 (ja) * 2018-11-29 2022-11-17 富士通株式会社 鍵生成装置、鍵更新方法および鍵更新プログラム

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140219443A1 (en) * 2011-06-17 2014-08-07 Universite Libre De Bruxelles Generation of cryptographic keys
US20140208117A1 (en) * 2011-09-30 2014-07-24 Toshiba Solutions Corporation Server apparatus and program
US20150016606A1 (en) * 2013-07-12 2015-01-15 Kabushiki Kaisha Toshiba Generating device, re-encrypting device, method, and computer program product
CN103888243A (zh) * 2014-04-15 2014-06-25 飞天诚信科技股份有限公司 一种种子密钥安全传输的方法
CN106161017A (zh) * 2015-03-20 2016-11-23 北京虎符科技有限公司 标识认证安全管理系统
WO2017060675A1 (en) * 2015-10-07 2017-04-13 Westgate Cyber Security Limited Public key infrastructure & method of distribution
CN108347334A (zh) * 2017-01-24 2018-07-31 恩智浦有限公司 生成加密密钥对的方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3664362A4 *

Also Published As

Publication number Publication date
EP3664362A4 (en) 2020-06-17
US20200119915A1 (en) 2020-04-16
EP3664362A1 (en) 2020-06-10
CN111344996A (zh) 2020-06-26
US11190351B2 (en) 2021-11-30
EP3664362B1 (en) 2021-06-09
CN111344996B (zh) 2023-01-31

Similar Documents

Publication Publication Date Title
CN108235806B (zh) 安全访问区块链的方法、装置、系统、存储介质及电子设备
EP3458999B1 (en) Self-contained cryptographic boot policy validation
WO2019233204A1 (zh) 密钥管理方法、装置、系统、存储介质和计算机设备
US10985925B1 (en) Systems and methods for providing authentication to a plurality of devices
US10187373B1 (en) Hierarchical, deterministic, one-time login tokens
JP7113123B2 (ja) デバイス、及び方法
US20140281502A1 (en) Method and apparatus for embedding secret information in digital certificates
US10880100B2 (en) Apparatus and method for certificate enrollment
JP2015171153A (ja) ルート証明書の無効化
US10375084B2 (en) Methods and apparatuses for improved network communication using a message integrity secure token
CN109361520B (zh) 基于登录序号的物联网设备动态加密方法
KR102137122B1 (ko) 보안 체크 방법, 장치, 단말기 및 서버
TW201706898A (zh) 安全軟體認證及驗證
CN112653553B (zh) 物联网设备身份管理系统
CN113014444A (zh) 一种物联网设备生产测试系统及安全保护方法
KR102364649B1 (ko) Puf 기반 사물인터넷 디바이스 인증 장치 및 방법
US11216571B2 (en) Credentialed encryption
WO2020073314A1 (zh) 密钥生成方法、获取方法、私钥更新方法、芯片和服务器
CN115242471B (zh) 信息传输方法、装置、电子设备及计算机可读存储介质
CN109426727B (zh) 数据加密方法、解密方法、加密系统及解密系统
Yu et al. How to detect unauthorised usage of a key.
KR102539418B1 (ko) Puf 기반 상호 인증 장치 및 방법
CN117397199A (zh) 嵌入式设备的安全信任根注册和身份管理
CN107920097B (zh) 一种解锁的方法及装置
KR20240045160A (ko) 신뢰 루트(Root-of-Trust) 기반의 보안을 갖는 암호화되고 인증된 펌웨어 제공 방법 및 시스템

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018919399

Country of ref document: EP

Effective date: 20191128

NENP Non-entry into the national phase

Ref country code: DE