Embedded system fast and safe startup method, device and electronic equipment

By segregating boot programs into secure and non-secure domains and using MAC and signature verifications, the method addresses long boot times and security vulnerabilities in IoT devices, achieving fast and secure startup.

CN113946375BActive Publication Date: 2024-12-03ALLWINNER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111218606.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-19
Publication Date
2024-12-03
Estimated Expiration
2041-10-19

AI Technical Summary

Technical Problem

Existing secure boot methods for IoT devices are computationally intensive and result in long boot times, which is unsuitable for low-end CPUs and affects user experience in products like dashcams and scanner pens, while methods lacking verification are vulnerable to malicious modifications.

Method used

A method involving a secure domain for on-chip and first-level boot programs, a trusted execution environment, and a non-secure domain for second-level and common operating environment programs, using MAC verification for the secure domain and signature verification for the non-secure domain, with MAC keys stored in a secure area and generated on a secure server.

Benefits of technology

This approach reduces computational load and boot time, ensuring fast and secure startup of embedded systems with minimal hardware requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113946375B_ABST
    Figure CN113946375B_ABST
Patent Text Reader

Abstract

The present invention relates to a technical solution of a method, device and electronic device for fast and secure startup of an embedded system, including: executing the startup of an on-chip boot program, a first-level boot program, a trusted execution environment operating system, a second-level boot program and a common operating environment operating system in sequence when the embedded system is started, wherein the on-chip boot program, the first-level boot program and the trusted execution environment operating system are set in a secure domain, the second-level boot program and the common operating environment operating system are set in a non-secure domain, the first-level boot program, the trusted execution environment operating system and the second-level boot program are verified using MAC, and the common operating environment operating system is verified using a signature method or MAC. The beneficial effects of the present invention are: the amount of calculation for image credibility and integrity verification during secure startup is small, the hardware requirements are low, and the startup time is faster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method, a device and an electronic device for quickly and safely starting an embedded system. Background Art

[0002] With the advent of the IoT era, more and more IoT devices are connected to the Internet. IoT devices are no longer isolated islands and will face various threats on the network. To ensure the safe operation of IoT devices, secure boot is essential. Secure boot allows only certified firmware or programs to be loaded and run on IoT devices.

[0003] The secure boot methods widely used in the industry currently use signature or public key certificate technology to authenticate each image during the boot process. Both signatures and certificates use asymmetric encryption operations, which are extremely computationally intensive and not friendly to low-end CPUs. In addition, multiple images often need to be verified during the entire secure boot process, resulting in a very long boot time, which cannot meet the needs of products such as dashcams with collision detection, electronic cat eyes, and scanner pens. Finally, a long boot time also greatly affects the user experience of the product.

[0004] Existing technologies are activated in three ways, including:

[0005] The first type is that the firmware is directly started without any verification during the startup process. It cannot prevent the firmware from being maliciously modified, has weak resistance, and has not been authenticated, making it difficult to prevent the firmware from being maliciously modified;

[0006] The second method is to use a simple check during the boot process, such as using a CRC algorithm to check each image during the boot process.

[0007] The third method is to verify the credibility and integrity of each image during the startup process, which is a typical secure startup implementation. The digital signature of each image is verified by the signature public key to ensure the credibility and integrity of the software. However, due to the long trust chain, multiple asymmetric encryption operations are required, resulting in a long startup time, which cannot meet the product requirements in related fields. Summary of the invention

[0008] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art, and to provide a method, device and electronic device for fast and safe startup of an embedded system, so as to realize fast startup and safe startup of an embedded system device.

[0009] The technical solution of the present invention includes a method for fast and secure startup of an embedded system, characterized in that the method includes: executing the startup of an on-chip boot program, a first-level boot program, a trusted execution environment operating system, a second-level boot program and a common operating environment operating system in sequence when the embedded system is started, wherein the on-chip boot program, the first-level boot program and the trusted execution environment operating system are set in a secure domain, the second-level boot program and the common operating environment operating system are set in a non-secure domain, the first-level boot program, the trusted execution environment operating system and the second-level boot program are verified using MAC, and the common operating environment operating system is verified using a signature method or MAC.

[0010] According to the embedded system fast and secure startup method, the on-chip boot program includes: at startup, the first-level boot program is loaded from the Flash memory, and the MAC key stored in the OTP space of the main chip is used to perform MAC verification on the image of the first-level boot program, and the calculated MAC value is compared with the MAC of the first-level boot program in the Flash memory. If they are the same, it means that the verification is successful, otherwise, the startup process is terminated.

[0011] According to the embedded system fast and secure startup method, the MAC check includes HMAC, OMAC, CCM, GCM and PMAC check authentication algorithms, and also includes a MAC extension algorithm, and the MAC extension algorithm includes Encrypt-the-MAC, Encrypt-and-MAC, MAC-then-Encrypt and a combination of a custom hash algorithm and a countermeasure encryption algorithm.

[0012] According to the embedded system fast and secure startup method, the MAC key is a public key, the MAC key is used to generate a MAC value of the image, the MAC key is configured to be accessed through the security domain, and the security domain is a security area of ​​a one-time programmable memory.

[0013] According to the embedded system fast and secure startup method, the MAC key is burned by a burning device and stored in a secure area of ​​a one-time programmable memory, the MAC key is stored on a secure server, and secure firmware is generated in the secure server, and when the MAC key is burned on the device to be produced, the MAC key is encrypted and transmitted between the burning device and the device to be produced using a public key cryptography or a Diffie-Hellman key exchange method.

[0014] According to the embedded system fast and secure startup method, the common operating environment operating system includes a first verification method and a second verification method, the first verification method includes: loading the common operating environment operating system into the memory through the secondary boot program, sending the memory address and MAC value memory address range of the common operating environment operating system to the trusted execution environment operating system, using the MAC key in the OTP space to perform MAC operation on the common operating environment operating system in the memory passed by the secondary boot program to obtain a MAC value, comparing the calculated MAC value with the MAC value in the memory passed by the secondary boot program, and if the two are the same, If the verification succeeds, the secondary boot program starts to execute the normal operating environment operating system; otherwise, the verification fails and the startup process terminates; the second verification method includes: the secondary boot program uses a signature method to verify the normal operating environment operating system, the secondary boot program uses the PUK code to decrypt the signature of the normal operating environment operating system, and compares the decrypted data with the hash value of the normal operating environment operating system. If they are equal, it means that the verification is successful. If they are different, the startup of the normal operating environment operating system is terminated, wherein the secondary boot program and the PUK code of the normal operating environment operating system are simultaneously subjected to MAC operation and verified by the first-level boot program.

[0015] According to the embedded system fast and secure startup method, the first verification method also includes: using MAC verification for the entire loading process of the normal operating environment operating system, and loading the normal operating environment operating system through the second boot program when performing the verification, and verifying whether the MAC of the normal operating environment operating system matches through the trusted execution environment operating system.

[0016] According to the embedded system fast and secure startup method, the signature method includes signature verification and certificate verification.

[0017] According to the embedded system fast and secure startup method, the signature method includes signature verification and certificate verification.

[0018] The technical solution of the present invention also includes a dynamically accessed embedded system fast and secure startup device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that the processor implements any of the method steps described above when executing the computer program.

[0019] The technical solution of the present invention also includes an electronic device, characterized in that it includes any one of the embedded system fast and secure startup methods described above.

[0020] The beneficial effects of the present invention are: the amount of calculation for image credibility and integrity verification during the secure startup process is small, the hardware requirements are low, and the startup time is faster. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention is further described below in conjunction with the accompanying drawings and embodiments;

[0022] Figure 1 Shown is a schematic diagram according to an embodiment of the present invention;

[0023] Figure 2 Shown is an example of fast and secure startup according to an embodiment of the present invention;

[0024] Figure 3 Shown is a schematic diagram of a common operating environment verification according to an embodiment of the present invention;

[0025] Figure 4 Shown is another schematic diagram of a common operating environment verification according to an embodiment of the present invention;

[0026] Figure 5 The figure is a flowchart of the on-chip boot program according to an embodiment of the present invention;

[0027] Figure 6 Shown is a flow chart of a secondary boot program according to an embodiment of the present invention;

[0028] Figure 7 Shown is a diagram of an apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.

[0030] In the description of the present invention, “several” means one or more, “more” means more than two, “greater than”, “less than”, “exceed”, etc. are understood as not including the number itself, and “above”, “below”, “within”, etc. are understood as including the number itself.

[0031] In the description of the present invention, the consecutive numbering of the method steps is for the convenience of review and understanding. Combined with the overall technical scheme of the present invention and the logical relationship between the various steps, adjusting the implementation order between the steps will not affect the technical effect achieved by the technical scheme of the present invention.

[0032] In the description of the present invention, unless otherwise clearly defined, words such as "setting" should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meaning of the above words in the present invention in combination with the specific content of the technical solution.

[0033] Figure 1 The figure shows a fast and secure startup flow chart according to an embodiment of the present invention, the flow chart comprising:

[0034] When the embedded system is started, the on-chip boot program, the first-level boot program, the trusted execution environment operating system, the second-level boot program and the normal operating environment operating system are started in sequence, wherein the on-chip boot program, the first-level boot program and the trusted execution environment operating system are set in the security domain, and the second-level boot program and the normal operating environment operating system are set in the non-security domain. The first-level boot program, the trusted execution environment operating system and the second-level boot program are verified using MAC, and the normal operating environment operating system is verified using a signature method.

[0035] MAC is the MAC key, which is a public key used to generate the MAC value of each image. It also needs to be burned into the secure area of ​​the eFuse in the chip. To avoid leakage, the MAC key is kept on a private server and secure firmware is generated on the server. When burning the MAC key during the device production stage, the burning tool and the device can use public key cryptography, Diffie-Hellman key exchange, etc. to encrypt the MAC key to prevent the MAC key from existing in plain text.

[0036] In the embodiment of the present invention, the common operating environment operating system includes a Linux operating system or a RTOS operating system.

[0037] Figure 2 Based on the technical solution of the present invention, a fast and secure boot instance is proposed, not all instances. The entire boot process is: on-chip boot program (Boot ROM) -> first-level boot program (BL1, bootloader1) -> trusted execution environment operating system (TEE OS, Trusted Execution Environment Operating System) -> second-level boot program (BL2) -> ordinary operating environment operating system (REE OS, Rich Execution Environment Operating System). Among them, Boot ROM, BL1, TEE OS are located in the security domain, and BL2 and REE OS are located in the non-security domain. REE OS verification can use MAC or signature.

[0038] REE OS can be Linux or RTOS operating system. MAC verification includes HMAC, OMAC, CCM, GCM and PMAC verification authentication algorithms, and also includes MAC extension algorithm, MAC extension algorithm includes Encrypt-the-MAC, Encrypt-and-MAC, MAC-then-Encrypt and the combination of custom hash algorithm and countermeasure encryption algorithm. SIGN is not limited to signature, but can also be a certificate.

[0039] Figure 3 The figure shows a schematic diagram of a normal operating environment verification according to an embodiment of the present invention. The first type: the secondary boot program loads the normal operating environment operating system into the memory, and sends the memory address of the normal operating environment operating system and the memory address range of the MAC value of the normal operating environment operating system to the trusted execution environment operating system. The trusted execution environment operating system uses the MAC key in the OTP space to perform MAC operation on the normal operating environment operating system in the memory passed by the secondary boot program to obtain a MAC value, and compares the calculated MAC value with the MAC value in the memory passed by the secondary boot program. If they are equal, it indicates that the verification is passed, and the secondary boot program starts to execute the normal operating environment operating system; if they are not equal, it indicates that the verification failed, and the startup process terminates. (The difference between this and the second type is that MAC verification is used throughout the process, BL2 is responsible for loading the REE OS, and the TEE OS is responsible for verifying whether the MAC of the REE OS matches. This method is better.)

[0040] Figure 4 Another common operating environment verification schematic diagram according to an embodiment of the present invention is shown. The second type: Here is a detailed description, BL2 and REE OS PUK are MAC-calculated together. In the BL1 stage, (BL2 and REE OS PUK) are verified together.

[0041] Figure 5 The figure shows a flowchart of the on-chip boot program according to an embodiment of the present invention. The Boot ROM is an on-chip boot program written into the read-only ROM inside the chip when the chip is manufactured. It cannot be modified after leaving the factory and is executed first after the device is powered on. The Boot ROM loads BL1 from the Flash memory and uses the MAC key stored in the OTP space inside the main chip to perform MAC calculation on the BL1 image. The calculated MAC value is compared with the BL1 MAC in the Flash memory. If they are the same, it means that the verification is successful and BL1 is run. If they are not the same, the startup process is terminated.

[0042] Figure 6The figure shows a secondary boot program flow chart according to an embodiment of the present invention, including: loading a normal operating environment operating system into a memory through the secondary boot program, sending a memory address of the normal operating environment operating system and a MAC value memory address range to a trusted execution environment operating system, performing a MAC operation on the normal operating environment operating system in the memory transmitted by the secondary boot program using a MAC key in an OTP space through the trusted execution environment operating system to obtain a MAC value, comparing the calculated MAC value with the MAC value in the memory transmitted by the secondary boot program, if they are equal, the verification is passed, and the secondary boot program starts to execute the normal operating environment operating system; otherwise, the verification fails, and the startup process terminates.

[0043] In a preferred embodiment, MAC verification can also be used throughout the loading process of the normal operating environment operating system, and the normal operating environment operating system can be loaded through the second boot program when the verification is performed, and the MAC of the normal operating environment operating system can be verified through the trusted execution environment operating system to see if it matches.

[0044] The implementation manner of the present invention can also verify the normal operating environment operating system using a signature method through a secondary boot program. The secondary boot program uses a PUK code to decrypt the signature of the normal operating environment operating system, and compares the decrypted data with the hash value of the normal operating environment operating system. If they are equal, it indicates that the verification is successful. If they are different, the startup of the normal operating environment operating system is terminated, wherein the PUK codes of the secondary boot program and the normal operating environment operating system are simultaneously subjected to MAC operations and verified by the primary boot program.

[0045] Figure 5 The device diagram according to an embodiment of the present invention is shown. The device includes a memory 100 and a processor 200, wherein the processor 200 stores a computer program, and the computer program is used to execute: when the embedded system is started, the on-chip boot program, the first-level boot program, the trusted execution environment operating system, the second-level boot program and the normal operating environment operating system are sequentially started, wherein the on-chip boot program, the first-level boot program and the trusted execution environment operating system are set in the security domain, the second-level boot program and the normal operating environment operating system are set in the non-security domain, the first-level boot program, the trusted execution environment operating system and the second-level boot program are verified using MAC, and the normal operating environment operating system is verified using a signature method or MAC. Among them, the memory 100 is used to store data.

[0046] It should be appreciated that the method steps in the embodiments of the present invention can be implemented or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level process or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in an assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, the program can be run on a programmed ASIC for this purpose.

[0047] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0048] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.

[0049] The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on the display.

[0050] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present invention.

Claims

1. A fast and secure startup method for an embedded system, characterized in that: The method includes: When starting the embedded system, the on-chip boot program, the first-level boot program, the trusted execution environment operating system, the second-level boot program and the common operating environment operating system are sequentially started, wherein the on-chip boot program, the first-level boot program and the trusted execution environment operating system are set in a secure domain, and the second-level boot program and the common operating environment operating system are set in a non-secure domain, the first-level boot program, the trusted execution environment operating system and the second-level boot program are verified using MAC, and the common operating environment operating system is verified using a signature method or MAC; The common operating environment operating system includes a first verification method and a second verification method, The first verification method comprises: The normal operating environment operating system is loaded into the memory through the secondary boot program, the memory address of the normal operating environment operating system and the memory address range of the MAC value are sent to the trusted execution environment operating system, the trusted execution environment operating system uses the MAC key in the OTP space to perform MAC operation on the normal operating environment operating system in the memory passed by the secondary boot program to obtain a MAC value, and the calculated MAC value is compared with the MAC value in the memory passed by the secondary boot program. If they are equal, the verification is passed, and the secondary boot program starts to execute the normal operating environment operating system; otherwise, the verification fails and the startup process is terminated; The second verification method includes: The secondary boot program uses a signature method to verify the normal operating environment operating system. The secondary boot program uses a PUK code to decrypt the signature of the normal operating environment operating system, and compares the decrypted data with the hash value of the normal operating environment operating system. If they are equal, it means that the verification is successful. If they are different, the startup of the normal operating environment operating system is terminated. The secondary boot program and the PUK code of the normal operating environment operating system are simultaneously subjected to MAC operation and verified by the primary boot program.

2. The method for fast and secure startup of an embedded system according to claim 1, characterized in that: The on-chip boot program includes: During startup, the first-level boot program is loaded from the Flash memory, and the MAC key stored in the OTP space of the main chip is used to perform MAC verification on the image of the first-level boot program. The calculated MAC value is compared with the MAC of the first-level boot program in the Flash memory. If they are the same, it means that the verification is successful, otherwise, the startup process terminates.

3. The method for fast and secure startup of an embedded system according to claim 2, characterized in that: The MAC key is a public key, the MAC key is used to generate a MAC value of the mirror, and the MAC key is configured to be accessed through the security domain, and the security domain is a security area of ​​a one-time programmable memory.

4. The method for fast and secure startup of an embedded system according to claim 3, characterized in that: The MAC key is burned by a burning device and stored in a secure area of ​​a one-time programmable memory. The MAC key is stored on a secure server, and secure firmware is generated in the secure server. When the MAC key is burned on the device to be produced, the burning device and the device to be produced use public key cryptography or Diffie-Hellman key exchange to encrypt and transmit the MAC key.

5. The method for fast and secure startup of an embedded system according to claim 1, characterized in that: The first verification method also includes: using MAC verification throughout the loading process of the normal operating environment operating system, and loading the normal operating environment operating system through the secondary boot program when performing the verification, and verifying whether the MAC of the normal operating environment operating system matches through the trusted execution environment operating system.

6. The method for fast and secure startup of an embedded system according to claim 1, characterized in that: The signing method includes signature verification and certificate verification.

7. A fast and secure startup device for a dynamically accessed embedded system, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method steps described in any one of claims 1 to 6 are implemented.

8. An electronic device, characterized in that: The invention comprises the embedded system fast and secure startup method as described in any one of claims 1 to 6.