Electronic control unit and system for processing security log data
By encrypting, storing and decrypting the secure log data using a combination of random numbers, symmetric encryption algorithms and asymmetric encryption algorithms in the on-board ECU, the risk of keys being obtained in the prior art is solved, and the confidentiality and integrity of the secure log data are ensured.
Patent Information
- Application Number
- CN202311333267.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2025-04-18
AI Technical Summary
The symmetric encryption algorithm used in existing vehicle-mounted ECUs has the risk that the keys are obtained by unauthorized third parties, which poses threats the confidentiality and integrity of the secure log data.
The combination of random numbers, symmetric encryption algorithms and asymmetric encryption algorithms is used to encrypt and store secure log data, and the private keys of the one-way hash function and asymmetric encryption algorithm are used to decrypt and tamper with data.
Effectively prevent unauthorized third parties from obtaining security log data, ensuring their confidentiality and integrity, and avoiding the risk of unauthorized acquisition of keys.
Smart Images

Figure CN119848938A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle and electronic technology, and in particular to an electronic control unit and a system for processing security log data. Background Art
[0002] In a vehicle, there is usually an on-board ECU (Electronic Control Unit) for controlling the vehicle's engine, brake system, etc. These ECUs include a HOST (also called a host or processor core) and a HSM (Hardware Security Module).
[0003] The security log data related to information security behavior or network security behavior generated during the operation of the current vehicle-mounted ECU is generally stored in the NVM (Non-volatile Memory) or HSM (Hardware Security Module) of the HOST (also called the host or processor core) in a symmetric encrypted manner to ensure its confidentiality.
[0004] Information security behavior or network security behavior involves privacy data such as user information and cryptographic information such as security mechanisms. Therefore, the integrity and confidentiality of security log data must be guaranteed. When using conventional symmetric encryption algorithms to encrypt security log data, the symmetric key shared by the sender and receiver of the communication message may be obtained by a third party. Once an unauthorized third party obtains the symmetric key, it can directly obtain and tamper with the security log data stored in the ECU, destroying the confidentiality and integrity of the security log data. Summary of the invention
[0005] The starting point of the present invention is to provide an electronic control unit and a system for processing security log data, thereby solving the above-mentioned problems in the prior art.
[0006] A first aspect of an embodiment of the present invention provides an electronic control unit, wherein the electronic control unit is used for:
[0007] Generate security log data and random numbers;
[0008] The security log data is protected by using the random number, symmetric encryption algorithm and asymmetric encryption algorithm; and
[0009] After receiving a request from the test party device to obtain security log data, it is determined whether the security log data has been tampered with. If the determination result is no, the security log data is sent to the test party device.
[0010] Optionally, protecting the security log data by using the random number, the symmetric encryption algorithm and the asymmetric encryption algorithm includes:
[0011] Inputting the security log data and the random number into a one-way hash function to calculate a hash value;
[0012] encrypting the security log data, the random number and the hash value as a whole using a symmetric key of a symmetric encryption algorithm to obtain an encrypted data packet, and storing the encrypted data packet;
[0013] The symmetric key is encrypted using a public key of an asymmetric encryption algorithm to obtain an encrypted symmetric key, and the encrypted symmetric key is stored.
[0014] Optionally, determining whether the security log data has been tampered with includes:
[0015] Decrypting the encrypted symmetric key using a private key of an asymmetric encryption algorithm from the test party device to obtain a symmetric key;
[0016] Decrypting the encrypted data packet using the symmetric key to obtain decrypted security log data, random numbers and hash values;
[0017] Inputting the security log data and the random number into the one-way hash function to calculate a hash value; and
[0018] The calculated hash value is compared with the decrypted hash value. If the two are the same, it is considered that the security log data has not been tampered with.
[0019] Optionally, the one-way hash function includes a SHA 256 function.
[0020] Optionally, when abnormal information security behavior occurs, the security log data is generated.
[0021] Optionally, the information security abnormal behavior includes at least one of the following: software signature verification failure, security access verification failure, and security startup verification failure.
[0022] Optionally, the random number is a 128-bit random number generated by a true random number generator.
[0023] Optionally, the symmetric encryption algorithm includes an AES128 algorithm.
[0024] Optionally, the asymmetric encryption algorithm includes an RSA 3072 algorithm.
[0025] A second aspect of an embodiment of the present invention provides a system for processing security log data, the system comprising an electronic control unit and a tester device provided according to the first aspect of an embodiment of the present invention, wherein the tester device is used to:
[0026] Obtain the private key of the asymmetric encryption algorithm from the public key infrastructure;
[0027] Sending a request to the electronic control unit to obtain security log data, wherein the request includes the private key;
[0028] receiving security log data from the electronic control unit; and,
[0029] Analyze information security abnormal behaviors based on the security log data.
[0030] The electronic control unit and the system for processing security log data of the embodiments of the present invention have at least the following advantages:
[0031] In the present invention, the electronic control unit uses a combination of random numbers, symmetric encryption algorithms and asymmetric encryption algorithms to encrypt and store security log data for protection, so that unauthorized third parties cannot crack the security log data to obtain the security log data, thereby ensuring the confidentiality of the security log data.
[0032] In the present invention, the testing party device uses the private key of the asymmetric encryption algorithm to access the electronic control unit, and the unauthorized third party cannot obtain the private key, thereby preventing the unauthorized third party from obtaining the security log data and ensuring the confidentiality of the security log data.
[0033] In the present invention, after receiving a request from the test party device to obtain security log data, the electronic control unit will compare the decrypted hash value with the hash value calculated based on the decrypted random number and the security log data, and determine whether the security log data has been tampered with based on whether the two are the same, thereby ensuring the integrity of the security log data. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Other details and advantages of the present invention will become apparent from the detailed description provided below. It should be understood that the following drawings are merely schematic and not drawn to scale, and thus cannot be regarded as limiting the present application. The following will be described in detail with reference to the drawings, wherein:
[0035] Figure 1 The diagram schematically shows a process in which an electronic control unit according to a specific embodiment of the present invention encrypts and stores security log data.
[0036] Figure 2The information interaction process between the electronic control unit and the testing device according to a specific embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0037] Embodiments of the present invention are described below with reference to the accompanying drawings. In the following description, many specific details are set forth so that those skilled in the art can more fully understand and implement the present invention. However, it is obvious to those skilled in the art that the present invention may be implemented without some of these specific details. In addition, it should be understood that the present invention is not limited to the specific embodiments described. On the contrary, any combination of the features and elements described below may be considered to implement the present invention, regardless of whether they relate to different embodiments. Therefore, the following aspects, features, embodiments and advantages are for illustrative purposes only and should not be regarded as elements or limitations of the claims unless clearly stated in the claims.
[0038] Now refer to Figure 1 , schematically illustrates a process of encrypting and storing security log data by an electronic control unit according to a specific embodiment of the present invention. Figure 1 As shown,
[0039] When an electronic control unit has information security abnormal behaviors such as software signature verification failure, security access verification failure, and security boot verification failure, each abnormal behavior is defined as a specific DID (Diagnostic Identifier), thereby generating security log data.
[0040] When generating the security log data, the electronic control unit may generate a random number at the same time. The electronic control unit may generate the random number in any suitable manner, and these variations do not exceed the protection scope of the present invention. For example, the random number may be a 128-bit random number generated by a true random number generator.
[0041] Then, the electronic control unit inputs the security log data and the random number into a one-way hash function to calculate a hash value. The electronic control unit can calculate the hash value by any suitable one-way hash function, and these variations do not exceed the protection scope of the present invention. For example, the one-way hash function can be a SHA 256 function.
[0042] Next, the electronic control unit uses the symmetric key of the symmetric encryption algorithm to encrypt the security log data, the random number and the hash value as a whole to obtain an encrypted data packet. The electronic control unit can calculate the hash value by any suitable symmetric encryption algorithm, and these variations do not exceed the scope of protection of the present invention. For example, the symmetric encryption algorithm can be the AES128 algorithm. The electronic control unit stores the encrypted data packet, for example, in the HSM of the electronic control unit.
[0043] Afterwards, the electronic control unit encrypts the symmetric key using the public key of the asymmetric encryption algorithm to obtain the encrypted symmetric key. The electronic control unit can encrypt the symmetric key by any suitable asymmetric encryption algorithm, and these variations do not exceed the scope of protection of the present invention. For example, the asymmetric encryption algorithm can be the RSA 3072 algorithm. The electronic control unit stores the encrypted symmetric key, for example, in the HSM of the electronic control unit.
[0044] Now refer to Figure 2 , schematically illustrates the information interaction process between the electronic control unit and the test equipment according to a specific embodiment of the present invention. Figure 2 As shown,
[0045] First, when the tester device needs to obtain security log data, it can obtain the private key of the asymmetric encryption algorithm from PKI (Public Key Infrastructure) and send a request to obtain the security log data to the electronic control unit, where the request includes the private key.
[0046] The electronic control unit then decrypts the encrypted symmetric key using the private key to obtain the symmetric key.
[0047] Next, the electronic control unit decrypts the encrypted data packet using the symmetric key to obtain the decrypted security log data, random number and hash value.
[0048] Afterwards, the electronic control unit inputs the decrypted security log data and the random number into a one-way hash function to calculate a hash value.
[0049] Again, the electronic control unit compares the calculated hash value with the decrypted hash value. If the two are the same, it is considered that the security log data has not been tampered with.
[0050] Finally, if the security log data has not been tampered with, the electronic control unit sends the security log data to the tester device, which can analyze information security abnormal behavior based on the security log data.
[0051] Compared with the prior art, the electronic control unit and the system for processing security log data of the embodiment of the present invention have at least the following advantages:
[0052] In the present invention, the electronic control unit uses a combination of random numbers, symmetric encryption algorithms and asymmetric encryption algorithms to encrypt and store security log data for protection, so that unauthorized third parties cannot crack the security log data to obtain the security log data, thereby ensuring the confidentiality of the security log data.
[0053] In the present invention, the testing party device uses the private key of the asymmetric encryption algorithm to access the electronic control unit, and the unauthorized third party cannot obtain the private key, thereby preventing the unauthorized third party from obtaining the security log data and ensuring the confidentiality of the security log data.
[0054] In the present invention, after receiving a request from the test party device to obtain security log data, the electronic control unit will compare the decrypted hash value with the hash value calculated based on the decrypted random number and the security log data, and determine whether the security log data has been tampered with based on whether the two are the same, thereby ensuring the integrity of the security log data.
[0055] It should be noted that the above description is only an example and not a limitation of the present invention. In other embodiments of the present invention, the method may have more, fewer or different steps, and the order, inclusion and function of the steps may be different from those described and illustrated. For example, generally multiple steps can be combined into a single step, and a single step can also be split into multiple steps. For those of ordinary skill in the art, without paying creative work, the sequential changes of the steps are also within the scope of protection of the present invention.
[0056] The technical solution of the present invention, in essence or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor or a microcontroller to perform all or part of the steps of the method described in each embodiment of the present invention.
[0057] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0058] Although the present invention has been disclosed as above with preferred embodiments, the present invention is not limited thereto. Any changes and modifications made by any person skilled in the art without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention, and therefore the protection scope of the present invention should be subject to the scope defined by the claims.
Claims
1. An electronic control unit, characterized in that: The electronic control unit is used for: Generate security log data and random numbers; The security log data is protected by using the random number, symmetric encryption algorithm and asymmetric encryption algorithm; and After receiving a request from the test party device to obtain security log data, it is determined whether the security log data has been tampered with. If the determination result is no, the security log data is sent to the test party device.
2. The electronic control unit according to claim 1, wherein: Using the random number, symmetric encryption algorithm and asymmetric encryption algorithm to protect the security log data includes: Inputting the security log data and the random number into a one-way hash function to calculate a hash value; encrypting the security log data, the random number and the hash value as a whole using a symmetric key of a symmetric encryption algorithm to obtain an encrypted data packet, and storing the encrypted data packet; The symmetric key is encrypted using a public key of an asymmetric encryption algorithm to obtain an encrypted symmetric key, and the encrypted symmetric key is stored.
3. The electronic control unit according to claim 2, wherein: Determining whether the security log data has been tampered with includes: Decrypting the encrypted symmetric key using a private key of an asymmetric encryption algorithm from the test party device to obtain a symmetric key; Decrypting the encrypted data packet using the symmetric key to obtain decrypted security log data, random numbers and hash values; Inputting the security log data and the random number into the one-way hash function to calculate a hash value; and The calculated hash value is compared with the decrypted hash value. If the two are the same, it is considered that the security log data has not been tampered with.
4. The electronic control unit according to claim 2, wherein: The one-way hash function includes a SHA 256 function.
5. The electronic control unit according to claim 1, wherein: When information security abnormal behavior occurs, the security log data is generated.
6. The electronic control unit according to claim 5, wherein: The information security abnormal behavior includes at least one of the following: software signature verification failure, security access verification failure, and security startup verification failure.
7. The electronic control unit according to claim 1, wherein: The random number is a 128-bit random number generated by a true random number generator.
8. The electronic control unit according to claim 1, wherein: The symmetric encryption algorithm includes the AES128 algorithm.
9. The electronic control unit according to claim 1, wherein: The asymmetric encryption algorithm includes the RSA 3072 algorithm.
10. A system for processing security log data, characterized in that: The system comprises the electronic control unit according to any one of claims 1 to 9 and a tester device, wherein the tester device is used for: Obtain the private key of the asymmetric encryption algorithm from the public key infrastructure; Sending a request to the electronic control unit to obtain security log data, wherein the request includes the private key; receiving security log data from the electronic control unit; and, Analyze information security abnormal behaviors based on the security log data.