Anti-counterfeiting method, device, vehicle and system of controller
By generating public-private key pairs and server signature certificates for two-way authentication, the problem of illegal replacement of legitimate equipment in vehicle terminals has been solved, enabling reasonable control over key components and eliminating security risks posed by illegal parts in legitimate vehicles.
Patent Information
- Application Number
- CN202310140289.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-02-20
AI Technical Summary
In the existing technology, the hardware serial number authentication method of vehicle terminal cannot effectively solve the problem of illegal replacement of legitimate equipment, and the authentication efficiency is low, and it cannot prevent legitimate parts from being used in non-matched vehicles.
By generating a public-private key pair, using the server's signature certificate and a preset algorithm for two-way authentication, the system determines whether the controller is legitimate and reads the whitelist to determine if it matches the vehicle, thus preventing unauthorized controllers from being used in legitimate vehicles.
It has achieved reasonable control over key components, prevented the use of illegal parts in legal vehicles, eliminated the safety hazards of illegal parts in legal vehicles, ensured that legal parts cannot be used in incompatible vehicles, and solved the problem of illegal parts replacement.
Smart Images

Figure CN116527301B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network security technology, and in particular to a method, device, vehicle, and system for preventing counterfeiting of a controller. Background Technology
[0002] In related technologies, the hardware serial number of the vehicle terminal is burned onto the vehicle terminal; the vehicle infotainment system of the vehicle terminal generates a unique identification code based on the hardware serial number for identity authentication. This method requires the use of a backend server for identity authentication and cannot solve the problem of illegal replacement of parts with legitimate devices.
[0003] Other related technologies include vehicle authentication systems, communication devices, vehicle authentication devices, computer programs, and communication devices that can authenticate communication devices without wireless communication with devices outside the vehicle. However, the authentication process uses asymmetric algorithms, resulting in low authentication efficiency and failing to address the issue of illegal use of legitimate devices. Summary of the Invention
[0004] This application provides a method, device, vehicle, and system for preventing counterfeiting of controllers, in order to solve problems such as the use of illegal parts in legitimate vehicles and the use of legitimate parts in non-matching vehicles.
[0005] The first aspect of this application provides a method for preventing counterfeiting of a controller. The method is applied to a vehicle and includes the following steps: identifying whether the controller is being authenticated for the first time; if the controller is being authenticated for the first time, performing bidirectional authentication between the controller and other controllers based on a signature certificate issued by a server and a preset algorithm; otherwise, performing bidirectional authentication between the controller and other controllers based on the authentication key generated after the first authentication; if the bidirectional authentication fails, determining that the controller is illegitimate and prohibiting the controller from working; if the bidirectional authentication passes, determining that the controller is legitimate and reading the whitelist in the signature certificate; if the whitelist is in the vehicle's preset whitelist database, determining that the controller's anti-counterfeiting authentication has passed; otherwise, determining that the controller is incompatible with the vehicle and prohibiting the controller from working.
[0006] Based on the above technical means, the embodiments of this application can effectively detect whether the controller is legitimate through two-way authentication and effectively detect whether the legitimate controller is being used illegally through a whitelist. This enables reasonable control over key components, ensuring that illegal components cannot be used in legitimate vehicles and that legitimate components cannot be used in incompatible vehicles, thus completely solving the problem of illegal component replacement.
[0007] Optionally, the step of performing bidirectional authentication between this controller and other controllers based on the signature certificate issued by the server and a preset algorithm includes: sending the signature certificate of this controller to other controllers of the vehicle, wherein the other controller uses the root public key of the server to verify the signature certificate, and after successful verification, encrypts a first random number using the public key of this controller to obtain a first encrypted ciphertext; receiving the first encrypted ciphertext and the signature certificate of the other controller sent by the other controller, decrypting the first encrypted ciphertext using the private key of this controller to obtain the first random number, and verifying the signature certificate of the other controller using the root public key of the server, and after successful verification, using the public key of the other controller to verify the signature certificate of the other controller. The public key is used to decrypt the second random number, resulting in a second encrypted ciphertext. The first plaintext and the second encrypted ciphertext are then sent to the other controller. The other controller verifies that the first plaintext is the second random number, decrypts the second encrypted ciphertext using its private key to obtain the second random number, and encrypts the first and second random numbers into an encryption key using the preset algorithm. The encryption key is then used to encrypt the authentication key, resulting in an encrypted authentication key. The other controller receives the encrypted authentication key, encrypts the first and second random numbers into an encryption key using the preset algorithm, and decrypts the encrypted authentication key using the encryption key to obtain the authentication key.
[0008] Based on the above technical means, this application embodiment uses the signature certificate and preset algorithm issued by the server to perform two-way authentication between this controller and other controllers to determine whether the controller is legitimate, thereby preventing illegal devices from being used on legitimate vehicles. Therefore, it can eliminate the security risks of illegal components being used on legitimate vehicles.
[0009] Optionally, the authentication key is used to encrypt a third random number to obtain a third encrypted ciphertext, which is then sent to the other controller. The other controller uses the authentication key to decrypt the third encrypted ciphertext to obtain the third random number, and then uses the authentication key to encrypt a fourth random number to obtain a fourth encrypted ciphertext. The other controller receives the second plaintext and the fourth encrypted ciphertext sent by the other controller. After verifying that the second plaintext is the third random number, it uses the authentication key to decrypt the fourth encrypted ciphertext to obtain the fourth random number, and then sends the third plaintext to the other controller. If the other controller authenticates that the third plaintext is the fourth random number, then authentication is complete.
[0010] Based on the above technical means, this application embodiment uses the authentication key generated after the first authentication to perform bidirectional authentication between this controller and other controllers to determine whether the controller is legitimate, thereby preventing illegal devices from being used on legitimate vehicles. Therefore, it can eliminate the security risks of illegal components being used on legitimate vehicles.
[0011] Optionally, before identifying whether the controller is being authenticated for the first time, the method further includes: generating a public-private key pair and storing the private key in a preset trusted environment; creating a certificate signing request file from the controller's public key, the vehicle's identity identifier, and the controller whitelist, and sending the certificate signing request file to the server, wherein the server uses the key to sign the certificate signing request file to obtain a signing certificate, and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legitimate database; receiving the signing certificate issued by the server and completing the initialization of the controller.
[0012] Based on the aforementioned technical means, this embodiment of the application completes the controller initialization by generating a public-private key pair, creating a certificate signing file, obtaining a signing certificate, and generating a preset legitimate database. After the controller initialization is completed, based on the determination of the controller's legitimacy, it further determines whether the controller is compatible with the vehicle. Therefore, it can prevent legitimate components from being used in incompatible vehicles, further eliminating potential vehicle security risks.
[0013] A second aspect of this application provides an anti-counterfeiting device for a controller, the device being applied to a vehicle, wherein the device includes: an identification module for identifying whether the controller is undergoing its first authentication; an authentication module for performing bidirectional authentication between the controller and other controllers based on a signature certificate issued by a server and a preset algorithm if the controller is undergoing its first authentication, otherwise performing bidirectional authentication between the controller and other controllers based on an authentication key generated after the controller's first authentication, and determining that the controller is illegitimate and prohibiting the controller from operating if the bidirectional authentication fails; and a determination module for determining that the controller is legitimate if the bidirectional authentication passes, and reading a whitelist from the signature certificate, determining that the controller's anti-counterfeiting authentication has passed if the whitelist is in the vehicle's preset whitelist database, otherwise determining that the controller is incompatible with the vehicle and prohibiting the controller from operating.
[0014] Optionally, the signature certificate of this controller is sent to other controllers of the vehicle. The other controller verifies the signature certificate using the root public key of the server, and upon successful verification, encrypts a first random number using the public key of this controller to obtain a first encrypted ciphertext. The system receives the first encrypted ciphertext and the signature certificate of the other controller, decrypts the first encrypted ciphertext using its private key to obtain the first random number, and verifies the signature certificate of the other controller using the root public key of the server. Upon successful verification, it decrypts the certificate using the public key of the other controller to obtain a second random number, thus obtaining a second encrypted ciphertext. The system sends a first plaintext and a second encrypted ciphertext to the other controller. The other controller verifies that the first plaintext is the second random number, then decrypts the second encrypted ciphertext using its private key to obtain the second random number. It then encrypts the first random number and the second random number into an encryption key using the preset algorithm, and uses the encryption key to encrypt an authentication key, obtaining the encrypted authentication key. The system also receives the encrypted authentication key from the other controller, encrypts the first random number and the second random number into an encryption key using the preset algorithm, and decrypts the encrypted authentication key using the encryption key to obtain the authentication key.
[0015] Optionally, the authentication module is configured to: encrypt a third random number using the authentication key to obtain a third encrypted ciphertext, and send the third encrypted ciphertext to the other controller, wherein the other controller decrypts the third encrypted ciphertext using the authentication key to obtain the third random number, and encrypts a fourth random number using the authentication key to obtain a fourth encrypted ciphertext; receive a second plaintext and the fourth encrypted ciphertext sent by the other controller, verify that the second plaintext is the third random number, decrypt the fourth encrypted ciphertext using the authentication key to obtain the fourth random number, and send the third plaintext to the other controller, wherein if the other controller authenticates that the third plaintext is the fourth random number, then the authentication is complete.
[0016] Optionally, it further includes: an initialization module, used to generate a public-private key pair before identifying whether the controller is being authenticated for the first time, and store the private key in a preset trusted environment; to create a certificate signing request file from the controller's public key, the vehicle's identity identifier, and the controller whitelist, and send the certificate signing request file to the server, wherein the server uses a key to sign the certificate signing request file to obtain a signing certificate, and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legal database; and to receive the signing certificate issued by the server to complete the initialization of the controller.
[0017] A third aspect of this application provides a vehicle, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the anti-counterfeiting method for the controller as described in the above embodiments.
[0018] A fourth aspect of this application provides an anti-counterfeiting system for controllers, comprising: a vehicle, the vehicle including multiple controllers, wherein any controller generates a public-private key pair and stores the private key in a preset trusted environment; a certificate signing request file is created by combining the controller's public key, the vehicle's identity identifier, and a controller whitelist, and the certificate signing request file is sent to a server; the server is used to sign the certificate signing request file using a key to obtain a signing certificate, and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legitimate database, and issues the signing certificate to the controller; wherein, during the first authentication of the controller, the controller performs bidirectional authentication with other controllers based on the signing certificate issued by the server and a preset algorithm; during subsequent authentication processes, the controller performs bidirectional authentication with other controllers based on the authentication key generated after the first authentication; if the bidirectional authentication fails, the controller is deemed illegitimate and its operation is prohibited; if the bidirectional authentication passes, the controller is deemed legitimate, and the whitelist in the signing certificate is read; if the whitelist is in the vehicle's preset whitelist database, the controller's anti-counterfeiting authentication is deemed successful; otherwise, the controller is deemed incompatible with the vehicle and its operation is prohibited.
[0019] Therefore, this application has at least the following beneficial effects:
[0020] (1) This application embodiment achieves reasonable control over key components through two-way authentication. It ensures that illegal parts cannot be used in legitimate vehicles, and guarantees that legitimate parts cannot be used in incompatible vehicles, thus completely solving the problem of illegal parts replacement.
[0021] (2) In this embodiment of the application, the signature certificate and preset algorithm issued by the server are used to perform two-way authentication between the controller and other controllers to determine whether the controller is legitimate, thereby preventing illegal devices from being used on legitimate vehicles. Therefore, the security risks of illegal components being used on legitimate vehicles can be eliminated.
[0022] (3) In this embodiment of the application, the authentication key generated after the first authentication is used to perform two-way authentication between the controller and other controllers to determine whether the controller is legitimate, thereby preventing the use of illegal devices on legitimate vehicles and thus eliminating the safety hazards of illegal components being used on legitimate vehicles.
[0023] (4) In this embodiment, the controller initialization is completed by generating a public-private key pair, creating a certificate signing file, obtaining a signing certificate, and generating a preset legitimate database. After the controller initialization is completed, based on the determination of the controller's legitimacy, it is further determined whether the controller is compatible with the vehicle. Therefore, it can prevent legitimate components from being used in incompatible vehicles, further eliminating potential vehicle security risks.
[0024] This solves the technical problems of using illegal parts in legitimate vehicles and using legitimate parts in incompatible vehicles.
[0025] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0026] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0027] Figure 1 This is a flowchart of an anti-counterfeiting method for a controller according to an embodiment of this application;
[0028] Figure 2 This is a diagram illustrating the overall architecture of the anti-counterfeiting system for the controller provided in the embodiments of this application.
[0029] Figure 3 This is an example diagram of an anti-counterfeiting device for a controller provided according to an embodiment of this application;
[0030] Figure 4 This is a structural schematic diagram of a vehicle provided according to an embodiment of this application. Detailed Implementation
[0031] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0032] The following description, with reference to the accompanying drawings, describes an anti-counterfeiting method, apparatus, vehicle, and system for a controller according to embodiments of this application. Addressing the issues mentioned in the background art, such as the need for backend server authentication leading to low authentication efficiency and the inability to resolve the problems of legitimate vehicles using illegal components and legitimate components being used in incompatible vehicles, this application provides an anti-counterfeiting method for a controller. This method achieves reasonable control over key components through two-way authentication, ensuring that illegal components cannot be used in legitimate vehicles while also preventing legitimate components from being used in incompatible vehicles. Thus, it solves the problems of legitimate vehicles using illegal components and legitimate components being used in incompatible vehicles.
[0033] Specifically, Figure 1 This is a flowchart illustrating an anti-counterfeiting method for a controller provided in an embodiment of this application.
[0034] The method is applied to vehicles, such as Figure 1 As shown, the anti-counterfeiting method for this controller includes the following steps:
[0035] In step S101, it is determined whether the controller is being authenticated for the first time.
[0036] It is understandable that the first authentication can be interpreted as whether the controller has completed authentication after initialization. If authentication has not been completed, the controller is considered to be performing its first authentication; otherwise, the controller is considered to have completed one or more authentications.
[0037] In this embodiment of the application, before identifying whether the controller is being authenticated for the first time, the method further includes: generating a public-private key pair and storing the private key in a preset trusted environment; creating a certificate signing request file from the controller's public key, the vehicle's identity identifier, and the controller's whitelist, and sending the certificate signing request file to the server, wherein the server uses the key to sign the certificate signing request file to obtain a signing certificate, and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legitimate database; receiving the signing certificate issued by the server and completing the controller initialization.
[0038] In this context, a public-private key pair refers to a key pair obtained through an encryption algorithm (i.e., a public key and a private key, also known as asymmetric encryption). The public key can encrypt sessions and verify digital signatures; only the corresponding private key can decrypt session data, thus ensuring the security of data transmission. The public key is the publicly disclosed part of the key, while the private key is the non-public part, kept secure by the user. A pre-defined trusted environment refers to a secure area that can be pre-built within the central processing unit using hardware and software methods, ensuring the confidentiality and integrity of the programs and data loaded within it. A legitimate database stores the binding relationships between vehicles, controllers, and signature certificates. It records the binding relationship between vehicles and legitimate controllers, ensuring that legitimate controllers can only be installed on their bound vehicles, preventing unauthorized replacement of old parts. During replacement, the device can be unbound from the vehicle through legitimate channels; the specific operation method is not restricted, but the rebound vehicle, controller, and certificate relationship must be written into the legitimate database.
[0039] It is understandable that, in this embodiment of the application, the controller should be initialized before determining whether it is the first time for authentication. First, a public-private key pair is generated to provide encryption and decryption for the subsequent authentication process. After the authentication process is completed and the controller is determined to be legitimate, it is also necessary to further determine whether the controller is matched with the vehicle. Therefore, a legitimate database needs to be pre-set and compared with the controller. If the match is successful, the authentication is successful; otherwise, the controller is prohibited from working.
[0040] In step S102, if the controller is being authenticated for the first time, it performs two-way authentication with other controllers based on the signature certificate issued by the server and the preset algorithm. Otherwise, it performs two-way authentication with other controllers based on the authentication key generated after the first authentication. If the two-way authentication fails, the controller is deemed illegal and its operation is prohibited.
[0041] Two-way authentication can be understood as the controller needing to authenticate each other with other controllers, resulting in higher communication security.
[0042] Understandably, after each controller is initialized, it enters the authentication process after the vehicle starts. To reduce the latency caused by authentication, the authentication process is divided into two cases based on whether it is the first authentication, and bidirectional authentication is performed between this controller and other controllers, which can effectively improve the authentication speed.
[0043] In this embodiment, bidirectional authentication between the controller and other controllers is performed based on the signature certificate issued by the server and a preset algorithm. This includes: sending the controller's signature certificate to other controllers of the vehicle, wherein the other controllers verify the signature certificate using the server's root public key, and after successful verification, encrypting a first random number using the controller's public key to obtain a first encrypted ciphertext; receiving the first encrypted ciphertext and the other controller's signature certificate sent by the other controllers, decrypting the first encrypted ciphertext using the controller's private key to obtain a first random number, and verifying the other controllers' signature certificates using the server's root public key, and after successful verification... Then, the second random number is obtained by decrypting the public key of other controllers, resulting in the second encrypted ciphertext. The first plaintext and the second encrypted ciphertext are sent to other controllers. After verifying that the first plaintext is the second random number, the other controllers decrypt the second encrypted ciphertext using their private keys to obtain the second random number. They then use a preset algorithm to encrypt the first random number and the second random number into an encryption key, and use the encryption key to encrypt the authentication key, resulting in the encrypted authentication key. The system then receives the encrypted authentication key sent by other controllers, uses the preset algorithm to encrypt the first random number and the second random number into an encryption key, and uses the encryption key to decrypt the encrypted authentication key, resulting in the authentication key.
[0044] The preset algorithm can be selected according to actual needs without specific limitations.
[0045] by Figure 2 Taking ECU1 and ECU2 as examples in the system shown, after each controller is initialized, the authentication process begins after the vehicle starts. During the first authentication, the ECUs authenticate each other through the authentication unit. The specific authentication process is as follows:
[0046] (1) ECU1 sends the signature certificate to ECU2;
[0047] (2) ECU2 verifies the signature certificate using the root public key, obtains the public key of ECU1, encrypts a random number RAND1 using the public key of ECU1 and sends it back to ECU1, and at the same time sends the signature certificate of ECU2 to ECU1.
[0048] (3) ECU1 uses its private key to decrypt the random number encrypted by ECU2's public key to obtain RAND1. At the same time, it uses the root public key to verify the signature of ECU2's signature certificate, obtains ECU2's public key, encrypts a random number RAND2 with ECU2's public key, and then feeds back the ciphertext RAND2 and the plaintext RAND1 to ECU2.
[0049] (4) ECU2 compares RAND1 to see if it is correct, and decrypts the ciphertext RAND2 to obtain the plaintext RAND2. ECU2 (which can be any ECU) randomly generates the authentication key of the temporary authentication unit, and uses a specific algorithm to generate an encryption key for RAND1+RAND2 to encrypt the authentication key and sends it to ECU1. ECU1 uses the same conventional algorithm as RAND1+RAND2 to generate an encryption key to decrypt the authentication key and stores the authentication key in the trusted area.
[0050] In this embodiment of the application, the controller performs bidirectional authentication with other controllers based on the authentication key generated after the first authentication. This includes: encrypting a third random number using the authentication key to obtain a third encrypted ciphertext, and sending the third encrypted ciphertext to other controllers. The other controllers decrypt the third encrypted ciphertext using the authentication key to obtain a third random number, and encrypt a fourth random number using the authentication key to obtain a fourth encrypted ciphertext. The controllers also receive a second plaintext and a fourth encrypted ciphertext sent by other controllers. After verifying that the second plaintext is the third random number, they decrypt the fourth encrypted ciphertext using the authentication key to obtain a fourth random number, and send the third plaintext to other controllers. If the other controllers authenticate the third plaintext as the fourth random number, the authentication is complete.
[0051] Understandably, after the initial authentication, in order to facilitate authentication, this application embodiment generates an authentication key. For a period of time, such as a week or a month, each ECU uses this authentication key to authenticate with each other, thereby improving the convenience of authentication.
[0052] by Figure 2 Taking ECU1 and ECU2 as examples in the system shown, the temporary authentication unit consists of an authentication key. After the first authentication, an authentication key is generated. For a period of time, each ECU uses this authentication key to authenticate with each other. The authentication process is not specifically limited, including but not limited to challenge and response. That is, ECU1 generates random number 1, encrypts it with the authentication key, and sends it to ECU2. ECU2 decrypts it with the authentication key to obtain random number 1. At the same time, it generates random number 2, encrypts it with the authentication key, and sends both random numbers to ECU1. ECU1 decrypts random number 2 with the authentication key and verifies whether random number 1 is correct. Then, it sends random number 2 to ECU2. ECU2 compares whether random number 2 is correct, and thus completes the authentication.
[0053] In step S103, if the two-way authentication is successful, the controller is deemed legitimate, and the whitelist in the signature certificate is read. If the whitelist is in the vehicle's preset whitelist library, the controller's anti-counterfeiting authentication is deemed successful; otherwise, the controller is deemed incompatible with the vehicle, and the controller is prohibited from working.
[0054] The whitelist can be simply understood as a list of trusted data; data on this list can be accessed, while data outside the whitelist cannot.
[0055] Understandably, the vehicle's whitelist database stores all ECU whitelist information for the vehicle. During the initial authentication process and each subsequent temporary authentication unit authentication process, each ECU will retrieve its whitelist from the certificate verified by the other party and compare it with the vehicle's whitelist database to confirm whether it is a legitimate ECU of the vehicle. If it is not a legitimate ECU of the vehicle, the authentication will still fail.
[0056] The anti-counterfeiting method for controllers proposed in this application achieves reasonable control over key components through two-way authentication. This ensures that illegal components cannot be used in legitimate vehicles, and also prevents legitimate components from being used in incompatible vehicles, thus completely resolving the issue of illegal component replacement. The method utilizes a server-issued signature certificate and a preset algorithm to perform two-way authentication between the controller and other controllers, determining the controller's legitimacy and preventing the use of illegal devices in legitimate vehicles. This eliminates the security risks associated with the use of illegal components in legitimate vehicles. Furthermore, the method uses the authentication key generated after the initial authentication to perform two-way authentication between the controller and other controllers, again determining the controller's legitimacy and preventing the use of illegal devices in legitimate vehicles. This eliminates the security risks associated with the use of illegal components in legitimate vehicles. The controller initialization is completed by generating a public-private key pair, creating a certificate signing file, obtaining the signature certificate, and generating a preset legitimate database. After controller initialization, based on the determination of the controller's legitimacy, the method further determines whether the controller is compatible with the vehicle. Therefore, it prevents legitimate components from being used in incompatible vehicles, further eliminating potential vehicle security risks.
[0057] The following will be based on Figure 2 Taking the vehicle key controller anti-counterfeiting system shown as an example, the vehicle key controller anti-counterfeiting system consists of a cloud signature system, authentication units of each controller on the vehicle, temporary authentication units, and a whitelist database.
[0058] The signature system generates a root public key and a root private key during initialization. The root private key is stored in a trusted environment within the cryptographic machine and cannot be exported. It is used to provide digital signatures for each ECU and serves as the trusted root of the entire authentication system. The root public key is sent to each controller developer offline or online, pre-installed in the controller, and stored in a tamper-proof medium, such as EFUSE, for verifying the legitimacy of digital certificates issued by the signature system. The signature algorithm for the root private key can be any algorithm with sufficient security, such as RSA2048, 3072, 4096, ECC256, 512, etc., without specific restrictions, all of which are within the scope of protection of this invention. The signature system also includes a legitimate database for storing the binding relationships between vehicles, controllers, and signature certificates. This database records the binding relationships between vehicles and legitimate controllers, ensuring that legitimate controllers can only be installed on their bound vehicles, avoiding illegal replacement of old parts. When replacing parts, the device and vehicle can be unbound through legitimate channels. The specific operation method is not restricted, but the rebound vehicle, controller, and certificate relationship must be written into the legitimate database.
[0059] During device initialization, the authentication unit generates a public-private key pair. After the private key is generated, it is stored in a trusted environment, such as hardware storage space like HSM or SE, or software storage space like TEE or white-box, without specific restrictions. The private key is stored and processed within the trusted environment, ensuring its confidentiality. The authentication units of each controller in the vehicle combine the generated public key, VIN, and ECU whitelist to create a certificate signing request file, which is transmitted to the signing system wirelessly or via wired connection. The signing system signs the signing request file with its private key, binds the VIN, controller number, and signing certificate in the signing request file, writes the binding relationship into the legitimate database, and simultaneously sends the signing certificate back to the corresponding controller storage on the vehicle.
[0060] The vehicle whitelist database is stored in each controller on the vehicle side. After each controller's authentication unit completes initialization, it sends its own ECU whitelist and the signature certificate of the signature system to other controllers through channels such as bus and Ethernet. Each controller verifies the signature certificate using the root public key of the signature system. After successful verification, it retrieves the ECU whitelist from the signature certificate and compares it with the transmitted ECU whitelist. If they are the same, it writes the received ECU whitelist into the vehicle whitelist database. This process continues until all ECU whitelists are verified and stored in the vehicle whitelist database, at which point the vehicle whitelist database initialization is complete.
[0061] After each controller is initialized, the authentication process begins upon vehicle startup. The authentication process will be described in detail below. Here, ECU refers to the vehicle's electronic control unit, also known as the vehicle's onboard computer. In C language, `rand` generates random numbers from 0 to m-1. In the following steps, `RAND1` and `RAND2` can be understood as the first random number 1 and the second random number 2. To reduce authentication latency, the authentication process is divided into two cases:
[0062] First scenario:
[0063] During the initial authentication, ECUs authenticate each other through an authentication unit. The specific authentication process is as follows: ECU1 sends its signature certificate to ECU2. ECU2 verifies the signature certificate using its root public key, obtains ECU1's public key, and uses ECU1's public key to encrypt a random number RAND1, which is then sent back to ECU1. Simultaneously, ECU2 sends its signature certificate to ECU1. ECU1 decrypts the random number encrypted with ECU2's public key using its private key to obtain RAND1. ECU1 also verifies ECU2's signature certificate using its root public key, obtains ECU2's public key, and uses ECU2's public key... A random number RAND2 is encrypted, and then the ciphertext RAND2 and the plaintext RAND1 are fed back to ECU2. ECU2 compares RAND1 to see if it is correct, and decrypts the ciphertext RAND2 to obtain the plaintext RAND2. ECU2 (which can be any ECU) randomly generates an authentication key for a temporary authentication unit, and uses a specific algorithm to generate an encryption key from RAND1+RAND2 to encrypt the authentication key before sending it to ECU1. ECU1 uses the same agreed-upon algorithm as RAND1+RAND2 to generate an encryption key to decrypt the authentication key, and stores the authentication key in a trusted area.
[0064] The second scenario:
[0065] After the initial authentication, an authentication key is generated. For a period of time (the specific time is not limited and can be any time such as a week or a month), each ECU uses this authentication key to authenticate with each other. The authentication process is not specifically limited and includes, but is not limited to, challenge and response. That is, ECU1 generates random number 1, encrypts it with the authentication key, and sends it to ECU2. ECU2 decrypts it with the authentication key to obtain random number 1, and at the same time generates random number 2, encrypts it with the authentication key, and sends both random numbers to ECU1. ECU1 decrypts random number 2 with the authentication key and verifies whether random number 1 is correct. Then, it sends random number 2 to ECU2. ECU2 compares random number 2 to see if it is correct, and thus completes the authentication.
[0066] Furthermore, the vehicle's whitelist database stores all ECU whitelist information for the vehicle. During the initial authentication process and during each temporary authentication unit authentication process, each ECU will retrieve its whitelist from the certificate verified by the other party and compare it with the vehicle's whitelist database to confirm whether it is a legitimate ECU of the vehicle. If it is not a legitimate ECU of the vehicle, the authentication will still fail.
[0067] In summary, the embodiments of this application can achieve reasonable control over key components, ensuring that illegal components cannot be used in legitimate vehicles, and that legitimate components cannot be used in incompatible vehicles, thus completely solving the problem of illegal component replacement.
[0068] Next, with reference to the accompanying drawings, an anti-counterfeiting device for a controller according to an embodiment of this application is described.
[0069] Figure 3 This is a block diagram of the anti-counterfeiting device of the controller according to an embodiment of this application.
[0070] like Figure 3 As shown, the anti-counterfeiting device 10 of the controller includes: an identification module 100, an authentication module 200, and a judgment module 300.
[0071] The identification module 100 is used to identify whether the controller is being authenticated for the first time; the authentication module 200 is used to perform bidirectional authentication between the controller and other controllers based on the signature certificate issued by the server and the preset algorithm if the controller is being authenticated for the first time; otherwise, it performs bidirectional authentication between the controller and other controllers based on the authentication key generated after the controller's first authentication. If the bidirectional authentication fails, the controller is deemed illegitimate and its operation is prohibited; the judgment module 300 is used to determine the controller is legitimate if the bidirectional authentication passes, and read the whitelist in the signature certificate. If the whitelist is in the vehicle's preset whitelist database, the controller's anti-counterfeiting authentication is deemed successful; otherwise, the controller is deemed incompatible with the vehicle and its operation is prohibited.
[0072] Optionally, it also includes: an initialization module, used to generate a public-private key pair before identifying whether the controller is being authenticated for the first time, and store the private key in a preset trusted environment; to create a certificate signing request file from the controller's public key, the vehicle's identity identifier, and the controller whitelist, and send the certificate signing request file to the server, wherein the server uses the key to sign the certificate signing request file to obtain a signing certificate, and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legitimate database; and to receive the signing certificate issued by the server to complete the controller initialization.
[0073] It should be noted that the foregoing explanation of the anti-counterfeiting method embodiment for the controller also applies to the anti-counterfeiting device for the controller in this embodiment, and will not be repeated here.
[0074] The anti-counterfeiting device for the controller proposed in this application achieves reasonable control over key components through two-way authentication. It ensures that illegal components cannot be used in legitimate vehicles, and that legitimate components cannot be used in incompatible vehicles, thus completely solving the problem of illegal component replacement. It uses a signature certificate issued by the server and a preset algorithm to perform two-way authentication between the controller and other controllers, determining the controller's legitimacy and preventing the use of illegal devices in legitimate vehicles, thereby eliminating the security risks associated with the use of illegal components in legitimate vehicles. It also uses the authentication key generated after the first authentication to perform two-way authentication between the controller and other controllers, determining the controller's legitimacy and preventing the use of illegal devices in legitimate vehicles, thus eliminating the security risks associated with the use of illegal components in legitimate vehicles. The controller initialization is completed by generating a public-private key pair, creating a certificate signature file, obtaining the signature certificate, and generating a preset legitimate database. After controller initialization, based on the determination of the controller's legitimacy, it further determines whether the controller is compatible with the vehicle. Therefore, it can prevent legitimate components from being used in incompatible vehicles, further eliminating vehicle security risks.
[0075] Figure 4 A schematic diagram of the structure of a vehicle provided in an embodiment of this application. The vehicle may include:
[0076] The memory 401, the processor 402, and the computer program stored on the memory 401 and capable of running on the processor 402.
[0077] When the processor 402 executes the program, it implements the anti-counterfeiting method for the controller provided in the above embodiments.
[0078] Furthermore, the vehicle also includes:
[0079] Communication interface 403 is used for communication between memory 401 and processor 402.
[0080] The memory 401 is used to store computer programs that can run on the processor 402.
[0081] The memory 401 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0082] If the memory 401, processor 402, and communication interface 403 are implemented independently, then the communication interface 403, memory 401, and processor 402 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0083] Optionally, in a specific implementation, if the memory 401, processor 402, and communication interface 403 are integrated on a single chip, then the memory 401, processor 402, and communication interface 403 can communicate with each other through an internal interface.
[0084] Processor 402 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of this application.
[0085] This application also provides an anti-counterfeiting system for a controller, including a vehicle and a server.
[0086] The vehicle includes multiple controllers. Each controller generates a public-private key pair and stores the private key in a preset trusted environment. The controller's public key, the vehicle's identity identifier, and the controller's whitelist are combined into a certificate signing request file, which is then sent to a server. The server uses the key to sign the certificate signing request file, obtains a signing certificate, writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legal database, and issues the signing certificate to the controller.
[0087] Specifically, during the first authentication, the controller performs two-way authentication with other controllers based on the signature certificate issued by the server and a preset algorithm. In subsequent authentication processes, the controller performs two-way authentication with other controllers based on the authentication key generated after the first authentication. If the two-way authentication fails, the controller is deemed illegitimate and its operation is prohibited. If the two-way authentication succeeds, the controller is deemed legitimate, and the whitelist in the signature certificate is read. If the whitelist is in the vehicle's preset whitelist database, the controller's anti-counterfeiting authentication is deemed successful; otherwise, the controller is deemed incompatible with the vehicle and its operation is prohibited.
[0088] It should be noted that the foregoing explanation of the anti-counterfeiting method embodiment for the controller also applies to the anti-counterfeiting system for the controller in this embodiment, and will not be repeated here.
[0089] The anti-counterfeiting system for controllers proposed in this application achieves reasonable control over key components through two-way authentication. This ensures that illegal components cannot be used in legitimate vehicles, and also prevents legitimate components from being used in incompatible vehicles, completely resolving the issue of illegal component replacement. The system uses a signature certificate issued by the server and a preset algorithm to perform two-way authentication between the controller and other controllers, determining the controller's legitimacy and preventing the use of illegal devices in legitimate vehicles. This eliminates the security risks associated with the use of illegal components in legitimate vehicles. The system also uses the authentication key generated after the initial authentication to perform two-way authentication between the controller and other controllers, again determining the controller's legitimacy and preventing the use of illegal devices in legitimate vehicles. This eliminates the security risks associated with the use of illegal components in legitimate vehicles. The controller initialization is completed by generating a public-private key pair, creating a certificate signature file, obtaining the signature certificate, and generating a preset legitimate database. After controller initialization, based on the determination of the controller's legitimacy, the system further determines whether the controller is compatible with the vehicle. Therefore, it prevents legitimate components from being used in incompatible vehicles, further eliminating potential vehicle security risks.
[0090] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0091] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0092] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0093] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0094] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0095] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for preventing counterfeiting of a controller, characterized in that, The method is applied to a vehicle, and the method includes the following steps: Identify whether the controller is being authenticated for the first time; If the controller is being authenticated for the first time, it will perform two-way authentication with other controllers based on the signature certificate issued by the server and the preset algorithm. Otherwise, it will perform two-way authentication with other controllers based on the authentication key generated after the first authentication. If the two-way authentication fails, the controller will be deemed illegal and its operation will be prohibited. If the two-way authentication is successful, the controller is deemed legitimate, and the whitelist in the signature certificate is read. If the whitelist is in the vehicle's preset whitelist library, the controller's anti-counterfeiting authentication is deemed successful; otherwise, the controller is deemed incompatible with the vehicle, and the controller is prohibited from working. The step of performing two-way authentication between this controller and other controllers based on the signature certificate issued by the server and the preset algorithm includes: Send the signature certificate of this controller to other controllers of this vehicle, wherein the other controllers use the root public key of the server to verify the signature certificate, and after the verification is successful, use the public key of this controller to encrypt a first random number to obtain a first encrypted ciphertext; The system receives a first encrypted ciphertext and a signature certificate from another controller. It decrypts the first encrypted ciphertext using its private key to obtain a first random number. It then verifies the signature certificate of the other controller using the root public key of the server. After successful verification, it encrypts a second random number using the public key of the other controller to obtain a second encrypted ciphertext. Send the first plaintext and the second encrypted ciphertext to the other controller, wherein, after verifying that the first plaintext is the first random number, the other controller decrypts the second encrypted ciphertext using the private key of the other controller to obtain the second random number, and encrypts the first random number and the second random number into an encryption key using the preset algorithm, and encrypts the authentication key using the encryption key to obtain the encrypted authentication key; The system receives the encrypted authentication key sent by the other controller, encrypts the first random number and the second random number into an encryption key using the preset algorithm, and decrypts the encrypted authentication key using the encryption key to obtain the authentication key.
2. The method according to claim 1, characterized in that, The step of performing two-way authentication between this controller and other controllers based on the authentication key generated after the first authentication includes: The authentication key is used to encrypt a third random number to obtain a third encrypted ciphertext, which is then sent to the other controllers. The other controllers use the authentication key to decrypt the third encrypted ciphertext to obtain the third random number, and use the authentication key to encrypt a fourth random number to obtain a fourth encrypted ciphertext. The system receives the second plaintext and the fourth encrypted ciphertext sent by the other controllers. After verifying that the second plaintext is the third random number, it decrypts the fourth encrypted ciphertext using the authentication key to obtain the fourth random number and sends the third plaintext to the other controllers. If the other controllers authenticate that the third plaintext is the fourth random number, the authentication is completed.
3. The method according to claim 1, characterized in that, Before identifying whether the controller is authenticating for the first time, the following steps are also included: Generate a public-private key pair and store the private key in a pre-defined trusted environment; The controller's public key, the vehicle's identity identifier, and the controller's whitelist are compiled into a certificate signing request file, which is then sent to the server. The server signs the certificate signing request file to obtain a signing certificate and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legal database. The controller receives the signature certificate issued by the server and completes its initialization.
4. An anti-counterfeiting device for a controller, characterized in that, The device is applied to a vehicle, wherein the device includes: The identification module is used to identify whether the controller is being authenticated for the first time. The authentication module is used to perform two-way authentication between the controller and other controllers based on the signature certificate issued by the server and the preset algorithm if the controller is authenticating for the first time; otherwise, it performs two-way authentication between the controller and other controllers based on the authentication key generated after the controller's first authentication. If the two-way authentication fails, the controller is determined to be illegal and is prohibited from working. The determination module is used to determine that the controller is legitimate if the two-way authentication is successful, and to read the whitelist in the signature certificate. If the whitelist is in the vehicle's preset whitelist library, the controller is determined to have passed the anti-counterfeiting authentication. Otherwise, the controller is determined to be incompatible with the vehicle and the controller is prohibited from working. The authentication module is used for: Send the signature certificate of this controller to other controllers of this vehicle, wherein the other controllers use the root public key of the server to verify the signature certificate, and after the verification is successful, use the public key of this controller to encrypt a first random number to obtain a first encrypted ciphertext; The system receives a first encrypted ciphertext and a signature certificate from another controller. It decrypts the first encrypted ciphertext using its private key to obtain a first random number. It then verifies the signature certificate of the other controller using the root public key of the server. After successful verification, it encrypts a second random number using the public key of the other controller to obtain a second encrypted ciphertext. Send the first plaintext and the second encrypted ciphertext to the other controller, wherein, after verifying that the first plaintext is the first random number, the other controller decrypts the second encrypted ciphertext using the private key of the other controller to obtain the second random number, and encrypts the first random number and the second random number into an encryption key using the preset algorithm, and encrypts the authentication key using the encryption key to obtain the encrypted authentication key; The system receives the encrypted authentication key sent by the other controller, encrypts the first random number and the second random number into an encryption key using the preset algorithm, and decrypts the encrypted authentication key using the encryption key to obtain the authentication key.
5. The apparatus according to claim 4, characterized in that, The authentication module is used for: The authentication key is used to encrypt a third random number to obtain a third encrypted ciphertext, which is then sent to the other controllers. The other controllers use the authentication key to decrypt the third encrypted ciphertext to obtain the third random number, and use the authentication key to encrypt a fourth random number to obtain a fourth encrypted ciphertext. The system receives the second plaintext and the fourth encrypted ciphertext sent by the other controllers. After verifying that the second plaintext is the third random number, it decrypts the fourth encrypted ciphertext using the authentication key to obtain the fourth random number and sends the third plaintext to the other controllers. If the other controllers authenticate that the third plaintext is the fourth random number, the authentication is completed.
6. The apparatus according to claim 4, characterized in that, Also includes: The initialization module is used to generate a public-private key pair before identifying whether the controller is being authenticated for the first time, and to store the private key in a preset trusted environment; The controller's public key, the vehicle's identity identifier, and the controller's whitelist are compiled into a certificate signing request file, which is then sent to the server. The server signs the certificate signing request file to obtain a signing certificate and writes the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legal database. The controller receives the signature certificate issued by the server and completes its initialization.
7. A vehicle, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the anti-counterfeiting method for the controller as described in any one of claims 1-3.
8. An anti-counterfeiting system for a controller, characterized in that, include: The vehicle includes multiple controllers, wherein any controller generates a public-private key pair and stores the private key in a preset trusted environment; the controller's public key, the vehicle's identity identifier, and the controller whitelist are used to create a certificate signing request file, and the certificate signing request file is sent to the server; The server is used to sign the certificate signing request file to obtain a signing certificate, write the binding relationship between the controller, the identity identifier, and the signing certificate into a preset legal database, and then issue the signing certificate to the controller; wherein, During the initial authentication of the controller, it performs two-way authentication with other controllers based on the signature certificate issued by the server and a preset algorithm. In subsequent authentication processes, it performs two-way authentication with other controllers based on the authentication key generated after the initial authentication. If the two-way authentication fails, the controller is deemed illegitimate and its operation is prohibited. If the two-way authentication succeeds, the controller is deemed legitimate, and the whitelist in the signature certificate is read. If the whitelist is in the vehicle's preset whitelist database, the controller's anti-counterfeiting authentication is deemed successful; otherwise, the controller is deemed incompatible with the vehicle and its operation is prohibited. The step of performing two-way authentication between this controller and other controllers based on the signature certificate issued by the server and the preset algorithm includes: Send the signature certificate of this controller to other controllers of this vehicle, wherein the other controllers use the root public key of the server to verify the signature certificate, and after the verification is successful, use the public key of this controller to encrypt a first random number to obtain a first encrypted ciphertext; The system receives a first encrypted ciphertext and a signature certificate from another controller. It decrypts the first encrypted ciphertext using its private key to obtain a first random number. It then verifies the signature certificate of the other controller using the root public key of the server. After successful verification, it encrypts a second random number using the public key of the other controller to obtain a second encrypted ciphertext. Send the first plaintext and the second encrypted ciphertext to the other controller, wherein, after verifying that the first plaintext is the first random number, the other controller decrypts the second encrypted ciphertext using the private key of the other controller to obtain the second random number, and encrypts the first random number and the second random number into an encryption key using the preset algorithm, and encrypts the authentication key using the encryption key to obtain the encrypted authentication key; The system receives the encrypted authentication key sent by the other controller, encrypts the first random number and the second random number into an encryption key using the preset algorithm, and decrypts the encrypted authentication key using the encryption key to obtain the authentication key.
Citation Information
Patent Citations
Trusted platform protection in an autonomous vehicle
US20200213287A1