Information security communication method, device and computer equipment based on automobile CAN-FD network

By implementing ECU identity authentication and authorization mechanisms in the smart car CAN-FD network, using digital certificates and encryption algorithms, the problem of network attacks is solved, a comprehensive information security design is realized, the confidentiality and availability of messages is ensured, and the confidentiality and availability of messages is improved. Safety of drivers and passengers.

CN114945169BActive Publication Date: 2024-12-31HUNAN UNIV CHONGQING RES INST
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210643722.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2024-12-31
Estimated Expiration
2042-06-08

AI Technical Summary

Technical Problem

The modern smart car CAN-FD network lacks security protection measures and is vulnerable to cyber attacks, threatening the safety of drivers and passengers.

Method used

Using information security communication method based on automotive CAN-FD network, through ECU identity authentication and authorization mechanism, digital certificates, digital signatures, asymmetric encryption algorithms, symmetric encryption algorithms and HMAC algorithms are used to ensure the confidentiality, integrity and availability of messages. , realize identity authentication and secure communication of intelligent connected vehicle nodes.

Benefits of technology

A comprehensive information security design is realized, ensuring the confidentiality, integrity and availability of messages, providing a lightweight secure communication solution to prevent cyber attacks, and ensuring the safety of drivers and passengers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114945169B_ABST
    Figure CN114945169B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information security technology, and discloses an information security communication method, device and computer equipment based on a car CAN FD network, wherein the method comprises: after the car is started, when slave ECUa has a message to send to slave ECUb, slave ECUa sends a request message to the main ECU; the main ECU decrypts the request message, obtains the target message stream ID, and verifies the legitimacy; when the target message stream ID is legal, the main ECU generates authorization information and sends it to slave ECUa and slave ECUb; slave ECUa encrypts and sends a message, obtains a first encryption result and sends it to slave ECUb; slave ECUb receives and decrypts the first encryption result to obtain a first decryption result; when the first encryption result and the first decryption result are successfully compared, the information security communication of the car CAN FD network is completed. The information security communication method, device and computer equipment based on the car CAN FD network provided by the present invention provide a comprehensive information security design, including intelligent networked car node identity authentication, to ensure confidentiality, integrity and availability of secure communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to an information security communication method, device and computer equipment based on an automobile CAN-FD network. Background Art

[0002] With the development of modern communication and network technologies (such as 4G / 5G), a large number of autonomous driving applications have been applied to smart cars. This makes the traditional CAN network unable to meet the requirements of such high data volume, and CAN-FD with high bandwidth and flexible data rate came into being. At the same time, in order to provide a comfortable and convenient riding experience, external smart devices can be connected to the CAN-FD network. However, the CAN-FD network has no security protection measures and is easily subject to various network attacks (eavesdropping, tampering, Dos attacks, etc.), thus threatening the safety and even life of drivers and passengers. Summary of the invention

[0003] The present invention provides an information security communication method, device and computer equipment based on the automobile CAN-FD network, providing a comprehensive information security design, including intelligent connected vehicle node identity authentication, ensuring confidentiality, integrity and availability of secure communication.

[0004] The present invention provides an information security communication method based on an automobile CAN-FD network, comprising:

[0005] After the car is started, the slave ECUa sends a request message to the master ECU, wherein the request message includes a message stream ID encrypted with the authorization key of the slave ECUa;

[0006] The master ECU decrypts the request message using the authorization key of the slave ECUa to obtain the target message stream ID, and verifies the legitimacy of the target message stream ID according to the access control list;

[0007] When the target message stream ID is legal, the master ECU generates authorization information and sends the authorization information to the slave ECUa and the slave ECUb; wherein the authorization information includes the stream key encrypted by the authorization key of the slave ECUa and the authorization key of the slave ECUb;

[0008] The slave ECUa encrypts the sending message using a stream key to obtain a first encryption result and sends the first encryption result to the slave ECUb;

[0009] The slave ECUb receives the first encryption result and decrypts the first encryption result using a stream key to obtain a first decrypted result;

[0010] When the first encryption result and the first decryption result are successfully compared, the information security communication of the automobile CAN-FD network is completed.

[0011] Furthermore, after the car is started, the slave ECUa sends a request message to the master ECU, wherein the request message includes a message stream ID of the message encrypted with the authorization key of the slave ECUa, and further includes:

[0012] Before the car is started, the master ECU broadcasts a first digital certificate to all slave ECUs in the CAN-FD domain; wherein the first digital certificate includes a master ECU public key and a first identifier;

[0013] The slave ECU sends registration information to the master ECU; wherein the registration information includes a ciphertext of the authorization key of the current slave ECU formed by the slave ECU encrypting the master ECU public key, a digital signature of the authorization key, and a second digital certificate, wherein the second digital certificate includes the slave ECU public key and a second identifier;

[0014] The master ECU uses the master ECU private key to decrypt the authorization key of the slave ECU currently encrypted with the master ECU public key to obtain a second decryption result, and generates a hash value of the second decryption result. The master ECU uses the slave ECU public key to decrypt the digital signature to obtain a third decryption result.

[0015] When the hash value of the second decryption result is equal to the third decryption result, the master ECU sends a confirmation message to the slave ECU; wherein the confirmation message includes the first identifier and the second identifier encrypted by the authorization key of the slave ECU;

[0016] The slave ECU receives the confirmation information and uses its authorization key to decrypt the confirmation information to complete the ECU identity authentication of the CAN-FD network.

[0017] Further, the step of encrypting the sending message by the slave ECUa using a stream key to obtain a first encryption result and sending the first encryption result to the slave ECUb includes:

[0018] The slave ECUa uses the authorization key of the slave ECUa to decrypt the authorization message to obtain a first stream key;

[0019] Encrypt the sent message using a first stream key to obtain an encrypted message, and generate a first HMAC value of the encrypted message; wherein the encrypted message and the first HMAC value constitute the first encryption result;

[0020] The first encryption result is sent to the slave ECUb.

[0021] Furthermore, the step of receiving the first encryption result from ECUb and decrypting the first encryption result using a stream key to obtain a first decrypted result includes:

[0022] The slave ECUb uses the authorization key of the slave ECUb to decrypt the authorization message to obtain a second stream key; wherein the first stream key and the second stream key are the same symmetric key;

[0023] The slave ECUb receives the first encryption result, uses the second stream key to decrypt the ciphertext message in the first encryption result to obtain a plaintext message, and uses the HMAC algorithm to calculate the encrypted message in the first encryption result to obtain a second HMAC value; wherein the plaintext message and the second HMAC value constitute the first decryption result.

[0024] Further, the master ECU uses the master ECU private key to decrypt the authorization key of the slave ECU currently encrypted with the master ECU public key to obtain a second decryption result, and generates a hash value of the second decryption result, and the master ECU uses the slave ECU public key to decrypt the digital signature to obtain a third decryption result, including:

[0025] The master ECU uses the master ECU private key to decrypt the authorization key ciphertext currently encrypted with the master ECU public key to obtain the authorization key in plain text, and the authorization key in plain text is the second decryption result;

[0026] Performing hash calculation on the authorization key in plain text to obtain a first hash value, where the first hash value is the hash value of the second decryption result;

[0027] The master ECU uses the slave ECU public key to decrypt the digital signature and obtains the hash value of the authorization key of the current slave ECU in the digital signature, which is recorded as the second hash value. The second hash value is the third decryption result.

[0028] Furthermore, when the ECU sends a message, a CAN-FD message fragmentation mechanism is adopted, and the CAN-FD message fragmentation mechanism includes sending data in a single frame format and sending data in a multi-frame format;

[0029] The single-frame format transmission data includes: the high 4 bits of byte 1 are the single-frame identifier, the low 4 bits of byte 1 are the size of the additional padding data sent in the single frame, and bytes 2 to byte 64 are the data actually sent;

[0030] The multi-frame format sends data including the first frame and continuous frames, the high 4 bits of the first frame byte 1 are the first frame identifier, the low 4 bits of the first frame byte 1 represent the number of continuous frames, the high 4 bits of the continuous frame byte 1 are the continuous frame identifier, the low 4 bits of the continuous frame byte 1 are the continuous frame index, and the continuous frame bytes 2 to byte 64 are the data actually sent.

[0031] Furthermore, the request message, authorization message and encrypted message all include a unique random number and a timestamp.

[0032] The present invention also provides an information security communication device based on an automobile CAN-FD network, comprising:

[0033] A first sending module, used for sending a request message from ECUa to the master ECU after the car is started, wherein the request message includes a message stream ID encrypted by using the authorization key of the slave ECUa to send the message;

[0034] A first decryption module, used for the master ECU to decrypt the request message using the authorization key of the slave ECUa, obtain the target message stream ID, and verify the legitimacy of the target message stream ID according to the access control list;

[0035] A second sending module, configured to generate authorization information by the master ECU and send the authorization information to the slave ECUa and the slave ECUb when the target message stream ID is legal; wherein the authorization information includes a stream key encrypted by the authorization key of the slave ECUa and the authorization key of the slave ECUb;

[0036] An encryption module, used for the slave ECUa to encrypt the sending message with a stream key, obtain a first encryption result and send the first encryption result to the slave ECUb;

[0037] A second decryption module, configured to receive the first encryption result from the slave ECUb, and decrypt the first encryption result using a stream key to obtain a first decrypted result;

[0038] The comparison module is used to complete the information security communication of the automobile CAN-FD network when the first encryption result and the first decryption result are successfully compared.

[0039] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0040] The present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.

[0041] The beneficial effects of the present invention are:

[0042] 1. Security and comprehensiveness: Stream key encryption ensures the confidentiality of messages, HMAC ensures the integrity of messages, and random number and timestamp mechanisms ensure the availability of messages, reflecting comprehensive information security.

[0043] 2. Use digital certificates, digital signatures, asymmetric encryption algorithms, and symmetric encryption algorithms to achieve identity authentication of intelligent connected vehicle nodes; use symmetric encryption algorithms, random numbers and timestamp mechanisms, and HMAC algorithms to achieve lightweight and comprehensive secure communications.

[0044] 3. All asymmetric encryption algorithms, symmetric encryption algorithms and hash algorithms used in the present invention can freely select different types of cryptographic algorithms without being affected by the design. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The figure is a schematic diagram of the ECU identity authentication process according to an embodiment of the present invention.

[0046] Figure 2 The figure is a schematic diagram of the authorization communication process according to an embodiment of the present invention.

[0047] Figure 3 Schematic diagram of a CAN-FD network architecture according to an embodiment of the present invention.

[0048] Figure 4 FIG. 1 is a schematic diagram of a device structure according to an embodiment of the present invention.

[0049] Figure 5 The figure is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.

[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0052] like Figure 2 As shown, the present invention provides an information security communication method based on an automobile CAN-FD network, comprising:

[0053] S1. After the car is started, the slave ECUa sends a request message to the master ECU, wherein the request message includes a message stream ID encrypted with the authorization key of the slave ECUa;

[0054] S2. The master ECU decrypts the request message using the authorization key of the slave ECUa to obtain the target message stream ID, and verifies the legitimacy of the target message stream ID according to the access control list;

[0055] S3. When the target message stream ID is legal, the master ECU generates authorization information and sends the authorization information to the slave ECUa and the slave ECUb; wherein the authorization information includes the stream key encrypted by the authorization key of the slave ECUa and the authorization key of the slave ECUb;

[0056] S4, the slave ECUa encrypts the sending message using a stream key to obtain a first encryption result and sends the first encryption result to the slave ECUb;

[0057] S5, the slave ECUb receives the first encryption result, and decrypts the first encryption result using a stream key to obtain a first decrypted result;

[0058] S6. When the first encryption result and the first decryption result are successfully compared, the information security communication of the automobile CAN-FD network is completed.

[0059] As described in the above steps S1-S6, in order to ensure the authenticity of the ECU identity in the CAN-FD network and the comprehensive security of the CAN-FD message, the present invention provides an ECU identity authentication and secure communication framework for the CAN-FD network. ECU identity authentication occurs before the vehicle is officially used, and is used to verify the legitimacy of the identity of each node in the CAN-FD network, and to share the symmetric key for the subsequent authorization process. Authorized communication occurs after the vehicle is started, mainly to complete the authorization of the ECU's legal communication, that is, to share the symmetric key of the ECU's legal communication.

[0060] Reference Figure 2 , Figure 2 This is a flowchart of authorized communication after the vehicle is started, which includes three processes, namely, request from ECUa, authorization from the master ECU, and communication between ECUa and ECUb. Slave ECUa and slave ECUb are two slave ECUs that need to communicate. Request from ECUa refers to the process of sending request information to the master ECU when slave ECUa has a message to send to slave ECUb. The request information is an encrypted message, which is the message stream ID encrypted with the authorization key of slave ECUa. The message stream ID can indicate the IDs of the two communicating ECUs (slave ECUa and slave ECUb) and the ID of the message being sent. In addition to the above-mentioned message stream ID, the request information also comes with a unique random number and timestamp. This mechanism effectively resists replay attacks, flood attacks, etc., and ensures the availability of communication.

[0061] The master ECU authorization means that after receiving the request message from slave ECUa and verifying its legitimacy, the master ECU generates and sends authorization information to the two communicating slave ECUs (slave ECUa and slave ECUb). The authorization process is a decryption task and an encryption task. The decryption task is that the master ECU uses the authorization key of slave ECUa to decrypt the request message of slave ECUa to obtain the message stream ID. Each master ECU has an access control list to verify the legitimacy of the message stream ID. If it is a message stream of legal communication, the master ECU will generate an authorization message. If it is an illegal message stream, the authorization will be terminated. The encryption task is that the master ECU uses the authorization keys of the two slave ECUs (slave ECUa and slave ECUb) to encrypt the communication key (i.e., stream key) respectively, thereby forming authorization information. Finally, the master ECU sends the authorization information to the two slave ECUs (slave ECUa and slave ECUb) to complete the authorization. Among them, the stream key is also a symmetric key, which is a key shared by the two communicating slave ECUs (slave ECUa and slave ECUb). The stream key is different for each communication, and the real-time update of the stream key effectively prevents the possibility of the key being cracked by brute force. In addition, in addition to the communication key, the authorization message also comes with a unique random number and timestamp. Different messages carry different random numbers and timestamps, ensuring the availability of communication.

[0062] The master ECU communicates with the slave ECU. After receiving the authorization information from the master ECU, the slave ECUa uses the authorization key of the slave ECUa to decrypt the authorization information and obtain the communication key (stream key). The slave ECUa uses the communication key to encrypt the message to be sent, and generates the HMAC value of the message (the first HMAC value) at the same time, and sends it to the receiving slave ECUb together with the encrypted message; after the slave ECUb receives the message from the slave ECUa, it uses the authorization key of the slave ECUb to decrypt the message to obtain the plain text of the message, and uses the HMAC algorithm to calculate the HMAC value of the message (the second HMAC value), and checks the received HMAC value (the first HMAC value) and the calculated new HMAC value (the second HMAC value). If the two are consistent, it means that the message has not been tampered with, and the message is executed to complete the secure communication, otherwise the communication is stopped. The encrypted message sent from the slave ECUa to the slave ECUb also comes with a unique random number and timestamp to ensure the availability of the communication.

[0063] Information security design includes three aspects: confidentiality, integrity, and availability. Existing information security technologies are not complete enough and generally only include one or two of the three aspects of information security. In addition to being a safety-critical system, the automobile is also a time-critical system. The deployed security measures will increase the latency of automobile applications, and existing security technologies are not lightweight enough. Therefore, the present invention also adds an unencrypted receiving end identifier to each process of authorized communication. After the receiving ECU (slave ECUb) receives the CAN-FD message, it first identifies the receiving end ID. If it is sent to itself, it is received, otherwise it is discarded. This design enables the present invention to have lightweight secure communication.

[0064] Reference Figure 3 , Figure 3 The CAN-FD network architecture of the present invention is shown, including three stm32 chips and three CAN-FD transceivers. The present invention uses the STM32H743 chip of STMicroelectronics to realize CAN-FD network communication. The main chips used in the invention and the chip functions are as follows:

[0065] 3 STM32 development boards: The main related chip is STM32H743IIT. The STM32H743IIT chip uses an ARMCortex M7 core processor and has peripherals such as USART serial port controller and CAN controller required for this design.

[0066] 3 TJA1057 transceivers: TJA1057 is the interface between the CAN-FD protocol controller and the physical bus. The transceiver is designed for high-speed CAN applications in the automotive industry and provides differential transmission and reception capabilities for CAN-FD protocol controllers. The STM32 development board is connected to the CAN-FD bus by connecting the 5V, PA11, PA12, GND and other pins of the STM32 development board.

[0067] STM32 Cryptographic Library (X-CUBE-CRYPTOLIB V4.0): Provided by STMicroelectronics, it provides all information security algorithms including encryption, hashing, message authentication and digital signature. These algorithms have been certified by the US Cryptographic Algorithm Validation Program (CAVP).

[0068] Symmetric encryption algorithms include AES-128, AES-192, AES-256, and support ECB, CBC, CTR, CFB, OFB, CCM, GCM, CMAC, KEY WRAP and XTS modes; there are also DES and TripleDES algorithms, supporting ECB and CBC modes;

[0069] HASH and HMAC support MD5, SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 modes; the random number generator supports the random engine of DRBG-AES-128;

[0070] Asymmetric encryption algorithms include: RSA, ECC, etc.

[0071] like Figure 1 As shown, in one embodiment, after the car is started, the slave ECUa sends a request message to the master ECU, wherein the request message includes a message stream ID of the message encrypted with the authorization key of the slave ECUa, and also includes:

[0072] S01. Before the vehicle is started, the master ECU broadcasts a first digital certificate to all slave ECUs in the CAN-FD domain; wherein the first digital certificate includes a master ECU public key and a first identifier;

[0073] S02, the slave ECU sends registration information to the master ECU; wherein the registration information includes the ciphertext of the authorization key of the current slave ECU formed by the slave ECU encrypting the master ECU public key, the digital signature of the authorization key, and the second digital certificate, wherein the second digital certificate includes the slave ECU public key and the second identifier;

[0074] S03, the master ECU uses the master ECU private key to decrypt the authorization key of the slave ECU currently encrypted with the master ECU public key to obtain a second decryption result, and generates a hash value of the second decryption result, and the master ECU uses the slave ECU public key to decrypt the digital signature to obtain a third decryption result;

[0075] S04. When the hash value of the second decryption result is equal to the third decryption result, the master ECU sends a confirmation message to the slave ECU; wherein the confirmation message includes the first identifier and the second identifier encrypted by the authorization key of the slave ECU;

[0076] S05. The slave ECU receives the confirmation information and uses its authorization key to decrypt the confirmation information to complete the ECU identity authentication of the CAN-FD network.

[0077] As described in the above steps S01-S05, refer to Figure 1 , Figure 1 This is a flow chart of ECU identity authentication before the vehicle is officially used. ECU identity authentication is divided into four steps, namely, master ECU broadcast, slave ECU registration, and master ECU confirmation and slave ECU confirmation. There are multiple slave ECUs, and this embodiment uses one slave ECU for example.

[0078] Master ECU broadcast refers to broadcasting the master ECU's own digital certificate to all slave ECUs in the CAN-FD domain, so that the slave ECU can authenticate the master ECU's identity. A digital certificate is an authoritative electronic document issued by a certificate authority (CA), which includes a node public key, identifier, and other information. This embodiment mainly uses the public key in the digital certificate. Each node has a trusted identity certificate list to verify the identity of other nodes. Broadcasting actually sends the master ECU public key.

[0079] Slave ECU registration is a registration message consisting of three pieces of information sent from the slave ECU to the master ECU, so that the master ECU can authenticate the identity of the slave ECU and share the authorization key with the master ECU. The first piece of information is the authorization key encrypted with the master ECU public key (each slave ECU has its own authorization key); the second piece of information is the master ECU's digital signature on the authorization key, which includes two operations. First, the authorization key is hashed to obtain a hash value, and then the hash value is encrypted with the slave ECU's own private key. The digital signature ensures that the transmitted content has not been tampered with and comes from a legitimate sender; the third piece of information is the slave ECU's digital certificate, which is to share the slave ECU's public key with the master ECU. That is, the registration message is actually composed of two encrypted messages and a slave ECU public key. The slave ECU registration process includes two asymmetric encryption tasks, but the keys used are different: one is the master ECU's public key, and the other is the slave ECU's private key.

[0080] The master ECU confirms that the master ECU verifies the slave ECU registration message and sends a confirmation message encrypted with the slave ECU's authorization key to the slave ECU. The master ECU verifies the slave ECU registration information by two decryption tasks and one hash value comparison. The first decryption is that the master ECU uses its own private key to decrypt the authorization key (that is, the slave ECU's authorization key) encrypted with its public key to obtain the authorization key in plain text, and then hashes the authorization key to obtain a new hash value; the second decryption is to use the slave ECU's public key to decrypt the slave ECU's digital signature to obtain the hash value of the authorization key in the digital signature. A hash value comparison is to compare the hash value calculated by the master ECU with the hash value decrypted in the digital signature. If the two hash values ​​are equal, it means that the authorization key has not been tampered with, otherwise the authentication is stopped. After verifying and obtaining the legal authorization key, the master ECU uses the authorization key (the slave ECU's authorization key) to encrypt the confirmation information and send it to each slave ECU. The master ECU confirmation process includes two asymmetric decryption tasks, using different keys, one using the master ECU's private key and the other using the slave ECU's public key. The two asymmetric decryptions correspond one-to-one with the encryption registered by the slave ECU, which cleverly utilizes the characteristics of asymmetric encryption, where the private key is stored privately and the public key is shared. The authorization key is a symmetric key, which is shared by the master ECU and the slave ECU during the authorization process. However, the authorization key of each slave ECU is different from that of the master ECU, that is, each slave ECU shares its own authorization key with the master ECU, and the master ECU has the authorization key of each slave ECU.

[0081] Slave ECU confirmation means that after the slave ECU receives the confirmation information from the master ECU (the confirmation information includes the first identifier and the second identifier encrypted by the authorization key of the slave ECU), the slave ECU uses the authorization key (the authorization key in the request process, which is also its own authorization key) to decrypt the confirmation information to complete the slave ECU confirmation, thereby completing the entire CAN-FD network ECU identity authentication.

[0082] In one embodiment, the step of encrypting the send message by the slave ECUa using a stream key to obtain a first encryption result and sending the first encryption result to the slave ECUb includes:

[0083] S41, the slave ECUa uses the authorization key of the slave ECUa to decrypt the authorization message to obtain a first stream key;

[0084] S42, using the first stream key to encrypt the sent message to obtain an encrypted message, and generating a first HMAC value of the encrypted message; wherein the encrypted message and the first HMAC value constitute the first encryption result;

[0085] S43. Send the first encryption result to the slave ECUb.

[0086] As described in the above steps S41-S43, slave ECUa uses the authorization key of slave ECUa to decrypt the stream key to obtain a first stream key, which is the stream key decrypted by the authorization key of slave ECUa; then the decrypted stream key is used to encrypt and send a message (that is, a message that slave ECUa needs to send to slave ECUb) to obtain an encrypted message, and at the same time, a first HMAC value of the encrypted message is generated, and then the encrypted message and the first HMAC value are sent to the slave ECUb so that the slave ECUb can decrypt and use it.

[0087] In one embodiment, the step of receiving the first encryption result from ECU b and decrypting the first encryption result using a stream key to obtain a first decrypted result includes:

[0088] S51, the slave ECUb uses the authorization key of the slave ECUb to decrypt the authorization message to obtain a second stream key; wherein the first stream key and the second stream key are the same symmetric key;

[0089] S52, the slave ECUb receives the first encryption result, uses the second stream key to decrypt the ciphertext message in the first encryption result to obtain a plaintext message, and uses the HMAC algorithm to calculate the encrypted message in the first encryption result to obtain a second HMAC value; wherein the plaintext message and the second HMAC value constitute the first decryption result.

[0090] As described in the above steps S51-S52, the first encryption result is received from ECUb, the first encryption result includes an encrypted message and a first HMAC value, and the second stream key is obtained by using the authorized key stream key of the slave ECUb. The second stream key is the stream key decrypted by the authorized key of the slave ECUb; then the encrypted message in the first encryption result is decrypted by using the decrypted stream key to obtain the message plaintext, and then the second HMAC value is calculated by using the HMAC algorithm, so as to compare the first HMAC value and the second HMAC value later. If the two are consistent, it means that the message has not been tampered with, and the message is executed to complete the secure communication, otherwise the communication is stopped.

[0091] In one embodiment, the master ECU uses the master ECU private key to decrypt the authorization key of the slave ECU currently encrypted with the master ECU public key to obtain a second decryption result, and generates a hash value of the second decryption result, and the master ECU uses the slave ECU public key to decrypt the digital signature to obtain a third decryption result, including:

[0092] S031, the master ECU uses the master ECU private key to decrypt the authorization key ciphertext currently encrypted with the master ECU public key to obtain the authorization key in plain text, and the authorization key in plain text is the second decryption result;

[0093] S032. Perform hash calculation on the authorization key in plain text to obtain a first hash value, where the first hash value is the hash value of the second decryption result;

[0094] S033. The master ECU uses the slave ECU public key to decrypt the digital signature and obtains the hash value of the authorization key of the current slave ECU in the digital signature, which is recorded as the second hash value. The second hash value is the third decryption result.

[0095] As described in the above steps S031-S033, the master ECU uses the master ECU private key to decrypt the authorization key of the current slave ECU to obtain the authorization key in plain text, and then performs hash calculation on the authorization key to obtain a first hash value; the master ECU uses the slave ECU public key to decrypt the digital signature (the digital signature of the slave ECU), and obtains the hash value of the authorization key of the current slave ECU in the digital signature, which is recorded as the second hash value, so as to subsequently compare the first hash value and the second hash value. If the two hash values ​​are equal, it means that the authorization key has not been tampered with, otherwise the authentication is stopped.

[0096] In one embodiment, when the ECU sends a message, a CAN-FD message fragmentation mechanism is adopted, and the CAN-FD message fragmentation mechanism includes sending data in a single frame format and sending data in a multi-frame format;

[0097] The single-frame format transmission data includes: the high 4 bits of byte 1 are the single-frame identifier, the low 4 bits of byte 1 are the size of the additional padding data sent in the single frame, and bytes 2 to byte 64 are the data actually sent;

[0098] The multi-frame format sends data including the first frame and continuous frames, the high 4 bits of the first frame byte 1 are the first frame identifier, the low 4 bits of the first frame byte 1 represent the number of continuous frames, the high 4 bits of the continuous frame byte 1 are the continuous frame identifier, the low 4 bits of the continuous frame byte 1 are the continuous frame index, and the continuous frame bytes 2 to byte 64 are the data actually sent.

[0099] As mentioned above, a CAN-FD frame can send up to 64 bytes of data, and after the data is encrypted, it may generate ciphertext exceeding 64 bytes. If the data exceeds 64 bytes, a fragmentation mechanism is required to send the data. This embodiment only changes the data field of the CAN-FD data message so that it can send data exceeding 64 bytes. The fragmentation mechanism is mainly divided into two types of data frame formats for sending data:

[0100] Single frame:

[0101] If the data does not exceed 63 bytes and can be sent in one frame, the data is sent in a single frame. A single frame consists of two parts: a 1-byte identification bit and the data to be sent. The specific format of the data field of a single frame is as follows:

[0102] 1. The high 4 bits of byte 1: single frame identifier, used to identify a single frame and distinguish the type of data when the receiving end receives the data.

[0103] 2. The lower 4 bits of byte 1: the size of the additional padding data sent in a single frame. Since CAN-FD only transmits fixed-length data (0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64), and the actual data length is arbitrary, when the actual data length is inconsistent with the fixed length of CAN-FD data, the fixed length of CAN-FD data is selected upward to send data, and the bytes that are insufficient for actual data are filled with 0. Therefore, the receiving end needs to directly discard the padded data according to the number of bytes of additional data to ensure correct data reception (filled from 33 bytes to 48 bytes and up to 15 bytes, 4 bits can be used to represent all data, that is: 24=16).

[0104] 3. Byte 2 to Byte 64: used to send the data that needs to be sent. Select the data to be sent upward according to the CAN-FD fixed data length, and fill the missing bytes with 0.

[0105] Multi-frame:

[0106] If the data exceeds 63 bytes and cannot be sent in one frame, the data is sent in multiple frames. For data sent in multiple frames, the first frame is called the first frame, and the frames sent subsequently are called consecutive frames.

[0107] 1. The high 4 bits of the first frame byte 1: the first frame identifier, indicating the first frame, is used to identify the type of data when the receiving end receives the data;

[0108] 2. The lower 4 bits of the first frame byte 1: indicate the number of consecutive frames, which can represent 24 = 16 consecutive frames, that is, a total of 16 * 63 = 1008 bytes of data, plus the 63 bytes of data in the last frame, a total of 1071 bytes of data can be transmitted, which is sufficient data size;

[0109] 3. The high 4 bits of the continuous frame byte 1: continuous frame identifier, indicating a continuous frame, is used to identify the type of data when the receiving end receives the data;

[0110] 4. The lower 4 bits of the continuous frame byte 1: continuous frame index, indicating the number of continuous frames;

[0111] 5. Continuous frame byte 2 to byte 64: used to send actual data. The last continuous frame sends the actual data size, which may be a full frame of data or may not be a full frame of data.

[0112] In one embodiment, the request message, authorization message and encrypted message all include a unique random number and a timestamp. The unique random number and timestamp included in the request message effectively resist replay attacks, flood attacks, etc., and ensure the availability of communication. The unique random number and timestamp included in the authorization message are different for different messages, ensuring the availability of communication. The unique random number and timestamp included in the encrypted message also ensure the availability of communication.

[0113] The information security design of the present invention is based on the CAN-FD automobile network. Compared with the existing information security design, it can provide a comprehensive information security design, including intelligent networked vehicle node identity authentication, and lightweight secure communication that ensures confidentiality, integrity and availability. The identity authentication of intelligent networked vehicle nodes is realized by using digital certificates, digital signatures, asymmetric encryption algorithms, and symmetric encryption algorithms; lightweight and comprehensive secure communication is realized by using symmetric encryption algorithms, random numbers and timestamp mechanisms, and HMAC algorithms; the encryption algorithm used is not limited to a certain fixed information algorithm, and can be selected by oneself, and is not limited here.

[0114] Advantages and positive effects of the present invention:

[0115] 1. Comprehensive security: The use of communication key encryption ensures the confidentiality of the message, HMAC ensures the integrity of the message, and the random number and timestamp mechanism ensures the availability of the message, reflecting comprehensive information security.

[0116] 2. Lightweight secure communication: Lightweight means that each process of authorized communication also adds an additional encrypted receiver identifier. After receiving the CAN-FD message, the receiving ECU first identifies the receiver ID. If it is sent to itself, it will be received, otherwise it will be discarded.

[0117] 3. Strong compatibility: All asymmetric encryption algorithms, symmetric encryption algorithms and hash algorithms used in the present invention can freely select different types of cryptographic algorithms without being affected by the design, which reflects the strong compatibility of the present invention.

[0118] like Figure 4 As shown, the present invention also provides an information security communication device based on a vehicle CAN-FD network, comprising:

[0119] A first sending module 1, used to send a request message from ECUa to the master ECU after the car is started, wherein the request message includes a message stream ID encrypted with the authorization key of the slave ECUa;

[0120] The first decryption module 2 is used for the master ECU to decrypt the request message using the authorization key of the slave ECUa to obtain the target message stream ID, and verify the legitimacy of the target message stream ID according to the access control list;

[0121] The second sending module 3 is used for the master ECU to generate authorization information and send the authorization information to the slave ECUa and the slave ECUb when the target message stream ID is legal; wherein the authorization information includes the stream key encrypted by the authorization key of the slave ECUa and the authorization key of the slave ECUb;

[0122] An encryption module 4, used for the slave ECUa to encrypt the sending message with a stream key, obtain a first encryption result and send the first encryption result to the slave ECUb;

[0123] A second decryption module 5, configured to receive the first encryption result from the slave ECUb, and decrypt the first encryption result using a stream key to obtain a first decrypted result;

[0124] The comparison module 6 is used to complete the information security communication of the automobile CAN-FD network when the first encryption result and the first decryption result are successfully compared.

[0125] In one embodiment, it further includes:

[0126] A broadcast module, used for the master ECU to broadcast a first digital certificate to all slave ECUs in the CAN-FD domain before the vehicle is started; wherein the first digital certificate includes a master ECU public key and a first identifier;

[0127] A registration information sending module, used for the slave ECU to send registration information to the master ECU; wherein the registration information includes a ciphertext of the authorization key of the current slave ECU formed by the slave ECU using the master ECU public key to encrypt, a digital signature of the authorization key, and a second digital certificate, wherein the second digital certificate includes the slave ECU public key and a second identifier;

[0128] A second decryption result module, used for the master ECU to decrypt the authorization key of the slave ECU currently encrypted with the master ECU public key using the master ECU private key to obtain a second decryption result, and generate a hash value of the second decryption result, and the master ECU to decrypt the digital signature using the slave ECU public key to obtain a third decryption result;

[0129] a confirmation information sending module, configured to cause the master ECU to send confirmation information to the slave ECU when the hash value of the second decryption result is equal to the third decryption result; wherein the confirmation information includes the first identifier and the second identifier encrypted by the authorization key of the slave ECU;

[0130] The slave ECU receives the confirmation information and uses its authorization key to decrypt the confirmation information to complete the ECU identity authentication of the CAN-FD network.

[0131] In one embodiment, the encryption module 4 includes:

[0132] A first stream key unit, used for the slave ECUa to decrypt the authorization message using the authorization key of the slave ECUa to obtain a first stream key;

[0133] an encryption message unit, configured to encrypt the sent message with a first stream key to obtain an encrypted message, and generate a first HMAC value of the encrypted message; wherein the encrypted message and the first HMAC value constitute the first encryption result;

[0134] An encrypted message sending unit is used to send the first encryption result to the slave ECUb.

[0135] In one embodiment, the second decryption module 5 comprises:

[0136] A second stream key unit, wherein the slave ECUb uses the authorization key of the slave ECUb to decrypt the authorization message to obtain a second stream key; wherein the first stream key and the second stream key are the same symmetric key;

[0137] A plaintext message unit is used for receiving the first encryption result from ECUb, decrypting the ciphertext message in the first encryption result using the second stream key to obtain a plaintext message, and calculating the encrypted message in the first encryption result using the HMAC algorithm to obtain a second HMAC value; wherein the plaintext message and the second HMAC value constitute the first decryption result.

[0138] In one embodiment, the second decryption result module includes:

[0139] An authorization key unit, used for the master ECU to decrypt the authorization key ciphertext currently encrypted with the master ECU public key using the master ECU private key to obtain the authorization key in plain text, where the authorization key in plain text is the second decryption result;

[0140] A second decryption result unit, configured to perform hash calculation on the authorization key in plain text to obtain a first hash value, where the first hash value is the hash value of the second decryption result;

[0141] The third decryption result unit is used for the master ECU to decrypt the digital signature using the slave ECU public key to obtain the hash value of the authorization key of the current slave ECU in the digital signature, which is recorded as the second hash value. The second hash value is the third decryption result.

[0142] In one embodiment, when the ECU sends a message, a CAN-FD message fragmentation mechanism is adopted, and the CAN-FD message fragmentation mechanism includes sending data in a single frame format and sending data in a multi-frame format;

[0143] The single-frame format transmission data includes: the high 4 bits of byte 1 are the single-frame identifier, the low 4 bits of byte 1 are the size of the additional padding data sent in the single frame, and bytes 2 to byte 64 are the data actually sent;

[0144] The multi-frame format sends data including the first frame and continuous frames, the high 4 bits of the first frame byte 1 are the first frame identifier, the low 4 bits of the first frame byte 1 represent the number of continuous frames, the high 4 bits of the continuous frame byte 1 are the continuous frame identifier, the low 4 bits of the continuous frame byte 1 are the continuous frame index, and the continuous frame bytes 2 to byte 64 are the data actually sent.

[0145] In one embodiment, the request message, authorization message and encryption message all include a unique random number and a timestamp.

[0146] The above modules and units are used to execute the corresponding steps in the above-mentioned information security communication method based on the automobile CAN-FD network. The specific implementation method thereof is described in the above-mentioned method embodiment and will not be repeated here.

[0147] like Figure 5 As shown, the present invention also provides a computer device, which can be a server, and its internal structure can be as shown in Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store all data required for the process of the information security communication method based on the automobile CAN-FD network. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the information security communication method based on the automobile CAN-FD network is implemented.

[0148] Those skilled in the art will understand that Figure 5The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.

[0149] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned information security communication methods based on the automotive CAN-FD network is implemented.

[0150] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0151] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0152] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An information security communication method based on an automotive CAN-FD network, characterized in that: include: After the car is started, the slave ECUa sends a request message to the master ECU, wherein the request message includes a message stream ID encrypted with the authorization key of the slave ECUa; The master ECU decrypts the request message using the authorization key of the slave ECUa to obtain the target message stream ID, and verifies the legitimacy of the target message stream ID according to the access control list; When the target message stream ID is legal, the master ECU generates authorization information and sends the authorization information to the slave ECUa and the slave ECUb; wherein the authorization information includes a stream key encrypted by the authorization key of the slave ECUa and the authorization key of the slave ECUb; The slave ECUa encrypts the sending message using a stream key to obtain a first encryption result and sends the first encryption result to the slave ECUb; The slave ECUb receives the first encryption result, and decrypts the first encryption result using a stream key to obtain a first decrypted result; When the first encryption result and the first decryption result are successfully compared, the information security communication of the vehicle CAN-FD network is completed; The step of encrypting the send message by using a stream key from the slave ECUa to obtain a first encryption result and sending the first encryption result to the slave ECUb comprises: The slave ECUa uses the authorization key of the slave ECUa to decrypt the authorization information to obtain a first stream key; Encrypt the sent message using a first stream key to obtain an encrypted message, and generate a first HMAC value of the encrypted message; wherein the encrypted message and the first HMAC value constitute the first encryption result; Sending the first encryption result to the slave ECUb; The step of receiving the first encryption result from ECUb and decrypting the first encryption result using a stream key to obtain a first decrypted result includes: The slave ECUb uses the authorization key of the slave ECUb to decrypt the authorization information to obtain a second stream key; wherein the first stream key and the second stream key are the same symmetric key; The slave ECUb receives the first encryption result, uses the second stream key to decrypt the ciphertext message in the first encryption result to obtain a plaintext message, and uses the HMAC algorithm to calculate the encrypted message in the first encryption result to obtain a second HMAC value; wherein the plaintext message and the second HMAC value constitute the first decryption result.

2. The information security communication method based on the automobile CAN-FD network according to claim 1 is characterized in that: After the car is started, the slave ECUa sends a request message to the master ECU, wherein the request message includes a message stream ID encrypted with the authorization key of the slave ECUa before sending the message, and further includes: Before the car is started, the master ECU broadcasts a first digital certificate to all slave ECUs in the CAN-FD domain; wherein the first digital certificate includes the master ECU public key and a first identifier; The slave ECU sends registration information to the master ECU; wherein the registration information includes a ciphertext of the authorization key of the current slave ECU formed by the slave ECU encrypting the master ECU public key, a digital signature of the authorization key, and a second digital certificate, wherein the second digital certificate includes the slave ECU public key and a second identifier; The master ECU uses the master ECU private key to decrypt the authorization key currently encrypted by the master ECU public key to obtain a second decryption result, and generates a hash value of the second decryption result. The master ECU uses the slave ECU public key to decrypt the digital signature to obtain a third decryption result. When the hash value of the second decryption result is equal to the third decryption result, the master ECU sends a confirmation message to the slave ECU; wherein the confirmation message includes the first identifier and the second identifier encrypted by the authorization key of the slave ECU; The slave ECU receives the confirmation information and uses its authorization key to decrypt the confirmation information to complete the ECU identity authentication of the CAN-FD network.

3. The information security communication method based on the automobile CAN-FD network according to claim 2 is characterized in that: The master ECU uses the master ECU private key to decrypt the authorization key of the slave ECU currently encrypted with the master ECU public key to obtain a second decryption result, and generates a hash value of the second decryption result, and the master ECU uses the slave ECU public key to decrypt the digital signature to obtain a third decryption result, including: The master ECU uses the master ECU private key to decrypt the authorization key ciphertext currently encrypted with the master ECU public key to obtain the authorization key in plain text, and the authorization key in plain text is the second decryption result; Performing hash calculation on the authorization key in plain text to obtain a first hash value, where the first hash value is the hash value of the second decryption result; The master ECU uses the slave ECU public key to decrypt the digital signature and obtains the hash value of the authorization key of the current slave ECU in the digital signature, which is recorded as the second hash value. The second hash value is the third decryption result.

4. The information security communication method based on the automobile CAN-FD network according to claim 1 is characterized in that: When sending a message from ECUa, a CAN-FD message fragmentation mechanism is adopted, and the CAN-FD message fragmentation mechanism includes sending data in a single frame format and sending data in a multi-frame format; The single-frame format transmission data includes: the high 4 bits of byte 1 are the single-frame identifier, the low 4 bits of byte 1 are the size of the additional padding data sent in the single frame, and bytes 2 to byte 64 are the data actually sent; The multi-frame format sends data including the first frame and continuous frames, the high 4 bits of the first frame byte 1 are the first frame identifier, the low 4 bits of the first frame byte 1 represent the number of continuous frames, the high 4 bits of the continuous frame byte 1 are the continuous frame identifier, the low 4 bits of the continuous frame byte 1 are the continuous frame index, and the continuous frame bytes 2 to byte 64 are the data actually sent.

5. The information security communication method based on the automobile CAN-FD network according to claim 1 is characterized in that: The request message, authorization information and encrypted message all include a unique random number and a timestamp.

6. An information security communication device based on a vehicle CAN-FD network, characterized in that: include: A first sending module, used for sending a request message from ECUa to the master ECU after the car is started, wherein the request message includes a message stream ID encrypted by using the authorization key of the slave ECUa to send the message; A first decryption module, used for the master ECU to decrypt the request message using the authorization key of the slave ECUa, obtain the target message stream ID, and verify the legitimacy of the target message stream ID according to the access control list; A second sending module, configured to generate authorization information by the master ECU and send the authorization information to the slave ECUa and the slave ECUb when the target message stream ID is legal; wherein the authorization information includes a stream key encrypted by the authorization key of the slave ECUa and the authorization key of the slave ECUb; An encryption module, used for the slave ECUa to encrypt the sending message with a stream key, obtain a first encryption result and send the first encryption result to the slave ECUb; A second decryption module, configured to receive the first encryption result from the slave ECUb, and decrypt the first encryption result using a stream key to obtain a first decrypted result; A comparison module, configured to complete information security communication of the automobile CAN-FD network when the first encryption result and the first decryption result are successfully compared; The step of encrypting the send message by using a stream key from the slave ECUa to obtain a first encryption result and sending the first encryption result to the slave ECUb comprises: The slave ECUa uses the authorization key of the slave ECUa to decrypt the authorization information to obtain a first stream key; Encrypt the sent message using a first stream key to obtain an encrypted message, and generate a first HMAC value of the encrypted message; wherein the encrypted message and the first HMAC value constitute the first encryption result; Sending the first encryption result to the slave ECUb; The step of receiving the first encryption result from ECUb and decrypting the first encryption result using a stream key to obtain a first decrypted result includes: The slave ECUb uses the authorization key of the slave ECUb to decrypt the authorization information to obtain a second stream key; wherein the first stream key and the second stream key are the same symmetric key; The slave ECUb receives the first encryption result, uses the second stream key to decrypt the ciphertext message in the first encryption result to obtain a plaintext message, and uses the HMAC algorithm to calculate the encrypted message in the first encryption result to obtain a second HMAC value; wherein the plaintext message and the second HMAC value constitute the first decryption result.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Cited By

  • CAN network secure transmission method and system based on credibility of address binding relationship

    CN122204563A