Vehicle-mounted CAN bus message authentication method based on data compression and label filling

By using data compression and label filling methods in the on-board network of intelligent connected vehicles, the on-board CAN bus messages are authenticated, which solves the problem of low data packet authentication efficiency in the prior art, and achieves the effect of improving on-board network security without increasing the bus load.

CN119519985APending Publication Date: 2025-02-25SHANGHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411648070.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art cannot effectively authenticate in-vehicle network data packets with limited resources, resulting in insufficient security of intelligent connected vehicles in-vehicle network communication.

Method used

The on-board CAN bus message authentication method based on data compression and tag filling is adopted. The data sender compresses the message before sending, and performs tag authentication after decompressing the receiver to ensure the authenticity and integrity of the data packet.

Benefits of technology

Without increasing the bus load rate, the security of on-board network data packets is improved, the security capabilities of smart connected vehicles in-car networks are enhanced, and various network attacks are resisted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119519985A_ABST
    Figure CN119519985A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted CAN bus message authentication method based on data compression and label filling. The method comprises the following steps: designing and realizing a lossless compression algorithm of a CAN bus message; the sender selects a data frame filling mode according to the compression result and the minimum authentication label length; the receiver decompresses the data packet and extracts the original information and the authentication label; and finally, the receiver recalculates the authentication label, and verifies the authenticity and integrity of the data packet by comparing whether the extracted label is consistent with the recalculated label. According to the method, the thought of combining lossless compression and message authentication codes is adopted, and a new scheme for enhancing network security is provided for the vehicle-mounted CAN network of the intelligent networked automobile.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of on-board network security for intelligent network-connected vehicles, and in particular relates to an on-board CAN bus message authentication method based on data compression and label filling. Background Art

[0002] Modern vehicles are becoming increasingly complex, integrating hundreds of electronic control units (ECUs) to manage functions ranging from engine control and braking systems to infotainment and driver assistance features. The proliferation of ECUs requires a robust and reliable communication network to ensure seamless coordination and information exchange. The on-board controller area network (CAN) bus is this critical backbone, facilitating communication between ECUs and playing a vital role in vehicle motion control.

[0003] However, due to the lack of encryption and authentication, the CAN bus is vulnerable to cyber attacks. Malicious attackers can exploit various entry points, including Wi-Fi, Bluetooth, and cellular networks, to gain unauthorized access to the CAN bus, thereby remotely controlling the vehicle and potentially causing catastrophic consequences. Therefore, it is critical to improve the security of the CAN bus.

[0004] Message Authentication Code (MAC) is a widely used method to ensure the authenticity and integrity of messages. In MAC-based methods, each message is attached with a short tag to verify its authenticity. However, the CAN bus communication environment places many requirements on the MAC method, including real-time response, minimized communication overhead, high security strength, frame-by-frame verification, and computing resource limitations. How to effectively perform frame-by-frame verification of vehicle network data packets under limited resources is a difficult problem faced by the field of intelligent connected vehicle security. Summary of the invention

[0005] In order to solve the above-mentioned problems, the purpose of the present invention is to overcome the dilemma that the existing technology cannot efficiently authenticate the vehicle network data packets, and according to the task characteristics of the vehicle network communication of intelligent connected vehicles, a vehicle CAN bus message authentication method based on data compression and label filling is provided for the first time.

[0006] In order to achieve the above invention purpose, the present invention adopts the following technical solution:

[0007] A vehicle-mounted CAN bus message authentication method based on data compression and tag filling specifically comprises the following steps:

[0008] (1) Design and implement the data compression operation of CAN bus messages, which is applied by the data sender before the message is sent;

[0009] (2) Design and implement two message filling modes, where the filling mode will be selected based on the result of data compression in step (1);

[0010] (3) Design and implement a method for filling the authentication tag. The sender cuts off a certain length of authentication tag based on the message compression result and pre-designed security requirements, and embeds it into the free position of the message. The filled data frame will be sent to the bus.

[0011] (4) Design and implement a data decompression operation. When the receiver receives a data packet, it decompresses the data packet using the reverse operation of step (1) to extract the original data and label information carried by the message.

[0012] (5) Tag authentication: extract the original data and tag information tag according to step (4), recalculate the tag value tag′ according to the predefined algorithm (hash-based message authentication code), and the receiver determines whether the equation tag=tag′ holds. If so, the frame data is secure; if not, the frame data is insecure.

[0013] Preferably, the data compression in step (1) is specifically implemented by comprising the following sub-steps:

[0014] (1.1) The data compression operation divides the message payload into n data blocks of the same size B = {b1, b2, ..., b n}, compressed block by block; the size of each data block is bits; and aggregated into the final compression result by concatenation;

[0015] (1.2) A single data block generates a dictionary table D corresponding to each data block by traversing the pre-collected data set. n}, the elements in the dictionary table are the values ​​that appear in the data block in the data set, the number of elements is N, and the encoding length of the dictionary is

[0016] (1.3) A single data block b is compressed according to the dictionary table obtained in step (1.2). To assist the compression operation, a 1-bit flag bit h is introduced to indicate whether the data block has been searched for the index where the value is located; if the value of the current data block appears in the dictionary, then h = 1, and the encoded value of the data block is represented by the index of the corresponding value in the dictionary b′ = find(D, b), and the index length is L D ; If the value of the current data block does not appear in the dictionary, then h = 0, and the encoded value of the data block is represented by its original value b′ = b;

[0017] (1.4) According to step (1.3), for each data block in the message payload, the compressed data b′ and the compression mark h are obtained respectively; the compression results of each block are aggregated together through the concatenation operation; the aggregated result of the mark bit m bitmap=h1||h2||...||h n ; The aggregate result of the compressed block is m encoded =b′1||b′2||...|‖b′ n ; The compression result of the original message m compressed =m bitmap ||m encoded .

[0018] Preferably, in step (1), the compression of the data packet and the embedding of the authentication tag are both deployed in the electronic control unit in the form of software middleware, which does not change the original sending method of the CAN controller.

[0019] Preferably, the filling mode selection in step (2) is specifically implemented by comprising the following sub-steps:

[0020] (2.1) The filling modes include single frame filling and continuous frame filling; single frame filling means using a single complete data frame to transmit this information; continuous frame filling means sending two complete data frames in succession to transmit this information;

[0021] (2.2) Filling mode according to expected frame length L e The expected frame length is calculated as L e =L tag0 +L bitmap +L encoded , where L tag0 is the minimum authentication tag length; L bitmap is the marker bit aggregation length; L encoded is the aggregate length of the original data after compression;

[0022] (2.3) When the expected frame length is less than or equal to the upper limit of the message load (L e ≤64), select single frame filling;

[0023] (2.4) When the expected frame length is greater than the upper limit of the message load (L e >64), select continuous frame filling; before the first frame transmission The information corresponding to the data block, after the second frame is transmitted At the same time, a 1-bit segmentation marker is newly inserted at the end of the marker bit of each frame to distinguish whether the frame data corresponds to the first part or the second part.

[0024] Preferably, the filling method in step (3) is specifically implemented by comprising the following sub-steps:

[0025] (3.1) Generate initial authentication data using a hash-based message authentication code algorithm; Calculate the size of the remaining free space in the data frame based on the frame filling mode selected in step (2), and use truncation to obtain authentication data of a certain length; The sender fills the data frame and sends the message to the bus;

[0026] (3.2) The truncated length of the authentication data is determined by calculating the number of bytes occupied by the expected data; the number of bytes Authentication tag cutoff length L tag =N byte ×8-(L bitmap +L encoded );

[0027] (3.3) The sender packs the mark bit, compressed data, and truncated authentication tag into the payload of the data frame and sends it to the bus through the controller.

[0028] Preferably, in step (3), the data packets of the communicating parties will be authenticated frame by frame to meet the security requirements of high-traffic automobile communications; the entire encoding and decoding process only relies on dictionary lookup, which takes a few milliseconds to meet the real-time requirements of automobiles at high speeds.

[0029] Preferably, the decompression method in step (4) is specifically implemented by comprising the following sub-steps:

[0030] (4.1) The receiver calculates the tag length, compressed block length, and label length based on the predefined block parameters and the pre-shared dictionary;

[0031] (4.2) The receiver uses truncation operation to obtain the compressed data of each block and the authentication tag in the data frame;

[0032] (4.3) The receiver obtains the original data corresponding to the block by retrieving the index value of the corresponding block dictionary; the dictionary consists of a series of key-value pairs, and each data block has a corresponding dictionary table; the original data value can be obtained by searching the data index.

[0033] Preferably, in step (4), the load reduction during the data compression process can offset the load increase caused by sending additional messages, thereby maintaining limited control of the bus load rate.

[0034] Preferably, in steps (1) and (4), the dictionary relied on in the compression and pre-decompression process can be generated by pre-statistical message generation or can be generated online by software operation; the strategy for detecting anomalies only needs to compare the new and old labels, thereby improving the network security of the network bus with a relatively small overhead.

[0035] Preferably, the predefined algorithm in step (5) is specifically a hash-based message authentication code.

[0036] Compared with the prior art, the method of the present invention adopts the idea of ​​combining data compression and message authentication code, performs lossless compression on the original data to be sent, and adopts different label embedding strategies according to different contents, so as to provide security for each frame of data packet without increasing the bus load rate, and verifies the authenticity and integrity of the data packet by comparing the proposed data label with the newly calculated data label, thereby effectively enhancing the security of the on-board network of the intelligent networked vehicle, and has the following obvious outstanding substantial characteristics and significant advantages:

[0037] 1. The present invention combines lossless data compression with tag embedding, frees up space for authentication tags through compression technology, improves data packet security while effectively limiting bus load rate, and enhances the network security capability of the bus to resist various network attacks;

[0038] 2. The method of the present invention can be deployed as software middleware in the vehicle electronic control unit module, without changing the sending mechanism of the CAN message, and is transparent to the user;

[0039] 3. The method of the present invention is simple, easy to implement, low in cost, and suitable for popularization and use. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 The present invention is a flowchart of the steps of the vehicle-mounted CAN bus message authentication method based on data compression and tag filling.

[0041] Figure 2 The present invention is a flowchart of the vehicle-mounted CAN bus message authentication method based on data compression and tag filling. DETAILED DESCRIPTION

[0042] The following is a detailed description of an embodiment of the present invention in conjunction with the accompanying drawings: This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given, but the protection scope of the present invention is not limited to the following embodiments.

[0043] Example:

[0044] In this embodiment, see Figure 1 and Figure 2 , a vehicle-mounted CAN bus message authentication method based on data compression and tag filling, specifically comprising the following steps:

[0045] (1) Design and implement the data compression operation of CAN bus messages. The data sender uses it before sending the message. The main features of data compression are:

[0046] (1.1) The data compression operation divides the message payload into 8 identical data blocks B = {b1, b2, ..., b8}, and compresses each block one by one; the size of each data block is 8 bits (1 byte); and the data blocks are aggregated into the final compression result in a serial manner;

[0047] (1.2) A single data block generates a dictionary table D corresponding to each data block by traversing the pre-collected data set. n}, the elements in the dictionary table are the values ​​that appear in the data block in the data set, the number of elements is N, and the encoding length of the dictionary is L D = [log2N];

[0048] (1.3) A single data block b is compressed according to the dictionary table obtained in step (1.2). To assist the compression operation, a 1-bit flag bit h is introduced to indicate whether the data block has been searched for the index where the value is located; if the value of the current data block appears in the dictionary, then h = 1, and the encoded value of the data block is represented by the index of the corresponding value in the dictionary (b′find(D, b)), and the index length is L D ; If the value of the current data block does not appear in the dictionary, then h = 0, and the encoded value of the data block is represented by its original value b′ = b;

[0049] (1.4) According to step (1.3), for each data block in the message payload, the compressed data b′ and the compression mark h are obtained respectively; the compression results of each block are aggregated together through the concatenation operation; the aggregated result of the mark bit m bitmap =h1||h2||...||h8; the aggregation result of the compressed block is m encoded =b′1||b′2||...|‖b′8; the compression result of the original message m compressed =m bitmap ||m encoded ;

[0050] (2) Design and implement two message filling modes. The filling mode will be selected based on the result of data compression in step (1). The main features of the filling mode selection are:

[0051] (2.1) The filling modes include single frame filling and continuous frame filling; single frame filling means using a single complete data frame to transmit this information; continuous frame filling means sending two complete data frames in succession to transmit this information;

[0052] (2.2) Filling mode according to expected frame length L e The expected frame length is calculated as L e =L tag0 +L bitmap +L encoded, where L tag0 is the minimum authentication tag length; L bitmap is the marker bit aggregation length; L encoded is the aggregate length of the original data after compression;

[0053] (2.3) When the expected frame length is less than or equal to the upper limit of the message load (L e ≤64), select single frame filling;

[0054] (2.4) When the expected frame length is greater than the upper limit of the message load (L e >64), select continuous frame filling; the first frame transmits the information corresponding to the first 4 data blocks, and the second frame transmits the information corresponding to the last 4 data blocks; at the same time, a 1-bit segmentation marker is newly inserted at the end of the marker bit of each frame to distinguish whether the frame data corresponds to the first part or the second part;

[0055] (3) Design and implement a method for filling the authentication tag. The sender cuts off a certain length of authentication tag based on the message compression result and pre-designed security requirements, and embeds it into the free position of the message. The filled data frame will be sent to the bus. The main features of the filling method are:

[0056] (3.1) Generate initial authentication data using a hash-based message authentication code algorithm; Calculate the size of the remaining free space in the data frame based on the frame filling mode selected in step (2), and use truncation to obtain authentication data of a certain length; The sender fills the data frame and sends the message to the bus;

[0057] (3.2) The truncated length of the authentication data is determined by calculating the number of bytes occupied by the expected data; the number of bytes Authentication tag cutoff length L tag =N byte ×8-(L bitmtap +L encoded );

[0058] (3.3) The sender packs the mark bit, compressed data, and truncated authentication tag into the payload of the data frame and sends it to the bus through the controller;

[0059] (4) Design and implement a data decompression operation. When the receiver receives a data packet, it decompresses the data packet using the reverse operation of step (1) to extract the original data and label information carried by the message. The main features of the decompression method are:

[0060] (4.1) The receiver calculates the tag length, compressed block length, and label length based on the predefined block parameters and the pre-shared dictionary;

[0061] (4.2) The receiver uses truncation operation to obtain the compressed data of each block and the authentication tag in the data frame;

[0062] (4.3) The receiver obtains the original data corresponding to the block by retrieving the index value of the corresponding block dictionary; the dictionary consists of a series of key-value pairs, and each data block has a corresponding dictionary table; the original data value can be obtained by searching the data index.

[0063] (5) Tag authentication: extract the original data and tag information tag according to step (4), recalculate the tag value tag′ according to the predefined algorithm (hash-based message authentication code), and the receiver determines whether the equation tag=tag′ holds. If so, the frame data is secure; if not, the frame data is insecure.

[0064] In this embodiment, the authentication process does not focus on the cause of the exception, and only makes an exception judgment by comparing the new and old tags; the cause of the exception is an exception caused by external interference or an exception caused by a malicious network attack.

[0065] The method of this embodiment adopts the idea of ​​combining data compression with message authentication code, and provides a new solution in the form of software middleware for the on-board CAN network security authentication of intelligent connected vehicles, which does not require hardware assistance, does not occupy load, and is simple and easy to implement, has low cost, and is suitable for popularization and use.

[0066] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A vehicle-mounted CAN bus message authentication method based on data compression and tag filling, characterized in that: The specific steps include: (1) Design and implement the data compression operation of CAN bus messages, which is applied by the data sender before the message is sent; (2) Design and implement two message filling modes, where the filling mode will be selected based on the result of data compression in step (1); (3) Design and implement a method for filling the authentication tag. The sender cuts off a certain length of authentication tag based on the message compression result and pre-designed security requirements, and embeds it into the free position of the message. The filled data frame will be sent to the bus. (4) Design and implement a data decompression operation. When the receiver receives a data packet, it uses the reverse operation of step (1) to decompress the data packet and extract the original data and label information carried by the message. (5) Tag authentication: extract the original data and tag information tag according to step (4), recalculate the tag value tag′ according to the predefined algorithm (hash-based message authentication code), and the receiver determines whether the equation tag=tag′ holds. If so, the frame data is secure; if not, the frame data is insecure.

2. According to claim 1, a vehicle-mounted CAN bus message authentication method based on data compression and tag filling is characterized in that: The data compression in step (1) is specifically implemented by the following sub-steps: (1.1) The data compression operation divides the message payload into n data blocks of the same size B = {b1, b2, ..., b n }, compressed block by block; the size of each data block is bits; and aggregated into the final compression result by concatenation; (1.2) A single data block generates a dictionary table D corresponding to each data block by traversing the pre-collected data set. n }, the elements in the dictionary table are the values ​​that appear in the data block in the data set, the number of elements is N, and the encoding length of the dictionary is (1.3) A single data block b is compressed according to the dictionary table obtained in step (1.2). To assist the compression operation, a 1-bit flag bit h is introduced to indicate whether the data block has been searched for the index where the value is located; if the value of the current data block appears in the dictionary, then h = 1, and the encoded value of the data block is represented by the index of the corresponding value in the dictionary b′ = find(D, b), and the index length is L D ; If the value of the current data block does not appear in the dictionary, then h = 0, and the encoded value of the data block is represented by its original value b′ = b; (1.4) According to step (1.3), for each data block in the message payload, the compressed data b′ and the compression mark h are obtained respectively; the compression results of each block are aggregated together through the concatenation operation; the aggregated result of the mark bit m bitmap =h1||h2||…||h n ; The aggregate result of the compressed block is m encoded =b′1||b′2||...||b′ n ; The compression result of the original message m compressed =m bitmap ||m encoded .

3. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: In the step (1), the compression of the data packet and the embedding of the authentication tag are both deployed in the electronic control unit in the form of software middleware, and will not change the original sending method of the CAN controller.

4. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: The filling mode selection in step (2) is specifically implemented by the following sub-steps: (2.1) The filling modes include single frame filling and continuous frame filling; single frame filling means using a single complete data frame to transmit this information; continuous frame filling means sending two complete data frames in succession to transmit this information; (2.2) Filling mode according to expected frame length L e The expected frame length is calculated as L e =L tag0 +L bitmap +L encoded , where L tag0 is the minimum authentication tag length; L bitmap is the marker bit aggregation length; L encoded is the aggregate length of the original data after compression; (2.3) When the expected frame length is less than or equal to the upper limit of the message load (L e ≤64), select single frame filling; (2.4) When the expected frame length is greater than the upper limit of the message load (L e >64), select continuous frame filling; before the first frame transmission The information corresponding to the data block, after the second frame is transmitted At the same time, a 1-bit segmentation marker is newly inserted at the end of the marker bit of each frame to distinguish whether the frame data corresponds to the first part or the second part.

5. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: The filling method in step (3) is specifically implemented by comprising the following sub-steps: (3.1) Generate initial authentication data using a hash-based message authentication code algorithm; Calculate the size of the remaining free space in the data frame based on the frame filling mode selected in step (2), and use truncation to obtain authentication data of a certain length; The sender fills the data frame and sends the message to the bus; (3.2) The truncated length of the authentication data is determined by calculating the number of bytes occupied by the expected data; the number of bytes Authentication tag cutoff length L tag =N byte ×8-(L bitmap +L encoded ); (3.3) The sender packs the mark bit, compressed data, and truncated authentication tag into the payload of the data frame and sends it to the bus through the controller.

6. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: In the step (3), the data packets of the communicating parties will be authenticated frame by frame to meet the security requirements of high-traffic automobile communications; the entire encoding and decoding process only relies on dictionary lookup and takes a few milliseconds to meet the real-time requirements of automobiles at high speeds.

7. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: The decompression method in step (4) is specifically implemented by comprising the following sub-steps: (4.1) The receiver calculates the tag length, compressed block length, and label length based on the predefined block parameters and the pre-shared dictionary; (4.2) The receiver uses truncation operation to obtain the compressed data of each block and the authentication tag in the data frame; (4.3) The receiver obtains the original data corresponding to the block by retrieving the index value of the corresponding block dictionary; the dictionary consists of a series of key-value pairs, and each data block has a corresponding dictionary table; the original data value can be obtained by searching the data index.

8. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: In the step (4), the load reduction during the data compression process can offset the load increase caused by sending additional messages, thereby maintaining limited control of the bus load rate.

9. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1 is characterized in that: In the steps (1) and (4), the dictionary relied on in the compression and pre-decompression process can be generated by pre-statisticing messages or generated online by software operation; the strategy for detecting anomalies only needs to compare the new and old labels, thereby improving the network security of the network bus with a relatively small overhead.

10. The vehicle-mounted CAN bus message authentication method based on data compression and tag filling according to claim 1, characterized in that: The predefined algorithm in step (5) is specifically a hash-based message authentication code.