A vehicle communication security authentication method and system based on hierarchical dynamic keys
Through the layered dynamic key architecture and advanced encryption algorithms, the balance problem between security, real-time and computing power consumption of the vehicle communication system is solved, and a comprehensive security protection system is built to resist data eavesdropping and attacks, ensuring the security and real-time performance of communications.
Patent Information
- Application Number
- CN202511053130.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-30
AI Technical Summary
Existing in-vehicle communication systems find it difficult to achieve a good balance between security, real-time performance, and computing power consumption. The traditional CAN bus lacks encryption and identity authentication, and faces risks such as data eavesdropping, message forgery, and replay attacks. Existing solutions fail to effectively respond to high-frequency security threats.
A hierarchical dynamic key architecture is adopted, including a master key (MK), a work key (WK), and a session key (SK). Keys are generated and updated through a hardware security module. Combined with the Advanced Encryption Standard (AES) and counter mode (CTR/CBC) encryption algorithms, an anti-replay attack and identity authentication mechanism is built to ensure the security and real-time performance of data transmission.
It achieves the goal of reducing computing power consumption while ensuring communication security, building a comprehensive security protection system to resist data eavesdropping, replay attacks and message tampering, and meet the real-time requirements of in-vehicle communications.
Smart Images

Figure CN120602928B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of vehicle-mounted control systems, and in particular relates to a vehicle-mounted communication security authentication method and system based on hierarchical dynamic keys. Background Art
[0002] With the rapid advancement of automotive intelligence, the number of in-vehicle electronic control units (ECUs) has exploded. ECUs rely on the CAN bus for real-time communication of critical control signals, such as brakes and accelerators. The security of these communications directly impacts driving safety and the protection of passengers' lives and property. However, the traditional CAN bus, designed in its early stages, prioritized real-time performance and efficiency, leaving it largely devoid of security mechanisms. The lack of protections like encryption and identity authentication has exposed the communication process to multiple risks, including data eavesdropping, message forgery, and replay attacks. In particular, malicious attackers who eavesdrop on critical signal data or forge or replay control commands can cause serious consequences, such as brake failure and powertrain anomalies, posing a significant threat to vehicle safety and reliability. Furthermore, the computing power of existing ECUs varies, placing a significant burden on advanced encryption algorithms running on lower-power ECUs. Striking a key challenge in the in-vehicle communications field is how to ensure communication security while meeting real-time requirements.
[0003] Existing research focuses on dynamic key generation, lightweight encryption algorithms, and authentication mechanism optimization. For example, Chinese patent CN117714055A proposes generating public-private key pairs based on ECU identity information, using asymmetric encryption for key distribution, and combining timestamps and message authentication codes for data integrity verification. Chinese patent CN119172175A utilizes quantum random numbers to dynamically generate keys and updates the encryption state by correlating historical CAN frames, achieving lightweight resistance to replay attacks. Chinese patent CN119728104A encrypts only critical signals and reduces ECU computing power consumption by infrequently updating session keys. While these solutions have improved the security of in-vehicle communications to some extent, they still have significant shortcomings. Asymmetric encryption schemes based on identity information face the challenge of complex key management, increasing system operation and maintenance costs. Mechanisms that rely on historical data or hardware synchronization are less adaptable to complex and changing in-vehicle communication environments and are prone to key update delays. While infrequent session key updates reduce computing power, they also weaken the system's anti-attack capabilities, making it difficult to effectively address high-frequency security threats. In summary, existing solutions fail to achieve a good balance between security, real-time performance, and computing power consumption. A better vehicle communication security authentication method and system are urgently needed to solve the above problems. Summary of the Invention
[0004] The purpose of the present invention is to provide a vehicle communication security authentication method and system based on hierarchical dynamic keys, aiming to solve the problems raised in the above background technology.
[0005] The present invention is implemented as follows: on the one hand, a vehicle communication security authentication method based on hierarchical dynamic keys, the method comprising:
[0006] During the vehicle manufacturing phase, the OEM generates a master key, stores it in the hardware security module boot configuration area, and locks it with a hardware fuse, allowing access only through hardware-signed instructions.
[0007] The supplier triggers the derivation of the master key through the application programming interface. The working key is generated by encrypting the master key and a random number generated by a true random number generator through the Advanced Encryption Standard and is periodically updated according to the chain iteration rule.
[0008] The current working key is XORed with the fresh value generated by the built-in frame counter of the hardware security module to generate the session key, thus building an anti-replay attack mechanism.
[0009] The session key is used to encrypt the original data in Advanced Encryption Standard-Counter Mode to generate a 16-byte ciphertext. Based on the original data, the session key, and the freshness value, a message authentication code is generated in Advanced Encryption Standard-Cipher Block Chaining Mode, and the last 56 bits are intercepted as the intercepted message verification code.
[0010] The 16-byte ciphertext, 1-byte freshness value, and 7-byte intercepted message verification code are combined into a 24-byte data field and transmitted through the data forwarding module in the standard CAN frame format;
[0011] The receiving end calculates the difference between the received freshness value and the local frame counter. If it is less than or equal to the preset threshold, the data is considered fresh; otherwise, it is discarded.
[0012] The ciphertext is decrypted using the session key, and the intercepted message verification code is recalculated based on the decrypted data, the session key, and the fresh value. If it matches the received intercepted message verification code, the authentication is passed, and the local frame counter is incremented by one to achieve timing synchronization.
[0013] As a further solution of the present invention, the freshness value generation method includes:
[0014] The hardware security module secure storage area presets the initial counter value, and each electronic control unit is allocated an independent counter;
[0015] Each time a frame of valid data is sent or received, the counter automatically increases by one;
[0016] When the preset maximum value is reached, the working key is updated and the counter is reset, with the lowest 8 bits of the counter as the fresh value.
[0017] As a further embodiment of the present invention, in another aspect, a vehicle communication security authentication system based on hierarchical dynamic keys includes:
[0018] Hardware security module, used to isolate from the MCU through a firewall to build a secure and trusted execution environment;
[0019] The hardware security module includes a secure storage area, a true random number generator and a cryptographic operation unit;
[0020] The data forwarding module is used to receive the original CAN bus data from the application layer, forward it to the hardware security module for encryption and message authentication code authentication, encapsulate the encrypted data into a 24-byte data field, and transmit it to the CAN bus driver module
[0021] A multi-level key architecture, comprising:
[0022] Master key, used to derive working keys;
[0023] Working key, used to generate session key;
[0024] Session key, used for data encryption and decryption;
[0025] An anti-replay attack module is used to implement anti-replay attack by verifying the difference of frame counters;
[0026] The identity authentication module is used to implement identity authentication by verifying the intercepted message verification code.
[0027] As a further solution of the present invention, the chain iteration rule of the working key is:
[0028] When a vehicle leaves the factory, the vehicle gateway hardware security module generates a random number and distributes it to each electronic control unit. The electronic control unit uses the random number and the master key as input to generate an initial working key through advanced encryption standard encryption;
[0029] When a preset period or counter threshold is reached, a next-generation working key is generated using the current working key and the random number as input;
[0030] When a serious security incident occurs, the electronic control unit requests a new random number from the gateway and re-executes the key generation process.
[0031] The present invention provides a vehicle communication security authentication method and system based on hierarchical dynamic keys, which has the following beneficial effects:
[0032] Hierarchical key architecture: MK-WK-SK three-level key hierarchy, MK does not participate in direct encryption, WK is periodically updated in a chain, and SK is dynamically generated in real time, balancing key security and management complexity.
[0033] Lightweight security mechanism: FV uses the lowest 8 bits of the counter and TMAC intercepts 56 bits to reduce computing power consumption; the AES-CTR and AES-CBC combined algorithm is suitable for low-computing-power ECUs while taking into account real-time performance.
[0034] Multi-dimensional security protection: HSM hardware isolation ensures key storage security, the anti-replay module resists timing attacks, and the identity authentication module prevents data tampering, building a comprehensive security system. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The present invention is a key generation flow chart of a vehicle communication security authentication method based on hierarchical dynamic keys.
[0036] Figure 2 The present invention is an identity authentication flow chart of an in-vehicle communication security authentication method based on hierarchical dynamic keys. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0038] The specific implementation of the present invention is described in detail below with reference to specific embodiments.
[0039] The present invention provides a vehicle communication security authentication method and system based on hierarchical dynamic keys, which solve the technical problems in the background technology.
[0040] A system architecture of a vehicle communication security authentication system based on hierarchical dynamic keys includes:
[0041] Hardware Security Module (HSM): Isolated by a firewall, it includes a secure storage area (storing MK, WK, and other keys), a TRNG (generating true random numbers), and a cryptographic operation unit (performing AES encryption, CMAC calculations, etc.), ensuring the security of key generation and storage.
[0042] Data forwarding module (PDUR): realizes the interaction between application layer data and HSM, completes the format encapsulation of encrypted data (24-byte data field: 16-byte ciphertext + 1-byte FV + 7-byte TMAC), and ensures the standardized transmission of data on the CAN bus.
[0043] Multi-level key architecture: Master Key (MK): Generated by the OEM when the vehicle leaves the factory, stored in the HSM startup configuration area and locked by hardware fuse. It is only used to derive WK and does not directly participate in encryption, ensuring the security of the root key.
[0044] Working Key (WK): Generated through MK and TRNG random numbers, shared by all ECUs, and periodically updated according to chain iteration rules (e.g., WK1=AES(MK,R), WKi=AES(WKi-1,R)), taking into account both key dynamics and management efficiency.
[0045] Session key (SK): generated by real-time XOR of the current WK and FV, one-time key, reducing the risk of key leakage, and adapting to low-computing-power ECUs.
[0046] Anti-replay attack module: Determines data freshness and defends against replay attacks by performing a difference check of the frame counter FV (the difference between the local counter at the receiving end and the received FV is ≤ the threshold).
[0047] Identity authentication module: Recalculates TMAC based on the decrypted original data, SK and FV, and compares it with the received TMAC to ensure that the data has not been tampered with, achieving two-way authentication.
[0048] A method flow of a vehicle communication security authentication method based on hierarchical dynamic keys includes:
[0049] Key initialization and derivation: The MK is stored as the root key in the HSM secure area. The WK is generated by encrypting the MK and a random number using AES. This system supports periodic updates and mandatory updates triggered by security events, ensuring that the key cannot be reversed.
[0050] Real-time encryption authentication: SK is dynamically generated by WK and FV. AES-CTR mode is used to encrypt data to ensure confidentiality. AES-CBC mode generates CMAC and intercepts TMAC to ensure integrity. The 24-byte fixed encapsulation format is adapted to real-time transmission on the CAN bus.
[0051] Receiver verification: Anti-replay is achieved through FV difference verification, and identity authentication is achieved through TMAC comparison. After successful authentication, the counter is synchronized to ensure communication timing consistency.
[0052] The above embodiment of the present invention provides a vehicle communication security authentication method based on hierarchical dynamic keys, and provides a vehicle communication security authentication system based on hierarchical dynamic keys. Through the MK-WK-SK three-level hierarchical key architecture, the master key (MK) is hardware-fused and isolated for storage and is only used to derive the working key (WK). The WK is periodically updated based on the chain iteration rule. The session key (SK) is generated in real time by XORing the WK and the fresh value of the frame counter (FV). While ensuring the key dynamicity, non-retrospectibility and storage security, the FV uses the lowest 8 bits of the counter and the 5 bits after the TMAC is intercepted. The 6-bit lightweight design, combined with the AES-CTR and AES-CBC combined encryption algorithms, effectively reduces the computational burden of low-computing-power ECUs and meets the real-time requirements of in-vehicle communications. Through the hardware security module (HSM) to isolate key storage, the anti-replay attack module to verify the freshness based on the frame counter difference, and the identity authentication module to compare the integrity of the intercepted message verification code (TMAC), a multi-dimensional security protection system covering key generation, data transmission timing and interactive content is constructed to comprehensively resist risks such as data eavesdropping, replay attacks and message tampering, achieving an optimized balance between security, real-time performance and computing power consumption.
[0053] In order to enable the above-mentioned method and system to be loaded and run smoothly, in addition to the various modules mentioned above, the system may also include more or fewer components than described above, or a combination of certain components, or different components, for example, it may include input and output devices, network access devices, buses, processors and memories, etc.
[0054] The processor may be a central processing unit, other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The processor is the control center of the system, connecting various components using various interfaces and lines.
[0055] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0056] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
[0057] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A vehicle communication security authentication method based on hierarchical dynamic keys, characterized in that: The method comprises: During the vehicle manufacturing phase, the OEM generates a master key, stores it in the hardware security module boot configuration area, and locks it with a hardware fuse, allowing access only through hardware-signed instructions. The supplier triggers the derivation of the master key through the application programming interface. The working key is generated by encrypting the master key and a random number generated by a true random number generator through the Advanced Encryption Standard and is periodically updated according to the chain iteration rule. The current working key is XORed with the fresh value generated by the built-in frame counter of the hardware security module to generate the session key, thus building an anti-replay attack mechanism. The session key is used to encrypt the original data in Advanced Encryption Standard-Counter Mode to generate a 16-byte ciphertext. Based on the original data, the session key, and the freshness value, a message authentication code is generated in Advanced Encryption Standard-Cipher Block Chaining Mode, and the last 56 bits are intercepted as the intercepted message verification code. The 16-byte ciphertext, 1-byte freshness value, and 7-byte intercepted message verification code are combined into a 24-byte data field and transmitted through the data forwarding module in the standard CAN frame format; The receiving end calculates the difference between the received freshness value and the local frame counter. If it is less than or equal to the preset threshold, the data is considered fresh; otherwise, it is discarded. The ciphertext is decrypted using the session key, and the intercepted message verification code is recalculated based on the decrypted data, the session key, and the fresh value. If it matches the received intercepted message verification code, the authentication is passed, and the local frame counter is incremented by one to achieve timing synchronization.
2. The vehicle communication security authentication method based on hierarchical dynamic keys according to claim 1 is characterized in that: The method for generating the fresh value includes: The hardware security module secure storage area presets the initial counter value, and each electronic control unit is allocated an independent counter; Each time a frame of valid data is sent or received, the counter automatically increases by one; When the preset maximum value is reached, the working key is updated and the counter is reset, with the lowest 8 bits of the counter as the fresh value.
3. A vehicle communication security authentication system based on hierarchical dynamic keys, characterized in that: The vehicle communication security authentication method based on hierarchical dynamic keys according to any one of claims 1 to 2 is applied, wherein the system comprises: Hardware security module, used to isolate from the MCU through a firewall to build a secure and trusted execution environment; The hardware security module includes a secure storage area, a true random number generator and a cryptographic operation unit; The data forwarding module is used to receive the original CAN bus data from the application layer, forward it to the hardware security module for encryption and message authentication code authentication, encapsulate the encrypted data into a 24-byte data field, and transmit it to the CAN bus driver module A multi-level key architecture, comprising: Master key, used to derive working keys; Working key, used to generate session key; Session key, used for data encryption and decryption; An anti-replay attack module is used to implement anti-replay attack by verifying the difference of frame counters; The identity authentication module is used to implement identity authentication by verifying the intercepted message verification code.
4. The vehicle communication security authentication system based on hierarchical dynamic keys according to claim 3 is characterized in that: The chain iteration rule of the working key is: When a vehicle leaves the factory, the vehicle gateway hardware security module generates a random number and distributes it to each electronic control unit. The electronic control unit uses the random number and the master key as input to generate an initial working key through advanced encryption standard encryption; When a preset period or counter threshold is reached, a next-generation working key is generated using the current working key and the random number as input; When a serious security incident occurs, the electronic control unit requests a new random number from the gateway and re-executes the key generation process.
Citation Information
Patent Citations
In-vehicle network communication method based on identity information
CN117714055A
Dynamic flow encryption authentication communication method and system capable of detecting CAN replay attack
CN119172175A
Lightweight communication encryption method and device among multiple ECUs in vehicle
CN119728104A
Enhanced automobile CANFD network security communication method and system
CN118869271A
Authentication method and system based on Ksession shared session key MAC
CN119583064A