Automobile OBD port access authentication method, system, device and medium
By using TLS two-way authentication and encryption channels in automotive diagnostic services, the security threat problem during OBD port connection is solved, ensuring the authenticity and reliability of the connection, and allowing third-party devices to read regulatory data, reducing maliciousness Risk of modification.
Patent Information
- Application Number
- CN202411049686.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-01
AI Technical Summary
There is a security threat when the existing automotive diagnostic business is connected through the OBD port, which may lead to malicious modifications or black and gray products, causing losses to car owners and car companies.
Connect the diagnostic device through the DOIP port. If the connection fails, perform TLS bidirectional authentication. After the authentication is passed, open the DOIP port, allow UDS services, and maintain it through the CAN and ETH interfaces. Build a whitelist to determine the identity of the device and use encrypted channels to perform data. transmission.
Two-way authentication and maintenance between diagnostic equipment and vehicles are achieved, ensuring the authenticity and reliability of the connection, while allowing third-party equipment to read regulatory data, reducing the risk of malicious modifications.
Smart Images

Figure CN119094160A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automobile communication, and in particular relates to an automobile OBD port access authentication method. Background Art
[0002] Generally speaking, vehicle diagnostic services are completed through diagnostic equipment (such as diagnostic instruments) connected to the vehicle's OBD port using the UDS protocol. The UDS protocol includes a set of services that can read, write, and execute various operations on vehicle components (ECUs), and has extremely high permissions. Therefore, if the diagnostic service is used improperly (such as abuse), it will lead to malicious modifications to any vehicle, or form black and gray industries, causing losses to car owners and car companies.
[0003] The main security threats in various diagnosis business scenarios are as follows:
[0004]
[0005] In order to improve the security of diagnostic services, the above risks need to be eliminated to achieve the following status:
[0006]
[0007] Therefore, it is necessary to provide a new automobile OBD port access authentication method, system, device and medium to solve the above technical problems. Summary of the invention
[0008] The purpose of the present disclosure is to provide a method, system, device and medium for automobile OBD port access authentication in order to solve the above problems.
[0009] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0010] A method for authenticating access to an automobile OBD port comprises the following steps:
[0011] The diagnostic device is connected through the DOIP port. If the connection fails, TLS two-way authentication is performed through the authentication port. After the TLS two-way authentication passes, the DOIP port is opened to connect the diagnostic device, allowing UDS services and keeping them alive.
[0012] As a further optimization solution of the present disclosure, a CAN interface and an ETH interface are integrated in the OBD port.
[0013] As a further optimization solution of the present disclosure, the DOIP port and the authentication port are both connected to the diagnostic device through the ETH interface.
[0014] As a further optimization solution of the present disclosure, before connecting the diagnostic device through the DOIP port, a whitelist is constructed to determine whether the diagnostic device belongs to the whitelist diagnostic device. If so, the connection is made through the CAN interface.
[0015] As a further optimization solution of the present disclosure, the whitelist diagnostic device does not need to pass device access authentication and is allowed to read regulatory data.
[0016] As a further optimization solution of the present disclosure, the prerequisites for performing TLS two-way authentication through the authentication port include:
[0017] The diagnostic device is pre-set with a device certificate and a root certificate for verifying the in-vehicle access authentication controller certificate; the in-vehicle access authentication controller is pre-set with a device certificate and a root certificate for verifying the diagnostic device certificate.
[0018] As a further optimization solution of the present disclosure, keep-alive includes:
[0019] Negotiate a symmetric algorithm to encrypt the channel;
[0020] The client periodically sends keep-alive parameters to the server through an encrypted channel;
[0021] The server receives the keep-alive parameters. If five keep-alive parameters are lost in succession, the connection is disconnected and the DOIP port is closed.
[0022] An automobile OBD port access authentication system, comprising:
[0023] Try connecting the module to connect the diagnostic equipment via the DOIP port;
[0024] The two-way authentication connection module is used to perform TLS two-way authentication through the authentication port after the diagnostic device fails to connect through the DOIP port. After the TLS two-way authentication passes, the DOIP port is opened to connect the diagnostic device, allowing UDS services and keeping it alive.
[0025] An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0026] Memory, for storing computer programs;
[0027] The processor is used to implement the automobile OBD port access authentication method when executing the program stored in the memory.
[0028] A computer-readable storage medium stores a computer program, which implements a vehicle OBD port access authentication method when executed by a processor.
[0029] The beneficial effects of the present disclosure are:
[0030] This paper completes the two-way authentication of diagnostic equipment and vehicles based on the TLS protocol. After the authentication is passed, a keep-alive strategy is designed to ensure the authenticity and reliability of the link. At the same time, a whitelist is designed to allow third-party devices to read regulatory data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a flow chart of the method disclosed herein;
[0032] Figure 2 is a schematic diagram of a device access authentication framework in this embodiment of the present disclosure;
[0033] Figure 3 is a schematic diagram of the OBD and diagnosis-related ports in this embodiment of the present disclosure;
[0034] Figure 4 is an access authentication flow chart in this embodiment of the present disclosure;
[0035] Figure 5 is a system framework diagram in this embodiment of the present disclosure;
[0036] Figure 6 It is a device framework diagram in this embodiment of the present disclosure. DETAILED DESCRIPTION
[0037] The present application is further described in detail below in conjunction with the accompanying drawings. It is necessary to point out here that the following specific implementation methods are only used to further illustrate the present application and cannot be understood as limiting the scope of protection of the present application. Technical personnel in this field can make some non-essential improvements and adjustments to the present application based on the above application content.
[0038] like Figure 1 As shown, a vehicle OBD port access authentication method includes the following steps:
[0039] The diagnostic device is connected through the DOIP port. If the connection fails, TLS (Transport Layer Security) two-way authentication is performed through the authentication port. After the TLS two-way authentication passes, the DOIP (Diagnostic over Internet Protocol based on Ethernet) port is opened to connect the diagnostic device, allowing UDS services and keeping them alive.
[0040] In this embodiment, the method specifically includes:
[0041] Device access authentication framework such as Figure 2 As shown, OBD and diagnostic related ports are as follows Figure 3 As shown;
[0042] Port 30504 (authentication port): used for device entry authentication;
[0043] Port 13400 (DOIP port): UDS channel for ETH (Ethernet) diagnostic equipment;
[0044] CAN port: UDS channel of CAN device;
[0045] Main functions:
[0046] ETH access authentication: Port 30504 performs two-way authentication based on TLS. After the authentication is passed, the encryption key is negotiated for keep-alive, and port 13400 is opened at the same time;
[0047] CAN port: supports switch control and controls the function switch through UDS;
[0048] ETH access authentication switch (controls port 13400 to be always open): supports switch control and enables access authentication function through UDS commands;
[0049] OBD Whitelist: Allows reading of regulatory data.
[0050] 1. The device access authentication process is as follows:
[0051] like Figure 4 As shown, after the diagnostic device is connected to the vehicle's OBD port, it first tries to connect using port 13400 (DOIP port). If it fails, it performs TLS two-way authentication through port 30504 (authentication port).
[0052] Prerequisites:
[0053] The diagnostic device pre-sets the device certificate and the root certificate used to verify the in-vehicle access authentication controller certificate;
[0054] The in-vehicle access authentication controller presets the device certificate and the root certificate used to verify the diagnostic device certificate.
[0055] 1. Two-way authentication: Implementation of certificate authentication process based on TLS standard:
[0056] Certificate: Support X.509 format
[0057] TLS version: 1.2 and above
[0058] Signature algorithm: ED25519
[0059] TLS Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
[0060] 2. After the two-way authentication is passed, port 13400 is opened to allow UDS services.
[0061] 3. Keep alive
[0062] a) After the two-way authentication is passed, the symmetric algorithm (such as AES GCM 128) is negotiated to encrypt the channel
[0063] b) The client periodically sends keep-alive parameters to the server through an encrypted channel
[0064] i. Sending frequency: once per second
[0065] ii. Parameters: counter = 0; counter++ (increase by 1 per second);
[0066] iii.Counter byte length: 4 bytes, unsigned integer
[0067] iv. Encryption: Use a symmetric algorithm to encrypt the data before transmission.
[0068] v. The keep-alive message uses a TCP message, the payload length is 4 bytes, and the Counter value is placed in it
[0069] c) The server receives keep-alive parameters. If five keep-alive parameters are lost in succession, the connection is terminated and port 13400 is closed.
[0070] 2. Port switch control
[0071] The ports related to device access authentication are mainly: port 30504, port 13400, and CAN port. At different stages, the switch status of these ports is different. In order to set and store these switch items, an "OBD security access mode" configuration item is introduced. The relationship between "OBD security access mode" and each port is as follows:
[0072] 1. Off (non-safe mode): When the in-vehicle access authentication controller component leaves the factory, the "OBD safety access mode" is off, and the status of each port is as follows:
[0073] ETH access authentication: open;
[0074] CAN port: open;
[0075] Port 13400: Open.
[0076] 2. Enable (safe mode): After the vehicle leaves the factory, the in-vehicle access authentication controller needs to be set to enable (safe mode). After enabling, the status of each port is as follows:
[0077] ETH access authentication: open;
[0078] CAN port: closed;
[0079] Port 13400: closed.
[0080] The mapping relationship between "OBD security access mode" and each port at different stages is shown in the following table:
[0081]
[0082]
[0083] 3. Functional Interface
[0084] 1. OBD security access mode switch (persistent storage) switch command:
[0085]
[0086] response:
[0087]
[0088] 2. Current OBD safety access mode query switching command:
[0089]
[0090] response:
[0091]
[0092]
[0093] 4. Demands from car companies
[0094]
[0095]
[0096] like Figure 5 As shown, an embodiment of the present disclosure provides a vehicle OBD port access authentication system, comprising:
[0097] An attempt to connect a module 11, for connecting a diagnostic device via a DOIP port;
[0098] The two-way authentication connection module 12 is used to perform TLS two-way authentication through the authentication port after the diagnostic device fails to connect through the DOIP port. After the TLS two-way authentication passes, the DOIP port is opened to connect the diagnostic device, allowing UDS services and keeping it alive.
[0099] The implementation process of the functions and effects of each module in the above system is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.
[0100] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0101] In the above-mentioned embodiment, any multiple of all modules can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least some functions of one or more of these modules can be combined with at least some functions of other modules and implemented in one module. At least one of all modules can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of all modules can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0102] See also Figure 6 , an electronic device provided by an embodiment of the present disclosure includes a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other through the communication bus 1140;
[0103] Memory 1130, for storing computer programs;
[0104] The processor 1110 is used to implement the following automobile OBD port access authentication method when executing the program stored in the memory 1130.
[0105] The communication bus 1140 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0106] The communication interface 1120 is used for communication between the above electronic device and other devices.
[0107] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1130 may also be at least one storage device located away from the processor 1110.
[0108] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0109] The embodiment of the present disclosure further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the vehicle OBD port access authentication method described above is implemented.
[0110] The computer-readable storage medium may be included in the device / apparatus described in the above embodiment; or it may exist independently without being assembled into the device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the automobile OBD port access authentication method according to the embodiment of the present disclosure is implemented.
[0111] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0112] The above-mentioned embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present disclosure. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure.
Claims
1. A vehicle OBD port access authentication method, characterized in that: The following steps are involved: The diagnostic device is connected through the DOIP port. If the connection fails, TLS two-way authentication is performed through the authentication port. After the TLS two-way authentication passes, the DOIP port is opened to connect the diagnostic device, allowing UDS services and keeping them alive.
2. A vehicle OBD port access authentication method according to claim 1, characterized in that: The OBD port is integrated with a CAN interface and an ETH interface.
3. A vehicle OBD port access authentication method according to claim 2, characterized in that: The DOIP port and the authentication port are both connected to the diagnostic device through the ETH interface.
4. A vehicle OBD port access authentication method according to claim 2, characterized in that: Before connecting the diagnostic device through the DOIP port, a white list is constructed to determine whether the diagnostic device belongs to the white list diagnostic device. If so, the device is connected through the CAN interface.
5. A vehicle OBD port access authentication method according to claim 4, characterized in that: The whitelist diagnostic device does not need to pass device access authentication and is allowed to read regulatory data.
6. A vehicle OBD port access authentication method according to claim 1, characterized in that: The prerequisites for TLS two-way authentication through the authentication port include: The diagnostic device is pre-set with a device certificate and a root certificate for verifying the in-vehicle access authentication controller certificate; the in-vehicle access authentication controller is pre-set with a device certificate and a root certificate for verifying the diagnostic device certificate.
7. A vehicle OBD port access authentication method according to claim 1, characterized in that: Keeping alive includes: Negotiate a symmetric algorithm to encrypt the channel; The client periodically sends keep-alive parameters to the server through an encrypted channel; The server receives the keep-alive parameters. If five keep-alive parameters are lost in succession, the connection is disconnected and the DOIP port is closed.
8. A vehicle OBD port access authentication system, characterized in that: include: Try connecting the module to connect the diagnostic equipment via the DOIP port; The two-way authentication connection module is used to perform TLS two-way authentication through the authentication port after the diagnostic device fails to connect through the DOIP port. After the TLS two-way authentication passes, the DOIP port is opened to connect the diagnostic device, allowing UDS services and keeping it alive.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, for storing computer programs; The processor is used to implement the automobile OBD port access authentication method described in any one of claims 1-7 when executing the program stored in the memory.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the automobile OBD port access authentication method described in any one of claims 1-7 is implemented.
Citation Information
Patent Citations
TLS authentication method, device and system, electronic equipment and readable medium
CN113328980A
Identity authentication method for vehicle diagnosis, diagnosis equipment and vehicle control unit
CN115913558A
Vehicle diagnosis method, vehicle, diagnosis equipment and storage medium
CN117170347A
Methods and nodes for authentication of a TLS connection
WO2019227459A1
