Code starting method and device, electronic equipment and medium

Through the hardware acceleration algorithm and asynchronous computing technology of the hardware security module, the secure startup code block is split and processed in parallel, which solves the problem of long secure startup time in the existing technology, achieves fast and safe startup efficiency, and reduces costs.

CN118690374APending Publication Date: 2024-09-24吉咖智能机器人有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410855608.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing secure boot technology requires a large amount of code to be implemented when booting, resulting in a long boot time and unable to meet the requirements for fast boot.

Method used

The hardware acceleration algorithm of the hardware security module is used to encrypt and decrypt the secure startup code, and by splitting large application code blocks into multiple sub-code blocks for parallel processing, candidate acceleration tools are used to perform asynchronous calculations to accelerate the startup process.

Benefits of technology

It significantly shortens the encryption and decryption time and the overall startup time, ensures the safety and efficiency of the startup process, reduces the dependence on CPU resources, enhances information security protection capabilities, and saves material costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690374A
    Figure CN118690374A
Patent Text Reader

Abstract

The invention relates to a code starting method and device, electronic equipment and a medium. The method comprises the steps of determining a to-be-started security module in hardware security modules, wherein the to-be-started security module comprises at least one application code block; in response to determining that the data volume of the application code block is greater than a preset threshold value, splitting the application code block into a plurality of sub-application code blocks; determining a group of candidate acceleration tools associated with the security module to be started, wherein a corresponding candidate acceleration tool in the group of candidate acceleration tools can start a corresponding sub-application code block in the plurality of sub-application code blocks; and launching the respective sub-application code blocks with the respective candidate acceleration tools. In this way, the large-capacity code can be quickly and safely started.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, and in particular to a code startup method, device, electronic device, and computer-readable storage medium. Background Art

[0002] As an important part of information security development, safe boot technology (such as safe boot technology for intelligent connected vehicles) is indispensable when implementing information security solutions. However, it usually requires a lot of code implementation, which will result in a long boot time. Therefore, when the safe boot technology is actually deployed, it often cannot meet the customer's requirements for fast startup. For this reason, R&D personnel have to spend a lot of time optimizing the boot code or reducing the functional scope of the safe boot to meet the usage requirements. Summary of the invention

[0003] According to an exemplary embodiment of the present disclosure, a solution of a code startup method, apparatus, electronic device, and medium is provided to at least partially solve the problems existing in the prior art.

[0004] In a first aspect of the present disclosure, a code startup method is provided. The method includes: determining a security module to be started in a hardware security module, wherein the security module to be started includes at least one application code block; in response to determining that the amount of data of the application code block is greater than a predetermined threshold, splitting the application code block into multiple sub-application code blocks; determining a group of candidate acceleration tools associated with the security module to be started, wherein a corresponding candidate acceleration tool in the group of candidate acceleration tools can start a corresponding sub-application code block in a plurality of the sub-application code blocks; and starting the corresponding sub-application code block using the corresponding candidate acceleration tool.

[0005] In some embodiments, determining a security module to be started in a hardware security module may include: in response to determining that the security module to be started includes a boot loader module, determining whether to update the security module to be started; in response to determining to update the security module to be started, determining whether to update the boot loader module; in response to determining to update the boot loader module, obtaining a current boot loader module summary for the boot loader module using at least one tool from a group of candidate acceleration tools; and storing the current boot loader module summary to the security module to be started.

[0006] In some embodiments, determining a security module to be started in a hardware security module may include: determining that the security module to be started includes a user configuration information module; in response to determining that the security module to be started is updated and the boot loader module is not updated, using at least one tool from a set of candidate acceleration tools to obtain a current user configuration information module summary for the user configuration information module; and storing the current user configuration information module summary to the security module to be started.

[0007] In some embodiments, the method may also include: in response to determining that the security module to be started is not updated, using at least one candidate acceleration tool from a group of candidate acceleration tools to obtain a user configuration information module summary to be compared for the user configuration information module; and in response to determining that the user configuration information module summary to be compared is consistent with the current user configuration information module summary, loading the user configuration module information.

[0008] In some embodiments, the method may also include: determining that the safety module to be started includes a vehicle calibration data module; using at least one candidate acceleration tool from a group of candidate acceleration tools to obtain a vehicle calibration data module summary to be compared for the vehicle calibration data module; and in response to determining that the vehicle calibration data module summary to be compared is consistent with a preset vehicle calibration data module summary, loading the vehicle calibration data module information.

[0009] In some embodiments, using the corresponding candidate acceleration tool to start the corresponding sub-application code block may include: using at least one candidate acceleration tool from a group of the candidate acceleration tools to obtain each sub-application code block digest to be compared of the corresponding sub-application code block; and in response to determining that each sub-application code block digest to be compared is consistent with each preset sub-application code block digest, starting the corresponding sub-application code block.

[0010] In some embodiments, the method may further include: numbering each of the plurality of sub-application code blocks based on the running order; or injecting a key of the same length into each candidate acceleration tool of a group of candidate acceleration tools.

[0011] In the second aspect of the present disclosure, a code startup device is provided. The device includes: a security module to be started determination component, configured to determine a security module to be started in a hardware security module, wherein the security module to be started includes at least one application code block; a sub-application code block acquisition component, configured to split the application code block into multiple sub-application code blocks in response to determining that the amount of data of the application code block is greater than a predetermined threshold; a candidate acceleration tool determination component, configured to determine a group of candidate acceleration tools associated with the security module to be started, wherein a corresponding candidate acceleration tool in the group of candidate acceleration tools can start a corresponding sub-application code block in a plurality of the sub-application code blocks; and a sub-application code block startup component, which uses the corresponding candidate acceleration tool to start the corresponding sub-application code block.

[0012] In a third aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to the first aspect of the present disclosure.

[0013] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the medium, and when the program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.

[0014] In a fifth aspect of the present disclosure, a computer program product is provided, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the method according to the first aspect of the present disclosure is implemented.

[0015] The various embodiments of the present disclosure can at least achieve the following technical effects:

[0016] According to the embodiments of the present disclosure, the hardware acceleration algorithm of the hardware security module is used to speed up the encryption and decryption process of the secure boot code. The use of the hardware acceleration unit can greatly shorten the time of encryption and decryption operations, while also ensuring the security of the entire process, thereby improving the startup efficiency and effectively reducing the dependence on CPU resources, thereby releasing more computing power for other critical tasks.

[0017] According to the embodiment of the present disclosure, asynchronous computing is used to allow multiple encryption and decryption modules to perform computing tasks of the secure boot code block in parallel. Parallel processing can not only significantly shorten the overall secure boot time, but also ensure that the impact on the boot time is relatively small when the amount of secure boot code and data increases significantly. At the same time, this asynchronous design can also allow more functional modules to participate in the secure boot process, enhancing the overall information security protection capability.

[0018] According to the embodiments of the present disclosure, the computing power advantage of hardware resources is fully utilized to provide an effective reference for the evaluation of computing power. In future hardware designs, more cost-effective hardware can be purchased according to different computing power requirements, thereby saving material costs.

[0019] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure, wherein:

[0021] Figure 1 A schematic diagram illustrating an example environment in which various embodiments of the present disclosure can be implemented;

[0022] Figure 2 A flowchart of a code startup method according to some embodiments of the present disclosure is shown;

[0023] Figure 3 A schematic block diagram showing a code startup device according to some embodiments of the present disclosure; and

[0024] Figure 4 A block diagram of a computing device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0026] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0027] As mentioned above, since a large amount of code is required to implement secure boot, the secure boot time of the machine (such as a car) is too long and cannot meet the requirements for fast boot.

[0028] In response to the above problems, the various embodiments of the present disclosure use the hardware acceleration algorithm of the hardware security module to encrypt and decrypt the secure boot code, which can not only greatly shorten the time consumption of encryption and decryption, but also ensure the security of the entire process. On the one hand, the dedicated hardware acceleration unit can process encryption and decryption operations in parallel, greatly improving computing efficiency; on the other hand, offloading encryption and decryption operations to a dedicated security module can isolate key data to prevent it from being stolen or tampered with by attackers at the software level. This hardware-level security protection builds a solid line of defense for the information security of the entire system.

[0029] At the same time, by using asynchronous computing, multiple encryption and decryption modules can perform the calculation tasks of the secure boot code in parallel. This can not only significantly shorten the overall boot time, but also ensure that even if the amount of secure boot code and data increases significantly, the impact on the boot time is relatively small. This parallel processing architecture can also allow more functional modules to participate in the secure boot process, forming a three-dimensional security protection.

[0030] Moreover, making full use of the computing power advantages of hardware resources provides an effective basis for the evaluation and selection of future hardware designs. First of all, through performance testing and evaluation of existing hardware platforms, we can understand their computing power and resource utilization in secure boot scenarios. Based on these data, the R&D team can more accurately predict the demand for hardware computing power of future product lines and select more matching processors, accelerators and other solutions. This will not only improve the overall system security performance, but also select a more cost-effective hardware configuration while meeting the needs, thereby significantly reducing material costs.

[0031] The following will be combined Figures 1 to 4 An exemplary embodiment of the present disclosure is introduced. This exemplary embodiment is illustrated by taking the safe and fast startup of an intelligent connected car as an example. However, it should be understood that although the present disclosure is described by taking an intelligent connected car as an example, the code startup method is not limited to this. In fact, as long as it involves a scenario that requires both information security and startup speed, the technical ideas of the present disclosure can be used for optimization, such as industrial control equipment, embedded systems, 5G base stations, etc., and the present disclosure does not limit this.

[0032] Figure 1A schematic diagram of an example environment 100 in which multiple embodiments of the present disclosure can be implemented is shown. A vehicle 101 is schematically shown in the environment 100. For example, a hardware security module HSM may be provided in the vehicle 101 to implement safe startup of the vehicle 101. The HSM module can be used to be responsible for performing encryption and decryption operations of the secure startup code and provide reliable key management and storage functions. Normally, when a user starts the vehicle 101, such as pressing the ignition switch or starting it remotely, the vehicle system will respond to the user's input and start quickly and safely. This startup process is usually based on the secure startup code and key stored in the HSM module. The HSM module first reliably encrypts and decrypts the startup code to ensure its integrity and confidentiality, and then the decrypted code is handed over to the main processor for execution, and finally the entire fast and secure startup process is completed.

[0033] In some embodiments, the vehicle 101 may be any type of vehicle that can carry people and / or objects and move through a power system such as an engine, including but not limited to cars, trucks, buses, electric vehicles, motorcycles, RVs, trains, etc. In some embodiments, one or more vehicles 101 in the environment 100 may be vehicles with certain autonomous driving capabilities, which are also referred to as unmanned vehicles. In some embodiments, the vehicle 101 may also be a vehicle without autonomous driving capabilities.

[0034] In some embodiments, continue to refer to Figure 1 , the vehicle 101 can be communicatively coupled to the computing device 103. Although shown as a separate entity, the computing device 103 can be embedded in the vehicle 101. The computing device 103 can also be an entity external to the vehicle 101 and can communicate with the vehicle 101 via a wireless network. The computing device 103 can be any device with computing capabilities. As a non-limiting example, the computing device 103 can be any type of fixed computing device, mobile computing device, or portable computing device, including but not limited to a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a multimedia computer, a mobile phone, etc.; all or part of the components of the computing device 103 can be distributed in the cloud. The computing device 103 includes at least a processor, a memory, and other components that are typically present in a general-purpose computer to implement computing, storage, communication, control, and other functions. The computing device 103 can perform all or part of the operations according to the various embodiments of the present disclosure, which will be described in detail below. In the following, for ease of explanation, the computing device 103 will be combined with the computing device 103. Figure 1 To describe the embodiments of the present disclosure.

[0035] Figure 2 FIG. 2 is a flowchart of a code startup method 200 according to some embodiments of the present disclosure. The method 200 may be Figure 1The computing device 103 can be embedded in the vehicle 101 or as a standalone device outside the vehicle 101. Figure 1 Method 200 is described.

[0036] In block 210 , a security module to be started in a hardware security module is determined, wherein the security module to be started includes at least one application code block.

[0037] Pure software encryption and decryption operations usually have obvious disadvantages, such as requiring more CPU resources and placing a heavy burden on system performance. Moreover, the computing speed of software encryption and decryption often cannot reach the level of hardware acceleration, especially for complex or large-data cryptographic algorithms. In addition, software encryption and decryption mostly use sequential computing modes, which cannot give full play to the parallel advantages of modern processors.

[0038] As briefly mentioned above, the hardware security module HSM is a hardware device for information security applications. It is a dedicated security chip independent of the main processor and runs in a secure environment isolated from the main system to prevent various attacks at the software level from infringing on key security data and functions. HSM can have a built-in encryption operation unit, which can execute various cryptographic algorithms such as RSA, AES, etc. at high speed in hardware, thereby improving the efficiency of decryption operations, while also ensuring that key keys and algorithms will not be leaked. A secure key storage area can be set inside the HSM to reliably manage and protect the various keys required for the system. The key will neither be leaked to the software level nor illegally accessed by the outside. In the embodiments of this article, the HSM can participate in the trusted startup process of the system, verify and execute the secure startup code, and ensure that the system is started in a trusted environment. At the same time, the HSM can also provide remote authentication services to ensure the authenticity of the system identity.

[0039] According to the embodiments of the present disclosure, it can be applied to various chips and processors with built-in hardware security modules. For example, many modern MCU chips will integrate HSM functions, such as secure boot, encryption and decryption accelerators, secure memory, etc. These HSM modules can provide reliable security services for the MCU system. For another example, SOC chips that integrate multiple functions usually also have built-in HSM modules to protect the key data and algorithms involved in the entire system. This is very helpful for applications such as mobile devices and Internet of Things devices. In addition to MCU and SOC, some dedicated processor chips such as security coprocessors, GPUs, TPUs, etc., will also integrate HSM functions to provide hardware-level security support for various computing-intensive applications. In addition, some independent security elements, such as security element ICs, TPM chips, etc., can also be regarded as special HSMs to provide reliable security services for the system.

[0040] In some embodiments, the security module to be started is a module that needs to be securely started, for example, it may be a boot loader module, a user configuration information module, a vehicle calibration data module, an application code block, etc.

[0041] In one embodiment, the application code block may include an operating system kernel, a driver, and various vehicle-mounted application software. These codes need to be safely loaded and run when the system starts, otherwise malicious code may be injected and affect the security of the system. The application code block usually has a certain amount of data, and the data volume can be specifically characterized by parameters such as the number of lines of code, the size of the binary file, the number of functional modules, the number of dependent libraries, the size of the resource file, and the code dynamically loaded at runtime. Among them, by counting the number of source code lines of the application, the size of the code can be roughly reflected. Generally speaking, the more lines of code, the greater the complexity of the code block and the required resources. The size of the compiled application binary file is also an intuitive measurement indicator. The larger the binary file, the richer the functions contained in the code block and the more storage space it occupies. Moreover, the more functional modules are contained in the application, the larger the code block will be. For example, applications involving multiple functions such as ADAS, entertainment systems, and remote services will have a large amount of code. In addition, the more external library files the application depends on, the larger its code block will be. These dependent libraries also need to be included in the scope of security protection. In addition to the source code, resource files such as pictures, audio, and video in the application will also take up a lot of storage space, which needs to be taken into account. Some applications will dynamically load some code modules during runtime, which also needs to be taken into account in security considerations. Taking all the above factors into consideration, we can roughly assess the amount of data or code in a certain application code block, and thus determine the security protection measures required.

[0042] In one embodiment, the Bootloader may be the first underlying firmware program executed during the system startup process, responsible for performing some initialization operations, such as hardware checking, loading the operating system kernel, etc. The security of the Bootloader is very critical, because if the Bootloader is tampered with or injected with malicious code, the entire system startup process will be threatened, resulting in the system being unable to start or run normally. Therefore, the Bootloader needs to be authenticated and integrity checked to ensure that its code and configuration have not been illegally modified.

[0043] In one embodiment, the user configuration information module may include configuration parameters of various vehicle systems such as user personalized settings and driving mode preferences. These parameters directly affect the behavior and performance of the vehicle. If maliciously tampered with, it may cause the vehicle to behave unexpectedly. The vehicle calibration data block may be calibration data that stores various vehicle performance parameters, such as engine parameters, battery parameters, sensor calibration values, etc. These data are crucial to the normal operation of the vehicle. Once tampered with, it may cause various vehicle failures or even safety hazards.

[0044] In addition to the above main modules, the security module to be started may also include other key data blocks related to vehicle safety, such as ECU firmware, key storage area, log recording area, etc., which are not limited in this disclosure. The following will detail the fast and secure startup method embodiment of other modules besides the application code block.

[0045] In block 220 , in response to determining that the data amount of the application code block is greater than a predetermined threshold, the application code block is split into a plurality of sub-application code blocks.

[0046] In some embodiments, a predetermined threshold can be determined based on system resource limitations. For example, a reasonable upper limit of the code block size can be determined based on resource limitations such as memory capacity and storage space of the vehicle-mounted computing platform. Code blocks that exceed this upper limit need to be split. In another embodiment, a predetermined threshold can be determined based on the safe startup time. For example, it may be necessary to perform a performance evaluation on the entire safe startup process to determine the maximum time required to complete the loading and verification of all code blocks. This limits the upper limit of the size of a single code block. In another embodiment, a predetermined threshold can be determined based on code complexity. For example, a large code block that is too complex may take a long time to perform security verification, affecting the overall startup efficiency. In addition, a predetermined threshold can also be determined based on the functional module division. Specifically, a reasonable code block size threshold can be set in combination with the functional module division of the application. For example, each functional module corresponds to a sub-code block to avoid a code block containing too many functions. The predetermined threshold can also be determined based on actual test data or industry standards. For example, a reasonable code block size threshold can be obtained by analyzing the test data of the existing vehicle-mounted system. Alternatively, the relevant standards or best practices in the industry can also be referred to to determine a suitable predetermined threshold.

[0047] In this way, splitting a large application code block into multiple relatively independent sub-code blocks can reduce the complexity of a single sub-block, thereby simplifying the secure boot verification process; after splitting the code block, only the required sub-code block needs to be loaded and verified, rather than the entire large application code block, which can speed up the overall system startup speed; the dependencies between the split sub-code blocks are reduced, and if one of the sub-blocks is tampered with, it will not affect other sub-blocks, thereby reducing the security risk of the overall system. At the same time, differentiated secure boot strategies can be adopted for different sub-code blocks according to specific circumstances to improve the security and reliability of the overall system. When a sub-code block is really needed, it can be loaded and securely verified, thereby saving system resources.

[0048] In block 230, a group of candidate acceleration tools associated with the security module to be started is determined, and a corresponding candidate acceleration tool in the group of candidate acceleration tools can start a corresponding sub-application code block in the plurality of sub-application code blocks, and in block 240, the corresponding sub-application code block is started using the corresponding candidate acceleration tool. In this way, the startup of the entire security module to be started can be achieved by starting each sub-application code block at the same time.

[0049] In one embodiment, the candidate acceleration tool may include an algorithm tool. Corresponding algorithm tools can be selected for specific hardware security modules. For example, for the AES core and HASH core of Infineon TC397, corresponding AES-CMAC-256 and HASH-256 algorithms can be selected, which will be introduced in more detail below. In order to simplify key management, encryption and decryption algorithms of the same type can be selected, such as symmetric algorithms or asymmetric algorithms. At the same time, the key length is kept consistent as much as possible, so that keys can be reused and the complexity of key management is reduced. When selecting an algorithm, not only hardware support should be considered, but also the security and computing performance of the algorithm should be weighed to meet the system's secure boot requirements.

[0050] In one embodiment, the candidate acceleration tool may also be used to process a bootloader, a user configuration information module, a vehicle calibration data module, etc., which will be described in more detail below.

[0051] In some embodiments, in response to determining that the security module to be started includes a boot loader module, it can be determined whether to update the security module to be started, and in response to determining that the security module to be started is updated, it can be determined whether to update the boot loader module, and in response to determining that the boot loader module is updated, at least one tool in a set of candidate acceleration tools is used to obtain the current boot loader module digest for the boot loader module. Finally, the current boot loader module digest is stored in the security module to be started. In this way, the integrity of the boot loader module is ensured, and its information is saved in the security module for the subsequent security verification of the boot loading process, thereby improving the overall security of the system.

[0052] In some embodiments, it can be determined that the security module to be started includes a user configuration information module, and in response to determining that the security module to be started is updated and the boot loader module is not updated, at least one tool in a set of candidate acceleration tools is used to obtain a current user configuration information module summary for the user configuration information module, and finally, the current user configuration information module summary is stored in the security module to be started. Thus, the integrity of the user configuration information module is ensured, and its information is saved in the security module for security verification of the subsequent startup process. Even if the boot loader module does not need to be updated, the security of the user configuration information still needs to be protected.

[0053] In some embodiments, in response to determining that the security module to be started is not updated, at least one candidate acceleration tool in a group of candidate acceleration tools can be used to obtain a user configuration information module summary to be compared for the user configuration information module, and in response to determining that the user configuration information module summary to be compared is consistent with the current user configuration information module summary, the user configuration module information is loaded to verify the integrity of the user configuration information module. In this way, without the need to update the security module, the consistency of the user configuration information is ensured by comparing the summary information, unnecessary module updates are avoided, and the efficiency of system startup is improved.

[0054] In some embodiments, it can be determined that the security module to be started includes a vehicle calibration data module, and then at least one candidate acceleration tool in a group of candidate acceleration tools is used to obtain a summary of the vehicle calibration data module to be compared for the vehicle calibration data module, and then in response to determining that the summary of the vehicle calibration data module to be compared is consistent with the preset vehicle calibration data module summary, the vehicle calibration data module information is loaded to verify the integrity of the vehicle calibration data module. In the case of no need to update the security module, the consistency of the vehicle calibration data is ensured by comparing the summary information, unnecessary module updates are avoided, and the efficiency of system startup is improved.

[0055] In some embodiments, at least one candidate acceleration tool from a group of candidate acceleration tools can be used to obtain the digests of each sub-application code block to be compared of the corresponding sub-application code block, and in response to determining that the digests of each sub-application code block to be compared are consistent with the digests of each preset sub-application code block, the corresponding sub-application code block is started, thereby ensuring that each sub-application code block undergoes integrity verification before startup, thereby improving the security and reliability of the system.

[0056] In some embodiments, each of the multiple sub-application code blocks can also be numbered based on the running order. By numbering the sub-application code blocks, it can be ensured that they can be started in the expected order, which can provide a more stringent security guarantee for the system startup process.

[0057] The following will specifically introduce a complete exemplary embodiment according to the present disclosure in conjunction with the Infineon MCU TC397 chip design. This chip provides a secure encryption and decryption environment, secure key storage, hardware-accelerated encryption and decryption algorithms, and a true random number generator. Compared with pure software encryption and decryption, these hardware acceleration functions have many advantages, such as not occupying precious CPU resources, faster computing speed, and can use different encryption modules and algorithms for parallel computing at the same time.

[0058] In this embodiment, in the preparation stage before development, the various modules and related data involved in the project startup process can be fully collected first, and a detailed risk analysis can be performed on them. Through this step, it is possible to accurately determine which key parts need to implement a secure startup check to ensure the integrity and confidentiality of key data. In addition, based on an in-depth study of the functions of the hardware security module, it is also necessary to determine the types of hardware acceleration algorithms available, and in combination with the specific needs of the customer, sort out the specific algorithms used by each hardware acceleration module and the key information required.

[0059] Further, in this embodiment, the entire development process can be divided into two parts: the software update part and the secure boot part. The software update part is responsible for generating summary or fingerprint data for each code block using the previously determined algorithm and key information when the system software is upgraded, and storing it securely in the hardware security module to prepare for the subsequent secure boot verification. The secure boot part is responsible for performing step-by-step integrity verification of these code modules when the system starts. When all modules are verified, the system starts and runs smoothly.

[0060] In this embodiment, in order to further improve the efficiency of secure booting of large-capacity code, the "fast secure booting" technology according to various embodiments of the present disclosure can be adopted. Specifically, as mentioned above, the large-capacity code can be split into multiple smaller code blocks in advance to keep them consistent with the summary blocks generated when the software is updated. Then, different computing cores in the hardware security module are used to run different encryption algorithms in parallel to perform synchronous verification on these small code blocks. Only when all small blocks have passed the verification, the system allows the corresponding large-capacity code to be started. The detailed operation will be described below.

[0061] In this embodiment, the modules that need to be securely started can be sorted out first. When designing a secure boot mechanism, it is necessary to first sort out the modules that need to be securely verified. Usually including Bootloader, user configuration information module, user configuration information module, vehicle calibration data module, and one or more application code blocks. These modules involve key functions and data of the system. Once tampered with or damaged, it will seriously affect the normal operation of the system, so they need to be included in the verification scope of secure boot.

[0062] Furthermore, large code blocks can be split. For large application code blocks, in order to improve the efficiency of secure startup, they can be split into multiple smaller code blocks. Each small block needs to be verified for integrity. If all small blocks pass the verification, the entire large block can be started normally.

[0063] Specifically, the large-capacity application code can be divided into multiple small blocks, and each small block can be numbered, such as Block1, Block2, Block3, etc. Ensure that the size of each small block does not exceed the maximum processing capacity of the hardware security module. For example, the AES-CMAC-256 module of the TC397 chip can process up to 4KB of data at a time. The purpose of numbering is to accurately locate the corresponding small block in the subsequent summary calculation and verification process.

[0064] Further, the encryption and decryption algorithm and key can be determined. For example, the encryption and decryption algorithm that can be used can be determined based on the function manual of the selected hardware security module (such as the TC397 chip). In one embodiment, HASH-256 and AES-CMAC-256 can be used as acceleration tools. For example, HASH-256 can be used to calculate the summary value of each module, and AES-CMAC-256 can be used to verify the integrity of a small block of application code. Further, a 256-bit key can be selected, such as "HsS95JhUkRvdgK80BiwvfSwCkTjXSyFs". This key will be used in subsequent summary calculations and verifications. Selecting a symmetric algorithm can make key management relatively simple, without the need to maintain a public-private key pair. The purpose of selecting a 256-bit key is to improve security and resist brute force cracking.

[0065] Next, the summary can be calculated and stored in the software update process. When updating the system software, it is necessary to calculate the summary of each module and store it securely in the hardware security module to prepare for the subsequent secure boot verification. Specifically, when updating the Bootloader, the HASH-256 algorithm can be used to calculate the summary of the Bootloader and store it in the hardware security module. When updating other modules (such as user configuration information module, vehicle calibration data module, application code block), the user configuration information block and vehicle calibration data block can be calculated using HASH-256 and stored in the hardware security module. For large-capacity application code blocks, first split them into multiple small blocks, and then use HASH-256 and AES-CMAC-256 to calculate the summary for each small block, and store them one by one in the hardware security module. In this way, when the system software is updated, the summary information of each module can be securely saved in the hardware security module to prepare for the subsequent secure boot verification.

[0066] Furthermore, a secure boot process can be performed. When the system starts, each module needs to be verified for integrity in turn. If all verifications pass, the system starts and runs normally. Specifically, the HASH-256 algorithm can be used to calculate the summary of the user configuration information block and compare it with the summary stored in the hardware security module. If they are consistent, the user configuration information is loaded; otherwise, the secure boot process ends. The HASH-256 algorithm can be used to calculate the summary of the vehicle calibration data block and compare it with the summary stored in the hardware security module. If they are consistent, the vehicle calibration data is loaded; otherwise, the secure boot process ends.

[0067] For the application code block, you can first split it into multiple small blocks, and then use the HASH-256 and AES-CMAC-256 algorithms to calculate the digest of each small block, and compare it with the digest stored in the hardware security module. If all small blocks are verified, the entire application code block will start normally. Through such a secure startup process, the integrity and legitimacy of the key modules of the system can be ensured, effectively preventing various software attacks and improving the security of the entire system.

[0068] This secure boot mechanism based on hardware security modules fully leverages the advantages of chip-level security functions, and while protecting system security, it significantly improves boot efficiency through innovative parallel verification methods. It can not only be widely used in various embedded systems, but also provide a reliable technical reference for more safety-critical projects in the future.

[0069] Figure 3 A schematic block diagram of a code startup device 300 according to some embodiments of the present disclosure is shown; the device 300 may be included in Figure 1 in or as computing device 103 .

[0070] like Figure 3 As shown, the device 300 includes: a security module to be started determining component 301, configured to determine the security module to be started in the hardware security module, wherein the security module to be started includes at least one application code block; a sub-application code block acquisition component 303, configured to split the application code block into multiple sub-application code blocks in response to determining that the amount of data of the application code block is greater than a predetermined threshold; a candidate acceleration tool determination component 305, configured to determine a group of candidate acceleration tools associated with the security module to be started, and corresponding candidate acceleration tools in the group of candidate acceleration tools can start corresponding sub-application code blocks in multiple sub-application code blocks; and a sub-application code block starting component 307, using the corresponding candidate acceleration tool to start the corresponding sub-application code block.

[0071] In some embodiments, the component 301 for determining the security module to be started can also be configured to: in response to determining that the security module to be started includes a boot loader module, determine whether to update the security module to be started; in response to determining that the security module to be started is updated, determine whether to update the boot loader module; in response to determining that the boot loader module is updated, use at least one tool from a group of candidate acceleration tools to obtain a current boot loader module summary for the boot loader module; and store the current boot loader module summary to the security module to be started.

[0072] In some embodiments, the component 301 for determining the security module to be started can also be configured to: determine that the security module to be started includes a user configuration information module; in response to determining that the security module to be started is updated and the boot loader module is not updated, use at least one tool from a set of candidate acceleration tools to obtain a current user configuration information module summary for the user configuration information module; and store the current user configuration information module summary to the security module to be started.

[0073] In some embodiments, the device 300 can also be configured to: in response to determining that the security module to be started is not updated, use at least one candidate acceleration tool from a group of candidate acceleration tools to obtain a user configuration information module summary to be compared for the user configuration information module; and in response to determining that the user configuration information module summary to be compared is consistent with the current user configuration information module summary, load the user configuration module information.

[0074] In some embodiments, the device 300 can also be configured to: determine that the safety module to be started includes a vehicle calibration data module; use at least one candidate acceleration tool from a group of candidate acceleration tools to obtain a vehicle calibration data module summary to be compared for the vehicle calibration data module; and in response to determining that the vehicle calibration data module summary to be compared is consistent with a preset vehicle calibration data module summary, load the vehicle calibration data module information.

[0075] In some embodiments, the sub-application code block startup component 307 can also be configured to: use at least one candidate acceleration tool from a group of candidate acceleration tools to obtain each sub-application code block digest to be compared of the corresponding sub-application code block; and in response to determining that each sub-application code block digest to be compared is consistent with each preset sub-application code block digest, start the corresponding sub-application code block.

[0076] In some embodiments, the apparatus 300 may also be configured to: number each of the plurality of sub-application code blocks based on the running order; or inject a key of the same length into each candidate acceleration tool of a group of candidate acceleration tools.

[0077] Figure 4 FIG. 4 is a block diagram of a computing device 400 capable of implementing various embodiments of the present disclosure. The electronic device 400 may be used to implement Figure 2 The operations in the method 200 shown may be used to at least partially implement Figure 1 103 shown in . Electronic device 400 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0078] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0079] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0080] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).

[0081] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0082] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0083] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0084] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0085] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0086] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0087] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0088] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A code startup method, It is characterized in that include: Determine a security module to be started in the hardware security module, wherein the security module to be started includes at least one application code block; In response to determining that the data amount of the application code block is greater than a predetermined threshold, splitting the application code block into a plurality of sub-application code blocks; Determine a group of candidate acceleration tools associated with the security module to be started, wherein corresponding candidate acceleration tools in the group of candidate acceleration tools can start corresponding sub-application code blocks in the plurality of sub-application code blocks; as well as The corresponding sub-application code block is started using the corresponding candidate acceleration tool.

2. The method according to claim 1, It is characterized in that Determine the security module to be started in the hardware security module including: In response to determining that the security module to be started includes a boot loader module, determining whether to update the security module to be started; In response to determining that the security module to be started is updated, determining whether to update the boot loader module; In response to determining to update the boot loader module, obtaining a current boot loader module digest for the boot loader module using at least one tool from a set of candidate acceleration tools; and The current boot loader module digest is stored in the security module to be started.

3. The method according to claim 2, It is characterized in that Determine the security module to be started in the hardware security module including: Determining that the security module to be started includes a user configuration information module; In response to determining that the security module to be started is updated and the boot loader module is not updated, obtaining a current user configuration information module summary for the user configuration information module using at least one tool from a group of candidate acceleration tools; and The current user configuration information module summary is stored in the security module to be started.

4. The method according to claim 3, It is characterized in that include: In response to determining that the to-be-started security module is not to be updated, obtaining a to-be-compared user configuration information module summary for the user configuration information module by using at least one candidate acceleration tool from a group of candidate acceleration tools; as well as In response to determining that the to-be-compared user configuration information module digest is consistent with the current user configuration information module digest, user configuration module information is loaded.

5. The method according to claim 4, It is characterized in that include: Determining that the safety module to be activated includes a vehicle calibration data module; Obtaining a to-be-compared vehicle calibration data module summary for a vehicle calibration data module using at least one candidate acceleration tool from a group of the candidate acceleration tools; as well as In response to determining that the to-be-compared vehicle calibration data module digest is consistent with a preset vehicle calibration data module digest, vehicle calibration data module information is loaded.

6. The method according to claim 1 or 4, It is characterized in that Using the corresponding candidate acceleration tool to start the corresponding sub-application code block includes: Using at least one candidate acceleration tool from a group of the candidate acceleration tools to obtain the summaries of each to-be-compared sub-application code block of the corresponding sub-application code block; and In response to determining that the digests of each of the to-be-compared sub-application code blocks are consistent with the digests of each of the preset sub-application code blocks, the corresponding sub-application code blocks are started.

7. The method according to claim 1, It is characterized in that include: Numbering each sub-application code block in the plurality of sub-application code blocks based on a running order; or A key of the same length is injected into each candidate acceleration tool of a group of the candidate acceleration tools.

8. A code activation device, It is characterized in that include: A security module to be started determining component is configured to determine a security module to be started in the hardware security module, wherein the security module to be started includes at least one application code block; a sub-application code block acquisition component, configured to split the application code block into a plurality of sub-application code blocks in response to determining that the amount of data of the application code block is greater than a predetermined threshold; A candidate acceleration tool determination component is configured to determine a group of candidate acceleration tools associated with the security module to be started, wherein a corresponding candidate acceleration tool in the group of candidate acceleration tools can start a corresponding sub-application code block in the plurality of sub-application code blocks; as well as The sub-application code block startup component uses the corresponding candidate acceleration tool to start the corresponding sub-application code block.

9. An electronic device, the device include: one or more processors; as well as A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Code file intelligent analysis method and device, electronic equipment and storage medium

    CN119577761A