Data processing method, apparatus and device
Patent Information
- Application Number
- CN202311041082.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-08-17
AI Technical Summary
[0004]可以看出:相关技术中计算解锁密钥的算法较简单,容易被破解;且由于一类ECU通常采用相同的算法,一旦某个解锁密钥KEY的算法被泄露或者破解,便可解锁这类所有的ECU,导致车辆诊断解锁安全风险较高
[0035] The data processing method, apparatus, device, system, and storage medium provided in this application include at least: sending a first diagnostic request to a target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU; receiving seed data sent by the target ECU; generating a first unlocking key based at least on the seed data and information factors obtained from the target ECU; sending the first unlocking key to the target ECU, so that the target ECU performs diagnostic unlocking based on the first unlocking key and a second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and information factors of the target ECU; and receiving a diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
Smart Images

Figure CN117111577B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, including but not limited to data processing methods, apparatus, and equipment. Background Technology
[0002] With the continuous development of automotive technology, secure access and diagnostic services within vehicles have become a focus of attention.
[0003] For Unified Diagnostic Services (UDS), the relevant technical solutions include: the diagnostic tool requests an Electronic Control Unit (ECU); the ECU responds by generating a random number seed (SEED) and sending it to the diagnostic tool; after receiving the random number seed (SEED) from the ECU, the diagnostic tool calculates an unlocking key (KEY) using a simple algorithm and then sends the calculated KEY to the ECU; the ECU calculates its own key KEY' locally using the same algorithm; the ECU compares its calculated result KEY' with the received KEY to determine whether the diagnostic unlocking was successful.
[0004] It can be seen that the algorithms for calculating the unlock key in the relevant technologies are relatively simple and easy to crack; and since a type of ECU usually uses the same algorithm, once the algorithm of a certain unlock key is leaked or cracked, all ECUs of this type can be unlocked, resulting in a high security risk for vehicle diagnostic unlocking. Summary of the Invention
[0005] This application provides a data processing method, apparatus, and equipment, which improves the security of ECU diagnostic reception and the security of vehicle diagnostics.
[0006] The technical solution of this application is implemented as follows:
[0007] In a first aspect, this application provides a data processing method applied to a diagnostic instrument, the method comprising:
[0008] A first diagnostic request is sent to the target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU.
[0009] Receive seed data sent by the target ECU;
[0010] A first unlocking key is generated based at least on the seed data and the information factors of the target ECU obtained;
[0011] The first unlock key is sent to the target ECU, so that the target ECU can perform diagnostic unlocking based on the first unlock key and the second unlock key; the second unlock key is generated by the target ECU based at least on the seed data and the information factors of the target ECU;
[0012] Receive the diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes whether the unlocking was successful or failed.
[0013] Secondly, this application provides a data processing method applied to a target ECU, the method comprising:
[0014] Receive a first diagnostic request sent by the diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with the target ECU;
[0015] In response to the first diagnostic request, seed data is generated and sent to the diagnostic instrument so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the acquired target ECU;
[0016] Receive the first unlock key sent by the diagnostic instrument;
[0017] A second unlocking key is generated based at least on the seed data and the information factors of the target ECU;
[0018] Based on the first unlock key and the second unlock key, a diagnostic unlock result is obtained; and the diagnostic unlock result is sent to the diagnostic instrument; the diagnostic unlock result includes whether the unlock was successful or failed.
[0019] Thirdly, this application provides a data processing apparatus deployed on a diagnostic instrument, the apparatus comprising:
[0020] The first sending unit is configured to send a first diagnostic request to the target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU.
[0021] The first receiving unit is used to receive seed data sent by the target ECU;
[0022] A generation unit is configured to generate a first unlocking key based at least on the seed data and the information factors of the acquired target ECU;
[0023] The second sending unit is configured to send the first unlocking key to the target ECU, so that the target ECU can perform diagnostic unlocking based on the first unlocking key and the second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and the information factors of the target ECU;
[0024] The second receiving unit is used to receive the diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0025] Fourthly, this application provides a data processing apparatus deployed on a target ECU, the apparatus comprising:
[0026] The first receiving unit is configured to receive a first diagnostic request sent by the diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with the target ECU.
[0027] A first generation unit is configured to generate seed data in response to the first diagnostic request and send the seed data to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the acquired target ECU;
[0028] The second receiving unit is used to receive the first unlocking key sent by the diagnostic instrument;
[0029] The second generation unit is used to generate a second unlocking key based at least on the seed data and the information factors of the target ECU;
[0030] The processing unit is configured to obtain a diagnostic unlocking result based on the first unlocking key and the second unlocking key; and send the diagnostic unlocking result to the diagnostic instrument; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0031] Fifthly, this application provides a diagnostic instrument for performing the following: sending a first diagnostic request to a target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU; receiving seed data sent by the target ECU; generating a first unlocking key based at least on the seed data and information factors obtained from the target ECU; sending the first unlocking key to the target ECU, so that the target ECU performs diagnostic unlocking based on the first unlocking key and a second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and information factors of the target ECU; and receiving a diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0032] In a sixth aspect, this application provides a target ECU or vehicle device, the target ECU or vehicle device being configured to: receive a first diagnostic request sent by a diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with the target ECU; in response to the first diagnostic request, generate seed data and send the seed data to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and information factors of the target ECU; receive the first unlocking key sent by the diagnostic instrument; generate a second unlocking key based at least on the seed data and information factors of the target ECU; obtain a diagnostic unlocking result based on the first unlocking key and the second unlocking key; and send the diagnostic unlocking result to the diagnostic instrument; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0033] In a seventh aspect, this application provides a data processing system, including a diagnostic instrument and a target ECU, wherein the diagnostic instrument is used to execute the processing method provided in the first aspect above, and the target ECU is used to execute the data processing method provided in the second aspect above.
[0034] Eighthly, this application provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the data processing method provided in the first or second aspect above.
[0035] The data processing method, apparatus, device, system, and storage medium provided in this application include at least: sending a first diagnostic request to a target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU; receiving seed data sent by the target ECU; generating a first unlocking key based at least on the seed data and information factors obtained from the target ECU; sending the first unlocking key to the target ECU, so that the target ECU performs diagnostic unlocking based on the first unlocking key and a second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and information factors of the target ECU; and receiving a diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0036] The solution proposed in this application generates a first unlocking key based on at least seed data and information factors of the target ECU during the diagnostic unlocking process; that is, information factors unique to the ECU component are introduced during the unlocking key generation process. This increases the complexity of the unlocking key generation algorithm, reduces the probability of it being cracked, and improves the security of ECU diagnostic unlocking. Furthermore, even if the unlocking key generation algorithm for a particular ECU is leaked or cracked, it does not affect the security of other ECUs, thus improving the overall vehicle diagnostic security. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of an optional structure of the data processing system according to an embodiment of this application;
[0038] Figure 2 A schematic diagram of a first optional data processing method provided in an embodiment of this application;
[0039] Figure 3 A schematic diagram of a second optional data processing method provided in an embodiment of this application;
[0040] Figure 4 A schematic diagram of a third optional data processing method provided in the embodiments of this application;
[0041] Figure 5 A schematic diagram of a fourth optional data processing method provided in the embodiments of this application;
[0042] Figure 6 A schematic diagram of a fifth optional data processing method provided in the embodiments of this application;
[0043] Figure 7 This is a schematic diagram of an optional data flow in the data processing procedure provided in an embodiment of this application.
[0044] Figure 8 An optional flowchart illustrating the security diagnostic process provided in an embodiment of this application;
[0045] Figure 9 A schematic diagram of an optional structure of the first data processing apparatus provided in the embodiments of this application;
[0046] Figure 10 This is a schematic diagram of an optional structure of the second data processing apparatus provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of the application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0048] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0049] In the following description, the terms "first," "second," and "third" are used only to distinguish different objects and do not represent a specific order of objects, nor are they constituting a chronological order. It is understood that "first," "second," and "third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0051] This application provides data processing methods, apparatus, devices, systems, and storage media. In practical applications, the data processing method can be implemented by a data processing apparatus, wherein each functional entity in the data processing apparatus can be collaboratively implemented by the hardware resources of the electronic device, such as computing resources like processors and communication resources (such as those used to support various communication methods like optical fiber and cellular).
[0052] The data processing method provided in this application embodiment is applied to a data processing system, which includes a diagnostic instrument and at least one ECU.
[0053] The diagnostic tool can communicate with at least one ECU.
[0054] The diagnostic instrument is configured to perform the following actions: sending a first diagnostic request to a target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU; receiving seed data sent by the target ECU; generating a first unlocking key based at least on the seed data and information factors obtained from the target ECU; sending the first unlocking key to the target ECU, so that the target ECU performs diagnostic unlocking based on the first unlocking key and a second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and information factors of the target ECU; and receiving a diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0055] At least one ECU is configured to perform the following actions: receiving a first diagnostic request from a diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with a target ECU; in response to the first diagnostic request, generating seed data and sending the seed data to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and information factors of the target ECU; receiving the first unlocking key sent by the diagnostic instrument; generating a second unlocking key based at least on the seed data and information factors of the target ECU; obtaining a diagnostic unlocking result based on the first unlocking key and the second unlocking key; and sending the diagnostic unlocking result to the diagnostic instrument; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0056] For example, the data processing system 10 can be as follows Figure 1 As shown. It includes a diagnostic tool 101 and vehicle equipment 102. Vehicle equipment 102 includes at least one ECU 1021.
[0057] The diagnostic instrument 101 can communicate with the ECU 1021.
[0058] The diagnostic instrument 101 is a testing tool for detecting vehicle faults. It can be used to acquire vehicle information, such as diagnosing vehicle faults and obtaining diagnostic data. This application embodiment does not limit the specific type of diagnostic instrument. For example, a personal computer (PC) or tablet computer with diagnostic software installed.
[0059] ECU1021 refers to the ECUs installed in automobiles, including but not limited to: Body Control Module (BCM), Passive Entry Passive Start (PEPS), Electronic Stability Program (EPS), Battery Management System (BMS), and Vehicle Control Unit (VCU).
[0060] Diagnostic instrument 101 and ECU 1021 can be directly connected; or diagnostic instrument 101 and ECU 1021 can be connected through a network device, for example, diagnostic instrument 101 and ECU 1021 can be connected through a gateway or TBOX.
[0061] The diagnostic instrument 101 and the ECU 1021 can be connected wirelessly or via a wired connection.
[0062] The following describes various embodiments of the data processing methods, apparatus, devices, systems, and storage media provided in the embodiments of this application.
[0063] In a first aspect, embodiments of this application provide a first data processing method, which is applied to a first data processing device; wherein, the first data processing device can be deployed on a diagnostic instrument. The first data processing method will now be described using a diagnostic instrument as the executing entity.
[0064] Figure 2 This diagram illustrates a flowchart of a first data processing method. (Refer to...) Figure 2 The content shown, the first data processing method may include, but is not limited to, the following: Figure 2 S201 to S205 are shown.
[0065] S201, The diagnostic tool sends a first diagnostic request to the target electronic control unit (ECU).
[0066] The first diagnostic request is used to request diagnostic unlocking with the target ECU. In one possible implementation, the first authentication request may be a request carrying a secure access service identifier (0x2701).
[0067] The target ECU refers to the ECU that needs to be diagnosed and unlocked. Specifically, the target ECU can be any ECU in the vehicle's equipment.
[0068] S201 can be implemented as follows: the diagnostic instrument sends a first diagnostic request to the target ECU through the connection path between the diagnostic instrument and the target ECU to request diagnostic unlocking between the diagnostic instrument and the target ECU.
[0069] S202, The diagnostic instrument receives the seed data sent by the target ECU.
[0070] Seed data is used to assist in diagnostic unlocking. In one possible implementation, the seed data can be a random number. This application does not specifically limit the number of bits or other parameters of the seed data.
[0071] In practice, after the target ECU receives the first diagnostic request, it will generate seed data according to the instructions of the first diagnostic request and send the seed data to the diagnostic tool.
[0072] Correspondingly, S202 can be implemented as follows: the diagnostic instrument receives seed data sent by the target ECU through the connection path between the diagnostic instrument and the target ECU.
[0073] S203, the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the target ECU obtained.
[0074] The first unlocking key refers to the key generated by the diagnostic instrument for unlocking the diagnostic process. This application does not limit the specific method for generating the first unlocking key; it can be configured according to actual circumstances.
[0075] The information factor of a target ECU refers to the specific information configured for that target ECU. Different ECUs have different information factors.
[0076] In one possible implementation, the information factors of the target ECU can be configured and allocated in the same way as those of the ECU's OEM.
[0077] In another possible implementation, the information factor of the target ECU can be generated using a specific algorithm based on certain information about the target ECU. For example, the information factor of the target ECU can be information obtained by using a random algorithm to calculate the identifier of the target ECU.
[0078] In one possible implementation, S203 can be implemented as follows: the diagnostic instrument processes the seed data and the information factors of the target ECU to generate a first unlock key.
[0079] In another possible implementation, S203 can be implemented as follows: the diagnostic tool processes the seed data, the information factors of the target ECU, and the preset key to generate a first unlock key. Here, the preset key can be a fixed key or a randomly generated key.
[0080] S204. The diagnostic tool sends the first unlocking key to the target ECU, so that the target ECU can perform diagnostic unlocking based on the first unlocking key and the second unlocking key.
[0081] The second unlock key is generated by the target ECU based at least on the seed data and the information factors of the target ECU.
[0082] The diagnostic tool sends the first unlock key to the target ECU through the connection path between the diagnostic tool and the target ECU.
[0083] Correspondingly, the target ECU receives the first unlock key and generates a second unlock key based on at least the seed data and the information factors of the target ECU. It then determines whether the first unlock key and the second unlock key are the same. If they are the same, the unlock is successful; otherwise, the reception is considered to have failed.
[0084] It should be noted that the process by which the target ECU generates the second unlock key based on the seed data and the information factors of the target ECU is the same as the process by which the diagnostic tool generates the first unlock key based on the seed data and the information factors of the target ECU.
[0085] S205. The diagnostic instrument receives the diagnostic unlocking result sent by the target ECU.
[0086] The diagnostic unlock result includes whether the unlock was successful or failed.
[0087] The diagnostic tool receives the diagnostic unlocking result through the connection path with the target ECU, thereby determining whether the diagnostic unlocking result between the diagnostic tool and the target ECU is successful or unsuccessful.
[0088] The first data processing method provided in this application is applied to a diagnostic instrument. The method includes: sending a first diagnostic request to a target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU; receiving seed data sent by the target ECU; generating a first unlocking key based at least on the seed data and information factors obtained from the target ECU; sending the first unlocking key to the target ECU, so that the target ECU performs diagnostic unlocking based on the first unlocking key and a second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and information factors of the target ECU; and receiving a diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0089] The solution proposed in this application generates a first unlocking key based on at least seed data and information factors of the target ECU during the diagnostic unlocking process; that is, information factors unique to the ECU component are introduced during the unlocking key generation process. This increases the complexity of the unlocking key generation algorithm, reduces the probability of it being cracked, and improves the security of ECU diagnostic unlocking. Furthermore, even if the unlocking key generation algorithm for a particular ECU is leaked or cracked, it does not affect the security of other ECUs, thus improving the overall vehicle diagnostic security.
[0090] The process by which the diagnostic instrument in S203 generates a first unlocking key based at least on the seed data and the information factors of the target ECU obtained will be described below.
[0091] In one possible implementation, refer to Figure 3 The process may include, but is not limited to, S2031 to S2034 below.
[0092] S2031. The diagnostic instrument acquires the information factors of the target ECU.
[0093] For example, the information factors of the target ECU are manually pre-entered into the diagnostic tool. S2031 can be implemented as follows: the diagnostic tool reads the information factors of the target ECU from the location where the information factors are stored.
[0094] Here, you can either input only the information factors of the target ECU into the diagnostic tool beforehand, or input the information factors of all ECUs together. Then, based on the identifier or name of the target diagnostic tool, you can determine the information factors of the target ECU from among the multiple information factors.
[0095] S2032, The diagnostic instrument generates a first key based at least on the information factors of the target ECU.
[0096] In one possible implementation, the diagnostic tool generates a first key based on the information factors of the target ECU; for example, the diagnostic tool uses the information factors of the target ECU as the first key; or the information factors of the target ECU are processed by a preset operation to obtain a value as the first key.
[0097] In another possible implementation, the diagnostic tool generates a first key based on seed data and information factors of the target ECU.
[0098] In another possible implementation, the diagnostic tool can use the result of calculating the information factors of the target ECU and the fixed key using a preset algorithm as the first key; or it can obtain the first key based on seed data, the information factors of the target ECU, and the fixed key.
[0099] S2033. The diagnostic instrument uses the first encryption algorithm and the first key to encrypt the seed data to obtain the first encrypted data.
[0100] The first encryption algorithm is used to encrypt the seed data. In one possible implementation, the first encryption algorithm can be the HMAC_SHA256 algorithm.
[0101] For example, S2033 can be implemented as follows: the diagnostic instrument uses the seed data as the message to be encrypted, uses the first key as the encryption key, and performs encryption processing through the HMAC_SHA256 algorithm to obtain the first encrypted data.
[0102] S2034. The diagnostic instrument generates the first unlocking key based at least on the first encrypted data.
[0103] In one possible implementation, the diagnostic instrument identifies the first encrypted data as the first unlocking key.
[0104] In another possible implementation, the diagnostic instrument generates a first unlocking key based on the first encrypted data, seed data, etc.
[0105] It can be seen that obtaining the first unlock key is a complex process with a low probability of being cracked, thus ensuring high security.
[0106] The process by which the diagnostic instrument in S2032 generates a first key based at least on the information factors of the target ECU will be described below.
[0107] In one possible implementation, refer to Figure 4 The process may include, but is not limited to, S20321 to S20323 described below.
[0108] S20321. The diagnostic instrument performs a first operation on the seed data to obtain the first data.
[0109] In one possible implementation, the first operation can be a bitwise NOT operation.
[0110] In another possible implementation, the first operation can also be a shift operation or a bit flipping operation, etc.
[0111] S20322, The diagnostic instrument splices the first data with the information factors of the target ECU to obtain the first spliced data.
[0112] This application does not impose a specific limitation on the splicing order, and it can be configured according to actual needs. For example, the first data can be spliced first, and the information factors of the target ECU can be spliced second; or the information factors of the target ECU can be spliced first, and the first data can be spliced second.
[0113] S20323. The diagnostic instrument performs a hash operation on the first spliced data to generate the first key.
[0114] This application does not limit the specific type of hash operation, and can be configured according to actual needs.
[0115] For example, the hash operation here can be a SHA256 operation.
[0116] It can be seen that the first key is obtained based on the seed data and the information factor of the target ECU. Since the information factor of the target ECU is known and the seed data is randomly generated, the first key is also randomly generated, and the first unlock key is also randomly generated. Therefore, the first key does not need to be stored, and the first unlock key does not need to be stored, which reduces the probability of leakage during storage and improves security. Furthermore, since the first key and the first unlock key do not need to be stored, the target ECU does not need to have a dedicated hardware security module for storing sensitive information, resulting in lower hardware costs.
[0117] The process by which the diagnostic instrument generates the first unlocking key in S2033, based at least on the first encrypted data, will be described below.
[0118] This process may include, but is not limited to, method 1 or method 2 below.
[0119] Method 1: The diagnostic instrument determines the first encrypted data as the first unlocking key;
[0120] Method 2: The diagnostic instrument performs secondary encryption based on the first encrypted data to obtain the first unlocking key.
[0121] The process of obtaining the first unlocking key by the diagnostic instrument at least twice based on the first encrypted data in Method 2 is described below.
[0122] refer to Figure 5 The process may include, but is not limited to, S501 to S504 described below.
[0123] S501. The diagnostic instrument extracts the first digit of the first encrypted data to obtain the second key.
[0124] The embodiments of this application do not limit the specific value of the first digit or the method of truncation, and can be configured according to the actual situation.
[0125] In one possible implementation, the first encryption algorithm is the HMAC_SHA256 algorithm, and the resulting first encrypted data is 256 bits, with the first bit being 128 bits.
[0126] For example, S501 can be implemented as follows: the diagnostic instrument extracts the first 128 bits, the last 128 bits, or a fixed number of bits of data from the first 256-bit encrypted data, and uses the extracted result as the second key.
[0127] S502, the diagnostic instrument splices the seed data, the first data, and the second data to obtain the second spliced data.
[0128] The first data is obtained by performing a first operation on the seed data; the second data is obtained by performing a second operation on the seed data.
[0129] The second operation can be the same as the first operation; or the second operation can be different from the first operation.
[0130] For example, the second operation may include, but is not limited to, any of the following: bitwise NOT operation, shift operation, or bit flip operation, etc.
[0131] The embodiments of this application do not limit the splicing order between seed data, first data, and second data, and can be configured according to actual needs.
[0132] S502 can be implemented as follows: the diagnostic instrument first performs a first operation on the seed data to obtain the first data; performs a second operation on the seed data to obtain the second data; and then splices the seed data, the first data, and the second data in a preset splicing order to obtain the second spliced data.
[0133] S503 The diagnostic instrument uses the second encryption algorithm and the second key to encrypt the second concatenated data to obtain the second encrypted data.
[0134] The second encryption algorithm is different from the first encryption algorithm.
[0135] In one possible implementation, the second encryption algorithm can be the CMAC-AES128 algorithm.
[0136] For example, S503 can be implemented as follows: the diagnostic instrument uses the second spliced data as the data to be encrypted, uses the second key as the encryption key, and performs encryption processing through the second encryption algorithm to obtain the second encrypted data.
[0137] S504. The diagnostic instrument determines the first unlocking key based at least on the second encrypted data.
[0138] It can be seen that obtaining the first unlock key involves a complex encryption process on both sides, which further increases the complexity of obtaining the first unlock key, further reduces the probability of being cracked, and further improves security.
[0139] The process by which the diagnostic instrument determines the first unlocking key in S504 is described below, based at least on the second encrypted data. This process may include, but is not limited to, S5041 or S5042 described below.
[0140] S5041. The diagnostic instrument performs a third operation on the second encrypted data to obtain the first unlocking key.
[0141] The embodiments of this application do not specifically limit the third operation. In one possible implementation, the third operation can be a truncation operation. For example, the lower 32 bits of the second encrypted data can be truncated as the first unlocking key.
[0142] Extracting the lower 32 bits of the second encrypted data as the first unlocking key can reduce the amount of data transmitted and improve communication efficiency.
[0143] S5042, The diagnostic instrument determines the second encrypted data as the first unlocking key.
[0144] It can be seen that the interception operation further obfuscates the implementation process of the first unlocking key, increases the complexity of obtaining the first unlocking key, further reduces the probability of being cracked, and further improves security.
[0145] Secondly, embodiments of this application provide a second data processing method, which is applied to a second data processing device; wherein the second data processing device can be deployed on a target ECU or vehicle equipment. The second data processing method will now be described using the target ECU as the executing entity.
[0146] Figure 6 This diagram illustrates a flowchart of a second data processing method. (Refer to...) Figure 6 The data processing method shown may include, but is not limited to, the following: Figure 6 S601 to S605 are shown.
[0147] S601, The target ECU receives the first diagnostic request sent by the diagnostic instrument.
[0148] The first diagnostic request is used to request diagnostic unlocking with the target ECU.
[0149] The target ECU receives the first diagnostic request sent by the diagnostic tool through the connection between the ECU and the diagnostic tool.
[0150] S602. In response to the first diagnostic request, the target ECU generates seed data and sends the seed data to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the target ECU.
[0151] In response to the first diagnostic request, the target ECU generates a random number as seed data according to a random algorithm and sends the seed data to the diagnostic instrument so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the target ECU.
[0152] S603, the target ECU receives the first unlock key sent by the diagnostic tool.
[0153] The target ECU receives the first unlock key sent by the diagnostic tool through the connection between the diagnostic tool and the diagnostic tool.
[0154] S604. The target ECU generates a second unlock key based at least on the seed data and the information factors of the target ECU.
[0155] The implementation of S604 can be referred to the detailed description in S203 whereby the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the target ECU, which will not be repeated here.
[0156] S605. The target ECU obtains the diagnostic unlocking result based on the first unlocking key and the second unlocking key; and sends the diagnostic unlocking result to the diagnostic instrument.
[0157] The diagnostic unlock result includes whether the unlock was successful or failed.
[0158] The target ECU matches the first unlock key with the second unlock key. If they are the same, the unlock result is considered successful; if they are different, the unlock result is considered unsuccessful.
[0159] The second data processing method provided in this application includes: receiving a first diagnostic request sent by a diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with a target ECU; in response to the first diagnostic request, generating seed data and sending the seed data to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and information factors of the target ECU; receiving the first unlocking key sent by the diagnostic instrument; generating a second unlocking key based at least on the seed data and information factors of the target ECU; obtaining a diagnostic unlocking result based on the first unlocking key and the second unlocking key; and sending the diagnostic unlocking result to the diagnostic instrument; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0160] The solution proposed in this application generates a second unlocking key based on at least the seed data and information factors of the target ECU during the diagnostic unlocking process; that is, information factors unique to the ECU component are introduced during the unlocking key generation process. This increases the complexity of the unlocking key generation algorithm, reduces the probability of being cracked, and improves the security of ECU diagnostic unlocking. Furthermore, even if the unlocking key generation algorithm for a particular ECU is leaked or cracked, it does not affect the security of other ECUs, thus improving the overall vehicle diagnostic security.
[0161] It should be noted that the methods used in S604 for the target ECU to generate the second unlock key based at least on the seed data and the information factors of the target ECU, and in S203 for the diagnostic instrument to generate the first unlock key based at least on the seed data and the acquired information factors of the target ECU, are completely identical. For a detailed description of the implementation process, please refer to the diagnostic instrument's documentation; it will not be elaborated upon here.
[0162] The following describes the process by which the target ECU in S605 obtains the diagnostic unlocking result based on the first unlocking key and the second unlocking key.
[0163] The process may include: comparing the first unlock key and the second unlock key; if the first unlock key and the second unlock key are the same, determining the diagnostic unlock result as unlocking successful; if the first unlock key and the second unlock key are different, determining the diagnostic unlock result as unlocking failed.
[0164] The diagnostic unlocking process will now be described using a complete example.
[0165] The automotive industry is evolving towards intelligence, connectivity, electrification, and service. The next generation of intelligent connected vehicles, driven by these four trends, will involve extensive information interaction with the outside world, posing challenges to their information security. Diagnostics, as a key technology for data exchange between the vehicle's ECU and external devices, essentially summarizes the communication process between them. It is the most important means of acquiring internal vehicle information, configuring and upgrading the vehicle, and impacting user privacy and driving safety. Important operations on the vehicle's ECU generally require diagnostic unlocking before they can be performed; therefore, the security of diagnostic unlocking is a crucial aspect of overall vehicle information security.
[0166] Currently, traditional UDS27 diagnostic services request an ECU from the diagnostic tool. The ECU responds with a generated random number seed (SEED). After receiving the SEED, the diagnostic tool calculates an unlock key (KEY) using a simple algorithm and sends the calculated key to the ECU. The ECU then calculates its own key (KEY') locally using the same algorithm. The ECU compares its calculated key (KEY') with the received key (KEY) to determine whether to unlock. Because the algorithm used is relatively simple, it is easily guessed by attackers. Furthermore, since a type of ECU typically uses the same algorithm, it is impossible to distinguish between different ECUs. Therefore, if the algorithm for calculating the unlock key (KEY) is leaked, all such ECUs can be unlocked, leading to a high security risk in vehicle diagnostic unlocking.
[0167] In view of the above problems, this embodiment provides a method to improve the security of diagnostic unlocking algorithms, so as to reduce the security risks faced by current vehicle diagnostic unlocking.
[0168] In the field of automotive diagnostics, critical operations such as ECU data writing, important data reading, and ECU remapping generally require the diagnostic tool to first perform diagnostic unlocking via the UDS27 service before these operations can be performed. Reliable and secure diagnostic unlocking authentication plays a crucial role in protecting user privacy and driving safety. However, the traditional UDS27 service's algorithm for calculating the unlocking key is weak and poses significant security risks.
[0169] This embodiment provides a method to improve the security of existing UDS27 diagnostic unlocking algorithms. First, in the algorithm for calculating the unlocking key (KEY), high-strength key derivation and encryption algorithms that meet national standards, such as HMAC-SHA256 (equivalent to the first encryption algorithm mentioned above) and CMAC-AES128 (equivalent to the second encryption algorithm mentioned above), are used, greatly increasing the difficulty for attackers to brute-force guess the unlocking key generation algorithm. Second, in the calculation process of the diagnostic unlocking key (KEY) for each ECU component, information factors unique to that ECU component are introduced, ensuring that even if an attacker obtains the algorithm for the unlocking key (KEY) of a certain ECU component, they cannot forge the unlocking key (KEY) values of other ECU components, thus further ensuring the security of vehicle diagnostics. Furthermore, the resource consumption and computational speed of the HMAC-SHA256 and CMAC-AES128 algorithms are well-suited for resource-constrained in-vehicle networks. Since the encryption key for each calculation of the diagnostic unlocking key (KEY) is derived from the random number seed (SEED) of the current diagnostic session, the key does not need to be stored. Therefore, the fact that the ECU does not need to have a dedicated HSM (Hardware Security Module) for storing sensitive information makes this method highly applicable and also reduces chip costs.
[0170] The method for improving the security of diagnostic unlocking information provided in this embodiment may include, but is not limited to, the following S100 to S700.
[0171] S100. Upon receiving a seed request message from the diagnostic tool, the ECU (equivalent to the target ECU mentioned above) generates seed data SEED0 and sends it to the diagnostic tool. The seed is a random number of 4 bytes in length, which is randomly generated by the ECU each time the diagnostic tool requests it.
[0172] S200: The diagnostic instrument performs a bitwise NOT operation (equivalent to the first operation) on the received seed SEED0 (equivalent to the seed data mentioned above) to obtain SEED1 (equivalent to the first data mentioned above).
[0173] S300, stitch SEED1 with the information of this ECU. INFO (Equivalent to the information factor of the target ECU mentioned above), and then perform SHA256 hash operation (equivalent to the hash operation mentioned above) to obtain KEY1 (equivalent to the first key mentioned above).
[0174] Among them, ECU INFO This information is unique to the ECU, and can be allocated uniformly by the OEM.
[0175] S400. Use the HMAC_SHA256 algorithm to derive the key and calculate the key KEYtemp (equivalent to the first encrypted data mentioned above) required in subsequent steps.
[0176] The HMAC_SHA256 algorithm (equivalent to the first encryption algorithm mentioned above) is more secure than SHA256 alone as a key derivation function, and cannot be broken by brute-force attacks, dictionary attacks, rainbow attacks, etc. SEED0 is used as the INFO of HMAC_SHA256, and KEY1 is used as the key of HMAC_SHA256. KEY1 is calculated in the previous step, specifically: KEYtemp = HMAC_SHA256(INFO, KEY1), where KEYtemp is 256 bits.
[0177] S500, truncate KEYtemp and take 128 bits (equivalent to the first number above) as the key parameter of the algorithm CMAC-AES128 (equivalent to the second encryption algorithm above) for calculating the final unlock key, that is: KEY2 (equivalent to the second key above) = KEYtemp truncated, take 128 bits, KEY2 is 128 bits.
[0178] S600, Calculate the temporary value MACtemp of the message checksum (equivalent to the second encrypted data mentioned above).
[0179] Specifically, MACtemp = CMAC-AES128(SEED0||SEED1||SEED2, KEY2), where SEED0 is concatenated with SEED1 and then with SEED2 (equivalent to the second data mentioned above), and then the CMAC-AES128 operation is performed. SEED2 is obtained by flipping the bits of SEED0 (equivalent to the second operation mentioned above), and KEY2 is calculated by S500 in the previous step.
[0180] S700: In order to reduce the CAN communication load, only the lower 32 bits of the message checksum temporary value MACtemp are extracted as the final unlock key KEY (equivalent to the first unlock key mentioned above), that is, KEY = LSB32(MACtemp).
[0181] The KEY value is taken from the lower 32 bits of MACtemp, where LSBX(S) indicates that the lower X bits of string S are taken.
[0182] Thus, through the above steps, the unlock key KEY has been calculated from the seed SEED0. The unlock key KEY is then sent to the ECU, which uses the same algorithm to calculate KEY' (equivalent to the second unlock key mentioned above) and determines whether to unlock the device based on the comparison result of KEY and KEY'.
[0183] In short, this process can be referenced. Figure 7 The content shown includes: generating SEED0 based on request 2701; obtaining SEED1 by bitwise inversion of SEED0; and then, based on SEED1 and the ECU... INFO Get KEY1; KEY1 = SHA256(SEED1||ECU) INFO Based on KEY1 and SEED0, obtain KEYtemp; KEYtemp = HMAC_SHA256(INFO, KEY1); KEY2 = KEYtemp truncated, take 128 bits; MACtemp = CMAC-AES128(SEED0||SEED1||SEED2, KEY2); KEY = LSB32(MACtemp); obtain the final 4-byte message checksum.
[0184] The entire safety diagnostic process can be referenced. Figure 8 The content shown includes both the client (equivalent to a diagnostic tool) and the ECU. This includes, but is not limited to, S801 to S807 described below.
[0185] S801, ECU generates SEED0.
[0186] S802, Startup Authentication (SEED0).
[0187] The ECU sends SEED0 to the client to initiate authentication.
[0188] S803, the client calculates the KEY according to the algorithm.
[0189] S804, the client sends the KEY to the ECU.
[0190] S805 and ECU calculate KEY' according to the algorithm and verify whether KEY' is equal to KEY.
[0191] If they are equal, authentication is successful; otherwise, authentication fails.
[0192] S806 and ECU send the authentication results to the client.
[0193] S807. In the event of authentication failure, implement security mechanisms such as delay, logging, and alarms.
[0194] This embodiment has the following technical effects:
[0195] 1) In the algorithm for calculating the unlock key KEY, high-strength key derivation algorithms and encryption algorithms that meet national standards, such as HMAC-SHA256 and CMAC-AES128, are used, which greatly increases the difficulty for attackers to brute-force guess the unlock key KEY;
[0196] 2) During the calculation of the diagnostic unlock key KEY for each ECU component, a unique information factor for that ECU component is introduced, so that even if an attacker obtains the algorithm of the unlock key KEY for a certain ECU component, they still cannot forge the unlock key KEY value for other ECU components.
[0197] 3) The HMAC-SHA256 and CMAC-AES128 algorithms are well-suited for resource-constrained vehicular networks in terms of resource consumption and computation speed.
[0198] 4) Because the encryption key for each diagnostic unlock key KEY is derived from the random number seed SEED of the current diagnostic session, the key does not need to be stored, and the ECU does not need to have a dedicated HSM hardware security module (HSM) for storing sensitive information, which has good applicability and good economic benefits.
[0199] Thirdly, embodiments of this application provide a first data processing apparatus 90, such as... Figure 9 As shown, a first data processing device 90 is deployed on a diagnostic instrument. The first data processing device 90 includes: a first transmitting unit 901, a first receiving unit 902, a generating unit 903, a second transmitting unit 904, and a second receiving unit 905.
[0200] in:
[0201] The first sending unit 901 is used to send a first diagnostic request to the target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU.
[0202] The first receiving unit 902 is used to receive seed data sent by the target ECU;
[0203] The generation unit 903 is used to generate a first unlocking key based at least on the seed data and the information factors of the acquired target ECU;
[0204] The second sending unit 904 is used to send the first unlocking key to the target ECU, so that the target ECU can perform diagnostic unlocking based on the first unlocking key and the second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and the information factors of the target ECU;
[0205] The second receiving unit 905 is used to receive the diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0206] In some embodiments, the generation unit 903 is further configured to: generate a first key based at least on the information factors of the target ECU; encrypt the seed data using the first key through a first encryption algorithm to obtain first encrypted data; and generate the first unlock key based at least on the first encrypted data.
[0207] In some embodiments, the generation unit 903 is further configured to: perform a first operation on the seed data to obtain first data; concatenate the first data with the information factor of the target ECU to obtain first concatenated data; and perform a hash operation on the first concatenated data to generate the first key.
[0208] In some embodiments, the generating unit 903 is further configured to: determine the first encrypted data as the first unlocking key; or, extract the first digit of the first encrypted data to obtain a second key; concatenate the seed data, the first data, and the second data to obtain second concatenated data; the first data is obtained by performing a first operation on the seed data; the second data is obtained by performing a second operation on the seed data; encrypt the second concatenated data using the second key through a second encryption algorithm to obtain second encrypted data; the second encryption algorithm is different from the first encryption algorithm; and determine the first unlocking key based at least on the second encrypted data.
[0209] In some embodiments, the generating unit 903 is further configured to: perform a third operation on the second encrypted data to obtain the first unlocking key; or determine the second encrypted data as the first unlocking key.
[0210] Fourthly, embodiments of this application provide a second data processing apparatus 100, such as... Figure 10 As shown, the second data processing device 100 is deployed on the target ECU or vehicle equipment. The second data processing device 100 includes: a first receiving unit 1001, a first generating unit 1002, a second receiving unit 1003, a second generating unit 1004, and a processing unit 1005.
[0211] in:
[0212] The first receiving unit 1001 is used to receive a first diagnostic request sent by the diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with the target ECU.
[0213] The first generation unit 1002 is configured to generate seed data in response to the first diagnostic request and send the seed data to the diagnostic instrument so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the acquired target ECU.
[0214] The second receiving unit 1003 is used to receive the first unlocking key sent by the diagnostic instrument;
[0215] The second generation unit 1004 is used to generate a second unlocking key based at least on the seed data and the information factors of the target ECU;
[0216] The processing unit 1005 is configured to obtain a diagnostic unlocking result based on the first unlocking key and the second unlocking key; and send the diagnostic unlocking result to the diagnostic instrument; the diagnostic unlocking result includes unlocking success or unlocking failure.
[0217] In some embodiments, the processing unit 1005 is further configured to: compare the first unlock key and the second unlock key; if the first unlock key and the second unlock key are the same, determine that the diagnostic unlock result is successful; if the first unlock key and the second unlock key are different, determine that the diagnostic unlock result is unsuccessful.
[0218] Fifthly, this application provides a diagnostic instrument for performing the data processing method described above.
[0219] Sixthly, this application provides a target ECU or vehicle device for executing the data processing method performed by the target ECU.
[0220] It should be noted that the data processing device provided in this application embodiment includes all the units included, which can be implemented by a processor in an electronic device; of course, it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA), etc.
[0221] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0222] It should be noted that, in the embodiments of this application, if the above-described data processing method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0223] In a seventh aspect, this application provides a data processing system, including a diagnostic instrument and a target ECU, wherein the diagnostic instrument is used to execute the processing method provided in the first aspect above, and the target ECU is used to execute the data processing method provided in the second aspect above.
[0224] Eighthly, this application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described data processing methods.
[0225] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0226] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0227] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0228] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0229] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0230] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0231] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0232] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0233] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, The method is applied to a diagnostic instrument; the method includes: A first diagnostic request is sent to the target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU. Receive seed data sent by the target ECU; Obtain the information factors of the target ECU; generate a first key based at least on the information factors of the target ECU; The seed data is encrypted using a first encryption algorithm and a first key to obtain first encrypted data; the first digit of the first encrypted data is extracted to obtain a second key; the seed data, the first data, and the second data are concatenated to obtain second concatenated data; the first data is obtained by performing a first operation on the seed data; the second data is obtained by performing a second operation on the seed data; the second concatenated data is encrypted using a second encryption algorithm and the second key to obtain second encrypted data; the second encryption algorithm is different from the first encryption algorithm; a first unlocking key is determined at least based on the second encrypted data; the first encryption algorithm is the HMAC_SHA256 algorithm, and the second operation includes at least one of bitwise NOT, shift, or bit flip operations, and the first operation is different from the second operation; the second encryption algorithm is the CMAC-AES128 algorithm. The first unlock key is sent to the target ECU, so that the target ECU can perform diagnostic unlocking based on the first unlock key and the second unlock key; the second unlock key is generated by the target ECU based at least on the seed data and the information factors of the target ECU; Receive the diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes whether the unlocking was successful or failed.
2. The method according to claim 1, characterized in that, The generation of the first key based at least on the information factors of the target ECU includes: Perform a first operation on the seed data to obtain the first data; The first data is concatenated with the information factors of the target ECU to obtain the first concatenated data; Perform a hash operation on the first concatenated data to generate the first key.
3. The method according to claim 1, characterized in that, Determining the first unlocking key based at least on the second encrypted data includes: A third operation is performed on the second encrypted data to obtain the first unlocking key; Alternatively, the second encrypted data can be determined as the first unlocking key.
4. A data processing method, characterized in that, The method is applied to a target ECU; the method includes: Receive a first diagnostic request sent by the diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with the target ECU; In response to the first diagnostic request, seed data is generated and sent to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the target ECU; wherein, generating the first unlocking key based at least on the seed data and the information factors of the target ECU includes: acquiring the information factors of the target ECU; generating a first key based at least on the information factors of the target ECU; encrypting the seed data using the first key through a first encryption algorithm to obtain first encrypted data; extracting the first digit of the first encrypted data to obtain a second key; and combining the seed data, the first data, and the second data. The concatenation process yields second concatenated data; the first data is obtained by performing a first operation on the seed data; the second data is obtained by performing a second operation on the seed data; the second concatenated data is encrypted using a second encryption algorithm and a second key to obtain second encrypted data; the second encryption algorithm is different from the first encryption algorithm; the first unlocking key is determined at least based on the second encrypted data; the first encryption algorithm is the HMAC_SHA256 algorithm, and the second operation includes at least one of bitwise NOT, shift, or bit flip operations, wherein the first operation is different from the second operation; the second encryption algorithm is the CMAC-AES128 algorithm. Receive the first unlock key sent by the diagnostic instrument; A second unlocking key is generated based at least on the seed data and the information factors of the target ECU; Based on the first unlock key and the second unlock key, a diagnostic unlock result is obtained; and the diagnostic unlock result is sent to the diagnostic instrument; the diagnostic unlock result includes whether the unlock was successful or failed.
5. The method according to claim 4, characterized in that, The process of obtaining the diagnostic unlocking result based on the first unlocking key and the second unlocking key includes: Compare the first unlock key and the second unlock key; If the first unlock key and the second unlock key are the same, the diagnostic unlock result is determined to be successful. If the first unlock key and the second unlock key are different, the diagnostic unlock result is determined to be an unlock failure.
6. A data processing apparatus, characterized in that, The device is deployed in a diagnostic instrument, and the device includes: The first sending unit is configured to send a first diagnostic request to the target electronic control unit (ECU); the first diagnostic request is used to request diagnostic unlocking with the target ECU. The first receiving unit is used to receive seed data sent by the target ECU; A generation unit is configured to: acquire information factors of the target ECU; generate a first key based at least on the information factors of the target ECU; encrypt seed data using the first key via a first encryption algorithm to obtain first encrypted data; extract the first digit of the first encrypted data to obtain a second key; concatenate the seed data, the first data, and the second data to obtain second concatenated data; wherein the first data is obtained by performing a first operation on the seed data; the second data is obtained by performing a second operation on the seed data; encrypt the second concatenated data using the second key via a second encryption algorithm to obtain second encrypted data; wherein the second encryption algorithm is different from the first encryption algorithm; determine a first unlocking key based at least on the second encrypted data; wherein the first encryption algorithm is the HMAC_SHA256 algorithm, and the second operation includes at least one of bitwise NOT, shift, or bit flip operations, wherein the first operation is different from the second operation; and wherein the second encryption algorithm is the CMAC-AES128 algorithm. The second sending unit is configured to send the first unlocking key to the target ECU, so that the target ECU can perform diagnostic unlocking based on the first unlocking key and the second unlocking key; the second unlocking key is generated by the target ECU based at least on the seed data and the information factors of the target ECU; The second receiving unit is used to receive the diagnostic unlocking result sent by the target ECU; the diagnostic unlocking result includes unlocking success or unlocking failure.
7. A data processing apparatus, characterized in that, The device is deployed on the target ECU, and the device includes: The first receiving unit is configured to receive a first diagnostic request sent by the diagnostic instrument; the first diagnostic request is used to request diagnostic unlocking with the target ECU. A first generation unit is configured to, in response to the first diagnostic request, generate seed data and send the seed data to the diagnostic instrument, so that the diagnostic instrument generates a first unlocking key based at least on the seed data and the information factors of the target ECU; wherein, generating the first unlocking key based at least on the seed data and the information factors of the target ECU includes: acquiring the information factors of the target ECU; generating a first key based at least on the information factors of the target ECU; encrypting the seed data using the first key through a first encryption algorithm to obtain first encrypted data; extracting the first digit of the first encrypted data to obtain a second key; and combining the seed data and the first key. The second concatenated data is obtained by concatenating the first data with the second data; the first data is obtained by performing a first operation on the seed data; the second data is obtained by performing a second operation on the seed data; the second concatenated data is encrypted using a second encryption algorithm and a second key to obtain second encrypted data; the second encryption algorithm is different from the first encryption algorithm; a first unlocking key is determined at least based on the second encrypted data; the first encryption algorithm is the HMAC_SHA256 algorithm, and the second operation includes at least one of bitwise NOT operation, shift operation, or bit flip operation, and the first operation is different from the second operation; the second encryption algorithm is the CMAC-AES128 algorithm. The second receiving unit is used to receive the first unlocking key sent by the diagnostic instrument; The second generation unit is used to generate a second unlocking key based at least on the seed data and the information factors of the target ECU; The processing unit is configured to obtain a diagnostic unlocking result based on the first unlocking key and the second unlocking key; and send the diagnostic unlocking result to the diagnostic instrument; the diagnostic unlocking result includes unlocking success or unlocking failure.
8. An electronic device having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data processing method according to any one of claims 1-5.
Citation Information
Patent Citations
Vehicle data acquisition method and device and equipment
CN106155043A
Vehicle anti-theft matching method, device, equipment and medium
CN116552449A