Secure boot system, method and device
By storing the original signature of the startup program in a secure area and using the startup key to generate and verify the execution period signature, the problem of high maintenance cost and additional cost in the existing technology when verifying the integrity of the external startup program is solved, and security is achieved. And economical startup procedure verification.
Patent Information
- Application Number
- CN201910551780.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-24
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-05-04
AI Technical Summary
When verifying the integrity of an external startup program, the existing technology requires modifying the read-only memory program code or using a high-end microcontroller, resulting in high maintenance costs and additional costs.
Store the original signature of the startup program in a safe area that cannot be accessed by the outside world. The processor reads the startup key from the storage device to execute the encryption algorithm on the startup program, generates an execution period signature, and verifies it with the original signature. to ensure the integrity of the startup process.
It achieves self-verification of the integrity of the startup program without modifying the device program code, prevents external modifications and intrusions, and reduces maintenance and costs.
Smart Images

Figure CN112052455B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a system, method and device for starting a computer, and in particular to a safe starting system, method and device. Background Art
[0002] A boot code or boot loader is a program located on a computer or an embedded system for starting the operating system. It is usually stored on the hard disk or memory of the computer or embedded system. After the computer is powered on and the Basic Input / Output System (BIOS) power-on self-test (POST), it continues to execute hardware initialization, memory configuration and other hardware and software environment preparation programs in order to load and execute the operating system or other system software.
[0003] Since the boot program may be stored outside the main control device (such as CPU, SoC, MPU or MCU) on the host, the computer or embedded system may be attacked or invaded due to tampering of the boot program stored in the external storage device.
[0004] For the method of starting by an external device, there is currently a security protection mechanism, which is to modify the read-only memory program code (ROM Code) in the microcontroller (MCU) of the computer or embedded system device itself so that it can verify the integrity of the external device startup program during the startup process, thereby achieving the effect of secure startup. However, this method requires modifying the program code of the read-only memory, which increases the maintenance cost of the microcontroller. Another common method is to verify the integrity of the external startup program through the built-in secure startup mechanism of a higher-level microcontroller. This method also requires the use of a higher-level microcontroller and increases the cost. Summary of the invention
[0005] In view of this, the present invention provides a startup system, method and device, which stores the original signature used to verify the startup program in a secure area in the startup device that cannot be accessed by the outside world, so that the startup device can perform self-verification each time it is started.
[0006] The present invention provides a secure boot method, which is suitable for booting a host by a boot device. The boot device has a storage device and a processor. The method is that the processor reads a boot program (bootcode) and a boot key for booting the host from the storage device, and uses the boot key to execute an encryption algorithm on the boot program to obtain an execution period signature. In addition, the processor reads the original signature from a secure area of the storage device and uses it to verify the execution period signature. Among them, if the execution period signature is consistent with the original signature, the processor provides the boot program to the host to perform the boot operation.
[0007] In an embodiment of the present invention, the step of verifying the execution-time signature further includes that when the execution-time signature is inconsistent with the original signature, the processor prohibits providing the boot program to the host and sets the status flag to a failure state.
[0008] In one embodiment of the present invention, the step of executing the encryption algorithm on the boot program using the boot key includes the processor generating a digest from the boot program using a verification method, and signing the digest with the boot key using the encryption algorithm to generate an execution period signature.
[0009] The present invention provides a secure boot device, which includes a storage device and a processor. The secure boot device is connected to a host. The storage device is used to store a boot program and a boot key for booting the host. The processor is coupled to the storage device and is configured to read the boot program and the boot key from the storage device, and use the boot key to execute an encryption algorithm on the boot program to obtain an execution period signature. In addition, the processor also reads the original signature from a secure area of the storage device and uses it to verify the execution period signature. If the execution period signature is consistent with the original signature, the processor provides the boot program to the host to perform a boot operation.
[0010] The present invention provides a secure boot system, which includes a host and a boot device. The boot device includes a storage device and a processor. The boot device is connected to the host. The storage device is used to store a boot program and a boot key for booting the host. The processor is coupled to the storage device, and is configured to read the boot program and the boot key from the storage device, and use the boot key to execute an encryption algorithm on the boot program to obtain an execution period signature. In addition, the processor also reads the original signature from the security area of the storage device, and uses it to verify the execution period signature. If the execution period signature is consistent with the original signature, the processor provides the boot program to the host to perform the boot operation.
[0011] In one embodiment of the present invention, the activation key is stored in a secure area of the storage device.
[0012] In one embodiment of the present invention, if the execution-time signature is inconsistent with the original signature, the processor will prohibit providing the boot program to the host and set the status flag to a failure state.
[0013] In one embodiment of the present invention, the processor includes generating an extract from the boot program using a verification method, and signing the extract with a boot key using an encryption algorithm to generate an execution-time signature.
[0014] In one embodiment of the present invention, the verification method includes calculating a checksum, a cyclic redundancy check code or a hash value of the boot program to generate the excerpt.
[0015] In one embodiment of the present invention, the encryption algorithm includes RSA (Rivest-Shamir-Adleman) algorithm, Digital Signature Algorithm (DSA) or Elliptic Curve Digital Signature Algorithm (ECDSA).
[0016] In order to make the above features and advantages of the present invention more clearly understood, embodiments are given below with reference to the accompanying drawings for detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a block diagram of a secure boot system according to an embodiment of the present invention.
[0018] Figure 2 is a flow chart of a secure boot method according to an embodiment of the present invention.
[0019] Figure 3A and Figure 3B This is an example of a secure boot method according to an embodiment of the present invention.
[0020] Figure 4A and Figure 4B This is an example of a secure boot method according to an embodiment of the present invention.
[0021] [Description of Reference Numerals]
[0022] 1: Secure boot system
[0023] 10: Start the device
[0024] 12: Connecting device
[0025] 14: Storage device
[0026] 142: Safe Area
[0027] 144: Start segmentation
[0028] 16: Processor
[0029] 20: Host
[0030] 30: Factory host
[0031] S202~S210: Steps DETAILED DESCRIPTION
[0032] In the embodiment of the present invention, before the boot device leaves the factory, the original signature used to verify the boot program is stored in a secure area in the storage device that cannot be accessed by the outside world. Therefore, whenever the user wants to use the boot device to boot the host, the boot device will use the boot key stored in the storage device to execute an encryption algorithm on the boot program to obtain the execution period signature, and use the original signature previously stored in the secure area for verification. Only when the verification is successful will the boot program be provided to the host. Therefore, the boot device can self-verify without modifying the device program code to achieve secure boot.
[0033] Figure 1 is a block diagram of a secure boot system according to an embodiment of the present invention. Figure 1 , the secure boot system 1 includes a boot device 10 and a host 20. The host 20 is, for example, a microcontroller (MCU), a system on a chip (SoC), an application processor (AP), a computer, a workstation, a server, or other computer device, which needs to execute a boot program at each startup (power on or reset) to load and execute an operating system or other system software. The boot device 10 is, for example, an external storage device such as an embedded multimedia card (eMMC), an embedded universal flash memory storage (eUFS), an embedded solid-state drive (eSSD), a U disk, a memory card, a hard disk, etc., which is set independently of the host 20, and includes a connecting device 12, a storage device 14, and a processor 16. The processor 16 is coupled to the connecting device 12 and the storage device 14, and can access and execute instructions recorded in the storage device 14 to implement the secure boot method of the embodiment of the present invention.
[0034] The connecting device 12 is, for example, an interface device connected to the host 20 in any wired or wireless manner, and is, for example, a device supporting interfaces such as Universal Serial Bus (USB), RS232, Bluetooth (BT), and Wireless fidelity (Wi-Fi), but the present embodiment is not limited thereto.
[0035] The storage device 14 is, for example, any form of static or dynamic random access memory (RAM), read-only memory (ROM), flash memory or other similar device or a combination of these devices, and is used to store one or more instructions that can be executed by the processor 16. These instructions can be loaded by the processor 16 for execution.
[0036] The processor 16 is, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessor (Microprocessor), microcontroller (Microcontroller, MCU), digital signal processor (Digital Signal Processor, DSP), programmable controller, application specific integrated circuits (Application Specific Integrated Circuits, ASIC), programmable logic device (Programmable Logic Device, PLD) or other similar devices or a combination of these devices, but the present embodiment is not limited thereto.
[0037] Figure 2 is a flowchart of a secure boot method according to an embodiment of the present invention. Figure 1 and Figure 2 The method of this embodiment is applicable to the above-mentioned starting device 10. The following describes the detailed steps of the safe starting method of this embodiment in conjunction with the various devices and components of the starting device 10.
[0038] First, in step S202, the processor 16 reads the boot code and the boot key for booting the host 20 from the storage device 14 of the boot device 10 itself, and uses the boot key to execute an encryption algorithm on the boot code to obtain an execution period signature. The processor 16, for example, executes the operation of step S202 after receiving a boot signal sent by the host 20 through the connection device 12. The host 20, for example, sends a boot signal to the connected boot device 10 when receiving a boot operation such as a power-on or reset operation from the user, or when the host 20 triggers a reboot.
[0039] In one embodiment, the above-mentioned activation key is, for example, a string of 128 to 256 bits in length that is pre-given by the manufacturer of the activation device 10 for the activation device 10, but this embodiment is not limited thereto. The activation key is, for example, stored in the storage device 14 of the activation device 10 before the activation device 10 leaves the factory. In addition, the above-mentioned activation program is, for example, a program that can be used by the host 20 to perform the activation operation, which is, for example, stored in a boot partition of the storage device. Thus, whenever the processor 16 of the activation device 10 receives the activation signal, the above-mentioned activation program and activation key are read and used to execute the encryption algorithm to obtain a runtime signature. The signature is, for example, a string of 128 or 256 bits in length, and can be used to verify the integrity of the activation program.
[0040] In detail, after reading the boot program and the boot key, the processor 16 may execute a verification method to generate an extract from the boot program. The verification method is, for example, calculating a checksum, a cyclic redundancy check code, or a hash value of the boot program, etc., which are not limited here. Then, the processor 16 will use an encryption algorithm to sign the extract with the boot key to generate an execution period signature. The encryption algorithm is, for example, a hash message authentication code (Hash-based message authentication code, abbreviated as HMAC), an RSA (Rivest-Shamir-Adleman) algorithm, a digital signature algorithm (Digital Signature Algorithm, DSA) or an elliptic curve digital signature algorithm (Elliptic Curve Digital Signature Algorithm, ECDSA), etc., which are not limited here.
[0041] Back to Figure 2In addition to generating an execution-period signature, in step S204, the processor 16, for example, reads the original signature from the security area of the storage device 14, and uses it to verify the generated execution-period signature. The above-mentioned security area is, for example, an area where the manufacturer of the startup device 10 applies additional confidentiality measures to a certain part of the storage device 14, such as encapsulating or covering the part with a metal layer to prevent the part from being exposed and read externally, and making the part damaged and unable to be probed when the encapsulation or metal layer is damaged by external force. Thereby, it can be ensured that the information stored in the security area cannot be obtained from the outside. The above-mentioned installation area can only be accessed through a specific authentication command, that is, when the processor 16 needs to verify the execution-period signature, the original signature stored in the security area can be read by executing the above-mentioned authentication command.
[0042] In step S206, the processor 16 determines whether the execution period signature is consistent with the original signature. If the two are consistent, then in step S208, the processor 16 provides the startup program to the host 20 to perform the startup operation. In one embodiment, the processor 16, for example, uses the connection device 12 to upload the startup program to the host 20 so that the host 20 can perform the startup operation. Conversely, in step S210, the processor 16 prohibits providing the startup program to the host 20 and sets the status flag to a failed state. Thus, the host 20 can, for example, learn that the startup has failed by reading the status flag, and thus notify the user to check or replace the startup device 10.
[0043] Through the above method, whenever the host 20 is to use the boot device 10 for booting, the boot device 10 can perform self-verification to confirm the integrity of the boot program, thereby ensuring that the boot program is not modified externally and the host 20 is not invaded externally.
[0044] For example, Figure 3A and Figure 3B This is an example of a secure boot method according to an embodiment of the present invention. Figure 3A and Figure 3B , this embodiment is based on Figure 1 The architecture of the secure boot system 1 is used to illustrate the process of the secure boot method, wherein Figure 3A Draw the process before the factory, Figure 3B Draw the process of use.
[0045] exist Figure 3AIn the embodiment, the startup device 10 receives the startup key, the startup program and the original signature provided by the factory host 30 through the connection device 12. The original signature is obtained by, for example, the factory host 30 using the startup key to execute an encryption algorithm on the startup program. The detailed method is the same as the method for obtaining the execution period signature in the aforementioned embodiment, so it will not be repeated here. After receiving the startup key, the startup program and the original signature, the startup device 10 writes the original signature to the security area 142 in the storage device 14 by the processor 16, and writes the startup key and the startup program to the boot partition 144 in the storage device 14. The setting method of the security area 142 is the same as that in the aforementioned embodiment, so it will not be repeated here.
[0046] exist Figure 3B In the example, after the startup device 10 receives the startup signal sent by the host 20 through the connection device 12, the processor 16 reads the startup key and the startup program from the startup partition 144, and uses the startup key to execute the encryption algorithm on the startup program to obtain or restore the execution period signature. At the same time, the processor 16 also reads the original signature from the secure area 142 and uses it to verify the execution period signature. When the verification is successful, the processor 16 uploads the startup program to the host 20 through the connection device 12, so that the host 20 executes the startup program to perform the startup operation.
[0047] In the above embodiment, the activation key is stored together with the activation program in the activation partition 144 of the storage device 14. In other embodiments, the activation key may be stored together with the original signature in the secure area 142 of the storage device 14 to increase security.
[0048] For example, Figure 4A and Figure 4B This is an example of a secure boot method according to an embodiment of the present invention. Figure 4A and Figure 4B , this embodiment is based on Figure 1 The architecture of the secure boot system 1 is used to illustrate the process of the secure boot method, wherein Figure 4A Draw the process before the factory, Figure 4B Draw the process of use.
[0049] exist Figure 4AIn the embodiment, the startup device 10 receives the startup key, the startup program and the original signature provided by the factory host 30 through the connection device 12. The original signature is obtained by, for example, the factory host 30 using the startup key to execute an encryption algorithm on the startup program. The detailed method is the same as the method for obtaining the execution period signature in the aforementioned embodiment, so it will not be repeated here. After receiving the startup key, the startup program and the original signature, the startup device 10 writes the original signature and the startup key to the secure area 142 in the storage device 14 by the processor 16, and writes the startup program to the startup partition 144 in the storage device 14. The setting method of the secure area 142 is the same as that in the aforementioned embodiment, so it will not be repeated here.
[0050] exist Figure 4B In the example, after the startup device 10 receives the startup signal sent by the host 20 through the connection device 12, the processor 16 reads the startup key and the startup program from the secure area 142 and the startup partition 144 respectively, and uses the startup key to execute the encryption algorithm on the startup program to obtain or restore the execution period signature. At the same time, the processor 16 also reads the original signature from the secure area 142 and uses it to verify the execution period signature. When the verification is successful, the processor 16 uploads the startup program to the host 20 through the connection device 12, so that the host 20 executes the startup program to perform the startup operation.
[0051] In summary, the secure boot system, method and device provided by the present invention can store the original signature for verifying the boot program in a secure area in the storage device that cannot be accessed by the outside world, so that the boot device can automatically perform the boot program verification procedure each time it receives the boot signal from the host. Therefore, the boot program can be prevented from being tampered with without modifying the device program code, and the host can be securely booted.
[0052] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the appended claims.
Claims
1. A secure boot method, suitable for booting a host by a boot device outside the host, the boot device having a storage device and a processor, the method comprising the following steps: connecting the processor to the host computer via a connecting device; After the processor is connected to the host through the connection device, the processor reads the startup program and the startup key for starting the host from the storage device, and executes an encryption algorithm on the startup program using the startup key to obtain an execution period signature; as well as The processor reads the original signature from the secure area of the storage device to verify the execution-period signature; If the execution-period signature is consistent with the original signature, the processor provides the boot program to the host to perform a boot operation.
2. The method of claim 1, wherein the activation key is stored in the secure area of the storage device.
3. The method of claim 1, wherein the step of verifying the execution-period signature further comprises: If the execution-period signature is inconsistent with the original signature, the processor prohibits providing the boot program to the host and sets a status flag to a failure status.
4. The method of claim 1, wherein the step of executing the encryption algorithm on the startup program using the startup key comprises: The processor generates a digest from the boot program using a verification method; as well as The processor signs the digest with the activation key using the encryption algorithm to generate the runtime signature.
5. The method of claim 4, wherein the verification method comprises calculating a checksum, a cyclic redundancy check code, or a hash value of the boot program to generate the digest.
6. The method according to claim 1, wherein the encryption algorithm comprises an RSA algorithm, a digital signature algorithm or an elliptic curve digital signature algorithm.
7. A secure boot device, the secure boot device being connected to a host, the secure boot device comprising: A storage device storing a startup program and a startup key for starting the host; as well as A processor, coupled to the storage device, is configured to: After the processor is connected to the host through the connection device, the startup program and the startup key are read from the storage device, and an encryption algorithm is executed on the startup program using the startup key to obtain an execution period signature; as well as Reading the original signature from the secure area of the storage device, If the execution period signature is consistent with the original signature, the startup program is provided to the host to perform a startup operation.
8. The activation device as claimed in claim 7, wherein the activation key is stored in the secure area of the storage device.
9. The starting device according to claim 7, wherein If the execution-period signature is inconsistent with the original signature, the processor prohibits providing the boot program to the host and sets a status flag to a failure status.
10. The startup device according to claim 7, wherein the processor comprises: generating a summary from the startup program using a test method; as well as The digest is signed with the activation key using the encryption algorithm to generate the execution-period signature.
11. The boot device of claim 10, wherein the verification method comprises calculating a check sum, a cyclic redundancy check code or a hash value of the boot program to generate the digest.
12. The starting device as claimed in claim 7, wherein the encryption algorithm comprises an RSA algorithm, a digital signature algorithm or an elliptic curve digital signature algorithm.
13. A secure boot system, comprising: Host; as well as A startup device, connected to the host, comprising: A storage device storing a startup program and a startup key for starting the host; and A processor, coupled to the storage device, is configured to: After the processor is connected to the host through the connection device, the startup program and the startup key are read from the storage device, and an encryption algorithm is executed on the startup program using the startup key to obtain an execution period signature; and Reading the original signature from the secure area of the storage device, If the execution period signature is consistent with the original signature, the startup program is provided to the host to perform a startup operation.
14. The secure boot system of claim 13, wherein the boot key is stored in the secure area of the storage device.
15. The secure boot system of claim 13, wherein If the execution-period signature is inconsistent with the original signature, the processor prohibits providing the boot program to the host and sets a status flag to a failure status.
16. The secure boot system of claim 13, wherein the processor comprises: generating a summary from the startup program using a test method; as well as The digest is signed with the activation key using the encryption algorithm to generate the execution-period signature.
17. The secure boot system of claim 16, wherein the verification method comprises calculating a checksum, a cyclic redundancy check code, or a hash value of the boot program to generate the digest.
18. The secure boot system of claim 13, wherein the encryption algorithm comprises an RSA algorithm, a digital signature algorithm, or an elliptic curve digital signature algorithm.
Citation Information
Patent Citations
Method and apparatus for device security verification utilizing a virtual trusted computing base
US20190163910A1
