A system for protecting the information security of passenger car EPS calibration messages
By using the encryption and signature module combined with SM4 and SM2 algorithms in intelligent connected buses, combined with the private key and location information obtained from vehicle status data, a 16-byte ciphertext is generated and digital signature and hash value processing is performed, and transmitted through registers Verifying information solves the problems of poor anti-playback performance and low randomness of encrypted content in the prior art, and realizes efficient information security protection on mass-produced vehicles.
Patent Information
- Application Number
- CN202210780133.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When protecting the security of EPS calibration packet information of intelligent connected passenger buses, the anti-playback performance is poor and cannot be fully installed on the mass-produced vehicle. The randomness of the encrypted content is reduced and it cannot effectively prevent attackers from using brute force replay methods. Forged encrypted packets.
The encryption and signature module is adopted that combines the SM4 algorithm and the SM2 signature algorithm. The vehicle status data acquisition module is used to obtain the private key and vehicle position information, generate 16-byte ciphertext and perform digital signature and hash value processing, and transmit key verification information through registers. , enhance the randomness and anti-playback performance of encrypted content.
It realizes efficient prevention of message replay and tampering on mass-produced vehicles, enhances the security of information transmission, ensures the randomness of encrypted content and anti-playback performance, and avoids attackers from extracting check values and verification through the CAN bus. Rules improve information security.
Smart Images

Figure CN115174065B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of information security, and in particular to a system for protecting the information security of EPS calibration messages of passenger cars. Background Art
[0002] The existing intelligent network bus EPS calibration software, after the key verification is successful, connects to the external diagnostic CAN line, sends calibration messages (calibration command messages) to modify the steering wheel angle, torque and other information. The calibration instructions of the message can be directly obtained through the Internet of Vehicles monitoring platform, connecting to the industrial-grade enhanced CAN interface card, and recorder playback. The calibration parameter indicators of the vehicle manufacturer and EPS motor can also be obtained. Developers can use this message to recalibrate the zero point, torque and other important parameters of the EPS steering machine without being limited to the site and time, which poses a major safety hazard to the normal driving of buses.
[0003] At present, the technology generally uses a microcontroller unit (MCU) with a hardware security module to encrypt CAN message data (calibration messages sent by the intelligent network-connected bus EPS calibration software), and adopts dynamic keys, inserts identification bits for message IDs, verifies the number of transmissions and receptions, and other methods to achieve encrypted communication of CAN bus messages. Due to the consistency of the calibration message data content, it is easy for network attackers to find encryption rules for brute force cracking and playback; although the software-defined digital signature can enhance the integrity and unforgeability of the message data, there is a possibility that the software code is illegally tampered with, resulting in signature forgery and increasing the operating load of the microcontroller unit (MCU); in addition, the bus EPS calibration requires a professional test road. Therefore, obtaining the GPS time and positioning information of the vehicle-mounted GPS driving recorder to design a restricted venue and time, encrypting the content of the EPS calibration command message, and enhancing the randomness of the calibration command message content and the unforgeability of the digital signature are key technologies for protecting the EPS calibration command message.
[0004] The vehicle-mounted CAN bus message encryption communication technology refers to the use of encryption algorithms in CAN bus communications (especially smart connected vehicles) that are easy to record, easy to replay, and have no security protection. The sending encryption node introduces a key to encrypt the CAN bus message data field. After receiving the encrypted message, the receiving decryption node decrypts the encrypted message by reading the key to obtain the data field plaintext to complete the encrypted communication. The data field is encrypted in the CAN bus transmission message. Therefore, the true content of the message cannot be obtained from the replayed recorded data, which ultimately protects the information security of each CAN network node on the vehicle side.
[0005] The current technical solution adopts dynamic key encryption, that is, it stipulates that a single message corresponds to a key, and a dynamic key library is composed of multiple messages. The hardware-protected security register has high reliability, and the dynamic key library is flashed into the ECU's local security register to achieve the isolation of the dynamic key library information from the ECU's external communication. The sending node ECU extracts key A from the local register according to the ID of the message to be encrypted, and encrypts the message data field, while the receiving node ECU extracts key A from the pre-loaded dynamic key library according to the encrypted message ID, decrypts the message data field to obtain the plaintext content of the message data field. An attacker needs to crack all message keys to steal all the plaintext information of the vehicle-side messages from the CAN bus, which increases the cracking time and enhances the integrity of the security information.
[0006] To prevent attackers from recording encrypted messages and maliciously replaying them on the vehicle side, the data security on the vehicle side is further strengthened. The existing technical solution adopts an anti-replay mechanism, that is, identifying the messages of the secure encrypted sending node and eliminating the attacker's messages. Generally, this mechanism uses a byte in the message data field to fill the content of the number of times the message is sent and received based on a local counter; or the byte is filled with information means such as the message content check value obtained based on the checksum algorithm. The byte content and the remaining seven bytes of the original content of the message form a plaintext, which is encrypted and transmitted to the secure decryption receiving node. The plaintext decrypted by the secure decryption receiving node obtains the number of times ...
[0007] As mentioned above, the local dynamic key encryption and the message data field insertion verification value mechanism prevents attackers from stealing message data, and also prevents attackers from replaying and tampering to a certain extent. To achieve vehicle-mounted CAN bus message encryption communication, the flow chart is as follows Figure 1 As shown, Figure 1 A flow chart of a technical solution of the prior art is shown.
[0008] Most of the existing technologies only use encryption algorithms and injection check value methods to achieve encrypted communication to prevent replay theft. First, the number of transmission and reception times, heartbeat value, freshness, checksum and other information means are designed to occupy one byte of the message data field. The verification byte has at most 64 possible data, resulting in poor anti-replay performance. At the same time, the data fields of various CAN messages in mass-produced vehicles do not have at least one byte reserved position, and the existing methods cannot be fully implemented on mass-produced vehicles; secondly, the content of the EPS calibration instruction message remains unchanged, so the checksum value remains unchanged. It is worth noting that the use of a counter verification method as mentioned above reduces the randomness of the encrypted content. The attacker uses a brute force replay method. Although the attacker does not crack the true content of the data, it causes multiple frames of encrypted messages to be decrypted and verified by the receiving node and not eliminated.
[0009] In summary, the existing method of encrypting and protecting the calibration message sent by the intelligent connected bus EPS calibration software, that is, the existing method of protecting the information security of the bus EPS calibration message has the defects of poor anti-replay performance, inability to be fully installed on mass-produced vehicles, and reduced randomness of the encrypted content. Summary of the invention
[0010] The purpose of the present invention is to provide a system for protecting the information security of EPS calibration messages of passenger cars, so as to achieve good anti-replay performance, be fully installed on mass-produced cars, and enhance the randomness of encrypted content.
[0011] To achieve the above object, the present invention provides the following solutions:
[0012] A system for protecting the information security of EPS calibration messages for passenger cars, the system comprising a sending node vehicle status data acquisition module, a sending node encryption and signature module, a receiving node decryption and signature verification module, and a register;
[0013] The sending node vehicle status data acquisition module is used to obtain a private key, the vehicle's current position and a calibration instruction, and when it is determined that the private key, the current time and the position are all in an authorized state, the calibration instruction, the current time, the position and the private key are all sent to the sending node encryption and signature module;
[0014] The sending node encryption and signature module is used to use the SM4 algorithm and the private key to encrypt and generate a 16-byte ciphertext by mixing the current time, the position and the calibration instruction, and use the SM2 signature algorithm to generate a first digital signature and a first hash value for the 16-byte ciphertext, and use the SM2 signature algorithm to generate a public key for the private key; the 16-byte ciphertext includes an 8-byte ciphertext of the calibration instruction and an 8-byte ciphertext of the current time and position; the sending node encryption and signature module is also used to upload the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key to the register, and send the 8-byte ciphertext of the calibration instruction to the receiving node decryption and signature verification module;
[0015] The receiving node decryption and signature verification module is used to read the 8-byte ciphertext at the current time and position, the first digital signature, the first hash value and the public key from the register, use the ciphertext of the 8-byte calibration instruction and the 8-byte ciphertext at the current time and position to form the 16-byte ciphertext, and use the SM2 signature verification algorithm and the public key to generate a second digital signature and a second hash value for the 16-byte ciphertext; the receiving node decryption and signature verification module is also used to compare the first digital signature with the second digital signature, compare the first hash value with the second hash value, and when the first digital signature and the second digital signature are the same and the first hash value and the second hash value are the same, use the SM4 algorithm to decrypt the 16-byte ciphertext, extract the calibration instruction, and send the calibration instruction to the vehicle.
[0016] Optionally, the sending node vehicle status data acquisition module specifically includes a driving recorder information acquisition submodule, a key detection submodule, and an EPS request instruction detection and feedback submodule;
[0017] The driving recorder information acquisition submodule is used to obtain the location of the vehicle at the current moment, and determine whether the current moment and the location are both in an authorized state. When the current moment and the location are both in an authorized state, the current moment and the location are sent to the sending node encryption and signature module;
[0018] The key detection submodule is used to obtain a private key and determine whether the private key is in an authorized state. When the private key is in an authorized state, the private key is sent to the sending node encryption and signature module;
[0019] The EPS request instruction detection and feedback submodule is used to obtain the calibration instruction and determine whether the calibration instruction is correct; the EPS request instruction detection and feedback submodule is also used to determine whether to send the calibration instruction to the sending node encryption and signature module based on whether the current moment and the position are both in an authorized state and whether the calibration instruction is correct. When the calibration instruction is correct and the current moment and the position are both in an authorized state, the calibration instruction is sent to the sending node encryption and signature module.
[0020] Optionally, the sending node encryption and signature module specifically includes an SM4 algorithm encryption submodule, an SM2 algorithm signature submodule and an upload register submodule;
[0021] The SM4 algorithm encryption submodule is used to encrypt the current time, the position and the calibration instruction by using the SM4 algorithm and the private key to generate a 16-byte ciphertext; the 16-byte ciphertext includes an 8-byte ciphertext of the calibration instruction and an 8-byte ciphertext of the current time and position;
[0022] The SM2 algorithm signature submodule is used to generate a first digital signature and a first hash value for the 16-byte ciphertext using the SM2 signature algorithm, and to generate a public key for the private key using the SM2 signature algorithm;
[0023] The upload register submodule is used to upload the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key to the register, and send the ciphertext of the 8-byte calibration instruction to the receiving node decryption and signature verification module.
[0024] Optionally, the receiving node decryption and signature verification module specifically includes a download register submodule, an SM2 algorithm signature verification submodule and an SM4 algorithm decryption submodule;
[0025] The download register submodule is used to read the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key from the register, and use the 8-byte ciphertext of the calibration instruction and the 8-byte ciphertext of the current time and position to form the 16-byte ciphertext;
[0026] The SM2 algorithm signature verification submodule is used to generate a second digital signature and a second hash value for the 16-byte ciphertext using the SM2 signature verification algorithm and the public key; the SM2 algorithm signature verification submodule is also used to compare the first digital signature with the second digital signature, and compare the first hash value with the second hash value;
[0027] The SM4 algorithm decryption submodule is used to decrypt the 16-byte ciphertext using the SM4 algorithm when the first digital signature and the second digital signature are the same and the first hash value and the second hash value are the same, extract the calibration instruction, and send the calibration instruction to the vehicle.
[0028] Optionally, the system further comprises a host computer interface;
[0029] The host computer interface is used to input private keys and calibration instructions.
[0030] Optionally, the private key includes an administrator key and a user key.
[0031] Optionally, the system is developed based on CANoe software.
[0032] Optionally, the register is a register designed by using the System Variables module in the environment functional area of the CANoe software, which can read and write local system global variables by multiple security nodes.
[0033] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0034] The system for protecting the information security of EPS calibration messages of passenger cars disclosed by the present invention, the sending node encryption and signature module uses the SM2 signature algorithm to enhance the anti-replay performance, the anti-replay performance is good, and the randomness is the same as the anti-replay performance, so the sending node encryption and signature module also enhances the randomness of the encrypted content. By designing a register of multi-node readable and writable global variables, unlike the previous method of injecting verification values into the message data domain, key verification information, such as digital signatures, hash values and public keys, communicate with each node through the register, compared with designing up to eight bytes of security verification content in the data domain message, the number of bytes of key security information is increased, thereby enhancing the randomness of the verification information, the attacker cannot extract the check value of the message through the CAN bus, and cannot learn the verification rules, the information transmission security is stronger, because the number of byte bits in the message data domain is not changed, so the original CAN communication protocol and message definition of the mass-produced vehicle are not destroyed, and for a variety of message definitions, especially messages with eight-byte data domains already defined, the system can be implemented on mass-produced vehicles, can be fully installed on mass-produced vehicles, and has high versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0036] Figure 1 It is a flow chart of the technical solution of the prior art;
[0037] Figure 2 A structural diagram of an embodiment of a system for protecting the information security of EPS calibration messages for passenger vehicles according to the present invention;
[0038] Figure 3 It is a diagram of the overall system structure of the present invention;
[0039] Figure 4 This is a schematic diagram of the platform construction scheme of the present invention;
[0040] Figure 5 This is a flow chart of the sending node vehicle status data acquisition module S10 of the present invention;
[0041] Figure 6 This is a flow chart of encrypted communication between the sending node encryption and signature module S20 and the receiving node decryption and signature verification module S30 of the present invention;
[0042] Figure 7This is a flow chart of encryption at the sending node and decryption at the receiving node in step S212 and step S331 of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The purpose of the present invention is to provide a system for protecting the information security of EPS calibration messages of passenger cars, so as to achieve good anti-replay performance, be fully installed on mass-produced cars, and enhance the randomness of encrypted content.
[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0046] First, the professional terms involved in the present invention are explained below:
[0047] EPS: Electric Power Steering, electric power steering system.
[0048] CAN: Controller Area Network, controller area network.
[0049] ECU: Electronic Control Unit, electronic control unit.
[0050] CAPL: Communication Access Programming Language, communication access programming language.
[0051] DLL: Dynamic Link Library, dynamic link library.
[0052] Figure 2 The structure diagram of the system embodiment of the present invention for protecting the information security of EPS calibration messages for passenger cars. Figure 3 This is the overall system structure diagram of the present invention. Figure 2 and Figure 3 The system for protecting the information security of passenger car EPS calibration message includes a sending node vehicle status data acquisition module S10, a sending node encryption and signature module S20, a receiving node decryption and signature verification module S30 and a register S40.
[0053] The sending node vehicle status data acquisition module S10 is used to obtain the private key, the vehicle's current location and calibration instructions, and when it is determined that the private key, current time and location are all authorized, the calibration instructions, current time, location and private key are sent to the sending node encryption and signature module S20.
[0054] The sending node encryption and signature module S20 is used to use the SM4 algorithm and the private key to encrypt and generate a 16-byte ciphertext by mixing the current time, position and calibration instruction, and use the SM2 signature algorithm to generate a first digital signature and a first hash value for the 16-byte ciphertext, and use the SM2 signature algorithm to generate a public key for the private key; the 16-byte ciphertext includes an 8-byte ciphertext of the calibration instruction and an 8-byte ciphertext of the current time and position; the sending node encryption and signature module S20 is also used to upload the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key to the register S40, and send the 8-byte ciphertext of the calibration instruction to the receiving node decryption and signature verification module S30.
[0055] The receiving node decryption and signature verification module S30 is used to read the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key from the register S40, use the 8-byte ciphertext of the calibration instruction and the 8-byte ciphertext of the current time and position to form a 16-byte ciphertext, and use the SM2 signature verification algorithm and the public key to generate a second digital signature and a second hash value for the 16-byte ciphertext; the receiving node decryption and signature verification module S30 is also used to compare the first digital signature with the second digital signature, compare the first hash value with the second hash value, and when the first digital signature and the second digital signature are the same and the first hash value and the second hash value are the same, use the SM4 algorithm to decrypt the 16-byte ciphertext, extract the calibration instruction, and send the calibration instruction to the vehicle.
[0056] Specifically, the sending node vehicle status data acquisition module S10 specifically includes a driving recorder information acquisition submodule S110, a key detection submodule S120, and an EPS request instruction detection and feedback submodule S130.
[0057] The driving recorder information acquisition submodule S110 is used to obtain the vehicle's current location and determine whether the current time and location are both authorized. When the current time and location are both authorized, the current time and location are sent to the sending node encryption and signature module S20.
[0058] The key detection submodule S120 is used to obtain the private key and determine whether the private key is in an authorized state. When the private key is in an authorized state, the private key is sent to the sending node encryption and signature module S20.
[0059] The EPS request instruction detection and feedback submodule S130 is used to obtain the calibration instruction and determine whether the calibration instruction is correct; the EPS request instruction detection and feedback submodule S130 is also used to determine whether to send the calibration instruction to the sending node encryption and signature module S20 based on whether the current time and position are both in an authorized state and whether the calibration instruction is correct. When the calibration instruction is correct and the current time and position are both in an authorized state, the calibration instruction is sent to the sending node encryption and signature module S20.
[0060] The sending node encryption and signature module S20 specifically includes an SM4 algorithm encryption submodule S210, an SM2 algorithm signature submodule S220 and an upload register submodule S230.
[0061] The SM4 algorithm encryption submodule S210 is used to use the SM4 algorithm and the private key to encrypt the current time, position and calibration instruction to generate a 16-byte ciphertext; the 16-byte ciphertext includes an 8-byte ciphertext of the calibration instruction and an 8-byte ciphertext of the current time and position.
[0062] The SM2 algorithm signature submodule S220 is used to generate a first digital signature and a first hash value for a 16-byte ciphertext using the SM2 signature algorithm, and to generate a public key for a private key using the SM2 signature algorithm.
[0063] The upload register submodule S230 is used to upload the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key to the register S40, and send the ciphertext of the 8-byte calibration instruction to the receiving node decryption and signature verification module S30.
[0064] The receiving node decryption and signature verification module S30 specifically includes a download register submodule S310, an SM2 algorithm signature verification submodule S320 and an SM4 algorithm decryption submodule S330.
[0065] The download register submodule S310 is used to read the 8-byte current time and position ciphertext, the first digital signature, the first hash value and the public key from the register S40, and use the 8-byte calibration instruction ciphertext and the 8-byte current time and position ciphertext to form a 16-byte ciphertext.
[0066] The SM2 algorithm signature verification submodule S320 is used to generate a second digital signature and a second hash value for the 16-byte ciphertext using the SM2 signature verification algorithm and the public key; the SM2 algorithm signature verification submodule S320 is also used to compare the first digital signature with the second digital signature, and to compare the first hash value with the second hash value.
[0067] The SM4 algorithm decryption submodule S330 is used to decrypt the 16-byte ciphertext using the SM4 algorithm when the first digital signature and the second digital signature are the same and the first hash value and the second hash value are the same, extract the calibration instruction, and send the calibration instruction to the vehicle.
[0068] Furthermore, the system for protecting the information security of the EPS calibration message of the passenger car is developed based on CANoe software. The system for protecting the information security of the EPS calibration message of the passenger car also includes a host computer interface; the host computer interface is used to input a private key and a calibration instruction. Among them, the private key includes an administrator key and a user key.
[0069] Specifically, the register S40 is a register designed by using the System Variables module in the environment functional area of the CANoe software, which can read and write local system global variables by multiple security nodes.
[0070] The technical solution of the present invention is described below with a specific embodiment:
[0071] The system for protecting the information security of EPS calibration messages of buses of the present invention provides a method for encrypting and protecting calibration messages (calibration instructions) sent by EPS calibration software of intelligent networked buses. The calibration software is sent by CANoe software used by the method of the present invention.
[0072] The present invention first uses the SystemVariables module in the environment functional area of CANoe to design registers that can read and write local system global variables by multiple secure nodes (the method of the present invention is developed using CANoe software, and the nodes can functionally read the SystemVariables module, and the method must be designed to upload or initialize variables). Security information such as keys, hash values, and digital signatures interact in the node automation module programmed by the CANoe software CAPL (similar to the C language in syntax and concept), without communicating through the CAN bus. The content of the data field of the EPS calibration instruction message is consistent, and the digital signature generated each time is unique. At the same time, it does not destroy the original CAN communication protocol and message definition of mass-produced vehicles and strengthens the security of the transmission of the check value information. Secondly, the encryption, decryption and signature verification source code based on the national commercial secret algorithm standard is encapsulated into a dynamic link library (DynamicLinkLibrary, DLL) that can be loaded by CAPL programming using CAPL DLL technology. Because only when the application software CANoe calls the encapsulated encryption, decryption and signature verification algorithm, that is, the encryption, decryption and signature verification source code of the national commercial secret algorithm standard, the system will load this DLL into the memory space, so it not only reduces the size of the node automation programming file and the occupation of memory space, but also can be used by multiple security nodes at the same time. According to the CANoeDLL code requirements, the encryption, decryption and signature verification source code of the national commercial secret algorithm standard is encapsulated into a DLL that can be called in CANOECAPL (compiler), and the DLL has an operational advantage. Finally, based on the vehicle-side driving recorder positioning and time information, a mechanism is designed to limit the location and time of the test vehicle when the user operates the security encryption module of the software of the present invention (sending node encryption and signature module S20 and receiving node decryption and verification module S30), to ensure that EPS calibration is carried out at the specified experimental location and experimental time.
[0073] The method for protecting the EPS calibration message information of a bus proposed in the present invention first determines whether the private key input into the security encryption module of the software is correct (the present invention designs a simple upper computer interface in the CANoe software, the user enters the key in the key column, clicks send, and if the verification is successful, the instruction can be entered in the instruction column). When it is detected that the private key is authorized, the EPS feedback message reading module (EPS request instruction detection and feedback submodule S130) is activated; through the GPS and time signal acquisition module (driving recorder information acquisition submodule S110), the time and space where the intelligent networked bus is located is quantitatively classified to determine whether the time and place of the vehicle end requesting calibration are authorized, that is, to determine whether the request time and the longitude and latitude of the test vehicle are within the authorized range, or within the unauthorized request time and place; when the private key, time and place are successfully authorized at the same time, the EPS request calibration message is sent for activation (the program is just a conditional function, which determines that the private key and GPS information are correct and sends instructions to the encryption ECU). After sending the correct EPS request calibration instruction, the first step is that the sending node encryption communication module (SM4 algorithm encryption submodule S210) combines the time and location information of the driving recorder and encrypts it based on the SM4 symmetric encryption algorithm to form a sixteen-byte ciphertext. The second step is the secure sending node signature communication module (SM2 algorithm signature submodule S220), based on the SM2 algorithm signature verification part, generates a signature and hash value for the sixteen-byte ciphertext. Generate a public key for the private key entered by the user. Anti-replay is partially strengthened using the national standard SM2 signature algorithm, and the randomness is the same as anti-replay. The third step is that after the signature is completed, part of the ciphertext is assigned to the message data field, and the public key, signature, hash value and the ciphertext part that is not assigned to the message are uploaded to the register. The last step is that in the closed-circuit CAN, the receiving node decryption module (SM4 algorithm decryption submodule S330) detects the encrypted message of the external CAN bus, downloads the register content, and verifies the signature, hash value, and time of the recorder in the decrypted plaintext of the message. After successful verification, the receiving node (receiving bus) performs EPS calibration.
[0074] According to the different sources of EPS calibration users, two request permission levels are designed based on the private key classification, namely the general user mode and the administrator mode. In the general user mode, the EPS calibration is performed at the time and place authorized by the vehicle manufacturer. Therefore, the general user mode is entered after the verification of the general user private key, ensuring that the downstream developers or users of the vehicle manufacturer can perform the calibration in a safe place and within the scheduled time period; in the administrator mode, since the time and place provided by the vehicle-side driving recorder are incomplete, the OEM developer directly activates the EPS request calibration message sending module after successfully verifying the administrator private key, ensuring that the EPS is successfully calibrated to achieve zeroing of the steering gear in the event of abnormal vehicle communication or incomplete parts of the vehicle driving recorder.
[0075] The present invention calls a dynamic link library encapsulated by a national standard commercial secret algorithm, designs registers that can read and write local global variables in the CANoe software, and the information security module (sending node encryption and signature module S20 and receiving node decryption and signature verification module S30) effectively uses the encryption and decryption and signature verification algorithms. At the same time, it uses the vehicle-side information to enhance the information entropy of the EPS calibration instruction message, so that the encrypted message data field content, digital signature, and hash value are guaranteed to be unique, and the encrypted message check value information transmission security can be better protected.
[0076] The platform construction scheme of the present invention is as follows Figure 4 As shown, the platform construction scheme implemented by the present invention is: the computer is connected to VN1610, and VN1610 is connected to the car, so that the simulated encryption and decryption ECU developed by CANoe is connected to the real car CAN line. The implementation platform of the present invention adopts the coexistence mode of real network nodes and some simulated nodes (all ECU nodes developed by the present invention, such as encryption nodes and decryption nodes), while the existing platform adopts all real network nodes (the code has been embedded in the real ECU).
[0077] The method of the present invention is applicable to the Xingchen series buses of Xiamen Jinlong Travel Vehicle Co., Ltd. This model has four CANs, CAN1 is physically isolated from the outside, and communicates with the outside through a gateway or a VN1610 hardware interface card, where the EPS node and the decryption node are on the CAN1 line; CAN4 is a line for external intelligent network terminals and automatic driving platform communications, where the driving recorder and the encryption node are on the CAN4 line.
[0078] The overall system structure diagram of the present invention is as follows: Figure 3 See Figure 3 The overall system of the present invention mainly includes a sending node vehicle status data acquisition module S10, a sending node encryption and signature module S20, and a receiving node decryption and signature verification module S30. The sending node vehicle status data acquisition module S10 reads the GPS message and time message in the CAN and reads the key and instruction input by the host computer. After the above information is verified, the calibration instruction (defined in the program, the operator does not know, only the corresponding request instruction is known, because the calibration instruction is to be injected into the calibration message) is sent to the encryption ECU, that is, the sending node encryption and signature module S20. The encryption ECU sends the encrypted message to CAN4. The decryption ECU, that is, the receiving node decryption and signature verification module S30 receives the encrypted message, and after successful decryption, it is sent to CAN1 on the road to receive the bus (which originally has the function). The EPS node receives this message and performs EPS calibration.
[0079] The sending node vehicle status data acquisition module S10 includes a driving recorder information acquisition submodule S110, a key detection submodule S120 and an EPS request instruction detection and feedback submodule S130. The driving recorder information acquisition submodule S110 obtains the vehicle's time and GPS data through the CAN bus (only limited to CAN4) and other interface methods to determine the location and time authorization status of the test vehicle. The key detection submodule S120 determines the software's security encryption module operation authorization status through the private key input by the software's security encryption module. The EPS request instruction detection and feedback submodule S130 determines whether the software's security encryption module input instruction is correct, and then determines whether the permission to send the EPS request instruction message and read the EPS feedback message information is authorized based on the key detection submodule S120 and the authorization status of the driving recorder information acquisition submodule S110.
[0080] The sending node encryption and signature module S20 includes an SM4 algorithm encryption submodule S210, an SM2 algorithm signature submodule S220, and an upload register submodule S230. The SM4 algorithm encryption submodule S210 obtains the time and location information of the S110 module by calling the DLL encapsulated by the SM4 algorithm standard source code (when the present invention is running, the CANoe software calls the encapsulated DLL), encrypts and generates a 16-byte ciphertext after mixing with the request instruction information, and assigns eight bytes of the content to the EPS request calibration encrypted message data field. The SM2 algorithm signature submodule S220 obtains the 16-byte ciphertext generated by the SM4 algorithm encryption submodule S210 by calling the DLL encapsulated by the SM2 algorithm standard source code (when the present invention is running, the CANoe software calls the encapsulated DLL), generates a digital signature and a hash value, sends an encrypted message after the signature is successful, obtains the private key of the S120 module, and generates a public key. The upload register submodule S230 obtains the remaining eight bytes of ciphertext information not assigned to the message data field through the S210 module and uploads it to the register S40, obtains the digital signature and result, hash value and public key generated by the S220 module and uploads them to the register S40.
[0081] The receiving node decryption and signature verification module S30 includes a download register submodule S310, an SM2 algorithm signature verification submodule S320, and an SM4 algorithm decryption submodule S330. The download register submodule S310 reads the digital signature result of the register, if any, detects the CAN4 route request EPS calibration encrypted message, extracts the eight-byte content of the message data field, and then reads the remaining eight bytes of the register ciphertext to form a 16-byte ciphertext to be decrypted. The SM2 algorithm signature verification submodule S320 reads the register public key by calling the DLL encapsulated by the SM2 algorithm standard source code (when the present invention is running, the CANoe software calls the encapsulated DLL), obtains the S310 module ciphertext information to generate a digital signature and hash value, and compares the two with the digital signature and hash value of the register. If it fails, it will be eliminated. The SM4 algorithm decryption submodule S330 calls the DLL encapsulated by the SM4 algorithm standard source code (when the present invention is running, the CANoe software calls the encapsulated DLL), reads the ciphertext successfully compared by S320, decrypts the ciphertext to generate plaintext, reads the time and location information in the plaintext, and sends the EPS calibration instruction on the internal CAN1 line if it is within the authorized scope.
[0082] Among them, the S210 module and the S330 module use a symmetric encryption algorithm (sharing a key) to encrypt and decrypt message data.
[0083] The flow chart of the sending node vehicle status data acquisition module S10 is as follows Figure 5 First, determine whether the input private key is authorized. The flow chart is as follows Figure 5 The private key input by the S120 module is obtained and verified. If yes, the S110 driving recorder module is obtained to determine whether the calibration time and location of the tested vehicle are authorized; if yes, the instruction input by the S130 module is determined whether to send EPS request calibration information. If yes, a request EPS calibration message is sent.
[0084] Secondly, considering the vehicle communication failure or incomplete driving recorder parts, when the S120 module detects that the private key input value is the administrator key, the time period and location determination are cancelled. After the correct EPS calibration request command is entered, the command signal can be transmitted to the S20 module.
[0085] The encrypted communication flow chart of the sending node encryption and signature module S20 and the receiving node decryption and signature verification module S30 is as follows: Figure 6 As shown, Figure 6 The encrypted communication method process is shown, including:
[0086] Step S211: The SM4 algorithm encryption submodule S210 extracts the request instruction input by the S10 module and initializes the EPS request message to be encrypted; obtains the time and positioning information in the S10 module; the data field of the message to be encrypted (eight bytes in total) and the time and positioning information (eight bytes in total) constitute a plain text of sixteen bytes.
[0087] Step S212: The SM4 algorithm encryption submodule S210 calls the encryption algorithm dynamic link library, extracts the private key input by the S10 module to implement encryption, and generates a sixteen-byte ciphertext.
[0088] Step S221: The SM2 algorithm signature submodule S220 calls the signature algorithm dynamic link library to obtain the ciphertext generated by the S210 module, extracts the private key input by the S10 module, and generates a digital signature and signature result, hash value, and public key.
[0089] Step S231: The 8-byte content in the ciphertext generated by the upload register submodule S230 is assigned to the encrypted message data field and then sent to CAN4. The remaining eight bytes of content constitute the remaining eight-byte ciphertext and are uploaded to register S40; the upload register submodule S230 obtains the digital signature and signature result, hash value, and public key of the S220 module and uploads them to register S40.
[0090] Step S311: The download register submodule S310 detects that there is an encrypted message on CAN4, extracts the data field content of the message, downloads the remaining bits of the register message, and reassembles it into a 16-byte ciphertext; downloads the hash value, public key and digital signature content in the register S40.
[0091] Step S321: Get the ciphertext of the S310 module combination, call the signature verification algorithm dynamic link library, and obtain the hash value, public key, digital signature content and signature result through the S310 module. If the signature result is signed, extract the public key, verify the hash value and digital signature. If the verification is successful, transmit the 16-byte ciphertext to the S330 module. If the verification is unsuccessful, the information is discarded.
[0092] Step S322: If the ciphertext signature verification succeeds, the register content is initialized, the signature result is changed to unsigned, and the digital signature, hash value and public key are set to zero.
[0093] Step S331: Get the private key content of S10 module, decrypt the algorithm dynamic link library, decrypt the ciphertext to generate 16-byte plaintext, extract the information positioning content in the plaintext, and get the S110 module positioning and time comparison. If they are inconsistent, they will be eliminated. If they are consistent, S30 module will send EPS calibration message on CAN1.
[0094] The present invention is based on step S231 and step S311, and adopts the national standard commercial encryption algorithm, so that the EPS calibration message finally sent is safer than the prior art.
[0095] The flow chart of encryption at the sending node and decryption at the receiving node in step S212 and step S331 is as follows: Figure 7 As shown. Since the minimum number of bits for encrypting content using the SM4 encryption algorithm is 16 bytes, while the message content is only 8 bytes. In response to this problem, the present invention appends eight bytes of content when encrypting the message content. 16-byte content (plaintext) generates 16-byte ciphertext, and when sending, only eight bytes of encrypted content are sent (the message content definition is only eight bytes) and the remaining eight bytes of content are placed in the register. In addition, the decryption node receives the eight-byte encrypted content of the encrypted message and reads the remaining eight bytes of encrypted content from the register, and recomposes the 16-byte ciphertext. The decryption node decrypts the 16-byte ciphertext to generate 16-byte plaintext, and then extracts the calibration instruction from the 16-byte content. For example, the calibration instruction is stored in the plaintext to be encrypted from bits 0 to 7, so the content of bytes 0 to 7 of the decrypted 16-byte plaintext is the calibration instruction.
[0096] Compared with the prior art, the present invention has the following advantages:
[0097] 1. Design a register for multi-node readable and writable global variables: It can be seen from steps S311 and S231 that it is different from the previous method of injecting verification values into the message data field. Key verification information, such as digital signatures, hash values, and public keys communicate with each node through registers. Compared with designing up to eight bytes of security verification content in the data field message. Increase the number of bytes of key security information, thereby enhancing the randomness of verification information. Attackers cannot extract the check value of the message through the CAN bus. It is also impossible to learn the verification rules, and the information transmission security is stronger. Because the number of byte bits in the message data field is not changed, the original CAN communication protocol and message definition of the mass-produced vehicle are not destroyed. For a variety of message definitions, especially messages with an eight-byte data field defined, the method of the present invention can be implemented on mass-produced vehicles, and has high versatility. The present invention places the verification value in the eight-byte message content for the existing method. The eight bytes of messages of many mass-produced vehicles are already defined, so the verification code cannot be injected into the message. The verification value is not injected into the message, but the verification value is placed in the register. The technical means, so that the encryption rules cannot be obtained from the message.
[0098] 2. Using CAPLDLL technology: It can be seen from steps S211, S212, S221, S321 and S331 that the encryption, decryption and signature verification source code based on the national commercial secret algorithm standard is encapsulated into a dynamic link library that can be called by each node. Because only when the application software CANoe calls the encapsulated encryption, decryption and signature verification algorithm, the system will load this DLL into the memory space, so it not only reduces the size of the security node automation programming file and the occupation of memory space, but also can be used by multiple nodes at the same time. This method can be used not only for EPS calibration messages, but also for other remote frames. The method of calling the dynamic link library to run the security communication module method can be used to achieve encryption, and it has strong portability. The present invention is implemented by CANoe, calling DLL, and dynamically calling functions when the node runs the program, and the encryption calculation or decryption calculation is faster.
[0099] 3. Considering the actual conditions of EPS calibration for ordinary users, downstream vehicle maintenance personnel and vehicle developers, a mechanism is designed to limit the location and time of the tested vehicle when users operate the security encryption module of the software of the present invention based on the vehicle-side positioning and time information. Ensure that EPS calibration is carried out at the designated experimental location and time. Ensure the personal safety of users and the operation specifications during EPS calibration.
[0100] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0101] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A system for protecting the information security of EPS calibration messages for passenger vehicles, characterized in that: The system includes a sending node vehicle status data acquisition module, a sending node encryption and signature module, a receiving node decryption and signature verification module and a register; The sending node vehicle status data acquisition module is used to obtain a private key, the vehicle's current location and a calibration instruction, and when it is determined that the private key, the current time and the location are all in an authorized state, the calibration instruction, the current time, the location and the private key are all sent to the sending node encryption and signature module; the private key includes an administrator key and a user key; The sending node encryption and signature module is used to use the SM4 algorithm and the private key to encrypt and generate a 16-byte ciphertext by mixing the current time, the position and the calibration instruction, and use the SM2 signature algorithm to generate a first digital signature and a first hash value for the 16-byte ciphertext, and use the SM2 signature algorithm to generate a public key for the private key; The 16-byte ciphertext includes an 8-byte ciphertext of the calibration instruction and an 8-byte ciphertext of the current time and position; the sending node encryption and signature module is further used to upload the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key to the register, and send the 8-byte ciphertext of the calibration instruction to the receiving node decryption and signature verification module; The receiving node decryption and signature verification module is used to read the 8-byte ciphertext at the current time and position, the first digital signature, the first hash value and the public key from the register, use the 8-byte ciphertext of the calibration instruction and the 8-byte ciphertext at the current time and position to form the 16-byte ciphertext, and use the SM2 signature verification algorithm and the public key to generate a second digital signature and a second hash value for the 16-byte ciphertext; The receiving node decryption and signature verification module is also used to compare the first digital signature with the second digital signature, compare the first hash value with the second hash value, and when the first digital signature and the second digital signature are the same and the first hash value and the second hash value are the same, use the SM4 algorithm to decrypt the 16-byte ciphertext, extract the calibration instruction, and send the calibration instruction to the vehicle.
2. The system for protecting the information security of EPS calibration messages of passenger vehicles according to claim 1 is characterized in that: The sending node vehicle status data acquisition module specifically includes a driving recorder information acquisition submodule, a key detection submodule, and an EPS request command detection and feedback submodule; The driving recorder information acquisition submodule is used to obtain the location of the vehicle at the current moment, and determine whether the current moment and the location are both in an authorized state. When the current moment and the location are both in an authorized state, the current moment and the location are sent to the sending node encryption and signature module; The key detection submodule is used to obtain a private key and determine whether the private key is in an authorized state. When the private key is in an authorized state, the private key is sent to the sending node encryption and signature module; The EPS request instruction detection and feedback submodule is used to obtain the calibration instruction and determine whether the calibration instruction is correct; the EPS request instruction detection and feedback submodule is also used to determine whether to send the calibration instruction to the sending node encryption and signature module based on whether the current moment and the position are both in an authorized state and whether the calibration instruction is correct. When the calibration instruction is correct and the current moment and the position are both in an authorized state, the calibration instruction is sent to the sending node encryption and signature module.
3. The system for protecting the information security of EPS calibration messages of passenger vehicles according to claim 1 is characterized in that: The sending node encryption and signature module specifically includes an SM4 algorithm encryption submodule, an SM2 algorithm signature submodule and an upload register submodule; The SM4 algorithm encryption submodule is used to encrypt the current time, the position and the calibration instruction by using the SM4 algorithm and the private key to generate a 16-byte ciphertext; the 16-byte ciphertext includes an 8-byte ciphertext of the calibration instruction and an 8-byte ciphertext of the current time and position; The SM2 algorithm signature submodule is used to generate a first digital signature and a first hash value for the 16-byte ciphertext using the SM2 signature algorithm, and to generate a public key for the private key using the SM2 signature algorithm; The upload register submodule is used to upload the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key to the register, and send the ciphertext of the 8-byte calibration instruction to the receiving node decryption and signature verification module.
4. The system for protecting the security of passenger car EPS calibration message information according to claim 1 is characterized in that: The receiving node decryption and signature verification module specifically includes a download register submodule, an SM2 algorithm signature verification submodule and an SM4 algorithm decryption submodule; The download register submodule is used to read the 8-byte ciphertext of the current time and position, the first digital signature, the first hash value and the public key from the register, and use the 8-byte ciphertext of the calibration instruction and the 8-byte ciphertext of the current time and position to form the 16-byte ciphertext; The SM2 algorithm signature verification submodule is used to generate a second digital signature and a second hash value for the 16-byte ciphertext using the SM2 signature verification algorithm and the public key; the SM2 algorithm signature verification submodule is also used to compare the first digital signature with the second digital signature, and compare the first hash value with the second hash value; The SM4 algorithm decryption submodule is used to decrypt the 16-byte ciphertext using the SM4 algorithm when the first digital signature and the second digital signature are the same and the first hash value and the second hash value are the same, extract the calibration instruction, and send the calibration instruction to the vehicle.
5. The system for protecting the information security of EPS calibration messages of passenger vehicles according to claim 1 is characterized in that: The system also includes a host computer interface; The host computer interface is used to input private keys and calibration instructions.
6. The system for protecting the information security of EPS calibration messages of passenger vehicles according to claim 1 is characterized in that: The system is developed based on CANoe software.
7. The system for protecting the information security of EPS calibration messages of passenger vehicles according to claim 1 is characterized in that: The register is a register designed by the System Variables module in the environment function area of the CANoe software, which can read and write local system global variables by multiple security nodes.
