Lightweight communication encryption method and device among multiple ECUs in vehicle
By introducing a lightweight communication encryption method between the ECUs in the car, the communication between the ECUs in the car is encrypted using a random number generator and the CAN frame encryption list, the contradiction between security and computing power requirements in the traditional method is solved, and efficient and secure information interaction is achieved.
Patent Information
- Application Number
- CN202411855912.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-28
AI Technical Summary
There are security risks in existing in-vehicle communications. Traditional encryption methods require high ECU computing power, making it difficult to take into account the simplicity and security of information interaction.
A lightweight communication encryption method between multiple ECUs in the car is adopted. By building a random number generator in the main management node ECU, the entire vehicle owner key and session key are generated, and the CAN frames of important signals are encrypted based on the CAN frame encryption list, while other CAN frames adopt plaintext interaction.
While providing sufficient security, it greatly reduces the computing power demand for ECU, realizes simplicity and security of information interaction, and improves the security and efficiency of the system by combining advanced encryption algorithms and stream cryptography algorithms.
Smart Images

Figure CN119728104A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent vehicles, and in particular to a lightweight communication encryption method and device between multiple ECUs in a vehicle. Background Art
[0002] With the rapid development of automobile intelligence, the number of ECUs (electronic control units) in the whole vehicle is gradually increasing, and the information exchanged between them is also increasing, including some signals related to driving safety, such as brakes, accelerators, etc. At present, the communication between ECUs in the car generally adopts the internationally common CAN communication protocol. CAN is a network protocol that connects the ECU nodes in the car into a physical CAN network, using public plaintext interactive information, and usually leaves an OBD interface on the physical network to facilitate the diagnosis of the working status of each ECU in the car through the diagnostic instrument. This network structure makes the information exchange between each ECU in the car, including with the external diagnostic instrument, simple and efficient, but it also brings great security risks. For example, malicious elements can install a CAN transceiver on the OBD interface to steal the information exchanged between ECUs in the car. At the same time, they can also inject malicious messages into the ECU in the car, such as emergency braking, sudden refueling, etc., which poses a great security threat to vehicles and personnel.
[0003] In the face of these security threats, the common method used to improve the security of the vehicle network is to authenticate the identity of each ECU before formal communication, and use advanced encryption algorithms such as DES or AES to encrypt and decrypt the information exchanged between ECUs during communication. However, these methods are not only difficult to inherit the advantages of simple and efficient information exchange between ECUs in the existing vehicle, but also have high requirements on the computing power of each ECU in the vehicle, and low-computing ECUs are difficult to meet the requirements. Summary of the invention
[0004] In response to the above problems, the present application provides a lightweight communication encryption method and device between multiple ECUs in a vehicle, which can significantly reduce the computing power requirements of the ECU while providing sufficient security.
[0005] The technical solution adopted by the present invention to solve the technical problem is:
[0006] A lightweight communication encryption method between multiple ECUs in a vehicle comprises the following steps:
[0007] S1. Select one ECU from each ECU in the vehicle as the main management node ECU, and build a random number generator into the main management node ECU;
[0008] S2. storing a CAN frame encryption list and a key list in each ECU in the vehicle, wherein the key list includes a master key and a session key;
[0009] 3.1 Read the identity serial number of each ECU in the vehicle and the random number generated by the main management node ECU through the offline encryption manager;
[0010] 3.2 Perform arithmetic operations on the master key preset in the offline encryption manager, the identity serial number of each ECU read in step 3.1, and the random number generated by the main management node ECU to generate the vehicle master key;
[0011] 3.3 Perform arithmetic operations on the session key preset in the offline encryption manager, the identity serial number of each ECU read in step 3.1, and the random number generated by the main management node ECU to generate the vehicle session key;
[0012] 3.4 Send the vehicle master key and vehicle session key obtained in steps 3.2 and 3.3 to each ECU in the vehicle for storage;
[0013] 3.5 The offline encryption manager sends the CAN frame encryption list to each ECU in the vehicle for storage;
[0014] S4. When the ECU sends or receives a CAN frame, it queries the CAN frame encryption list stored in the ECU. If the stored CAN frame encryption list contains the CAN frame to be sent or received, the session key is used to encrypt and decrypt the CAN frame data to be sent or received.
[0015] Furthermore, in step S4, the session key is used in the form of a binary stream cipher to encrypt and decrypt the CAN frame data to be sent.
[0016] Furthermore, in step S4, when querying whether there is a CAN frame to be sent or received in the CAN frame encryption list stored in the ECU, the CAN frame ID number is used as an identifier.
[0017] Furthermore, the CAN frame ID number is defined during the vehicle development stage according to the importance of the signal contained in each CAN frame.
[0018] Further, step S4 includes a session key update procedure, and the session key update procedure includes the following steps:
[0019] A1. Every time the vehicle is powered on, the main management node ECU starts the session key update timer and starts the session key update program at a certain interval;
[0020] A2. The main management node ECU generates a random number through a random number generator, encrypts the random number using the vehicle master key through an advanced encryption algorithm, and sends the encrypted random number to other node ECUs through the CAN network;
[0021] A3. After receiving the encrypted random number, other node ECUs in the vehicle use the vehicle master key to decrypt it through the corresponding advanced encryption algorithm to obtain the random number generated in step A2. After decryption, they send a random number reception completion response message and wait for the synchronization pulse on the synchronization signal line.
[0022] A4. After the main management node ECU receives all the random number reception completion response messages sent by other node ECUs, it performs a bitwise XOR operation on the random number generated in step A2 and the vehicle session key to obtain a new vehicle session key, and generates a synchronization pulse on the synchronization signal line;
[0023] A5. After receiving the synchronization pulse on the synchronization signal line, the other node ECUs in the vehicle perform a bitwise XOR operation on the random number obtained in step A3 and the session key to obtain a new session key.
[0024] Furthermore, a session key update procedure is started every 1 minute;
[0025] Furthermore, the advanced encryption algorithm adopts DES or AES.
[0026] A lightweight in-vehicle communication device adopts a lightweight communication encryption method between multiple ECUs in the vehicle, comprising multiple ECU modules, and the multiple ECU modules are connected through a CAN network and a synchronization signal line.
[0027] Furthermore, the synchronization signal line is a hard line.
[0028] The beneficial effects of the present invention are:
[0029] The embodiment of the present application provides a lightweight communication encryption method and device between multiple ECUs in a vehicle. By defining a CAN frame encryption list in each ECU in the vehicle, only CAN frames containing important signals (such as brakes, accelerators, etc.) are encrypted, and other CAN frames still use plain text for information exchange, which is highly flexible. In addition, in order to ensure security, a session key update management algorithm is designed. In this algorithm, the session key is periodically updated indirectly through the random number of the main management node ECU, and the transmission of the random number from the main management node ECU to other node ECUs adopts an advanced encryption algorithm. Although it takes time to run the advanced encryption algorithm once, the running frequency is low and has little impact on the overall ECU computing power.
[0030] The solution of the present invention can not only meet the information security needs more flexibly while taking into account the advantages of simple and efficient information exchange between the existing ECUs in the vehicle, but also greatly reduce the computing power requirements of the ECU while providing sufficient security by combining a low-frequency running of a highly secure but time-consuming advanced encryption algorithm with a real-time running of a highly efficient stream cipher algorithm, thereby facilitating promotion and use on complete vehicles that currently still use a large number of low-computing-power ECUs. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a technical solution for a lightweight communication encryption method between multiple ECUs in a vehicle provided by an embodiment of the present application;
[0032] Figure 2 Encryption list and key list of CAN frames in each ECU in the car;
[0033] Figure 3 Update algorithm flow chart for session password. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application, and the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by those skilled in the art without creative work on the basis of the embodiments of the present application shall belong to the protection scope of the present application.
[0035] A lightweight communication encryption method between multiple ECUs in a vehicle comprises the following steps:
[0036] S1. Select one ECU from the ECUs in the vehicle as the main management node ECU, and embed a random number generator in the main management node ECU. The main management node ECU is responsible for managing the session key when the ECUs in the vehicle actually interact with each other.
[0037] S2. When the vehicle is off the production line, Figure 2 As shown, a CAN frame encryption list and a key list are stored in each ECU in the vehicle. The key list includes a master key and a session key. The CAN frame encryption list is identified by a CAN frame ID number, which is defined during the vehicle development stage according to the importance of the signal contained in each CAN frame.
[0038] 3.1 Connect the offline encryption manager to the CAN network of the vehicle. The offline encryption manager reads the identity serial number of each ECU in the vehicle and the random number generated by the main management node ECU through the CAN network.
[0039] Since the ID number of the microprocessor in the ECU is globally unique, the identity serial number of the ECU is the ID number of the microprocessor in the ECU.
[0040] 3.2 The key generated by performing arithmetic operations on the master key preset in the offline encryption manager, the identity serial number of each ECU read in step 3.1, and the random number generated by the main management node ECU is used as the master key of the vehicle.
[0041] 3.3 The key generated by performing arithmetic operations on the session key preset in the offline encryption manager, the identity serial number of each ECU read in step 3.1, and the random number generated by the main management node ECU is used as the vehicle session key.
[0042] 3.4 The vehicle master key and vehicle session key obtained in steps 3.2 and 3.3 are sent to each ECU in the vehicle through the CAN network for storage.
[0043] Since each ECU identity serial number is unique and the random number generated by the main management node ECU is random, the vehicle master key and vehicle session key are obtained by performing arithmetic operations using the unique ECU identity serial number and the random number generated by the random main management node ECU, which can ensure the randomness and uniqueness of the vehicle master key and session key.
[0044] 3.5 The offline encryption manager sends the CAN frame encryption list defined in the vehicle development phase to each ECU in the vehicle through the CAN network for storage. At this point, the vehicle production offline configuration is completed, that is, a CAN frame encryption list and a key list are stored in each ECU in the vehicle.
[0045] S4. When the vehicle is actually running, when the ECU sends or receives a CAN frame, it uses the CAN frame ID number as an identifier to query the CAN frame encryption list stored in the ECU. If the stored CAN frame encryption list contains the CAN frame to be sent or received, the session key is used to encrypt and decrypt the CAN frame data to be sent or received.
[0046] Specifically, when each ECU sends a CAN frame, it uses the CAN frame ID number as an identifier to query the CAN frame encryption list stored in the ECU. If the stored CAN frame encryption list contains the CAN frame to be sent, the session key is used to encrypt the CAN frame data to be sent.
[0047] When each ECU receives a CAN frame, it uses the CAN frame ID number as an identifier to query the CAN frame encryption list stored in the ECU. If the stored CAN frame encryption list contains the CAN frame to be received, the session key is used to decrypt the CAN frame data to be received.
[0048] As a specific implementation, the session key described in this embodiment is used in the form of a binary stream cipher to encrypt and decrypt the CAN frame data to be sent.
[0049] The encryption algorithm is shown in Formula 1, and the decryption algorithm is shown in Formula 2.
[0050] c i =m i +k i (mod2) ——Formula 1
[0051] m i =c i +k i (mod2) ——Formula 2
[0052] In the formula, m i Represents the plaintext binary stream of CAN frame data before encryption;
[0053] c i Represents the encrypted binary stream of CAN frame data;
[0054] k i A binary stream representing the current session key.
[0055] Mod2 in Formula 1 and Formula 2 is a bitwise XOR operation in algorithm implementation. The operation is simple and fast, and the demand for ECU computing power is very low.
[0056] Furthermore, the CAN frame data to be sent or received is encrypted and decrypted in the form of a binary stream cipher. Unlike advanced encryption algorithms such as DES or AES, its operation is very simple, so its security mainly depends on the security of the binary key stream, i.e., the session key. In order to ensure sufficient security and resist replay attacks, the session key needs to be changed frequently. To this end, the main management node ECU needs to continuously update the session password and ensure the randomness of the session key and the security of transmission. Figure 3 The specific update steps are as follows:
[0057] A1. Every time the vehicle is powered on, the main management node ECU starts the session key update timer and starts the session key update program at a certain interval.
[0058] As a specific implementation, in this embodiment, the session key update program is started every 1 minute.
[0059] A2. The main management node ECU generates a random number through a random number generator, encrypts the random number using the vehicle master key through an advanced encryption algorithm, and sends the encrypted random number to other node ECUs through the CAN network, and then waits for the response message from other node ECUs indicating that the random number has been received.
[0060] As a specific implementation, the advanced encryption algorithm described in this embodiment adopts DES or AES, etc.
[0061] A3. After receiving the encrypted random number through the CAN network, other node ECUs in the vehicle decrypt it using the vehicle master key through the corresponding advanced encryption algorithm to obtain the random number generated in step A2. After decryption, a random number reception completion response message is sent through the CAN network, and the synchronization pulse on the synchronization signal line is waited for.
[0062] A4. After the main management node ECU receives all the random number reception completion response messages sent by other node ECUs, it performs a bitwise XOR operation on the random number generated in step A2 and the vehicle session key, and uses the result as the new vehicle session key, and immediately generates a synchronization pulse on the synchronization signal line.
[0063] As a specific implementation, the synchronization pulse described in this embodiment adopts a typical rising edge or falling edge level change.
[0064] A5. After receiving the synchronization pulse on the synchronization signal line, the other node ECUs in the vehicle immediately perform a bitwise XOR operation on the random number obtained in step A3 and the session key, and use the result as the new session key. At this point, a session key update process is completed.
[0065] In the session key update management algorithm, the session key is indirectly updated through the random number of the main management node ECU, and the transmission of the random number from the main management node ECU to other node ECUs adopts an advanced encryption algorithm, thereby ensuring the randomness and security of the session password. Although running the advanced encryption algorithm once is time-consuming, the running frequency is low and has little impact on the overall ECU computing power.
[0066] Furthermore, in order to ensure the synchronization of each ECU node when the session key is updated, the synchronization signal line adopts a hard line. The synchronization pulse signal transmitted by the hard line triggers the switching of the session key, and the delay is small, thereby ensuring the synchronization of the session key update.
[0067] like Figure 1 As shown, a lightweight communication device in a vehicle includes multiple ECU modules, and the multiple ECU modules are connected through a CAN network. A synchronization signal line is also provided between each ECU module, and the synchronization signal line adopts a hard line. The communication between each ECU module adopts the lightweight communication encryption method between multiple ECUs in the vehicle described above.
[0068] Other embodiments obtained by those skilled in the art by combining, splitting, reorganizing, etc. the embodiments of the present application on the basis of the embodiments provided in the present application do not exceed the protection scope of the present application.
[0069] The above specific implementation methods have detailed the purpose, technical solutions and beneficial effects of the embodiments of the present application. The above are only specific implementation methods of the embodiments of the present application and are not used to limit the protection scope of the embodiments of the present application. That is, any modifications, equivalent substitutions, improvements, etc. made on the basis of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A lightweight communication encryption method between multiple ECUs in a vehicle, characterized by: The following steps are included: S1. Select one ECU from each ECU in the vehicle as the main management node ECU, and build a random number generator into the main management node ECU; S2. storing a CAN frame encryption list and a key list in each ECU in the vehicle, wherein the key list includes a master key and a session key; 3.1 Read the identity serial number of each ECU in the vehicle and the random number generated by the main management node ECU through the offline encryption manager; 3.2 Perform arithmetic operations on the master key preset in the offline encryption manager, the identity serial number of each ECU read in step 3.1, and the random number generated by the main management node ECU to generate the vehicle master key; 3.3 Perform arithmetic operations on the session key preset in the offline encryption manager, the identity serial number of each ECU read in step 3.1, and the random number generated by the main management node ECU to generate the vehicle session key; 3.4 Send the vehicle master key and vehicle session key obtained in steps 3.2 and 3.3 to each ECU in the vehicle for storage; 3.5 The offline encryption manager sends the CAN frame encryption list to each ECU in the vehicle for storage; S4. When the ECU sends or receives a CAN frame, it queries the CAN frame encryption list stored in the ECU. If the stored CAN frame encryption list contains the CAN frame to be sent or received, the session key is used to encrypt and decrypt the CAN frame data to be sent or received.
2. According to claim 1, a lightweight communication encryption method between multiple ECUs in a vehicle is characterized in that: In step S4, the session key is used in the form of a binary stream cipher to encrypt and decrypt the CAN frame data to be sent.
3. The lightweight communication encryption method between multiple ECUs in a vehicle according to claim 1, characterized in that: In step S4, when querying whether there is a CAN frame to be sent or received in the CAN frame encryption list stored in the ECU, the CAN frame ID number is used as an identifier.
4. The lightweight communication encryption method between multiple ECUs in a vehicle according to claim 3 is characterized in that: The CAN frame ID number is defined during the vehicle development stage according to the importance of the signal contained in each CAN frame.
5. The lightweight communication encryption method between multiple ECUs in a vehicle according to claim 1, characterized in that: Step S4 includes a session key update procedure, wherein the session key update procedure includes the following steps: A1. Every time the vehicle is powered on, the main management node ECU starts the session key update timer and starts the session key update program at a certain interval; A2. The main management node ECU generates a random number through a random number generator, encrypts the random number using the vehicle master key through an advanced encryption algorithm, and sends the encrypted random number to other node ECUs through the CAN network; A3. After receiving the encrypted random number, other node ECUs in the vehicle use the vehicle master key to decrypt it through the corresponding advanced encryption algorithm to obtain the random number generated in step A2. After decryption, they send a random number reception completion response message and wait for the synchronization pulse on the synchronization signal line. A4. After the main management node ECU receives all the random number reception completion response messages sent by other node ECUs, it performs a bitwise XOR operation on the random number generated in step A2 and the vehicle session key to obtain a new vehicle session key, and generates a synchronization pulse on the synchronization signal line; A5. After receiving the synchronization pulse on the synchronization signal line, the other node ECUs in the vehicle perform a bitwise XOR operation on the random number obtained in step A3 and the session key to obtain a new session key.
6. The lightweight communication encryption method between multiple ECUs in a vehicle according to claim 5 is characterized in that: The session key renewal procedure is started every 1 minute.
7. The lightweight communication encryption method between multiple ECUs in a vehicle according to claim 5, characterized in that: The advanced encryption algorithm adopts DES or AES.
8. An in-vehicle lightweight communication device using the in-vehicle multi-ECU lightweight communication encryption method according to any one of claims 1 to 7, characterized in that: It comprises a plurality of ECU modules, and the plurality of ECU modules are connected via a CAN network and a synchronization signal line.
9. The lightweight in-vehicle communication device according to claim 8, characterized in that: The synchronization signal line adopts a hard line.
Citation Information
Cited By
A vehicle communication security authentication method and system based on hierarchical dynamic keys
CN120602928B