Search

CN-122001647-A - Hierarchical key management-based automobile electronic encryption processing system and method

CN122001647ACN 122001647 ACN122001647 ACN 122001647ACN-122001647-A

Abstract

The embodiment of the invention discloses an automobile electronic encryption processing system and method based on hierarchical key management, wherein the system comprises a hierarchical key management module, a hardware acceleration integration module, a security service engine module and a security mode switching module, wherein the hierarchical key management module is used for maintaining a multi-level key system in an MCU (micro control unit) security storage area of a vehicle-mounted microcontroller, responding to a security service request, dynamically decrypting and providing a target application key, the hardware acceleration integration module is used for calling MCU hardware encryption acceleration resources, executing AES GCM encryption and decryption operations based on the target application key, the security service engine module is used for realizing CMAC security authentication operation with double challenge values based on the target application key, and the security mode switching module is used for automatically switching between a factory mode and a user mode according to the starting times or authentication results. The invention realizes high-safety, high-efficiency and high-real-time automobile electronic encryption and authentication in an embedded environment by constructing a three-level key system of a master key, an application key and a session key and combining a hardware acceleration optimization and a double-challenge-value authentication mechanism.

Inventors

  • LUO XIAOPING
  • LIU NINGNING

Assignees

  • 深圳市豪恩汽车电子装备股份有限公司

Dates

Publication Date
20260508
Application Date
20260202

Claims (10)

  1. 1. An automobile electronic encryption processing system based on hierarchical key management, which is applied to an on-vehicle microcontroller MCU, is characterized by comprising: The hierarchical key management module is used for maintaining a multi-level key system in the secure storage area of the MCU, responding to the received secure service request, dynamically decrypting and providing a corresponding target application key based on the type and/or key identifier of the request; The hardware acceleration integration module is used for receiving the target application key provided by the hierarchical key management module, calling the hardware encryption acceleration resource of the MCU and executing AES-GCM encryption and decryption operation based on the target application key; A security service engine module for receiving the target application key provided by the hierarchical key management module and implementing CMAC security authentication operation with double challenge values based on the target application key, and And the safety mode switching module is used for managing the running safety state of the MCU and automatically switching between a factory debugging mode and a user running mode according to predefined state switching conditions.
  2. 2. The system of claim 1, wherein the hierarchical key management module comprises: the key maintenance unit is used for maintaining a multi-level key system, and the key system at least comprises a statically stored master key layer protected by an MCU hardware security module, an application key layer storing at least one application key encrypted by the master key layer and a session key layer dynamically generated by the application key; An application key management unit for decrypting the corresponding application key stored in an encrypted manner by using the master key in the master key layer and providing the decrypted application key to the hardware acceleration integration module or the security service engine module when receiving the service request, and And the session key generation unit is used for responding to the communication encryption request and generating a one-time or short-term valid target session key based on the decrypted application key and the runtime parameters.
  3. 3. The system of claim 1, wherein the hardware acceleration integration module specifically comprises: The fixed parameter configuration unit is used for executing a fixed parameter configuration flow when the system is initialized, loading and verifying a fixed key with a preset bit number, an initialization vector with a preset byte number and additional authentication data with a preset length so as to complete the pre-configuration of the encryption algorithm; The static memory management unit is used for pre-distributing a static memory pool during system initialization, providing a fixed buffer area for encryption context and temporary data, and realizing zero dynamic memory distribution and memory multiplexing during operation; the hardware acceleration integration unit is used for integrating and driving hardware encryption resources arranged in the MCU, and comprises a hardware random number generator, an AES hardware acceleration engine and a GCM mode hardware accelerator; The encryption performance optimization unit is used for executing an encryption performance optimization path and analyzing and performing iterative optimization on algorithm parameters, memory access, calculation paths and parallel processing strategies; a core encryption process execution unit for executing a core encryption process including receiving an encryption request, decrypting a key, initializing an AES-GCM, performing data encryption and authentication tag generation, and outputting an encryption result, and The optimizing effect monitoring unit is used for monitoring encryption time, memory use and hardware accelerator utilization rate, generating a monitoring report, and feeding back an evaluation result to the encryption performance optimizing unit to form a closed-loop optimizing mechanism.
  4. 4. The system of claim 1, wherein the security service engine module comprises: The double-challenge value generation unit is used for receiving a challenge value from external equipment in an external authentication request when the external authentication request is received, generating an internal challenge value by using an MCU internal true random number generator, and combining and splicing the two values into the double challenge value; The dynamic key selection unit is used for executing a dynamic key selection mechanism, and acquiring and decrypting a corresponding target application key from the hierarchical key management module according to the key identifier KeyID in the authentication request; The CMAC authentication calculation unit is used for executing a challenge-response authentication flow, performing AES-CMAC calculation on the double challenge value by using the target application key acquired by the dynamic key selection unit, and generating an authentication code; The key fuzzy processing unit is used for executing a key fuzzy processing mechanism, and immediately clearing a memory and a register for storing the intermediate key and sensitive intermediate data after the CMAC authentication calculation unit finishes calculation or related encryption operation; a core authentication flow control unit for executing core authentication flow to perform timing and logic control for authentication initialization, double challenge value generation, dynamic key selection, CMAC calculation, result verification and key fuzzy processing, and And the security monitoring unit is used for executing a security monitoring flow, monitoring and detecting the time, the key use condition and the abnormal behavior of the authentication process, evaluating the security state and generating a monitoring report.
  5. 5. The system of claim 1, wherein the security mode switching module determines whether a condition for switching from a factory mode to a user mode is satisfied according to the number of starts of the MCU, or an authentication result from the security service engine module, or a combination of both; the system further comprises an application layer interface module, a control module and a control module, wherein the application layer interface module is used for providing a unified security service calling interface for an upper layer application, and the interface at least comprises a CAN communication security interface, a diagnosis service security access control interface and an OTA firmware updating integrity verification interface.
  6. 6. The system of claim 2, wherein the system further comprises: the life cycle management module is used for presetting or learning a new application key in a factory mode, encrypting by using the master key and storing; The method comprises the steps of responding to a key updating instruction or a security event, decrypting an old application key by using the master key, generating a new application key by combining a new random number, updating storage after encryption by using the master key, and safely destroying related information of the old key.
  7. 7. The automobile electronic encryption processing method based on hierarchical key management is characterized by being applied to an on-board microcontroller MCU, and comprises the following steps of: Step S1, a hierarchical key system is established, a master key is generated and stored in an MCU (micro control Unit) safe storage area, and at least one application key is encrypted by using the master key for storage; Step S2, responding to the received secure service request, and dynamically decrypting a corresponding target application key by using the master key based on the type and/or key identifier of the request; Step S3, calling the hardware encryption acceleration resource of the MCU, executing AES-GCM encryption and decryption operation or CMAC authentication operation corresponding to the security service request by using the decrypted target application key, and And S4, automatically switching a security policy between a factory mode and a user mode according to at least one condition of the starting times and the authentication result of the MCU, wherein the factory mode allows key learning and debugging, and the user mode executes strict encryption authentication in running.
  8. 8. The method according to claim 7, wherein the performing CMAC authentication operation in step S3 specifically includes the following steps: The dual-random number source generation flow is that a challenge value from external equipment is received, an internal challenge value is generated by utilizing an MCU internal true random number generator, and the two are combined and spliced into the dual challenge value; A dynamic key selection flow, which is to acquire and decrypt a corresponding target application key from the hierarchical key system according to the key identifier KeyID in the authentication request; A challenge-response authentication flow, namely performing AES-CMAC calculation on the double challenge value by using the target application key to generate an authentication code; The key fuzzy processing flow is that after authentication calculation or related encryption operation is completed, the memory and the register for storing the intermediate key and sensitive intermediate data are immediately cleared; core authentication control flow, namely performing time sequence and logic control on authentication initialization, double-challenge value generation, dynamic key selection, CMAC calculation, result verification and key fuzzy processing, and And a safety monitoring flow, which is to monitor and detect the time of the authentication process, the key use condition and the abnormal behavior, evaluate the safety state and generate a monitoring report.
  9. 9. The method according to claim 7, wherein in the step S3, performing AES-GCM encrypting/decrypting operation includes the following steps: a fixed parameter configuration flow, namely loading and verifying a fixed main key with preset bit number, a preset byte number initialization vector and additional authentication data with preset length when the system is initialized so as to complete the pre-configuration of an encryption algorithm; the static memory management flow is to pre-allocate a static memory pool during system initialization to provide a fixed buffer area for encryption context and temporary data, thereby realizing zero dynamic memory allocation and memory multiplexing during operation; The hardware acceleration integration flow comprises the steps of calling a hardware encryption resource built in an MCU, wherein the hardware encryption resource comprises a hardware random number generator, an AES hardware acceleration engine and a GCM hardware accelerator; the encryption performance optimization flow is to analyze and iterate optimization on algorithm parameters, memory access, calculation paths and parallel processing strategies; the core encryption execution flow comprises receiving encryption request, decrypting key, initializing AES-GCM, performing data encryption and authentication tag generation, and outputting encryption result, and And (3) optimizing the effect monitoring flow, namely monitoring encryption time, memory use and hardware accelerator utilization rate, generating a monitoring report, and feeding back an evaluation result to the encryption performance optimizing flow to form a closed-loop optimizing mechanism.
  10. 10. The method according to any of claims 7 to 9, characterized in that the method further comprises a key lifecycle management step: in a factory mode, a new application key is preset or learned, and the new application key is stored after being encrypted by using the master key; Monitoring the use status of the application key and security events in user mode, and And in response to a key updating instruction or a security event, decrypting the old application key by using the master key, generating a new application key by combining a new random number, updating and storing after the encryption of the master key, and safely destroying the related information of the old key.

Description

Hierarchical key management-based automobile electronic encryption processing system and method Technical Field The embodiment of the invention relates to the technical field of automobile electronic safety, in particular to an encryption system and method for a resource-limited vehicle-mounted Microcontroller (MCU), and particularly relates to an automobile electronic encryption processing system and method based on hierarchical key management. Background With the advanced convergence of intelligent, networking and electromotive technologies of automobiles, especially the rapid development of high-level automatic driving and networking (V2X) technologies, modern automobiles have evolved into highly complex "mobile intelligent terminals". The number of vehicle-mounted Electronic Control Units (ECUs) is increased greatly, and an in-vehicle network (such as CAN, CAN-FD and Ethernet) carries a great amount of key data such as power control, chassis control, automatic driving decision and the like, so that the information security of the vehicle electronic system becomes a core issue related to driving security, personal privacy and even public security. Aiming at the threats of eavesdropping, tampering, replay attack, illegal access to the ECU, firmware tampering and the like possibly suffered by communication inside and outside the automobile, the industry commonly adopts the cryptography technology to construct a security line. At present, the prior art scheme focuses on solving the security challenge of single dimension, has the problem of systemization inadequacy. For example, a number of patents and literature have focused on improving the implementation efficiency of certain encryption algorithms (e.g., lightweight symmetric encryption algorithms) in an in-vehicle environment, or on proposing relatively simple key distribution and update protocols. However, these solutions are difficult to meet the complex, multi-level safety requirements of intelligent automobiles. Specifically, the prior art mainly has the following three defects: First, conventional key management systems suffer from inherent drawbacks: Many existing automotive electronic systems still employ a single-level key management policy, and applications with different security levels (such as core control communication, diagnostic services, over the air OTA) may share or use a key that is roughly managed, so that once a key leaks in a certain link, a systematic security risk is easily caused. The key update mechanism is stiff and lacks a flexible and secure lifecycle management strategy. For the whole key flow from factory production presetting, vehicle-mounted deployment and online updating to final invalidation, a fine state tracking and security updating mechanism is lacking, so that the key is unchanged for a long time or a security hole exists in the updating process. The method has the advantages that the method lacks effective isolation and state-division management strategies for the prefabricated keys required in the factory production debugging stage and the dynamic keys in the actual running process of the vehicle, and the mixed management of the prefabricated keys and the dynamic keys is easy to cause production key residue or leakage, so that potential safety hazards are buried for the subsequent running stage. Secondly, performance and real-time bottlenecks under the limitation of embedded resources: Automobile ECUs as typical embedded devices generally face challenges such as limited computing power, tight memory resources, and strict power consumption constraints. When a high-strength encryption algorithm (such as AES-GCM) with complex calculation is adopted, the millisecond-level delay requirement of high-instantaneity tasks such as vehicle control and real-time communication is difficult to meet without deep optimization. Many encryption solutions exist as universal schemes, and lack of customized optimization for special application scenarios of automotive electronics (such as CAN bus short frame communication, challenge-response mode of diagnostic service, OTA bulk firmware verification) results in low resource utilization or unqualified performance. Resources such as a Hardware Security Module (HSM), a True Random Number Generator (TRNG), a special encryption hardware accelerator and the like which are increasingly popular in a modern automobile-level MCU are not fully mined and utilized, and the coordination between software and hardware is insufficient, so that the encryption performance potential is not fully utilized. Again, the security authentication and protection mechanisms are deficient: Current security authentication mechanisms for services such as on-board diagnostics (OBD) tend to be relatively simple, such as using a fixed password or simple challenge-response, and are prone to replay attacks or brute force attacks, and difficult to cope with increasingly sophisticated means of attack. The lack of a multi-l