A method for implementing secure startup of the Internet of Things based on TEE

Through the TEE-based secure startup method, the software signature and certificate of the IoT device are verified, ensuring that only authorized software runs, solving the problems of software forgery and tampering at startup, realizing the security and flexibility of the device, and preventing the private key from being Mirror rollback caused by theft.

CN111967019BActive Publication Date: 2024-11-22BEIJING BEANPOD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010754683.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2024-11-22
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

When the Internet of Things devices are started, there are security risks such as software forgery or tampering. Malware can steal or tamper with private information, and even cause the device to fail to operate normally or boot, and there is a lack of relevant standards and specifications.

Method used

Using a TEE-based secure boot method, the signature header, X.509 digital certificate and hash digest of trusted applications and customer application images is used to verify signature legitimacy using asymmetric encryption to ensure that only authorized software runs. It also supports multiple private keys and revocation functions to prevent rollback.

Benefits of technology

It realizes the authenticity and integrity verification of the device software, ensures that only authorized software runs, provides a flexible secure startup mechanism, and can independently verify applications in trusted and non-secure processing environments, and prevents mirror revocation caused by theft of private keys.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111967019B_ABST
    Figure CN111967019B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for implementing secure booting based on TEE Internet of Things, which includes the following steps: finding a trusted application image that is a signed image; finding a certificate, calculating a hash digest of four groups of key hash fields in the image, and comparing the consistency of two hash digests; calculating a hash digest of a trusted application signature image; using asymmetric encryption to verify the legality of the signature; checking the legality of the client application image header, finding a client application image marked as a signed image; finding a certificate, calculating a hash digest of four groups of key hash fields in the image, and extracting a trusted application secure boot key hash digest in a key library, and comparing the consistency of the two hash digests; calculating a hash digest of a client application signature image; using asymmetric encryption to verify the legality of the signature, and entering the trusted application execution. Through this method, security and flexibility are guaranteed, the released signature image is revoked, and rollback is prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Things security technology, and in particular to a method for implementing secure startup of the Internet of Things based on TEE. Background Art

[0002] As IoT devices pay more attention to security, although sensitive business and information are executed in a secure processing environment, there are still security risks of software forgery or tampering. At present, there are the following shortcomings:

[0003] Security risks: On an IoT device, when the device is connected to a power source, the software on the device is executed. If the software on the device is maliciously implanted or tampered with, the private data of the device may be stolen or tampered with, causing damage, resulting in the risk of the device not functioning properly or being unable to boot up.

[0004] Forgery: Malicious client applications or trusted applications disguise themselves as legitimate firmware to obtain sensitive data output by TEE, causing data leakage.

[0005] Tampering: Malicious firmware is executed, causing the TEE or trusted applications to be unable to provide normal services or even the device to be unable to boot.

[0006] There are currently no relevant standards and specifications to constrain and define this part. Summary of the invention

[0007] In view of the above technical problems in the related technology, the present invention proposes a method for implementing secure startup of the Internet of Things based on TEE, which can overcome the above shortcomings of the prior art.

[0008] To achieve the above technical objectives, the technical solution of the present invention is implemented as follows:

[0009] A method for implementing secure startup of the Internet of Things based on TEE, the method comprising the following steps:

[0010] S1: Check the legitimacy of the trusted application image header and find out the trusted application image that is a signed image, wherein a flag contained in the signature header is used to identify whether the image is signed. If the flag is not a signed image, stop the secure boot;

[0011] S2: Verify the X.509 digital certificate embedded in the trusted application image, check and find the certificate with a serial number greater than or equal to the revocation ID in the chip, calculate the hash digest of the four key hash fields in the image, and extract the trusted application secure boot key hash digest in the key library, compare the consistency of the two hash digests, and stop the secure boot if the two hash digests are inconsistent;

[0012] S3: Calculate the hash digest of the trusted application signature image;

[0013] S4: The public key of the X.509 certificate in step S2 and the hash summary calculated in step S2 are used to verify the legitimacy of the signature using asymmetric encryption;

[0014] S5: Check the legitimacy of the client application image header. The signature header contains a mark, and find the client application image marked as the signature image;

[0015] S6: Verify the X.509 digital certificate embedded in the customer application image, check and find the certificate with a serial number greater than or equal to the revocation ID in the chip, calculate the hash digest of the four key hash fields in the image, and extract the trusted application secure boot key hash digest in the key library, and compare the consistency of the two hash digests;

[0016] S7: Calculate the hash digest of the client application signature image;

[0017] S8: The public key of the X.509 certificate in step S6 and the hash summary calculated in step S7 are used to verify the legitimacy of the signature using asymmetric encryption, and enter the trusted application for execution.

[0018] Furthermore, in step S2, if the serial number in the certificate is checked to be smaller than the revocation ID in the chip, the secure boot is stopped.

[0019] Furthermore, in step S4, if the signature is illegal, the secure boot is stopped.

[0020] Furthermore, the signed image supports several keys.

[0021] Beneficial effects of the present invention: Through this method, the following are achieved:

[0022] Security: The authenticity and integrity of device software is verified through cryptographic digital signatures to ensure that only authorized software can run on the IoT device;

[0023] Flexibility: Based on the secure boot under TEE, the trusted applications running in the secure processing environment and the client applications running in the non-secure processing environment can be verified separately. Even if the trusted applications and client applications are upgraded, the TEE secure boot program does not need to be modified;

[0024] Revoke published signed images: Support multiple private keys. If the private key is stolen, the image with the stolen certificate should be revoked. Revoke the published signed image by revoking the image certificate to prevent rollback. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 It is a principle block diagram of a method for implementing secure startup of the Internet of Things based on TEE according to an embodiment of the present invention;

[0027] Figure 2 is a structural diagram of a signature image according to an embodiment of the present invention;

[0028] Figure 3 It is a flowchart of a method for implementing secure startup of the Internet of Things based on TEE according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.

[0030] like Figure 1 , 3 As shown, a method for implementing secure startup based on TEE Internet of Things according to an embodiment of the present invention includes the following steps:

[0031] S1: Check the legitimacy of the trusted application image header and find out the trusted application image that is a signed image, wherein a flag contained in the signature header is used to identify whether the image is signed. If the flag is not a signed image, stop the secure boot;

[0032] S2: Verify the X.509 digital certificate embedded in the trusted application image, check and find the certificate with a serial number greater than or equal to the revocation ID in the chip, calculate the hash digest of the four key hash fields in the image, and extract the trusted application secure boot key hash digest in the key library, compare the consistency of the two hash digests, and stop the secure boot if the two hash digests are inconsistent;

[0033] S3: Calculate the hash digest of the trusted application signature image;

[0034] S4: The public key of the X.509 certificate in step S2 and the hash summary calculated in step S2 are used to verify the legitimacy of the signature using asymmetric encryption;

[0035] S5: Check the legitimacy of the client application image header. The signature header contains a mark, and find the client application image marked as the signature image;

[0036] S6: Verify the X.509 digital certificate embedded in the customer application image, check and find the certificate with a serial number greater than or equal to the revocation ID in the chip, calculate the hash digest of the four key hash fields in the image, and extract the trusted application secure boot key hash digest in the key library, and compare the consistency of the two hash digests;

[0037] S7: Calculate the hash digest of the client application signature image;

[0038] S8: The public key of the X.509 certificate in step S6 and the hash summary calculated in step S7 are used to verify the legitimacy of the signature using asymmetric encryption, and enter the trusted application for execution.

[0039] In a specific embodiment of the present invention, in step S2, if the serial number enclosed in the check certificate is smaller than the revocation ID in the chip, the secure boot is stopped.

[0040] In a specific embodiment of the present invention, in step S4, if the signature is illegal, the secure boot is stopped.

[0041] In a specific embodiment of the present invention, the signed image supports several keys.

[0042] In a specific embodiment of the present invention, an IoT device has an over-the-air firmware update function. How to ensure that the over-the-air firmware update on the device is complete and secure? Based on the secure boot architecture of the TEE service device, it is composed of three images, namely, the TEE image executed on the secure end, the trusted application image containing the over-the-air firmware update, and the non-secure end image containing the client application for over-the-air firmware update. The three images are respectively signed using their private keys and burned into the corresponding memory configuration positions. The firmware update program is for the client application to receive the firmware update request and transmit the request to the trusted application. The trusted application completes the firmware update through the TEE core function. The TEE image is executed as soon as the device is turned on. The TEE image contains a secure boot verification program, which authenticates the trusted application image and the client application image respectively. If both are authenticated successfully, the TEE jumps to the firmware update trusted application for execution. After the trusted application is successfully started, it jumps to the non-secure end for execution. After the firmware update client application of the non-secure end is successfully started, it enters the waiting firmware update program. Through the secure boot verification program, it is ensured that the over-the-air firmware update application on this IoT device is trustworthy.

[0043] In order to facilitate understanding of the above technical solutions of the present invention, the above technical solutions of the present invention are described in detail below.

[0044] The present invention is a TEE-based Internet of Things security startup method. The TEE image is the first image started after startup, which is responsible for core program and security startup verification. The applications of the Internet of Things device are divided into trusted applications and client applications. The image containing the trusted application is the second image executed on the secure end, and the image containing the client application is the third image executed on the non-secure end. The TEE image performs identity verification on the image containing the trusted application and the image containing the client application respectively, ensuring that the startup program of the Internet of Things device from startup to firmware execution is trusted.

[0045] like Figure 1 As described above, the present invention proposes an IoT secure startup method based on a trusted execution environment, which performs comprehensive identity authentication for the software executed on the IoT device, so that the IoT device is secure and unbreakable from the moment it is powered on.

[0046] Based on the TEE system architecture, the secure processing environment contains two images, namely the core TEE image and the image containing trusted applications; the non-secure processing environment contains the customer application image. Secure boot is implemented in the first execution image TEE of the trusted execution environment, and is also the first image executed after ROM Boot is started. The TEE secure boot software architecture is composed of four modules: secure boot, memory driver, key library, and encryption and decryption. The secure boot module is the core module of secure boot, responsible for the authentication of trusted applications and customer application images, reads the image data through the memory driver module, extracts the trusted application and customer application secure boot keys in the key library, and uses the encryption and decryption module to authenticate the legitimacy of the image signature.

[0047] like Figure 2 As shown, the signed image supports RSA keys and X.509 V3 certificates, and uses RSASSA-PKCS1-v1_5 signature verification. The signed image format is shown in the figure below. A signature header is added before the plaintext image, followed by an X509 certificate and four sets of key hash summary fields, and finally a digital signature. The algorithm for the digital signature first calculates a hash summary from the header to the public key three hash summaries, and then uses the RSA private key to encrypt the calculated hash summary.

[0048] Image verification consists of two steps:

[0049] 1. Verify the X.509 digital certificate embedded in the image.

[0050] 2. Use the image public key extracted from the x509 certificate to verify the image signature.

[0051] The feature of the present invention is that the signed image can support multiple keys, and the key certificate has a revocation function. The design supports up to 4 keys and up to 16 key certificates with image revocation function. If the private key is stolen, the image with the stolen certificate should be revoked. The signed and published image can be revoked by revoking the image key certificate to prevent rollback. In practice, there is a field with the certificate serial number in the certificate, and a revocation ID is stored in the protected flash memory area inside the chip. If the serial number of the digital certificate is smaller than the revocation ID inside the chip, the image verification process will fail. The serial number value can jump forward but cannot be rolled back. By remaking a certificate with a higher serial number and updating the signed image with the new certificate, the revocation ID inside the chip is updated. At this time, the old signed published image can no longer be executed or updated, that is, it is revoked. Four key hash digests are retained in the signed image, and a set of hash digests are stored in the key library as hash digests of these four key hash values ​​to verify whether the public key is correct. The four key hash value fields represent that a maximum of four keys can be used. When less than four keys are used, the unused field values ​​are 0.

[0052] like Figure 3 As shown, the secure boot process is:

[0053] 1) Check whether the trusted application image header is legal. The signature header contains a flag to identify whether the image is signed. If this flag does not indicate a signed image, stop secure boot.

[0054] 2) Verify the X.509 digital certificate embedded in the image, and check whether the serial number in the certificate is greater than or equal to the revocation ID in the chip. If not, stop the secure boot. Then calculate the hash digest of the four key hash fields in the image, and extract the trusted application secure boot key hash digest in the key library, and compare the two to see if they are consistent to verify whether the public key is correct. If not, stop the secure boot.

[0055] 3) Calculate the hash digest of the trusted application signature image.

[0056] 4) Use the public key in 2) the X.509 certificate and the calculated hash digest in 3) to verify the validity of the signature using asymmetric encryption. If it is not valid, stop the secure boot.

[0057] 5) Check whether the client application image header is legal. The signature header contains a flag to identify whether the image is signed. If this flag does not indicate a signed image, stop secure boot.

[0058] 6) Verify the X.509 digital certificate embedded in the customer application image, and check whether the serial number in the certificate is greater than or equal to the revocation ID in the chip. If not, stop the secure boot. Then calculate the hash digest of the four key hash fields in the image, extract the trusted application secure boot key hash digest in the key library, and compare the two to see if they are consistent to verify whether the public key is correct. If not, stop the secure boot.

[0059] 7) Calculate the hash digest of the client application signature image.

[0060] 8) Use the public key in the X.509 certificate in 6) and the hash summary calculated in 7) to use asymmetric encryption to verify whether the signature is legal. If it is illegal, stop the secure boot. If it is legal, enter the trusted application execution.

[0061] In summary, with the help of the above technical solution of the present invention, through this method, the following are achieved: Security: the authenticity and integrity of the device software are verified through encrypted digital signatures to ensure that only authorized software can run on the IoT device; Flexibility: based on the secure boot under TEE, trusted applications running in a secure processing environment and client applications running in a non-secure processing environment can be verified separately. Even if the trusted applications and client applications are upgraded, the TEE secure boot program does not need to be modified; Revocation of published signed images: supports multiple private keys. If the private key is stolen, the image with the stolen certificate should be revoked. The published signed image is revoked by revoking the image certificate to prevent rollback.

[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for implementing secure startup of the Internet of Things based on TEE, characterized in that: The following steps are involved: S1: Check whether the trusted application image header is legal. The signature header contains a flag to identify whether the image is signed. If this flag does not indicate a signed image, stop secure boot. S2: Verify the X.509 digital certificate embedded in the trusted application image, check and find the certificate with a serial number greater than or equal to the revocation ID in the chip, calculate the hash digest of the four key hash fields in the image, and extract the trusted application secure boot key hash digest in the key library, compare the consistency of the two hash digests, and stop the secure boot if the two hash digests are inconsistent; S3: Calculate the hash digest of the trusted application signature image; S4: The public key of the X.509 certificate in step S2 and the hash digest of the four key hash fields in the image calculated in step S2 are used to verify the legitimacy of the signature using asymmetric encryption; S5: Check the legitimacy of the client application image header and find out the client application image marked as a signed image; S6: Verify the X.509 digital certificate embedded in the customer application image, check and find the certificate with a serial number greater than or equal to the revocation ID in the chip, calculate the hash digest of the four key hash fields in the customer application image, and extract the trusted application secure boot key hash digest in the key library, and compare the consistency of the two hash digests; S7: Calculate the hash digest of the client application signature image; S8: The public key of the X.509 certificate in step S6 and the hash summary calculated in step S7 are used to verify the legitimacy of the signature using asymmetric encryption, and enter the trusted application for execution.

2. According to claim 1, a method for implementing secure startup based on TEE Internet of Things is characterized in that: In step S2, if the serial number in the certificate is smaller than the revocation ID in the chip, the secure boot is stopped.

3. According to a method for implementing secure startup based on TEE Internet of Things according to claim 1, it is characterized in that: In step S4, if the signature is illegal, the secure boot is stopped.

4. According to a method for implementing secure startup based on TEE Internet of Things according to claim 1, it is characterized in that: The trusted application signature image and the client application signature image both support a number of keys.