Vehicle-side safety communication method and device

By using SE module and OpenSSL for two-way authentication and session key negotiation in vehicle-side communication, the problem of security risks of vehicle-side communication is solved and the security of data transmission is improved.

CN114449512BActive Publication Date: 2025-04-25WUHAN ZHONGHAITING DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111653555.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-04-25
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

The existing vehicle-side communication methods have certain safety risks, especially during the transmission of internal and external data of the vehicle.

Method used

Through the vehicle-side SE module as the security carrier of certificates and keys, and using Linux OpenSSL as the security component, two-way authentication and session key negotiation are carried out to establish a secure communication link.

Benefits of technology

It improves the security of the data transmission process on the vehicle and server side and reduces the risk of man-in-the-middle attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114449512B_ABST
    Figure CN114449512B_ABST
Patent Text Reader

Abstract

The present invention provides a vehicle-side secure communication method and device, the method comprising: after the vehicle-side starts a secure connection, the vehicle-side application initiates external authentication to the vehicle-side SE module, and uses the vehicle-side certificate to initialize OpenSSL; based on the OpenSSL external connection, the vehicle-side initiates a handshake connection to the server; the vehicle-side application verifies the feedback server certificate, creates a pre-session key and encrypts it based on the server public key; the vehicle-side application sends a server random number signature request to the vehicle-side SE module, and the SE module returns the signature data; the vehicle-side application sends the client certificate, signature data and ciphertext, the server verifies the signature data, and calculates the session key according to the encryption algorithm; the server sends a check code to the vehicle-side application, the vehicle-side application verifies whether the key is consistent based on the calculated session key, and the vehicle-side application communicates with the server based on the verified consistent session key. Through this scheme, a secure communication link can be established to improve the security of vehicle-side data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communications, and in particular relates to a vehicle-side safety communication method and device. Background Art

[0002] With the continuous development of intelligent driving and unmanned driving technologies, the scale of vehicle-side software is also growing rapidly. At the same time, the information security issues caused by this are becoming more and more serious. In particular, there are major data security risks in the process of data transmission between inside and outside the vehicle.

[0003] At present, common vehicle-side communication solutions are mostly based on some encryption algorithms, such as digital signatures and key negotiation. These algorithms directly based on symmetric encryption or asymmetric encryption can achieve certain encryption communication effects, but there are still certain security risks. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a vehicle-side secure communication method and device, which are used to solve the problem that the existing vehicle-side communication method has certain security risks.

[0005] In a first aspect of an embodiment of the present invention, a vehicle-side secure communication method is provided, comprising:

[0006] After the vehicle starts the secure connection, the vehicle application initiates external authentication to the vehicle SE module and initializes OpenSSL based on the vehicle certificate obtained through external authentication.

[0007] Among them, the vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption;

[0008] Based on the OpenSSL external connection, the vehicle-side application initiates a handshake connection to the server-side, and the server-side returns a corresponding handshake message and requests a client certificate. The handshake message includes at least the server-side certificate, the determined encryption algorithm, and the server-side random number;

[0009] After the vehicle-side application verifies the server-side certificate, it creates a pre-session key and encrypts the pre-session key based on the server-side public key to obtain a ciphertext;

[0010] The vehicle-side application sends a random number signature request from the server to the vehicle-side SE module. After the vehicle-side SE module completes the signature, it returns the signature data.

[0011] The vehicle application sends the client certificate, signature data, and ciphertext to the server. The server verifies the client certificate and the signature data through the client certificate public key, decrypts the pre-session key based on the server private key, and calculates the session key according to the corresponding encryption algorithm.

[0012] The server sends a server verification code containing the session key to the vehicle application. The vehicle application calculates the session key based on the corresponding encryption algorithm, verifies whether the calculated session key is consistent with the received key, and calculates the client verification code and sends it to the server.

[0013] The vehicle-side application and the server-side communicate based on a verified and consistent session key.

[0014] In a second aspect of an embodiment of the present invention, a vehicle-side safety communication device is provided, including:

[0015] The vehicle-side application is used to initiate external authentication to the vehicle-side SE module and establish a secure connection between the vehicle and the server;

[0016] Among them, the vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption, and performs OpenSSL initialization according to the vehicle-side certificate obtained by external authentication, initiates a handshake connection to the server based on the OpenSSL external connection, creates a pre-session key after verifying the server-side certificate, encrypts the pre-session key based on the server-side public key to obtain a ciphertext, and sends a server-side random number signature request to the vehicle-side SE module, receives the signature data returned after the signature is completed, and sends the client certificate, signature data and ciphertext to the server, receives the verification code containing the session key sent by the server, calculates the session key based on the corresponding encryption algorithm, verifies whether the calculated session key is consistent with the received key, and calculates the vehicle-side verification code and sends it to the server;

[0017] The vehicle-side SE module is used to verify the vehicle-side external access rights, store the vehicle-side certificate, CA certificate and vehicle-side public and private keys, and sign random numbers.

[0018] In a third aspect of an embodiment of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect of the embodiment of the present invention when executing the computer program.

[0019] In a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method provided in the first aspect of the embodiment of the present invention are implemented.

[0020] In the embodiment of the present invention, based on the vehicle-side SE as a secure carrier of certificates and keys, Linux Openssl as a security component, two-way authentication is performed through the secure communication protocol TLS, and session key negotiation is performed to establish a secure communication link, thereby improving the security of the data transmission process between the vehicle and the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A schematic diagram of a process flow of a vehicle-side secure communication method provided by an embodiment of the present invention;

[0023] Figure 2 A timing diagram of a vehicle-side safety communication method provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of an internal call of SE based on OpenSSL provided by an embodiment of the present invention;

[0025] Figure 4 A schematic structural diagram of a vehicle-side safety communication device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] It should be understood that the term "including" and other similar expressions in the specification or claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions, such as a process, method, system, or device including a series of steps or units is not limited to the listed steps or units. In addition, "first" and "second" are used to distinguish different objects, not to describe a specific order.

[0028] See also Figure 1 , a schematic diagram of a process flow of a vehicle-side safety communication method provided by an embodiment of the present invention includes:

[0029] S101, after the vehicle-side starts the secure connection, the vehicle-side application initiates external authentication to the vehicle-side SE module, and performs OpenSSL initialization based on the vehicle-side certificate obtained through external authentication;

[0030] The vehicle-side application is a vehicle-side application program that can establish a network connection with a remote server for data transmission; the vehicle-side SE (Security Element) module is a vehicle-side security module that is used to store certificates, keys, etc. and provide an access interface for calling.

[0031] The SE module in the TBox security gateway inside the vehicle serves as a carrier of certificates and keys, and can provide support for the system security components of the vehicle-side Linux embedded system. That is, the vehicle is equipped with an SE security module, and the vehicle-side embedded Linux uses OpenSSL as the system certificate and security component.

[0032] Among them, the vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption;

[0033] Specifically, the vehicle-side application obtains the OpenSSL internal call based on the So interface, and calls the SeSdk library based on the So interface provided by the OpenSSL engine, and accesses the CA certificate, vehicle-side certificate, and vehicle-side public and private keys through the APDU interface encapsulated by the SeSdk library. Figure 2 As shown, the vehicle's client application calls OpenSSL through the So interface, OpenSSL then calls Engine internally, calls the SeSdk library through the So interface provided by Openssl Engine, and accesses the CA certificate, vehicle certificate, and vehicle public and private keys in the SE module based on the APDU interface.

[0034] In OpenSSL, the Openssl Engine library is used to connect to Openssl to provide underlying support during the TLS handshake process. The SeSdk library is called internally by OpensslEngine to implement key private key-related functional support. It can also integrate the SeSdk functional logic into MapEngine. Engine is reserved by OPENSSL to load third-party encryption library engines. It mainly includes dynamic library loading code and a series of interfaces for encryption function pointer management. When using Engine, you must first load the Engine, and then select the algorithm to be used or use all supported encryption algorithms. When the application calls the encryption and decryption algorithm, it will point to the encryption and decryption algorithm in the loaded dynamic library. The purpose of the SeSdk module is to encapsulate the SE command APDU interface into a standard module interface to facilitate external calls.

[0035] The external authentication is a means of authentication for SE to authenticate external users, and symmetric keys are often used for authentication. Specifically, the external user initiates an external authentication request instruction to the SE. After receiving the instruction, the SE generates a temporary random number and temporarily saves the random number to the RAM area of ​​the SE. After the external user receives the random number, the random number is encrypted using a symmetric key, and the generated ciphertext (also known as authentication data) is encapsulated into an instruction and sent to the SE for external authentication. After the SE receives the external authentication instruction, it uses the same key (the key is a symmetric key, which is a key pre-synchronized between the external caller and the SE) to encrypt the random number, and then compares the two ciphertexts (one is the ciphertext received in the external authentication command, and the other is the ciphertext calculated by the SE) to determine whether they are consistent. If they are consistent, it means that the caller is legal.

[0036] Among them, when it is determined that the external call of the vehicle-side application is legal, the SE module modifies the current state machine to the authorized state to obtain the corresponding SE operation authority. Once the external caller is confirmed to be legal, the SE modifies the current state machine to the authorized state, so that the external authentication party can carry out subsequent SE operations (such as private key signing, certificate data update, etc.).

[0037] S102, based on the OpenSSL external connection, the vehicle-side application initiates a handshake connection to the server-side, and the server-side returns a corresponding handshake message and requests a client certificate, wherein the handshake message includes at least a server-side certificate, a determined encryption algorithm, and a server-side random number;

[0038] A secure connection is established between the vehicle application and the server based on the TLS / SSL protocol. After the OpenSSL server completes the IP port binding, it processes the monitoring state and listens to the handshake request from the vehicle.

[0039] Among them, the vehicle-side application handshake connection request at least includes sending the SSL version, algorithm suite, and client random number to the server. The algorithm suite generally contains four parts of information: key exchange algorithm (such as RSA, ECDH, PSK, etc.), encryption algorithm (such as DES56, RC2 56, RC4 128, etc.), message authentication information code algorithm (such as MD5, SHA, etc.) and pseudo-random number function.

[0040] After the algorithm suite is sent to the server, the server determines the key exchange algorithm, encryption algorithm, etc. specifically used in the suite, and performs key exchange, encryption, and checksum calculation, etc. through the corresponding algorithms.

[0041] S103, after the vehicle-side application verifies the server-side certificate, it creates a pre-session key, and encrypts the pre-session key based on the server-side public key to obtain a ciphertext;

[0042] S104, the vehicle-side application sends a server-side random number signature request to the vehicle-side SE module, and the vehicle-side SE module returns the signature data after the signature is completed;

[0043] After the vehicle-side application sends a signature request to the vehicle-side SE module, the SE module can sign the random number sent by the server according to the stored vehicle-side private key.

[0044] S105, the vehicle-side application sends the client certificate, signature data and ciphertext to the server, the server verifies the client certificate, verifies the signature data through the client certificate public key, decrypts the pre-session key based on the server-side private key, and calculates the session key according to the corresponding encryption algorithm;

[0045] S106, the server sends a server verification code containing a session key to the vehicle application, the vehicle application calculates the session key based on the corresponding encryption algorithm, verifies whether the calculated session key is consistent with the received key, and calculates a client verification code and sends it to the server;

[0046] The vehicle-side application sends the verification code containing the session key calculated by the vehicle-side to the server-side, and the session key is verified on the server-side.

[0047] S107. The vehicle-side application communicates with the server-side based on the verified consistent session key.

[0048] When the session keys calculated by the vehicle-side application and the server are mutually verified to be consistent, the vehicle-side application can perform encrypted data transmission based on the agreed-upon session key and receive the encrypted data returned by the server.

[0049] For example, Figure 3 As shown, Figure 3 The data communication process between the vehicle-side application, vehicle-side SE and the server is shown in the figure, which is as follows:

[0050] After the vehicle starts the secure connection, the vehicle application initiates external authentication to the vehicle SE, and the vehicle SE returns the external authentication result. The vehicle initializes OpenSSL according to the obtained vehicle certificate. The vehicle application sends a Client Hello message to the server (the message contains the SSL version, algorithm suite, client random number Rand_c, etc.), receives the ServerHello message returned by the server (containing the server certificate Cert_s, the determined algorithm suite and related parameters, and the server random number Rand_s), and requests the client (vehicle) certificate. The vehicle application verifies the server certificate Cert_s, creates Premaster_key, and encrypts the ScrectKey through the server public key. The vehicle application sends a Hash signature request based on the Rand_s random number to the vehicle SE, and the vehicle SE returns the signature data Sign_c. The vehicle sends the client certificate Cert_c, Sign_c, ScrectKey, etc. to the server, and the server verifies the client certificate Cert_c, verifies Sign_c through the client certificate public key, decrypts Premaster_Key with the private key, and calculates the session key Master_Key through the algorithm, and sends the Server The Finish message (including the verification code of the Master_Key server) is sent to the vehicle; the vehicle application uses the relevant algorithm to calculate the Master_Key, verify the received Master_Key confirmation code, and calculate the verification code of the Master_Key client, and sends the Client Finish message (including the verification code of the Master_Key client) to the server. When the server and the vehicle reach an agreement on the Master_Key, the Master_Key is used as the session key for communication.

[0051] The vehicle-side application based on the embedded Linux system conducts TLS secure communication handshake negotiation with the network server, thereby achieving data security at the link layer, ensuring the security of data encryption and data integrity verification, and avoiding man-in-the-middle attacks. The vehicle-side hardware SE (Security Element) module stores certificates and keys, ensuring the security of vehicle-side certificates and keys.

[0052] The client (vehicle) software App realizes a secure data channel between the vehicle and the server through the support of local Openssl and the underlying Openssl Engine, SeSdk.so and SE.

[0053] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution, and the execution sequence 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 the present invention.

[0054] Figure 4 A schematic diagram of the structure of a vehicle-side safety communication device provided by an embodiment of the present invention, the device 40 includes:

[0055] The vehicle-side application 410 is used to initiate external authentication to the vehicle-side SE module and establish a secure connection between the vehicle-side and the server;

[0056] Among them, the vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption, and performs OpenSSL initialization according to the vehicle-side certificate obtained by external authentication, initiates a handshake connection to the server based on the OpenSSL external connection, creates a pre-session key after verifying the server-side certificate, encrypts the pre-session key based on the server-side public key to obtain a ciphertext, and sends a server-side random number signature request to the vehicle-side SE module, receives the signature data returned after the signature is completed, and sends the client certificate, signature data and ciphertext to the server, receives the verification code containing the session key sent by the server, calculates the session key based on the corresponding encryption algorithm, verifies whether the calculated session key is consistent with the received key, and calculates the vehicle-side verification code and sends it to the server;

[0057] Among them, when it is determined that the external call of the vehicle-side application is legal, the SE module modifies the current state machine to the authorized state to obtain the corresponding SE operation authority.

[0058] Specifically, the vehicle-side application obtains the OpenSSL internal call based on the So interface, and calls the SeSdk library based on the So interface provided by the OpenSSL engine, and accesses the CA certificate, vehicle-side certificate, and vehicle-side public and private keys through the APDU interface encapsulated by the SeSdk library.

[0059] The vehicle-side SE module 420 is used to verify the vehicle-side external access rights, store the vehicle-side certificate, CA certificate and vehicle-side public and private keys, and sign random numbers.

[0060] It can be understood by those skilled in the art that, in one embodiment, an electronic device is further provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, part of the process in steps S101 to S107 is implemented to perform a vehicle-side secure communication connection. In another embodiment, the computer program can also be stored in a computer-readable storage medium, and the storage medium includes, for example, ROM / RAM, a magnetic disk, an optical disk, etc.

[0061] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described system and module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0062] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0063] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A vehicle-side safety communication method, characterized in that: include: After the vehicle starts the secure connection, the vehicle application initiates external authentication to the vehicle SE module and initializes OpenSSL based on the vehicle certificate obtained through external authentication. Among them, the vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption; Among them, when it is determined that the external call of the vehicle-side application is legal, the SE module modifies the current state machine to the authorized state to obtain the corresponding SE operation authority; Based on the OpenSSL external connection, the vehicle-side application initiates a handshake connection to the server-side, and the server-side returns a corresponding handshake message and requests a client certificate. The handshake message includes at least the server-side certificate, the determined encryption algorithm, and the server-side random number; After the vehicle-side application verifies the server-side certificate, it creates a pre-session key and encrypts the pre-session key based on the server-side public key to obtain a ciphertext; The vehicle-side application sends a random number signature request from the server to the vehicle-side SE module. After the vehicle-side SE module completes the signature, it returns the signature data. The vehicle application sends the client certificate, signature data, and ciphertext to the server. The server verifies the client certificate and the signature data through the client certificate public key, decrypts the pre-session key based on the server private key, and calculates the session key according to the corresponding encryption algorithm. The server sends a server verification code containing the session key to the vehicle application. The vehicle application calculates the session key based on the corresponding encryption algorithm, verifies whether the calculated session key is consistent with the received key, and calculates the client verification code and sends it to the server. The vehicle-side application and the server-side communicate based on a verified and consistent session key.

2. The method according to claim 1, characterized in that The vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption: The vehicle-side application obtains OpenSSL internal calls based on the So interface, and calls the SeSdk library based on the So interface provided by the OpenSSL engine, and accesses the CA certificate, vehicle-side certificate, and vehicle-side public and private keys through the APDU interface encapsulated by the SeSdk library.

3. The method according to claim 1, characterized in that Based on the OpenSSL external connection, the vehicle-side application initiates a handshake connection to the server-side including: The vehicle-side application sends at least the SSL version, algorithm suite, and client random number to the server to initiate a handshake connection request.

4. A vehicle-side safety communication device, characterized in that: include: The vehicle-side application is used to initiate external authentication to the vehicle-side SE module and establish a secure connection between the vehicle and the server; Among them, the vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption, and performs OpenSSL initialization according to the vehicle-side certificate obtained by external authentication, initiates a handshake connection to the server based on the OpenSSL external connection, creates a pre-session key after verifying the server-side certificate, encrypts the pre-session key based on the server-side public key to obtain a ciphertext, and sends a server-side random number signature request to the vehicle-side SE module, receives the signature data returned after the signature is completed, and sends the client certificate, signature data and ciphertext to the server, receives the verification code containing the session key sent by the server, calculates the session key based on the corresponding encryption algorithm, verifies whether the calculated session key is consistent with the received key, and calculates the vehicle-side verification code and sends it to the server; The initiating of external authentication to the vehicle-side SE module includes: When the external call of the vehicle-side application is determined to be legal, the SE module modifies the current state machine to the authorized state to obtain the corresponding SE operation authority; The vehicle-side SE module is used to verify the vehicle-side external access rights, store the vehicle-side certificate, CA certificate and vehicle-side public and private keys, and sign random numbers.

5. The device according to claim 4, characterized in that The vehicle-side application accesses the vehicle-side certificate, CA certificate and vehicle-side public and private keys in the vehicle-side SE module based on symmetric encryption: The vehicle-side application obtains OpenSSL internal calls based on the So interface, and calls the SeSdk library based on the So interface provided by the OpenSSL engine, and accesses the CA certificate, vehicle-side certificate, and vehicle-side public and private keys through the APDU interface encapsulated by the SeSdk library.

6. The device according to claim 4, characterized in that The initiating a handshake connection to the server based on the OpenSSL external connection includes: The vehicle-side application sends at least the SSL version, algorithm suite, and client random number to the server to initiate a handshake connection request.

Citation Information

Patent Citations

  • Method of performing integrity verification between client and server and encryption security protocol-based communication method of supporting integrity verification between client and server

    US20190098016A1