A method for encrypting and transmitting CAN data

By using random number generation and segmented encryption strategies in CAN data transmission, the deficiencies in real-time and stability of encryption methods in the existing technology are solved, and low-latency and high-security data transmission is achieved, which is suitable for power applications. and chassis and other systems with high real-time requirements.

CN115459945BActive Publication Date: 2024-10-11CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210919266.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2024-10-11
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

Existing CAN data encryption methods have shortcomings in real-time and stability. Especially in systems with high real-time requirements such as chassis, packetized transmission will lead to increased signal delay and inconsistent data packet arrival times, which cannot be met. Safety and stability requirements in safe driving areas such as power and chassis.

Method used

By generating random numbers within the preset random number range, selecting the corresponding encryption strategy to encrypt the data in segments, and decrypting it through the decryption strategy at the receiving end, ensuring the security and stability of data transmission while using simple data processing Method to reduce operation time and delay.

Benefits of technology

It achieves low-latency and high-security data transmission, simplifies the encryption process, and improves the computing speed and security reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115459945B_ABST
    Figure CN115459945B_ABST
Patent Text Reader

Abstract

The present invention discloses an encryption transmission method for CAN data, the method comprising: generating a random number within a preset random number range according to data to be transmitted as a target random number; based on the corresponding relationship between the segment range of the random number and the encryption strategy, selecting the encryption strategy corresponding to the segment range where the target random number is located, encrypting the data to be transmitted to obtain the encrypted data to be transmitted; combining the target random number and the encrypted data to be transmitted to obtain the transmission data; sending the transmission data to a data receiving controller, wherein when the data receiving controller stores a decryption strategy corresponding to the encryption strategy, the data receiving controller is used to decrypt the transmission data through the decryption strategy to obtain the data to be transmitted. The data processing method of the present invention is simple, improves the operation speed, reduces the operation time, and thus reduces the delay caused by data encryption processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of automobile data transmission, and in particular relates to an encryption transmission method for CAN data. Background Art

[0002] With the rapid development of intelligence and networking, the interactive data carried on the automotive network is increasing, and the information security of automobiles is becoming more and more important. Although with the increase in the amount of network data in the whole vehicle, the on-board Ethernet has gradually carried a large amount of data, for safe driving areas such as power and chassis, the traditional network with high stability and low latency such as CAN is still used. At the same time, the reliable transmission of data in these network segments is related to the safety of life and property of automobile users. Therefore, the encryption of CAN data such as power and chassis is very important. On June 19, 2020, the China Patent Office disclosed an invention called a CAN network encryption method for a wire-controlled chassis, with a publication number of CN201911091214.3. The invention describes that at the CAN message sending end, the encrypted data is divided into two parts for transmission on the network, and finally the data is merged and parsed at the receiving end. Although this method can realize encrypted transmission of data and prevent network attacks, in the whole vehicle system, especially for systems with high real-time requirements such as the chassis, first of all, the subpacketization and assembly of the message will increase the signal delay, which does not meet the low real-time requirements; secondly, the packet transmission will cause the two data packets to arrive at the receiving end at different times, which does not meet the transmission stability requirements. Summary of the invention

[0003] The purpose of the present invention is: The purpose of the present invention is: to provide an encrypted transmission method for CAN data, which can ensure the security and stability of transmission and low delay.

[0004] In order to achieve the above purpose, the present invention adopts the following technical solution: a method for encrypting and transmitting CAN data, the method comprising:

[0005] Generate a random number within a preset random number range according to the data to be transmitted as the target random number;

[0006] Based on the correspondence between the segment range of the random number and the encryption strategy, an encryption strategy corresponding to the segment range where the target random number is located is selected to encrypt the data to be transmitted to obtain encrypted data to be transmitted;

[0007] Combining the target random number and the encrypted data to be transmitted to obtain transmission data;

[0008] The transmission data is sent to a data receiving controller, wherein when the data receiving controller stores a decryption strategy corresponding to the encryption strategy, the data receiving controller is used to decrypt the transmission data according to the decryption strategy to obtain the data to be transmitted.

[0009] Further, determining a random number within a preset random number range according to the data to be transmitted as a target random number includes:

[0010] Within a preset random number range, a random number that matches the importance and amount of the data to be transmitted is determined as the target random number.

[0011] Furthermore, the encryption strategy corresponding to the segment range where the target random number is located includes the following data processing methods:

[0012] Increasing a first specified value to the value of the data to be transmitted;

[0013] Decreasing the value of the data to be transmitted by a second specified value;

[0014] Inverting the value of the data to be transmitted;

[0015] The value of the data to be transmitted is maintained unchanged.

[0016] Furthermore, the random number range has at least four segmented ranges.

[0017] Furthermore, the size of each segment range is different.

[0018] Further, a segment range in the random number range adopts the following data processing method:

[0019] A first specified value is added to the value of the data to be transmitted.

[0020] Further, a segment range in the random number range adopts the following data processing method:

[0021] The value of the data to be transmitted is reduced by a second specified value.

[0022] Further, a segment range in the random number range adopts the following data processing method:

[0023] The value of the data to be transmitted is inverted.

[0024] Further, a segment range in the random number range adopts the following data processing method:

[0025] Maintain the value of the data to be transmitted.

[0026] The present invention has the following beneficial effects:

[0027] 1. The data processing method of the present invention is simple, improves the operation speed, reduces the operation time, and thus reduces the delay caused by data encryption processing.

[0028] 2. Due to the contingency and randomness of random numbers, and the correspondence between different data processing methods according to the size range of random numbers, the present invention achieves randomness in each data transmission, thereby ensuring the security and reliability of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The present invention can be further illustrated by the non-limiting examples given in the accompanying drawings;

[0030] Figure 1 It is a flow chart of a method for encrypting and transmitting CAN data of the present invention; DETAILED DESCRIPTION

[0031] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that in the drawings or descriptions, similar or identical parts all use the same figure numbers, and the implementation methods not shown or described in the drawings are forms known to ordinary technicians in the relevant technical field. In addition, the terms "data receiving controller" and "data sending controller" mentioned in the embodiments of the present invention may represent controllers that act as data receivers and data senders respectively in a CAN communication transmission, so they may not refer to a specific model of controller; that is, the same controller may only play the role of a data sending controller or a data receiving controller in different communication transmissions. Alternatively, the same controller may play the role of a data sending controller and a data receiving controller respectively in different communication transmissions, and both belong to the protection scope of the present invention.

[0032] See also Figure 1 The present invention provides a method for encrypting and transmitting CAN data, the method comprising:

[0033] The data transmission controller generates a 1-byte or multi-byte random number as a target random number according to the data to be transmitted within a preset random number range; the value of the target random number matches the importance and data volume of the data to be transmitted.

[0034] When the data is important and the data volume is small, more than two bytes can be used to store the random number; for example, the brake light signal is related to driving safety, and the signal only needs 1 bit to express: 0 represents off; 1 represents on; then the message carrying this signal can use 3 bytes to store the random number, and the remaining bytes are used for data transmission.

[0035] When the data is important and the amount of data is large, two bytes can be used to store the random number; for example, the vehicle speed signal is used to display the user, about driving safety, and the signal has high accuracy requirements, generally requiring 2 to 3 bytes to represent; then the message carrying this signal can use 2 bytes to store the random number, and the remaining bytes are used for data transmission;

[0036] When the data is generally important and the amount of data is small, 2 bytes can be used to store random numbers, such as the automatic headlight setting signal, which only needs 1 bit to express: 0 represents off; 1 represents on; then the message carrying this signal can use 2 bytes to store the random number, and the remaining bytes are used for data transmission;

[0037] When the data is generally important and the data volume is large, 1 byte can be used to store the random number. For example, the parking time signal generally requires 3 to 4 bytes to represent it. Then the message carrying this signal can use 1 byte to store the random number, and the remaining bytes are used for data transmission.

[0038] The preset random number range in the present invention is within the custom stored byte. For example, when the custom stored byte is one of the 8 bytes of the CAN message, the random number range needs to be set to 1 to 255;

[0039] The data transmission controller selects the encryption strategy corresponding to the segment range where the target random number is located based on the correspondence between the segment range of the random number and the encryption strategy, encrypts the data to be transmitted, and obtains the encrypted data to be transmitted; the corresponding encryption strategy includes the following data processing methods:

[0040] Increase the first specified value to the value of the data to be transmitted;

[0041] Decrease the value of the data to be transmitted by a second specified value;

[0042] Negate the value of the data to be transmitted;

[0043] Maintain the value of the data to be transmitted unchanged.

[0044] The data processing methods included in the encryption strategy in the present invention are all simple operations, which improves the running speed of the encryption process, shortens the running cycle of the encryption process, and further reduces the delay caused by encrypted data transmission.

[0045] The target random number and the encrypted data to be transmitted are combined to obtain the transmission data; compared with the prior art, the encryption method in the present invention ensures the security of data transmission;

[0046] The transmission data is sent to a data receiving controller, wherein when the data receiving controller stores a decryption strategy corresponding to the encryption strategy, the data receiving controller is used to decrypt the transmission data according to the decryption strategy to obtain the data to be transmitted. The target device here can be the data receiving controller.

[0047] In the present invention, the data receiving controller not only stores the decryption strategy corresponding to the encryption strategy, but also stores the parsing method corresponding to the determined random number.

[0048] When the data receiving controller receives the transmission data, it first parses the random number in the transmission data through the parsing method, extracts the random number, and obtains the encrypted data to be transmitted. Then, the encrypted data to be transmitted is processed through the decryption strategy, and finally the data to be transmitted is obtained.

[0049] The method of an embodiment of the present invention can be applied to CAN data transmission, between a data sending controller and a data receiving controller, wherein the sender's random number generation method and the receiver's random number parsing method are matched to each other (for example, they may be the same) and are pre-configured in the data sending controller and the data receiving controller, respectively.

[0050] The encryption strategy and the decryption strategy correspond to each other (for example, when the encryption strategy is to increase the value of the data to be transmitted by 1, the decryption strategy should be to decrease the value of the data to be transmitted by 1), and are pre-configured in the data sending controller and the data receiving controller respectively.

[0051] The random number range has at least four segment ranges, which can cover four data processing methods, increase the randomness of data confidentiality, and further improve the security of data confidentiality and transmission.

[0052] The size of each segment range is different. Since the size of each segment range is random and different, different data processing methods are used for the data to be transmitted in the corresponding segment range, further improving the confidentiality and security of the data.

[0053] Each segment range corresponds to a processing method. This setting further simplifies the encryption strategy. A simple data processing method makes the encryption and decryption process more efficient and further reduces the delay caused by encrypted data transmission.

[0054] See Table 1-2 for a specific explanation, taking the preset random number range of 1-255 as an example:

[0055] Table 1: Encryption policies

[0056] The first segment range The second segment range The third segment range The fourth segment range Random number value 1~63 64~100 101~200 201~255 Data processing methods Data plus 1 Data minus 1 Data inversion Data unchanged

[0057] Table 2: Decryption strategy

[0058]

[0059]

[0060] When the random number generated by the data sending controller is 1-63, corresponding to the first segment range, the data sending controller increases the value of the data to be transmitted by 1, combines it with the random number to obtain the encrypted data to be transmitted, and sends the encrypted data to be transmitted to the data receiving controller via CAN.

[0061] After receiving the encrypted data to be transmitted, the data transmission controller first performs random number analysis to determine the value of the random number, and then separates the random number from the encrypted data to be transmitted to obtain the encrypted data to be transmitted without the random number. Next, the data transmission controller reduces the value of the data by 1 to obtain the data to be transmitted.

[0062] When the value of the random number generated by the data sending controller is 64-100, corresponding to the second segment range, the data sending controller reduces the value of the data to be transmitted by 1, combines it with the random number to obtain the encrypted data to be transmitted, and sends the encrypted data to be transmitted to the data receiving controller via CAN.

[0063] After receiving the encrypted data to be transmitted, the data transmission controller first performs random number analysis to determine the value of the random number, and then separates the random number from the encrypted data to be transmitted to obtain the encrypted data to be transmitted without the random number. Next, the data transmission controller increases the value of the data by 1 to obtain the data to be transmitted.

[0064] When the random number generated by the data sending controller is 101-200, corresponding to the third segment range, the data sending controller inverts the value of the data to be transmitted, combines it with the random number to obtain the encrypted data to be transmitted, and sends the encrypted data to be transmitted to the data receiving controller via CAN.

[0065] After receiving the encrypted data to be transmitted, the data transmission controller first performs random number analysis to determine the random number value, and then separates the random number from the encrypted data to be transmitted to obtain the encrypted data to be transmitted without the random number. Next, the data transmission controller performs inversion processing on the value of the data to obtain the data to be transmitted.

[0066] When the value of the random number generated by the data sending controller is 201-255, corresponding to the fourth segment range, the data sending controller maintains the value of the data to be transmitted, combines it with the random number to obtain the encrypted data to be transmitted, and sends the encrypted data to be transmitted to the data receiving controller via CAN.

[0067] After receiving the encrypted data to be transmitted, the data transmission controller first performs random number analysis to determine the value of the random number, and then separates the random number from the encrypted data to be transmitted to obtain the encrypted data to be transmitted without the random number. Next, the data transmission controller maintains the value of the data to obtain the data to be transmitted.

[0068] The above is a detailed introduction to a method for encrypting and transmitting CAN data provided by the present invention. The description of the specific embodiment is only used to help understand the method and its core idea of ​​the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A method for encrypting and transmitting CAN data, characterized in that: The method comprises: Generate a random number within a preset random number range according to the data to be transmitted as the target random number; Based on the correspondence between the segment range of the random number and the encryption strategy, an encryption strategy corresponding to the segment range where the target random number is located is selected to encrypt the data to be transmitted to obtain encrypted data to be transmitted; Combining the target random number and the encrypted data to be transmitted to obtain transmission data; Sending the transmission data to a data receiving controller, wherein when the data receiving controller stores a decryption strategy corresponding to the encryption strategy, the data receiving controller is used to decrypt the transmission data according to the decryption strategy to obtain the data to be transmitted; Wherein, determining a random number within a preset random number range according to the data to be transmitted as a target random number includes: Within a preset random number range, determine a random number that matches the importance and amount of the data to be transmitted as the target random number; The encryption strategy corresponding to the segment range where the target random number is located includes the following data processing methods: Increasing a first specified value to the value of the data to be transmitted; Decreasing the value of the data to be transmitted by a second specified value; Inverting the value of the data to be transmitted; The value of the data to be transmitted is maintained unchanged.

2. The method according to claim 1, characterized in that: The random number range has at least four segment ranges.

3. The method for encrypting and transmitting CAN data according to claim 2, characterized in that: The size of each segment range is different.

4. The method for encrypting and transmitting CAN data according to claim 3, characterized in that: A segment range in the random number range adopts the following data processing method: A first specified value is added to the value of the data to be transmitted.

5. The method for encrypting and transmitting CAN data according to claim 3, characterized in that: A segment range in the random number range adopts the following data processing method: The value of the data to be transmitted is reduced by a second specified value.

6. The method for encrypting and transmitting CAN data according to claim 3, characterized in that: A segment range in the random number range adopts the following data processing method: The value of the data to be transmitted is inverted.

7. The method for encrypting and transmitting CAN data according to claim 3, characterized in that: A segment range in the random number range adopts the following data processing method: Maintain the value of the data to be transmitted.