CN115915131A - Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card - Google Patents

Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card Download PDF

Info

Publication number
CN115915131A
CN115915131A CN202211291413.0A CN202211291413A CN115915131A CN 115915131 A CN115915131 A CN 115915131A CN 202211291413 A CN202211291413 A CN 202211291413A CN 115915131 A CN115915131 A CN 115915131A
Authority
CN
China
Prior art keywords
ciphertext
key
vehicle
nfc card
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211291413.0A
Other languages
Chinese (zh)
Other versions
CN115915131B (en
Inventor
彭雪城
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yuanfeng Technology Co Ltd
Original Assignee
Yuanfeng Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yuanfeng Technology Co Ltd filed Critical Yuanfeng Technology Co Ltd
Priority to CN202211291413.0A priority Critical patent/CN115915131B/en
Publication of CN115915131A publication Critical patent/CN115915131A/en
Application granted granted Critical
Publication of CN115915131B publication Critical patent/CN115915131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a vehicle key bidirectional encryption authentication method, a vehicle key bidirectional encryption authentication system, a vehicle binding device and an NFC card, wherein in the vehicle key bidirectional encryption authentication method, the vehicle binding device and the NFC card are subjected to bidirectional encryption authentication based on a random number and a secret key, a key ciphertext is transmitted to the NFC card after the vehicle binding device and the NFC card can decrypt each other, and after the NFC card successfully decrypts the key ciphertext, the vehicle binding device stores a first identifier of the NFC card to an identifier database.

Description

Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card
Technical Field
The invention relates to the technical field of automobiles, in particular to a vehicle key bidirectional encryption authentication method and system, a vehicle binding device and an NFC card.
Background
At present, automobiles become an indispensable part in people's life, and along with rapid development of science and technology and continuous promotion of consumption demand, manufacturers gradually begin to adopt NFC cards to unlock vehicle binding devices, in order to realize that NFC cards unlock vehicle binding devices, it is necessary to perform binding authentication between NFC cards and vehicle binding devices, in the prior art, the binding authentication between NFC cards and vehicle binding devices generally is to bind key data of vehicle binding devices in NFC cards, when the NFC cards are used for card swiping transactions of vehicle binding devices, NFC sends stored key data to vehicle binding devices, the vehicle binding devices execute unlocking, locking, starting, closing and the like after verifying whether the key data are correct, in order to ensure the security during binding authentication, the vehicle binding devices can send ciphertext generated by encrypting the key data to NFC cards, and the NFC cards decrypt the ciphertext to obtain the key data to be stored. The current binding authentication only binds key data of the vehicle binding device on the NFC card, and only encrypts the key data, so that the NFC card is easy to crack by external attack and difficult to ensure safety and reliability.
Disclosure of Invention
The invention aims to provide a vehicle key bidirectional encryption authentication method, a vehicle key bidirectional encryption authentication system, a vehicle binding device and an NFC card, which can effectively improve the safety and reliability of vehicle key binding.
In order to achieve the above object, the present invention provides a vehicle key bidirectional encryption authentication method for binding a vehicle binding device with an NFC card, the bidirectional encryption authentication method being performed by the vehicle binding device, the bidirectional encryption authentication method including:
sending a first request to the NFC card, the first request comprising a first random number;
receiving a first response sent by the NFC card based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
encrypting the second random number to generate a first ciphertext and sending the first ciphertext to the NFC card;
receiving a second ciphertext sent by the NFC card, wherein the second ciphertext is generated by encrypting the first random number when the first ciphertext is decrypted by the NFC card and is compared with the second random number;
decrypting the second ciphertext and comparing the second ciphertext with the first random number;
if the comparison is consistent, a key ciphertext is generated according to first data and sent to the NFC card, the first data comprise key data, and the key data are generated based on the first identification and key parameters preset in the vehicle binding device;
and receiving a state signal sent by the NFC card and determining whether to store the first identifier in an identifier database according to the state signal, wherein the state signal indicates that the NFC card successfully or unsuccessfully receives the first data.
Optionally, the encrypting the second random number to generate a first ciphertext and sending the first ciphertext to the NFC card includes:
generating a first key based on the first identification;
encrypting the second random number with the first key to generate the first ciphertext.
Optionally, the second ciphertext is generated by encrypting the first random number by the NFC card according to a second key, and the second key is generated according to a key parameter preset in the NFC card.
Optionally, the bidirectional encryption authentication method further includes:
generating a check code according to the first data;
and the check code and the key ciphertext are sent to the NFC card together.
Optionally, the first data further comprises a vehicle identification number; or
The first data further comprises a vehicle identification number and a binding card number.
Optionally, before the sending the first request to the NFC card, the bidirectional encryption authentication method further includes:
receiving an instruction sent by an upper computer and entering a binding mode according to the instruction;
after receiving the status signal sent by the NFC card, the method further includes:
and generating a binding result signal according to the state signal and sending the binding result signal to the upper computer, wherein the binding result signal comprises a binding success signal and a binding failure signal.
Optionally, the first request further includes a second identifier, and the second identifier is an identifier of the vehicle-end security chip.
In order to achieve the above object, the present invention further provides a vehicle key bidirectional encryption authentication method for binding a vehicle binding device with an NFC card, the bidirectional encryption authentication method being performed by the NFC card, the bidirectional encryption authentication method including:
receiving a first request sent by the vehicle binding device, wherein the first request comprises a first random number;
sending a first response to the vehicle binding device based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
receiving a first ciphertext, the first ciphertext generated by the vehicle binding apparatus encrypting the second nonce;
decrypting the first ciphertext and comparing the first ciphertext with the second random number;
if the comparison is consistent, encrypting the first random number to generate a second ciphertext and sending the second ciphertext to the vehicle binding device;
receiving a key ciphertext sent by the vehicle binding device, wherein the key ciphertext is generated according to first data when the second ciphertext decrypted by the vehicle binding device is consistent with the first random number through comparison, the first data comprise key data, and the key data are generated based on the first identifier and key parameters preset in the vehicle binding device;
decrypting the key ciphertext and verifying the decrypted data;
and generating a state signal according to a verification result and sending the state signal to the vehicle binding device, wherein the state signal indicates that the NFC card successfully or unsuccessfully receives the first data.
Optionally, the first ciphertext is generated by encrypting, by the vehicle binding apparatus, the second nonce according to a first key generated based on the first identifier.
Optionally, the second ciphertext is generated by encrypting the first random number by the NFC card according to a second key, and the second key is generated according to a key parameter preset in the NFC card.
Optionally, the key ciphertext is generated by encrypting, by the vehicle binding apparatus, first data that includes the key data obtained according to the first identifier.
Optionally, the vehicle binding device receives a key ciphertext generated by the vehicle binding device and a check code, and the check code is generated according to the first data;
the decrypting the key ciphertext and verifying the decrypted data includes:
decrypting the key ciphertext to obtain decrypted data;
calculating a verification code according to the decrypted data, and comparing the verification code with the check code;
and if the comparison is consistent, the decrypted key data is stored, and a state signal indicating that the first data is successfully received is generated.
In order to achieve the above object, the present invention further provides a vehicle binding device, including a main module, a vehicle-end security chip and an NFC slave module, where the main module is in communication connection with the vehicle-end security chip and the NFC slave module respectively, and the NFC slave module is used for establishing communication connection with an NFC card;
the master module sends a first request to the NFC card through the NFC slave module, wherein the first request comprises a first random number generated by the vehicle-end security chip;
the master module receives a first response sent by the NFC card based on the first request through the NFC slave module, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
the vehicle-end security chip encrypts the second random number to generate a first ciphertext, and the master module sends the first ciphertext to the NFC card through the NFC slave module;
the master module receives a second ciphertext sent by the NFC card through the NFC slave module, and the second ciphertext is generated by encrypting the first random number when the first ciphertext is decrypted by the NFC card and is compared with the second random number to be consistent;
the vehicle-end security chip decrypts the second ciphertext and compares the second ciphertext with the first random number;
if the comparison is consistent, the vehicle-end security chip generates a key ciphertext according to the first data The master module sends the key ciphertext to the NFC card through the NFC slave module, the first data comprise key data, and the key data are generated based on the first identification and key parameters preset in the vehicle binding device;
the master module receives a state signal sent by the NFC card through the NFC slave module and determines whether to store the first identifier in an identifier database according to the state signal, wherein the state signal represents that the NFC card successfully or unsuccessfully receives the first data.
Optionally, the vehicle binding device further includes an upper computer, the upper computer is in communication connection with the main module, before the main module sends a first request to the NFC card through the NFC slave module, the upper computer sends an instruction to the main module, and the main module enters a binding mode according to the instruction;
after the master module receives the state signal sent by the NFC card through the NFC slave module, the master module generates a binding result signal according to the state signal and sends the binding result signal to the upper computer, wherein the binding result signal comprises a binding success signal and a binding failure signal.
In order to achieve the above object, the present invention further provides an NFC card, including a transceiver module and a card end security chip, where the transceiver module is used for communication connection with a vehicle binding device;
the transceiver module receives a first request sent by the vehicle binding device, wherein the first request comprises a first random number;
the transceiver module sends a first response to the vehicle binding device based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
the transceiver module receives a first ciphertext, and the first ciphertext is generated by the vehicle binding device encrypting the second random number;
the card end security chip decrypts the first ciphertext and compares the first ciphertext with the second random number;
if the comparison is consistent, the card end security chip encrypts the first random number to generate a second ciphertext, and the transceiver module sends the second ciphertext to the vehicle binding device;
the receiving and sending module receives a key ciphertext sent by the vehicle binding device, the key ciphertext is generated according to first data when the second ciphertext decrypted by the vehicle binding device is consistent with the first random number in a comparison manner, the first data comprises key data, and the key data is generated based on the first identifier and key parameters preset in the vehicle binding device;
the card end security chip decrypts the key ciphertext and verifies the decrypted data;
the card end safety chip generates a state signal according to a verification result, the transceiver module sends the state signal to the vehicle binding device, and the state signal indicates that the NFC card successfully or unsuccessfully receives the first data.
In order to achieve the above object, the present invention further provides a vehicle key bidirectional encryption authentication system, which includes the vehicle binding device as described above and the NFC card as described above, wherein the NFC slave module establishes a communication connection with the transceiver module.
In order to achieve the above object, the present invention also provides an electronic device comprising:
one or more processors;
a memory;
and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the programs comprising instructions for performing the bidirectional cryptographic authentication method as previously described.
To achieve the above object, the present invention also provides a computer-readable storage medium including a computer program executable by a processor to implement the bidirectional cryptographic authentication method as described above.
The invention also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the electronic device to perform the bidirectional cryptographic authentication method as described above.
According to the vehicle key bidirectional encryption authentication method, the vehicle binding device and the NFC card are subjected to bidirectional encryption authentication based on the random number and the secret key, the vehicle binding device and the NFC card can be guaranteed to decrypt mutually and then send the key ciphertext to the NFC card, after the NFC card successfully decrypts the key ciphertext, the vehicle binding device stores the first identifier of the NFC card to the identifier database, and due to the fact that the vehicle binding device and the NFC card before binding are subjected to bidirectional encryption authentication and the encrypted ciphertext is sent between the vehicle binding device and the NFC card in the authentication and binding processes, the safety of communication between the vehicle binding device and the NFC card can be improved, external attack can be prevented, and therefore the safety and reliability of vehicle key binding are improved.
Drawings
Fig. 1 is a flowchart of a bidirectional encryption authentication method for a vehicle key according to an embodiment of the invention.
Fig. 2 is a flowchart of a bidirectional encryption authentication method for a vehicle key according to another embodiment of the invention.
Fig. 3 is a flowchart of a bidirectional encryption authentication method for a vehicle key according to another embodiment of the invention.
Fig. 4 is a block diagram of a vehicle binding apparatus according to an embodiment of the present invention.
Fig. 5 is a schematic block diagram of an NFC card according to an embodiment of the present invention.
Fig. 6 is a block diagram of a bidirectional encryption authentication system for a vehicle key according to an embodiment of the invention.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to explain technical contents, structural features, and effects of the present invention in detail, the following detailed description is given with reference to the embodiments and the accompanying drawings.
Referring to fig. 1 and fig. 3, an embodiment of the present invention discloses a bidirectional encryption authentication method 100 for a vehicle key, which is used to bind a vehicle binding device with an NFC card, where the bidirectional encryption authentication method 100 is executed by the vehicle binding device, and the bidirectional encryption authentication method 100 includes the following steps:
110. a first request is sent to the NFC card, the first request including a first nonce.
The first request can also include a second identifier (ReaderID), the second identifier is an identification code of the vehicle-end security chip, and the first request can be understood as a binding request sent by the vehicle binding device to the NFC card. The safety level of signal transmission can be improved by arranging the vehicle-end safety chip on the vehicle binding device.
120. And receiving a first response sent by the NFC card based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card.
The NFC Card is triggered through the first request to obtain the first identifier and the second random number rnd2, and a first response comprising the first identifier (Card id) and the second random number rnd2 is returned to the vehicle binding device. The NFC card may further be provided with a security chip, and at this time, the first reply may include a third identifier (CardSEID), where the third identifier is an identification code of the security chip of the NFC card. The safety level of signal transmission can be improved by arranging the safety chip in the NFC card.
130. And encrypting the second random number to generate a first ciphertext and sending the first ciphertext to the NFC card.
And after receiving the first response, the vehicle binding device analyzes the first response and encrypts the analyzed second random number rnd2 to generate a first ciphertext. Before encrypting the second random number rnd2, the vehicle binding device generates a first key based on the first identifier in the first response, and encrypts the second random number rnd2 by using the first key to generate a first ciphertext. Specifically, the vehicle binding device generates a key parameter cpak according to the first identifier and a preset parameter cpmk, generates a first key sessionkey1 according to the key parameter, and encrypts the second random number with the first key sessionkey1 to obtain a first ciphertext. The vehicle binding device may generate the key parameter cpak by using the KDFX963 algorithm, and encrypt the second random number rnd2 by using the first key and the key uses.
140. And receiving a second ciphertext sent by the NFC card, and encrypting the first random number to generate the second ciphertext when the second ciphertext is decrypted by the NFC card and is consistent with the second random number ratio.
The NFC card decrypts the first ciphertext, the decrypted second random number is compared with the generated second random number rnd2, and when the comparison is consistent, the decryption algorithm of the NFC card and the encryption algorithm of the vehicle binding device are symmetrical, namely the vehicle binding device passes the authentication of the NFC card. The second ciphertext is generated by encrypting the first random number rnd1 by the NFC card according to the second key, which is generated according to the key parameter preset in the NFC card. Specifically, when receiving the first request, the NFC card is triggered to calculate a second key sessionkey2 according to a preset key parameter cpak, and when a first ciphertext decrypted by the NFC card is consistent with a second random number rnd2 generated by the first ciphertext, the NFC card encrypts the first random number rnd1 with the second key sessionkey 2. The NFC card may decrypt the first ciphertext through a key utils encryption algorithm, and encrypt the first random number rnd1 through a second key and the key utils encryption algorithm to generate a second ciphertext.
150. And decrypting the second ciphertext and comparing the second ciphertext with the first random number.
160. And if the comparison is consistent, generating a key ciphertext according to the first data and sending the key ciphertext to the NFC card, wherein the first data comprise key data, and the key data are generated based on the first identification and key parameters preset in the vehicle binding device.
The vehicle binding device decrypts the received second ciphertext, compares the decrypted first random number with the generated first random number rnd1, and when the comparison is consistent, shows that the decryption algorithm of the vehicle binding device and the encryption algorithm of the NFC card are symmetrical, that is, the NFC card passes the authentication of the vehicle binding device. It can be understood that the encryption algorithm and the decryption algorithm of the vehicle binding device and the NFC card may be the same or different, and when the encryption algorithm and the decryption algorithm of the vehicle binding device and the NFC card are the same, the first key and the second key are also the same; in the embodiment of the invention, as long as the encryption algorithm of the vehicle binding device is symmetrical to the decryption algorithm of the NFC card and the encryption algorithm of the NFC card is symmetrical to the decryption algorithm of the vehicle binding device, the vehicle binding device can decrypt the ciphertext emitted by the NFC card, and the NFC card can decrypt the ciphertext emitted by the vehicle binding device. The vehicle binding device may decrypt the second ciphertext using a key Utils.
And after the authentication is passed, the vehicle binding device generates a key ciphertext according to the first data and sends the key ciphertext to the NFC card.
Specifically, the vehicle binding device acquires the key data Dkey according to the received first identifier and the preset key parameter vkey, and encrypts the first data including the key data Dkey to generate a key ciphertext. Specifically, the vehicle binding device encrypts the first data with the first key session 1 to generate a key ciphertext and sends the key ciphertext to the NFC card, and the NFC card, upon receiving the key ciphertext, may decrypt the key ciphertext with an algorithm for decrypting the first ciphertext to obtain the first data including the key data.
In some other specific examples, to ensure the integrity and accuracy of signal transmission, the vehicle key bidirectional encryption authentication method 100 may further include:
generating a check code according to the first data;
and the check code and the key ciphertext are transmitted to the NFC card together.
Specifically, the check code can be obtained through calculation of the first data and the aes128 algorithm, and the NFC card verifies the check code to judge the integrity of the key ciphertext. Of course, the algorithm of the check code can also be derived according to other existing algorithms.
In addition, the first data may further include a vehicle identification number or the first data may further include a vehicle identification number and a number of binding cards, and generally, a vehicle may set a plurality of NFC cards as keys, so that a vehicle may bind a plurality of NFC cards, and thus may record the number of binding cards of the vehicle binding apparatus, where the number of binding cards is the number of NFC cards bound by the vehicle binding apparatus currently.
170. And receiving a state signal sent by the NFC card and determining whether to store the first identifier in an identifier database according to the state signal, wherein the state signal indicates that the NFC card successfully or unsuccessfully receives the first data.
Specifically, the NFC card decrypts the key ciphertext to obtain first data, the NFC card verifies the check code, when the verification passes, the key data in the first data are stored, a state signal which represents that the key data are successfully transmitted is sent to the vehicle binding device, the vehicle binding device stores a first identification which represents the identification code of the NFC card to an identification database according to the state signal, the vehicle binding device binds information of the NFC card, otherwise, when the verification does not pass, the NFC card sends a state signal which represents that the NFC card does not successfully receive the first data to the vehicle binding device, the vehicle binding device does not store the identification code of the NFC card, the binding failure is indicated, and the NFC card is bound again or replaced for binding.
As shown in fig. 3, before step 110, the vehicle key bidirectional encryption authentication method 100 may further include:
the vehicle key binding method includes the steps that an instruction sent by an upper computer is received, and a binding mode is entered according to the instruction, namely, the binding of the vehicle key can be controlled by the instruction sent by the upper computer.
Step 170 is followed by: and generating a binding result signal according to the state signal and sending the binding result signal to the upper computer, wherein the binding result signal comprises a binding success signal and a binding failure signal so as to report the binding result of the vehicle key to the upper computer, so that a worker or a user can timely know the binding result of the vehicle key.
It can be understood that the NFC card of the present invention may be an independent NFC card, or may be an NFC slave module built in a mobile electronic device, where the mobile electronic device may be an electronic device such as a mobile phone, a bracelet, and a watch.
In the vehicle key bidirectional encryption authentication method 100, the vehicle binding device and the NFC card are subjected to bidirectional encryption authentication based on the random number and the secret key, the vehicle binding device and the NFC card can be guaranteed to decrypt each other and then send the key ciphertext to the NFC card, after the NFC card successfully decrypts the key ciphertext, the vehicle binding device stores the first identifier of the NFC card to the identifier database, and because the vehicle binding device and the NFC card are subjected to bidirectional encryption authentication before binding and encrypted ciphertexts are sent between the vehicle binding device and the NFC card in the authentication and binding processes, the security of communication between the vehicle binding device and the NFC card can be improved, external attack can be prevented, and the security and reliability of vehicle key binding are improved.
The vehicle binding device is a device which is arranged on a vehicle and used for binding the vehicle and the NFC card.
As shown in fig. 2 and fig. 3, another embodiment of the present invention further provides a vehicle key bidirectional encryption authentication method 200 for binding a vehicle binding device with an NFC card, where the bidirectional encryption authentication method 200 is executed by the NFC card, and includes the following steps:
210. a first request from a vehicle binding device is received, the first request including a first random number.
The first request can also comprise a second identifier, the second identifier is an identification code of the vehicle-end security chip, and the first request can be understood as a binding request sent by the vehicle binding device to the NFC card. The safety level of signal transmission can be improved by arranging the vehicle-end safety chip on the vehicle binding device.
220. And sending a first response to the vehicle binding device based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card.
The NFC card responds to the first request, acquires the first identifier and the second random number rnd2 according to the first request, and sends a first response comprising the first identifier and the second random number to the vehicle binding device. The NFC card may further be provided with a security chip, and at this time, the first reply may include a third identifier, which is an identification code of the security chip of the NFC card. The security chip is arranged in the NFC card, so that the security level of signal transmission can be further improved.
230. And receiving a first ciphertext, wherein the first ciphertext is generated by encrypting the second random number by the vehicle binding device.
And after receiving the first response, the vehicle binding device analyzes the first response and encrypts the analyzed second random number rnd2 to generate a first ciphertext. Before encrypting the second random number rnd2, the vehicle binding device generates a first key based on the first identifier in the first response, and encrypts the second random number rnd2 by using the first key to generate a first ciphertext. Specifically, the vehicle binding device generates a key parameter cpak according to the first identifier and a preset parameter cpmk, generates a first key sessionkey1 according to the key parameter, and encrypts the second random number with the first key sessionkey1 to obtain a first ciphertext.
240. And decrypting the first ciphertext and comparing the first ciphertext with the second random number.
250. And if the comparison is consistent, encrypting the first random number to generate a second ciphertext and sending the second ciphertext to the vehicle binding device.
The NFC card decrypts the first ciphertext, the second random number obtained by decryption from the first ciphertext is compared with the second random number rnd2 generated before, when the comparison is consistent, the decryption algorithm of the NFC card is symmetrical to the encryption algorithm of the vehicle binding device, namely, the vehicle binding device passes the authentication of the NFC card, and then the vehicle binding device can authenticate the NFC card.
In step 250, the second ciphertext may be generated by encrypting, by the NFC card, the first random number rnd1 according to a second key, where the second key is generated according to a key parameter preset in the NFC card. Specifically, when the NFC card receives the first request, the NFC card is triggered to calculate a second key session 2 according to a preset key parameter cpak, and when a first ciphertext decrypted by the NFC card is consistent with a second random number rnd2 generated by the NFC card, the NFC card encrypts the first random number rnd1 with the second key session 2.
260. And receiving a key ciphertext sent by the vehicle binding device, and generating the key ciphertext according to first data when a second ciphertext decrypted by the vehicle binding device is consistent with the first random number ratio pair, wherein the first data comprises key data, and the key data is generated based on a first identifier and key parameters preset in the vehicle binding device.
It should be noted that the vehicle binding device decrypts the received second ciphertext, compares the first random number rnd1 obtained by decrypting the second ciphertext with the first random number rnd1 generated before the first random number rnd1, and when the comparison is consistent, indicates that the decryption algorithm of the vehicle binding device and the encryption algorithm of the NFC card are symmetrical, that is, the NFC card passes the authentication of the vehicle binding device, and before that, the vehicle binding device also passes the authentication of the NFC card. It can be understood that the encryption algorithm and the decryption algorithm of the vehicle binding device and the NFC card may be the same or different, and when the encryption algorithm and the decryption algorithm of the vehicle binding device and the NFC card are the same, the first key and the second key are also the same; in the embodiment of the invention, as long as the encryption algorithm of the vehicle binding device is symmetrical to the decryption algorithm of the NFC card and the encryption algorithm of the NFC card is symmetrical to the decryption algorithm of the vehicle binding device, the vehicle binding device can decrypt the ciphertext emitted by the NFC card, and the NFC card can decrypt the ciphertext emitted by the vehicle binding device.
And after the authentication is passed, the vehicle binding device generates a key ciphertext according to the first data and sends the key ciphertext to the NFC card, wherein the first data comprises key data generated according to the first identifier and key parameters preset in the vehicle binding device.
The first data may further include a vehicle identification number or the first data may further include a vehicle identification number and a number of bindings.
Specifically, the vehicle binding device encrypts the first data with the first key session key1 to generate a key ciphertext and sends the key ciphertext to the NFC card, and the NFC card, upon receiving the key ciphertext, may decrypt the key ciphertext with an algorithm for decrypting the first ciphertext to obtain the first data including the key data.
270. And decrypting the key ciphertext and verifying the decrypted data.
Through verifying the decrypted data, the integrity and accuracy of key ciphertext transmission between the NFC card and the vehicle binding device can be guaranteed.
280. And generating a status signal according to the verification result and sending the status signal to the vehicle binding device, wherein the status signal indicates that the NFC card successfully or unsuccessfully receives the first data.
It can be understood that when the status signal identifies that the first data is successfully received, the key data in the decrypted first data is stored in the NFC card for use in future authentication of the NFC card and the vehicle.
In other specific examples, the key cryptogram sent by the vehicle binding device is received at step 260, and the check code is also received, and is generated according to the first data.
Decrypting the key ciphertext and verifying the decrypted data in step 270 includes:
271. and decrypting the key ciphertext to obtain decrypted data.
272. And calculating the verification code according to the decrypted data, and comparing the verification code with the check code.
273. And if the comparison is consistent, the decrypted key data is stored, and a state signal indicating that the first data is successfully received is generated.
It can be understood that the algorithm for calculating the verification code from the decrypted data in the NFC card is the same as the algorithm for calculating the check code from the first data in the vehicle binding device.
For example, the NFC card may calculate a verification code according to the decrypted first data and the aes128 algorithm, and the verification code is consistent with the check code by comparison, which indicates that the decrypted first data is correct and integrity of the transmitted key ciphertext can be ensured.
In the vehicle key bidirectional encryption authentication method 200 according to another embodiment of the present invention, bidirectional encryption authentication is performed on the vehicle binding device and the NFC card based on the random number and the secret key, so that the vehicle binding device and the NFC card can decrypt each other and then transmit the key ciphertext to the NFC card, the NFC card decrypts the key ciphertext and verifies the decrypted data, generates a status signal according to the verification result, and transmits the status signal to the vehicle binding device.
Referring to fig. 3 and fig. 4, an embodiment of the present invention further provides a vehicle binding device 310, including a main module 311, a vehicle-end security chip 312, and an NFC slave module 313, where the main module 311 is in communication connection with the vehicle-end security chip 312 and the NFC slave module 313 respectively, and the NFC slave module 313 is used for establishing communication connection with an NFC card;
the master module 311 sends a first request to the NFC card through the NFC slave module 313, where the first request includes a first random number generated by the vehicle-end security chip 312;
the master module 311 receives a first response sent by the NFC card based on the first request through the NFC slave module 313, where the first response includes a first identifier and a second random number, and the first identifier is an identifier of the NFC card;
the vehicle-end security chip 312 encrypts the second random number to generate a first ciphertext, and the master module 311 sends the first ciphertext to the NFC card through the NFC slave module 313;
the master module 311 receives a second ciphertext sent by the NFC card through the NFC slave module 313, and the second ciphertext is generated by encrypting the first random number when the first ciphertext is decrypted by the NFC card and is consistent with the second random number ratio pair;
the vehicle-end security chip 312 decrypts the second ciphertext and compares the second ciphertext with the first random number;
if the comparison is consistent, the vehicle-end security chip 312 generates a key ciphertext according to the first data The master module 311 sends the key ciphertext to the NFC card through the NFC slave module 313, where the first data includes key data, and the key data is generated based on the first identifier and a key parameter preset in the vehicle binding device;
the master module 311 receives a status signal sent by the NFC card through the NFC slave module 313, and determines whether to store the first identifier in the identifier database according to the status signal, where the status signal indicates that the NFC card successfully or unsuccessfully receives the first data.
Further, the vehicle binding device 310 further includes an upper computer (as shown in fig. 3), the upper computer is in communication connection with the main module 311, before the main module 311 sends the first request to the NFC card through the NFC slave module 313, the upper computer sends an instruction to the main module 311, and the main module 311 enters the binding mode according to the instruction. It can be understood that the vehicle binding apparatus may be configured with a plurality of different NFC card forms as a key, for example, the different NFC card forms may be simultaneously satisfied with a mobile phone or an NFC card form, in this case, after the main module 311 enters the binding mode according to the instruction sent by the upper computer, the main module 311 may send a card binding instruction to the NFC slave module 313, and the NFC slave module 313 polls and selects a corresponding application according to an application identifier of the card binding instruction, so as to enable communication connection with an NFC card in the corresponding form.
Further, after the master module 311 receives the status signal sent by the NFC card through the NFC slave module 312, the master module 311 generates a binding result signal according to the status signal and sends the binding result signal to the upper computer. The binding result signal comprises a binding success signal and a binding failure signal, and the upper computer can display the binding result according to the binding result signal so as to be checked by a worker.
As shown in fig. 5, an embodiment of the present invention further provides an NFC card 320, which includes a transceiver module 321 and a card-end security chip 322, where the transceiver module 321 is used for communicating with a vehicle binding device;
the transceiver module 321 receives a first request from the vehicle binding device 310, where the first request includes a first random number;
the transceiver module 321 transmits a first response to the vehicle binding device 310 based on the first request, where the first response includes a first identifier and a second random number, and the first identifier is an identifier of the NFC card;
the transceiver module 321 receives the first ciphertext, and the vehicle binding apparatus 310 encrypts and generates the second random number;
the card end security chip 322 decrypts the first ciphertext and compares the first ciphertext with the second random number;
if the comparison is consistent, the card-end security chip 322 encrypts the first random number to generate a second ciphertext, and the transceiver module 321 sends the second ciphertext to the vehicle binding device 310;
the transceiver module 321 receives a key ciphertext sent by the vehicle binding device 310, and when a second ciphertext decrypted by the vehicle binding device 310 is consistent with the first random number ratio pair, the key ciphertext is generated according to first data, where the first data includes key data, and the key data is generated based on a first identifier and a key parameter preset in the vehicle binding device 310;
the card end security chip 322 decrypts the key ciphertext and verifies the decrypted data;
the card-end security chip 322 generates a status signal according to the verification result, and the transceiver module 321 sends the status signal to the vehicle binding apparatus 310, where the status signal indicates that the NFC card successfully or unsuccessfully receives the first data. The card end security chip 322 is used for encryption, decryption and data analysis, so that the security level of signal transmission of the NFC card can be effectively improved.
As shown in fig. 3 and fig. 6, an embodiment of the present invention further provides a vehicle key bidirectional encryption authentication system, which includes the vehicle binding apparatus 310 and the NFC card 320, where the NFC slave module 313 establishes a communication connection with the transceiver module 321. It is understood that the NFC card 320 needs to enter the sensing area of the NFC slave 313 of the vehicle binding 310 to establish a communication connection with the NFC slave 313.
As shown in fig. 7, an electronic device is also disclosed in embodiments of the invention, comprising one or more processors 400, memory 410, and one or more programs, wherein the one or more programs are stored in the memory 410 and configured to be executed by the one or more processors 400, the programs including instructions for performing the bidirectional cryptographic authentication method 100 or the bidirectional cryptographic authentication method 200 as described above.
The embodiment of the present invention also discloses a computer-readable storage medium, which includes a computer program, and the computer program can be executed by a processor to implement the bidirectional encryption authentication method 100 or the bidirectional encryption authentication method 200 as described above.
The embodiment of the application also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the bidirectional cryptographic authentication method 100 or the bidirectional cryptographic authentication method 200 as described above.
It should be understood that in the embodiments of the present invention, the processor may be a Central Processing Unit (CPU), and the processor may also be other general processors, digital signal processors (DP), application specific Integrated circuits (AIC), field Programmable Gate Arrays (FPGA) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware associated with computer program instructions, and the computer program may be stored in a computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only a preferred embodiment of the present invention, which is convenient for those skilled in the art to understand and implement, and certainly not to limit the scope of the present invention, which is not intended to be covered by the present invention.

Claims (17)

1. A vehicle key bidirectional encryption authentication method for binding a vehicle binding device with an NFC card, the bidirectional encryption authentication method being performed by the vehicle binding device, the bidirectional encryption authentication method comprising:
sending a first request to the NFC card, the first request comprising a first random number;
receiving a first response sent by the NFC card based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
encrypting the second random number to generate a first ciphertext and sending the first ciphertext to the NFC card;
receiving a second ciphertext sent by the NFC card, wherein the second ciphertext is generated by encrypting the first random number when the first ciphertext is decrypted by the NFC card and is compared with the second random number;
decrypting the second ciphertext and comparing the second ciphertext with the first random number;
if the comparison is consistent, generating a key ciphertext according to first data and sending the key ciphertext to the NFC card, wherein the first data comprise key data, and the key data are generated based on the first identification and key parameters preset in the vehicle binding device;
and receiving a state signal sent by the NFC card and determining whether to store the first identifier in an identifier database according to the state signal, wherein the state signal represents that the NFC card successfully or unsuccessfully receives the first data.
2. The vehicle key bidirectional encryption authentication method according to claim 1, wherein the encrypting the second random number to generate a first ciphertext and sending the first ciphertext to the NFC card comprises:
generating a first key based on the first identification;
encrypting the second random number with the first key to generate the first ciphertext.
3. The vehicle key bidirectional encryption authentication method according to claim 2, wherein the second ciphertext is generated by encrypting the first random number by the NFC card according to a second key, and the second key is generated according to a key parameter preset in the NFC card.
4. The vehicle key bidirectional encryption authentication method according to claim 1, further comprising:
generating a check code according to the first data;
and the check code and the key ciphertext are sent to the NFC card together.
5. The vehicle key bidirectional encryption authentication method according to any one of claims 1 to 4,
the first data further comprises a vehicle identification number; or
The first data further comprises a vehicle identification number and a binding number.
6. The vehicle key bidirectional encryption authentication method according to claim 1, further comprising, before the sending of the first request to the NFC card:
receiving an instruction sent by an upper computer and entering a binding mode according to the instruction;
after receiving the status signal sent by the NFC card, the method further includes:
and generating a binding result signal according to the state signal and sending the binding result signal to the upper computer, wherein the binding result signal comprises a binding success signal and a binding failure signal.
7. The vehicle key bidirectional encryption authentication method according to claim 1, wherein the first request further comprises a second identifier, and the second identifier is an identification code of a vehicle-end security chip.
8. A vehicle key bidirectional encryption authentication method is used for binding a vehicle binding device with an NFC card, and is executed by the NFC card, and the bidirectional encryption authentication method comprises the following steps:
receiving a first request sent by the vehicle binding device, wherein the first request comprises a first random number;
sending a first response to the vehicle binding device based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
receiving a first ciphertext generated by the vehicle binding apparatus encrypting the second nonce;
decrypting the first ciphertext and comparing the decrypted first ciphertext with the second random number;
if the comparison is consistent, encrypting the first random number to generate a second ciphertext and sending the second ciphertext to the vehicle binding device;
receiving a key ciphertext sent by the vehicle binding device, wherein the key ciphertext is generated according to first data when the second ciphertext decrypted by the vehicle binding device is compared with the first random number to be consistent, the first data comprises key data, and the key data is generated based on the first identifier and key parameters preset in the vehicle binding device;
decrypting the key ciphertext and verifying the decrypted data;
and generating a state signal according to the verification result and sending the state signal to the vehicle binding device, wherein the state signal indicates that the NFC card successfully or unsuccessfully receives the first data.
9. The vehicle key bidirectional encryption authentication method according to claim 8, wherein the first ciphertext is generated by the vehicle binding apparatus by encrypting the second nonce according to a first key generated based on the first identifier.
10. The vehicle key bidirectional encryption authentication method according to claim 9, wherein the second ciphertext is generated by encrypting the first random number by the NFC card according to a second key, and the second key is generated according to a key parameter preset in the NFC card.
11. The vehicle key bidirectional encryption authentication method according to claim 8,
the vehicle binding device receives a key ciphertext sent by the vehicle binding device and also receives a check code, and the check code is generated according to the first data;
the decrypting the key ciphertext and verifying the decrypted data includes:
decrypting the key ciphertext to obtain decrypted data;
calculating a verification code according to the decrypted data, and comparing the verification code with the check code;
and if the comparison is consistent, the decrypted key data is stored, and a state signal indicating that the first data is successfully received is generated.
12. The vehicle binding device is characterized by comprising a main module, a vehicle-end safety chip and an NFC slave module, wherein the main module is respectively in communication connection with the vehicle-end safety chip and the NFC slave module, and the NFC slave module is used for establishing communication connection with an NFC card;
the master module sends a first request to the NFC card through the NFC slave module, wherein the first request comprises a first random number generated by the vehicle-end security chip;
the master module receives a first response sent by the NFC card based on the first request through the NFC slave module, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
the vehicle-end security chip encrypts the second random number to generate a first ciphertext, and the master module sends the first ciphertext to the NFC card through the NFC slave module;
the master module receives a second ciphertext sent by the NFC card through the NFC slave module, and the second ciphertext is generated by encrypting the first random number when the first ciphertext is decrypted by the NFC card and is compared with the second random number to be consistent;
the vehicle-end security chip decrypts the second ciphertext and compares the second ciphertext with the first random number;
if the comparison is consistent, the vehicle-end security chip generates a key ciphertext according to the first data The master module sends the key ciphertext to the NFC card through the NFC slave module, the first data comprise key data, and the key data are generated based on the first identification and key parameters preset in the vehicle binding device;
the master module receives a state signal sent by the NFC card through the NFC slave module and determines whether to store the first identifier in an identifier database according to the state signal, wherein the state signal represents that the NFC card successfully or unsuccessfully receives the first data.
13. The binding apparatus according to claim 12, further comprising an upper computer, the upper computer being in communication connection with the main module, the upper computer sending a command to the main module before the main module sends a first request to the NFC card through the NFC slave module, the main module entering a binding mode according to the command;
after the master module receives the state signal sent by the NFC card through the NFC slave module, the master module generates a binding result signal according to the state signal and sends the binding result signal to the upper computer, wherein the binding result signal comprises a binding success signal and a binding failure signal.
14. The NFC card is characterized by comprising a transceiver module and a card end security chip connected with the transceiver module, wherein the transceiver module is used for being in communication connection with a vehicle binding device;
the transceiver module receives a first request sent by the vehicle binding device, wherein the first request comprises a first random number;
the transceiver module sends a first response to the vehicle binding device based on the first request, wherein the first response comprises a first identifier and a second random number, and the first identifier is an identification code of the NFC card;
the transceiver module receives a first ciphertext, and the first ciphertext is generated by the vehicle binding device encrypting the second random number;
the card end security chip decrypts the first ciphertext and compares the first ciphertext with the second random number;
if the comparison is consistent, the card end security chip encrypts the first random number to generate a second ciphertext, and the transceiver module sends the second ciphertext to the vehicle binding device;
the receiving and sending module receives a key ciphertext sent by the vehicle binding device, the key ciphertext is generated according to first data when the second ciphertext decrypted by the vehicle binding device is consistent with the first random number in a comparison manner, the first data comprises key data, and the key data is generated based on the first identifier and key parameters preset in the vehicle binding device;
the card end security chip decrypts the key ciphertext and verifies the decrypted data;
the card end safety chip generates a state signal according to a verification result, the transceiver module sends the state signal to the vehicle binding device, and the state signal indicates that the NFC card successfully or unsuccessfully receives the first data.
15. A vehicle key bidirectional encryption authentication system comprising the vehicle binding apparatus of claim 12 or 13 and the NFC card of claim 14, wherein the NFC slave module establishes a communication connection with the transceiver module.
16. An electronic device, comprising:
one or more processors;
a memory;
and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the programs comprising instructions for performing the bidirectional cryptographic authentication method of any of claims 1-7 or any of claims 8-11.
17. A computer-readable storage medium comprising a computer program, characterized in that the computer program is executable by a processor to implement the bidirectional cryptographic authentication method of any one of claims 1 to 7 or of any one of claims 8 to 11.
CN202211291413.0A 2022-10-20 2022-10-20 Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card Active CN115915131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211291413.0A CN115915131B (en) 2022-10-20 2022-10-20 Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211291413.0A CN115915131B (en) 2022-10-20 2022-10-20 Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card

Publications (2)

Publication Number Publication Date
CN115915131A true CN115915131A (en) 2023-04-04
CN115915131B CN115915131B (en) 2023-11-10

Family

ID=86477510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211291413.0A Active CN115915131B (en) 2022-10-20 2022-10-20 Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card

Country Status (1)

Country Link
CN (1) CN115915131B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248280A (en) * 2023-05-09 2023-06-09 北京智芯微电子科技有限公司 Anti-theft method for security module without key issue, security module and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493488A (en) * 2018-11-23 2019-03-19 北京小米移动软件有限公司 Smart card authentication method, smart lock, smart card, system and device
CN110111472A (en) * 2019-05-16 2019-08-09 广州小鹏汽车科技有限公司 Vehicle key control method and device
US20200092087A1 (en) * 2018-09-14 2020-03-19 Qualcomm Incorporated Apparatus and methods for authentication using message exchange
CN111554008A (en) * 2020-04-22 2020-08-18 支付宝(杭州)信息技术有限公司 Digital key binding method, digital key verification method, mobile electronic equipment and near field communication device
CN111815813A (en) * 2020-06-22 2020-10-23 北京智辉空间科技有限责任公司 Electronic lock safety system
CN114419765A (en) * 2022-01-18 2022-04-29 上汽通用五菱汽车股份有限公司 Method and device for realizing vehicle safety control by NFC card and readable storage medium
CN114466357A (en) * 2022-02-28 2022-05-10 重庆长安汽车股份有限公司 Vehicle-mounted NFC card key binding system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200092087A1 (en) * 2018-09-14 2020-03-19 Qualcomm Incorporated Apparatus and methods for authentication using message exchange
CN109493488A (en) * 2018-11-23 2019-03-19 北京小米移动软件有限公司 Smart card authentication method, smart lock, smart card, system and device
CN110111472A (en) * 2019-05-16 2019-08-09 广州小鹏汽车科技有限公司 Vehicle key control method and device
CN111554008A (en) * 2020-04-22 2020-08-18 支付宝(杭州)信息技术有限公司 Digital key binding method, digital key verification method, mobile electronic equipment and near field communication device
CN111815813A (en) * 2020-06-22 2020-10-23 北京智辉空间科技有限责任公司 Electronic lock safety system
CN114419765A (en) * 2022-01-18 2022-04-29 上汽通用五菱汽车股份有限公司 Method and device for realizing vehicle safety control by NFC card and readable storage medium
CN114466357A (en) * 2022-02-28 2022-05-10 重庆长安汽车股份有限公司 Vehicle-mounted NFC card key binding system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248280A (en) * 2023-05-09 2023-06-09 北京智芯微电子科技有限公司 Anti-theft method for security module without key issue, security module and device

Also Published As

Publication number Publication date
CN115915131B (en) 2023-11-10

Similar Documents

Publication Publication Date Title
US20210081928A1 (en) Systems and methods for linking devices to user accounts
CN108551455B (en) Configuration method and device of smart card
US10142114B2 (en) ID system and program, and ID method
CN111028397B (en) Authentication method and device, and vehicle control method and device
US8332935B2 (en) System and method for encrypted smart card pin entry
CN102215221B (en) Methods and systems for secure remote wake, boot, and login to a computer from a mobile device
CN107248075B (en) Method and device for realizing bidirectional authentication and transaction of intelligent key equipment
CN111923863B (en) Vehicle control method based on digital vehicle key
CN108141444B (en) Improved authentication method and authentication device
JP2006262184A (en) Authority possession apparatus, authority borrowing apparatus, control unit, authority delegation system, authority possession program and authority possession method
CN103401844A (en) Operation request processing method and system
CN110738776B (en) Method and system for opening Bluetooth access control, Bluetooth device and working method thereof
CN110322600B (en) Control method of electronic lock and electronic lock
CN114419765A (en) Method and device for realizing vehicle safety control by NFC card and readable storage medium
CN111083696B (en) Communication verification method and system, mobile terminal and vehicle machine side
CN115915131B (en) Vehicle key bidirectional encryption authentication method and system, vehicle binding device and NFC card
CN104835038A (en) Networking payment device and networking payment method
US7461252B2 (en) Authentication method, program for implementing the method, and storage medium storing the program
CN109451504A (en) Internet of Things mould group method for authenticating and system
CN113099457A (en) Method and system for binding vehicle and mobile terminal
CN115527292B (en) Mobile phone terminal remote vehicle unlocking method of security chip and security chip device
CN109743283B (en) Information transmission method and equipment
KR101868564B1 (en) Apparatus for authenticating user in association with user-identification-registration and local-authentication and method for using the same
WO2014187209A1 (en) Method and system for backing up information in electronic signature token
JP5985845B2 (en) Electronic key registration method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant