A vehicle data message secure communication method
By using encryption and decryption data on the CAN and CAN-FD buses to encrypt and decrypt messages, and adding time and identification marks, the protocol's flaws in authenticity, confidentiality and validity are solved, and eavesdropping, disguise and playback are prevented. attack, significantly improving the security performance of vehicle information communication.
Patent Information
- Application Number
- CN202111518234.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-11
AI Technical Summary
CAN and CAN-FD bus protocols have defects in authenticity, confidentiality, validity and non-repudiation in information security, and are susceptible to eavesdropping, camouflage and playback attacks, leading to serious traffic safety hazards.
By obtaining the encryption and decryption data in each ECU, including the source address, identification, key seed and key, the message is encrypted and transmitted, and decrypted at the receiving end, and a time mark and ordinal mark are added to determine the validity of the message. Prevent replay attacks and prevent masquerading attacks through source address and identifier comparison.
It effectively avoids eavesdropping, camouflage and playback attacks, improves the security performance of vehicle information communication, enhances the defense ability against attacks, and ensures the confidentiality and effectiveness of messages.
Smart Images

Figure CN114422181B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle communication, and in particular to a vehicle data message security communication method. Background Art
[0002] CAN (Controller Area Network) bus is the most important application bus of today's automotive high-speed network. It is connected to ECUs (Electronic Control Units) related to power, body control, comfort and brake safety. Therefore, once the CAN bus is attacked, the consequences will be disastrous. The CAN bus has not considered its information security since its design, and there are many security vulnerabilities. Its too short data field length makes it difficult to directly apply the existing information security algorithms. CAN-FD inherits the main characteristics of the CAN bus and makes up for the shortcomings of the CAN bus bandwidth and data field length, but still does not consider its information security.
[0003] Analyzing the vulnerabilities of the CAN and CAN-FD bus protocols from the perspective of data security, except for the integrity of the information, the authenticity, confidentiality, validity and non-repudiation of the information are not guaranteed.
[0004] Authenticity: There is no sending address in the CAN and CAN-FD bus messages, so it is impossible to tell who sent the message. Any ECU on the bus can send the same ID, and the receiving ECU cannot confirm the authenticity of the received message. Therefore, the attack module can completely disguise and send a message with a certain ID.
[0005] Confidentiality: CAN and CAN-FD bus messages are transmitted in plain text without any encryption, and all ECUs on the bus can receive the messages at the same time, which is not confidential. The attack module can monitor all original messages on the bus in real time.
[0006] Validity: CAN and CAN-FD bus messages do not contain time stamps or ordinal stamps, and the receiving ECU cannot determine whether the received message belongs to a valid time period.
[0007] Non-repudiation: Since the message does not have any identity mark, no ECU can prove that it has sent or received a message.
[0008] According to the above CAN and CAN-FD vulnerabilities, CAN and CAN-FD buses are vulnerable to the following attacks:
[0009] (1) Eavesdropping
[0010] The attack module can collect and save the data on the bus in real time, and then analyze the message protocol of the whole vehicle through the actual vehicle operation and the corresponding message data changes. For example, when the door is manually opened and closed in static state, the corresponding relationship between them can be found according to the data changes of the message. It is relatively easy to analyze a small part of the message protocol, but it is still a lot of work to analyze the control logic of the whole vehicle, which requires arduous reverse analysis. Different car manufacturers have different message protocols. It can be said that this is the most important CAN bus information security defense method in the hands of car manufacturers. However, once the message protocol is reverse parsed, the loss to a certain car manufacturer will be huge, because the message protocol contains a lot of control logic and technical parameters.
[0011] (2) Disguise
[0012] Since the CAN bus message only contains an ID, but no sending and receiving addresses, the attack module can forge and send a certain ID. There are too many ECUs connected to the vehicle CAN bus, including ECUs related to power, body, comfort, brake safety and other systems, such as BMS, VCU and ABS, so once the attack module forges and sends an ID related to power or brake safety, it will cause control conflicts for normal operation and brake safety at best, and cause major traffic safety accidents at worst.
[0013] (3) Playback
[0014] Since there is no time stamp or sequence number in the message, the receiving ECU cannot determine whether the received message is sent in a valid time period. Therefore, the attack module can collect messages from the previous time period and replay them to the bus in the next time period, which will also conflict with real-time control and is no different in severity from a disguised message. Summary of the invention
[0015] The purpose of the present invention is to provide a vehicle data message secure communication method in order to overcome the defects of the above-mentioned prior art.
[0016] The purpose of the present invention can be achieved by the following technical solutions:
[0017] A vehicle data message secure communication method is used for communication between ECUs of a vehicle, wherein the ECUs of the vehicle are connected via a communication bus, and the method comprises the following steps:
[0018] Acquire encryption and decryption data and write them into each of the ECUs, wherein the encryption and decryption data includes encryption and decryption information of each ECU;
[0019] When the ECU sends a message, the message is encrypted according to the encryption and decryption information of the ECU sending the message to form a ciphertext, and is sent to the ECU receiving the message through the bus;
[0020] When the ECU receives a message, it decrypts the received ciphertext according to the encryption and decryption information to obtain a plaintext message.
[0021] Preferably, the encryption and decryption information includes a source address, an identifier, a key seed and a key.
[0022] Preferably, the communication bus is a CAN bus or a CAN-FD bus.
[0023] Preferably, the data segment of the message includes a source address segment, a time period, an identification segment, and an information segment.
[0024] The source address segment includes the source address information of the ECU that sends the message;
[0025] The time period includes the sending time information of the message;
[0026] The identification segment includes identification information of the ECU that sends the message;
[0027] The information segment includes the message information of the message.
[0028] Preferably, the data frame of the message is 64 bytes, the source address segment occupies 1 byte, the time period occupies 7 bytes, the identification segment occupies 2 bytes, and the message segment occupies 54 bytes.
[0029] Preferably, the ciphertext data segment includes a source address segment and a ciphertext segment.
[0030] The source address segment includes the source address information of the ECU that sends the message;
[0031] The ciphertext segment includes ciphertext data obtained by performing encryption calculation on the message segment according to encryption and decryption information.
[0032] Preferably, the ciphertext data frame is 64 bytes, the source address segment occupies 1 byte, and the ciphertext segment occupies 63 bytes.
[0033] Preferably, the communication method further comprises the following steps:
[0034] When the ECU receives a message, it obtains the real-time time and the time difference between the time information time of the time period in the plaintext message and the real-time time, and determines whether the time difference is greater than a preset time threshold. If so, the message is discarded and a playback attack alarm is issued; if so, the message is received.
[0035] Preferably, the real-time time is obtained in the following manner:
[0036] The communication module of the vehicle obtains the current time and sends it to the vehicle gateway. The vehicle gateway randomly sends a set of key seeds to all ECUs. The ECU writes the key seeds into the encryption and decryption data and starts real-time time counting according to the time signal.
[0037] Preferably, the communication method further comprises the following steps:
[0038] When the ECU receives a message, it searches for an identifier in the stored encrypted and decrypted data according to the source address segment in the plaintext message and compares it with the identifier in the plaintext message. If the comparison is inconsistent, the message is discarded and a masquerade alarm is issued; if the comparison is consistent, the message is received.
[0039] Compared with the prior art, the present invention has the following advantages:
[0040] (1) The ECU message of the present invention is encrypted to form a ciphertext for communication on the bus, and the risk of eavesdropping is effectively avoided by using the form of ciphertext transmission. There is no need to modify the vehicle hardware. The encryption and decryption data of the ciphertext can be modified regularly according to needs to avoid cracking, thereby effectively improving the security performance of vehicle information communication;
[0041] (2) The message information of the present invention includes a time period mark, which can compare the time when the message is sent and the time when the message is received, discard the message that exceeds the time threshold and alarm, effectively avoid playback attacks, improve the anti-attack capability of communication, and improve the security performance of vehicle information communication;
[0042] (3) Each ECU of the present invention stores encryption and decryption data containing encryption and decryption information of each ECU. When receiving a message, it can compare the message identifier, discard the inconsistent message and issue a camouflage alarm, thereby improving the anti-attack capability of the communication and improving the security performance of vehicle information communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flow chart of Embodiment 1 of the present invention;
[0044] Figure 2 This is a flow chart of Embodiment 2 of the present invention;
[0045] Figure 3 This is a flow chart of Embodiment 3 of the present invention;
[0046] Figure 4 This is a flow chart of Example 4 of the present invention. DETAILED DESCRIPTION
[0047] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the following embodiments are merely illustrative in nature, and the present invention is not intended to limit its applicable objects or uses, and the present invention is not limited to the following embodiments.
[0048] Example 1
[0049] A vehicle data message secure communication method is used for communication between vehicle ECUs, where the vehicle ECUs are connected via a communication bus, such as Figure 1 As shown, the communication method includes the following steps:
[0050] S1: Acquire encryption and decryption data and write them into each of the ECUs, wherein the encryption and decryption data includes encryption and decryption information of each ECU.
[0051] Each ECU is assigned a corresponding encryption and decryption information, which includes a source address, an identifier, a key seed, and a key. In this embodiment, the communication bus adopts a CAN-FD bus, and its corresponding data frame is shown in Table 1 below:
[0052] Table 1 Data segment division of CAN-FD data frame
[0053] Source Address Time period Identification segment Message segment 1 byte 7 bytes 2 bytes 54 bytes
[0054] Correspondingly, the data segment of the message in this embodiment includes a source address segment, a time period, an identification segment, and an information segment. The data content of the source address segment includes the source address information of the ECU that sends the message; the data content of the time period includes the sending time information of the message; the data content of the identification segment includes the identification information of the ECU that sends the message; and the data content of the information segment includes the message message of the message. Corresponding to CAN-FD, the data frame of the message is 64 bytes, the source address segment occupies 1 byte, the time period occupies 7 bytes, the identification segment occupies 2 bytes, and the message segment occupies 54 bytes.
[0055] In this embodiment, the encryption and decryption data are shown in Table 2, and each ECU is assigned a corresponding encryption and decryption information.
[0056] Table 2 Encryption and decryption data table
[0057] ECU Source Address Logo Key Seed Key ECU1 SA1 B1 Ke1? Kkey1 ECU2 SA2 B2 Ke2? Kkey2 ECU3 SA3 B3 Ke3? Kkey3 ECU4 SA4 B4 Ke4? Kkey4 ECU5 SA5 B5 Ke5? Kkey5 ECU6 SA6 B6 Ke6? Kkey6 ECU7 SA7 B7 Ke7? Kkey7 … … … … … ECUn San Bn Ken? Kkeyn
[0058] S2: When the ECU sends a message, the message is encrypted according to the encryption and decryption information of the ECU sending the message to form a ciphertext, and is sent to the ECU receiving the message through the bus.
[0059] In this embodiment, as shown in Table 3, the data segment of the ciphertext includes a source address segment and a ciphertext segment. The source address segment includes the source address information of the ECU that sends the message; the ciphertext segment includes the ciphertext data obtained by encrypting and calculating the message segment according to the encryption and decryption information. The data frame of the ciphertext is 64 bytes, the source address segment occupies 1 byte, and the ciphertext segment occupies 63 bytes. When encrypting, the ciphertext is obtained by encrypting and calculating the time period, the identification segment, and the message segment according to the source address, identification, key seed, and key of the ECU that sends the message in the encryption and decryption data table. Since the ciphertext is transmitted on the bus, it can effectively prevent external nodes from eavesdropping on the signal.
[0060] Table 3 Ciphertext data segment
[0061] Source address segment Ciphertext segment 1 byte 63 bytes
[0062] S3: When the ECU receives the message, it decrypts the received ciphertext according to the encryption and decryption information to obtain the plaintext message. Specifically, after receiving the ciphertext, other ECUs on the CAN-FD bus translate the ciphertext into plaintext as shown in Table 4 below according to the data in the source address segment and their own ECU source address, identification, key seed and key.
[0063] Table 4 Plaintext data segment
[0064]
[0065] Example 2
[0066] The difference between this embodiment and embodiment 1 is that Figure 2 As shown, step S4 is also included:
[0067] When the ECU receives a message, it obtains the real-time time and the time difference between the time information time of the time period in the plaintext message and the real-time time, and determines whether the time difference is greater than a preset time threshold. If so, the message is discarded and a playback attack alarm is issued; if so, the message is received.
[0068] The real-time time is obtained as follows:
[0069] The vehicle's communication module obtains the current time and sends it to the vehicle gateway. The vehicle gateway randomly sends a set of key seeds to all ECUs. The ECU writes the key seeds into the encryption and decryption data and starts real-time time counting according to the time signal.
[0070] Specifically, in this embodiment, the vehicle gateway will connect all the CAN-FD modules of the vehicle. There will be a module with 4G communication on the vehicle. After the vehicle is powered on, the module with 4G communication sends the current Beijing time (accurate to milliseconds) to the gateway. The gateway receives the Beijing time signal and randomly sends a set of key seeds to all the ECUs of the vehicle. All the ECUs of the vehicle write the key seeds into their own ECU source address, identification, key seeds and keys, and start timing the received time signal, using the timing time as the real-time time.
[0071] All ECUs on the CAN-FD bus will start counting after receiving the time signal from the gateway. Each ECU needs to fill in the time when sending a message. When receiving the message, the receiving ECU compares the time of the time period with the real time. The time threshold of this embodiment is 1s. If the error is within 1s, it will be received. Otherwise, it will be discarded and a replay attack alarm will be issued, which can effectively prevent replay attacks. The byte format of the time period is shown in Table 5.
[0072] Table 5 Byte format of time period
[0073] Year moon day hour point Second millisecond 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte
[0074] Example 3
[0075] The difference between this embodiment and embodiment 1 is that Figure 3 As shown, step S4 is also included:
[0076] When the ECU receives a message, it searches for the identifier in the stored encrypted and decrypted data according to the source address segment in the plaintext message and compares it with the identifier in the plaintext message. If the comparison is inconsistent, the message is discarded and a masquerade alarm is issued; if the comparison is consistent, the message is received. Specifically, the receiving ECU finds the corresponding identification parameter in its own ECU source address, identifier, key seed and key through the source address segment parameter, and compares it with the identification parameter in the plaintext to see if they are the same. If they are not the same, it means that the signal may be masqueraded, and it is discarded and a masquerade alarm is issued.
[0077] Example 4
[0078] The difference between this embodiment and embodiment 1 is that Figure 4 As shown, step S4 is also included:
[0079] When the ECU receives the message, it obtains the real-time time and the time difference between the time information time of the time period in the plaintext message and the real-time time, and determines whether the time difference is greater than a preset time threshold. If so, the message is discarded and a playback attack alarm is issued; if so, the process proceeds to step S5;
[0080] S5: When the ECU receives a message, it searches for an identifier in the stored encrypted and decrypted data according to the source address segment in the plaintext message and compares it with the identifier in the plaintext message. If the comparison is inconsistent, the message is discarded and a masquerade alarm is issued; if the comparison is consistent, the message is received.
[0081] The above embodiments are merely examples and do not limit the scope of the present invention. These embodiments can also be implemented in various other ways, and various omissions, substitutions, and changes can be made without departing from the technical concept of the present invention.
Claims
1. A vehicle data message secure communication method, characterized in that: For communication of an ECU of a vehicle, the ECU of the vehicle being connected via a communication bus, the method comprising: Acquire encryption and decryption data and write them into each of the ECUs, wherein the encryption and decryption data includes encryption and decryption information of each ECU; When the ECU sends a message, the message is encrypted according to the encryption and decryption information of the ECU sending the message to form a ciphertext, and is sent to the ECU receiving the message through the bus; When the ECU receives the message, it decrypts the received ciphertext according to the encryption and decryption information to obtain the plaintext message; The communication method further comprises the following steps: When the ECU receives the message, it obtains the real-time time and the time difference between the time information time of the time period in the plaintext message and the real-time time, and determines whether the time difference is greater than a preset time threshold. If so, the message is discarded and a playback attack alarm is issued; if less, the message is received; The real-time time is obtained as follows: The communication module of the vehicle obtains the current time and sends it to the vehicle gateway. The vehicle gateway randomly sends a set of key seeds to all ECUs. The ECU writes the key seeds into the encryption and decryption data and starts real-time time counting according to the time signal. The communication method further comprises the following steps: When the ECU receives a message, it searches for an identifier in the stored encrypted and decrypted data according to the source address segment in the plaintext message and compares it with the identifier in the plaintext message. If the comparison is inconsistent, the message is discarded and a masquerade alarm is issued; if the comparison is consistent, the message is received.
2. A vehicle data message secure communication method according to claim 1, characterized in that: The encryption and decryption information includes a source address, an identifier, a key seed and a key.
3. A vehicle data message secure communication method according to claim 1, characterized in that: The communication bus is a CAN bus or a CAN-FD bus.
4. A vehicle data message secure communication method according to claim 1, characterized in that: The data segment of the message includes a source address segment, a time period, an identification segment, and an information segment. The source address segment includes the source address information of the ECU that sends the message; The time period includes the sending time information of the message; The identification segment includes identification information of the ECU that sends the message; The information segment includes a message message of the message.
5. A vehicle data message secure communication method according to claim 4, characterized in that: The data frame of the message is 64 bytes, the source address segment occupies 1 byte, the time period occupies 7 bytes, the identification segment occupies 2 bytes, and the information segment occupies 54 bytes.
6. A vehicle data message secure communication method according to claim 1, characterized in that: The ciphertext data segment includes a source address segment and a ciphertext segment. The source address segment includes the source address information of the ECU that sends the message; The ciphertext segment includes ciphertext data obtained by performing encryption calculation on the message segment according to encryption and decryption information.
7. A vehicle data message secure communication method according to claim 6, characterized in that: The data frame of the ciphertext is 64 bytes, the source address segment occupies 1 byte, and the ciphertext segment occupies 63 bytes.
Citation Information
Patent Citations
CAN automobile bus alarm gateway detecting injection type attack
CN107454107A
Vehicle-mounted Ethernet information security protection method
CN110635893A
Communication method and device, ECU, vehicle and storage medium
CN113162928A
