WO2024207754A1 - 身份认证方法、装置、车辆、电子控制单元和存储介质 - Google Patents

身份认证方法、装置、车辆、电子控制单元和存储介质 Download PDF

Info

Publication number
WO2024207754A1
WO2024207754A1 PCT/CN2023/133558 CN2023133558W WO2024207754A1 WO 2024207754 A1 WO2024207754 A1 WO 2024207754A1 CN 2023133558 W CN2023133558 W CN 2023133558W WO 2024207754 A1 WO2024207754 A1 WO 2024207754A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
ecu
sub
identity authentication
authentication
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.)
Ceased
Application number
PCT/CN2023/133558
Other languages
English (en)
French (fr)
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.)
Contemporary Amperex Technology Co Ltd
Original Assignee
Contemporary Amperex 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 Contemporary Amperex Technology Co Ltd filed Critical Contemporary Amperex Technology Co Ltd
Publication of WO2024207754A1 publication Critical patent/WO2024207754A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00—Network architectures or network communication protocols for network security
    • H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00—Network architectures or network communication protocols for network security
    • H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0869—Network architectures or network communication protocols for network security for authentication of entities for achieving mutual authentication
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00—Network architectures or network communication protocols for network security
    • H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876—Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00—Network arrangements or protocols for supporting network services or applications
    • H04L67/01—Protocols
    • H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40—Network security protocols

Definitions

  • the present application relates to the field of in-vehicle network technology, and in particular to an identity authentication method, device, vehicle, electronic control unit and storage medium.
  • In-vehicle network is the basic technology for realizing single-vehicle intelligent networking.
  • In-vehicle network refers to a standardized vehicle network based on mature technologies such as controller area network (CAN), local interconnect network (Local Interconnect Network) or Ethernet, which realizes communication between various electronic control units (Electronic Control Unit, referred to as ECU) in the vehicle.
  • CAN controller area network
  • Local Interconnect Network Local Interconnect Network
  • Ethernet which realizes communication between various electronic control units (Electronic Control Unit, referred to as ECU) in the vehicle.
  • ECU Electronic Control Unit
  • the present application provides an identity authentication method.
  • the method is applied to a first electronic control unit ECU, and the method comprises:
  • the first sub-information in the encrypted information is sent to the second electronic control unit ECU; the first sub-information is used by the second ECU to perform identity authentication on the first ECU to obtain a first authentication result.
  • the initial data obtained is encrypted based on a preset key to obtain encrypted information
  • the first sub-information in the encrypted information is sent to the second electronic control unit ECU, so that the second ECU authenticates the first ECU based on the first sub-information and obtains the first authentication result, thereby realizing the identity authentication of the first ECU by the second ECU.
  • the first ECU since the first ECU only sends part of the encrypted information to the second ECU, the information sent is reduced. The amount of data is reduced, the load rate of identity authentication is reduced, and the communication efficiency of identity authentication is improved.
  • the method further comprises:
  • a bidirectional identity authentication result of the first ECU and the second ECU is determined.
  • the second ECU by receiving the second sub-information and the first authentication result sent by the second ECU, and based on the second sub-information and the third sub-information in the encrypted information, the second ECU is authenticated to obtain the second authentication result, and based on the first authentication result and the second authentication result, the two-way authentication result of the first ECU and the second ECU is determined, thereby realizing the two-way authentication between the first ECU and the second ECU.
  • the first ECU authenticates the second ECU based on the second sub-information and the third sub-information in the encrypted information to obtain the second authentication result, that is, the second ECU only sends the second sub-information to the first ECU, thereby reducing the amount of data received by the first ECU, thereby reducing the load rate of the two-way authentication and improving the communication efficiency of the two-way authentication.
  • the first sub-information is the sub-information in the encrypted information that is located within a first preset area
  • the third sub-information is the sub-information in the encrypted information that is located within a second preset area.
  • the first sub-information is the sub-information in the encrypted information that is located within the first preset area
  • the third sub-information is the sub-information in the encrypted information that is located within the second preset area
  • the identity authentication of the second ECU is performed based on the second sub-information and the third sub-information in the encrypted information to obtain a second authentication result, including:
  • the comparison result is that the second sub-information is consistent with the third sub-information, then the second authentication result is determined to be identity authentication passed;
  • the comparison result is that the second sub-information is inconsistent with the third sub-information, it is determined that the second authentication result is that the identity authentication fails.
  • a comparison result is obtained by comparing the second sub-information with the third sub-information, and then the second authentication result is determined based on the comparison result.
  • the received second sub-information is compared with the third sub-information calculated by the first ECU. Since the comparison is between the second sub-information and the third sub-information, the amount of data required for comparison is reduced, thereby improving the comparison efficiency.
  • determining the bidirectional identity authentication result between the first ECU and the second ECU based on the first authentication result and the second authentication result includes:
  • the first authentication result is that the identity authentication is passed
  • the second authentication result is that the identity authentication is passed
  • determining that the two-way identity authentication result is that the two-way identity authentication is passed
  • the two-way identity authentication result is that the two-way identity authentication is not passed.
  • bidirectional identity authentication is achieved between the first ECU and the second ECU.
  • the method further comprises:
  • the first authentication result is that the identity authentication fails, it is determined that the identity authentication of the first ECU by the second ECU fails.
  • the first ECU can determine that the second ECU has failed the identity authentication of the first ECU, that is, if the first authentication result received by the first ECU is that the identity authentication fails, the first ECU may not send communication data to the second ECU subsequently, thereby improving the security of the communication data.
  • the method further comprises:
  • the first identity authentication request is used to trigger the second ECU to generate a first random number
  • the first random number sent by the second ECU is received, and the first random number is used as the initial data.
  • the non-fixed nature of the initial data is achieved, thereby improving the credibility of the first authentication result obtained by the second ECU authenticating the first ECU.
  • sending the first identity authentication request to the second ECU includes:
  • the first identity authentication request is sent to the second ECU at preset time intervals.
  • the method provided in the embodiment of the present application is that the first ECU sends a first identity authentication request to the second ECU at a preset time interval, so that the first random number sent by the second ECU received by the first ECU each time is different, and then the initial data obtained based on the first random number is different, so as to achieve the non-fixedness of the initial data, thereby improving the credibility of the first authentication result obtained by the second ECU for identity authentication of the first ECU, making the entire communication process more secure and able to resist replay attacks well.
  • the first identity authentication request is sent to the second ECU at a preset time interval, the number of first identity authentication requests sent by the first ECU can be reduced, and the communication load rate can be reduced.
  • the method further comprises:
  • a communication message is sent to the second ECU; the communication message includes communication data and verification information, the verification information is determined according to the encrypted information, and the verification information is used for the second ECU to verify the communication data.
  • the first ECU when the result of the two-way identity authentication is that the two-way identity authentication is passed, the first ECU sends a communication message to the second ECU, and the verification information included in the communication message is determined according to the encrypted information, thereby improving The security of the entire communication process can effectively resist replay attacks.
  • the verification information includes first verification information and/or second verification information, the first verification information is information in the first sub-information located within a third preset area, and the second verification information is information in the third sub-information located within a fourth preset area.
  • the security of the communication data is improved.
  • the method further comprises:
  • a second random number is generated in response to the second identity authentication request, and the second random number is sent to the second ECU, and the second random number is used as the initial data.
  • the first ECU can actively send a first identity authentication request to the second ECU to enable the second ECU to authenticate the first ECU, or it can passively receive a second identity authentication request sent by the second ECU to enable the first ECU to authenticate the second ECU, thereby improving the efficiency of two-way identity authentication.
  • the present application further provides an identity authentication device.
  • the device is arranged in a first ECU, and the device comprises:
  • An encryption module used for encrypting the acquired initial data based on a preset key to obtain encrypted information
  • the sending module is used to send the first sub-information in the encrypted information to the second electronic control unit ECU; the first sub-information is used by the second ECU to perform identity authentication on the first ECU to obtain a first authentication result.
  • the present application further provides a vehicle, wherein the vehicle comprises a first electronic control unit ECU and a second ECU;
  • the first ECU is used to encrypt the acquired initial data based on a preset key to obtain encrypted information
  • the first ECU is used to send the first sub-information in the encrypted information to the second ECU;
  • the second ECU is used to perform identity authentication on the first ECU based on the first sub-information to obtain a first authentication result.
  • the second ECU is further used to encrypt the acquired initial data based on the preset key to obtain authentication information, perform identity authentication on the first ECU based on the first sub-information and the fourth sub-information in the authentication information, and send the second sub-information in the authentication information to the first ECU;
  • the second sub-information is the sub-information in the authentication information that is located within the second preset area
  • the fourth sub-information is the sub-information in the authentication information that is located within the first preset area;
  • the first ECU is further used to receive the second sub-information sent by the second ECU, and perform identity authentication on the second ECU based on the third sub-information in the encrypted information and the second sub-information to obtain a second authentication result.
  • the present application further provides an electronic control unit, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the above method when executing the computer program.
  • the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
  • the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
  • FIG1 is a diagram of an application environment of an identity authentication method in one embodiment
  • FIG2 is a flow chart of an identity authentication method provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a flow chart of a two-way identity authentication method provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a flow chart of a method for obtaining a second authentication result provided in an embodiment of the present application
  • FIG5 is a flow chart of another identity authentication method provided in an embodiment of the present application.
  • FIG6 is a flow chart of a method for sending an identity authentication request provided in an embodiment of the present application.
  • FIG7 is a schematic diagram of a communication message format provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a verification information format provided in an embodiment of the present application.
  • FIG. 9 is a signaling flow chart of a two-way identity authentication method provided in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a flow chart of another method for sending an identity authentication request provided in an embodiment of the present application.
  • FIG. 11 is a structural block diagram of an identity authentication device provided in an embodiment of the present application.
  • the term "and/or" is only a description of the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this article generally indicates that the associated objects before and after are in an "or" relationship.
  • multiple refers to more than two (including two).
  • multiple groups refers to more than two groups (including two groups), and “multiple pieces” refers to more than two pieces (including two pieces).
  • In-vehicle network is the basic technology for realizing single-vehicle intelligent networking.
  • In-vehicle network refers to a standardized vehicle network established based on mature CAN, local area network or Ethernet technologies to achieve communication between various ECUs in the vehicle.
  • the first ECU in order to realize identity authentication of the ECU, encrypts the acquired initial data based on a preset key to obtain encrypted information, and sends the first sub-information in the encrypted information to the second ECU; the first sub-information is used by the second ECU to authenticate the first ECU, obtain the first authentication result, and realize the identity authentication of the first ECU by the second ECU.
  • the identity authentication method provided in the embodiment of the present application can be applied in the application environment as shown in FIG1.
  • the first ECU communicates with the second ECU through the network.
  • the first ECU encrypts the acquired initial data based on the preset key to obtain the encrypted information.
  • the first ECU sends the first sub-information in the encrypted information to the second ECU.
  • the second ECU authenticates the first ECU based on the first sub-information and obtains the first authentication result of the identity authentication of the first ECU, thereby achieving Authenticate the ECU.
  • FIG. 2 is a flow chart of an identity authentication method provided in an embodiment of the present application.
  • the method is applied to an ECU in a vehicle.
  • the method is described by taking the first ECU in FIG. 1 as an example.
  • the method includes the following steps:
  • the first ECU may use a cryptographic algorithm to encrypt the acquired initial data based on a preset key to obtain encrypted information.
  • the cryptographic algorithm may include a Data Encryption Standard (DES) encryption algorithm, an Advanced Encryption Standard (AES) encryption algorithm, a message-digest algorithm 5 (MD5) encryption algorithm, etc.
  • DES Data Encryption Standard
  • AES Advanced Encryption Standard
  • MD5 message-digest algorithm 5
  • the initial data may be preset data, and the first ECU and the second ECU may store the preset data in advance. After the vehicle is started, both parties may simultaneously encrypt the pre-stored preset data based on the preset key to obtain encrypted information.
  • the initial data may also be a random number sent by the second ECU and received by the first ECU.
  • the first ECU After the first ECU obtains the encrypted information, it can send part of the encrypted information to the second ECU, that is, send the first sub-information in the encrypted information to the second ECU, so that the second ECU can authenticate the first ECU based on the first sub-information and obtain a first authentication result.
  • the first ECU uses the highest bit of the encrypted information as the starting position and the number of bits of the first preset length as the first sub-information.
  • the first preset length can be equal to one-half of the total length of the encrypted information, or can be equal to other lengths. For example, if the length of the encrypted information is 8 bytes, the high 4 bytes can be named K1, and the low 4 bytes can be named K3.
  • the first ECU can use K1 as the first sub-information, and the first ECU only sends K1 to the second ECU.
  • the first ECU uses the lowest bit of the encrypted information as the starting position and the number of bits of the second preset length as the first sub-information.
  • the second preset length can be equal to half of the total length of the encrypted information, or can be equal to other lengths.
  • the first ECU can use K3 as the first sub-information, and the first ECU only sends K3 to the second ECU.
  • the ECUs can determine whether to send K1 or K3 through a protocol. If the protocol is that the first ECU sends K1 after receiving the encrypted information, the first ECU sends K1 to the second ECU. If the protocol is that the first ECU sends K3 after receiving the encrypted information, the first ECU sends K3 to the second ECU. For ease of introduction, this embodiment takes the example of the first ECU sending K1 to the second ECU for explanation.
  • the second ECU is also integrated with a preset key and cryptographic algorithm when it leaves the factory. After the vehicle is started, the second ECU can use the integrated cryptographic algorithm to encrypt the preset key to obtain authentication information.
  • the length of the authentication information is 8 bytes.
  • the high 4 bytes in the authentication information are named K4, and the low 4 bytes in the authentication information are named K2.
  • the second ECU authenticates the first ECU in the following process: the second ECU compares K1 with the value calculated by itself. K4 is compared. If K1 and K4 are consistent, the first authentication result is determined to be identity authentication passed; if K1 and K4 are inconsistent, the first authentication result is determined to be identity authentication failed.
  • the first authentication result obtained by the second ECU comparing K1 with K4 calculated by itself is the result of identity authentication passed, otherwise, the first authentication result obtained is the result of identity authentication failed.
  • the method provided in the embodiment of the present application encrypts the acquired initial data based on a preset key to obtain encrypted information, and sends the first sub-information in the encrypted information to the second electronic control unit ECU, so that the second ECU authenticates the first ECU based on the first sub-information, obtains the first authentication result, and thus realizes the second ECU's authentication of the first ECU.
  • the first ECU since the first ECU only sends part of the information in the encrypted information to the second ECU, the amount of data sent is reduced, the load rate of the authentication is reduced, and the communication efficiency of the authentication is improved.
  • FIG3 is a flow chart of a two-way identity authentication method provided in an embodiment of the present application. The method comprises the following steps:
  • the second sub-information is, for example, K2 in the above embodiment. If the first authentication result obtained by the second ECU is that the identity authentication is passed, that is, the second ECU determines that the first ECU is a trusted ECU, the second ECU can send K2 and the first authentication result to the first ECU. Correspondingly, the first ECU receives K2 and the first authentication result, and based on K2 and the third sub-information in the encrypted information, performs identity authentication on the second ECU to obtain the second authentication result. Among them, the third sub-information is K3.
  • the first ECU determines that the second authentication result is that the identity authentication is passed, that is, the first ECU determines that the second ECU is a trusted ECU. If K2 is consistent with K3, the first ECU determines that the second authentication result is that the identity authentication is not passed, that is, the first ECU determines that the second ECU is an untrustworthy ECU.
  • the authentication of the first ECU by the second ECU and the authentication of the second ECU by the first ECU can be performed simultaneously, that is, after the vehicle is started, the first ECU obtains the encrypted information, the second ECU obtains the authentication information, and the first ECU sends K1 to the second ECU, and the second ECU sends K2 to the first ECU.
  • the first ECU sends K1 to the second ECU, so that the second ECU can realize the identity authentication of the first ECU based on K1 and K4;
  • the second ECU sends K2 to the first ECU, so that the first ECU can realize the identity authentication of the second ECU based on K2 and K3.
  • S304 Determine a bidirectional identity authentication result between the first ECU and the second ECU based on the first authentication result and the second authentication result.
  • the result of the two-way identity authentication is that the two-way identity authentication failed
  • the bidirectional identity authentication result is determined to be that the bidirectional identity authentication fails.
  • the method provided in this embodiment receives the second sub-information and the first authentication result sent by the second ECU, and performs identity authentication on the second ECU based on the second sub-information and the third sub-information in the encrypted information to obtain the second authentication result, and determines the bidirectional identity authentication result of the first ECU and the second ECU based on the first authentication result and the second authentication result, thereby realizing the bidirectional identity authentication between the first ECU and the second ECU.
  • the second ECU since the first ECU performs identity authentication on the second ECU based on the second sub-information and the third sub-information in the encrypted information to obtain the second authentication result, that is, the second ECU only sends the second sub-information to the first ECU, thereby reducing the data volume of the information received by the first ECU, thereby reducing the load rate of the bidirectional identity authentication and improving the communication efficiency of the bidirectional identity authentication.
  • the first sub-information is sub-information in the encrypted information that is located within a first preset area
  • the third sub-information is sub-information in the encrypted information that is located within a second preset area.
  • the highest byte of the encrypted information can be used as the first sub-information, and the lowest byte of the encrypted information can be used as the third sub-information.
  • the highest byte is the first preset area range, and the lowest byte is the second preset area range.
  • the highest byte and the lowest byte of the encrypted information are used as the first sub-information, and the other sub-information in the encrypted information except the first sub-information is used as the third sub-information.
  • the first sub-information is the sub-information in the encrypted information that is located within the first preset area
  • the third sub-information is the sub-information in the encrypted information that is located within the second preset area
  • FIG4 is a flow chart of a method for obtaining a second authentication result provided in an embodiment of the present application.
  • This embodiment relates to a possible implementation method of how to authenticate the second ECU based on the second sub-information and the third sub-information in the encrypted information to obtain the second authentication result.
  • the above S303 "authenticating the second ECU based on the second sub-information and the third sub-information in the encrypted information to obtain the second authentication result" may include the following steps:
  • the second sub-information is K2 and the third sub-information is K3, then if K2 and K3 are consistent, the second authentication result is determined to be identity authentication passed. If K2 and K3 are inconsistent, the second authentication result is determined to be identity authentication failed.
  • the second sub-information is consistent with the third sub-information, which may mean that the second sub-information is identical to the third sub-information, or the similarity between the second sub-information and the third sub-information is greater than or equal to a preset threshold, for example, the preset threshold is 99.8%, and the similarity between the second sub-information and the third sub-information is equal to 99.9%, then the second sub-information is considered to be consistent with the third sub-information.
  • a preset threshold is 99.8%
  • the similarity between the second sub-information and the third sub-information is equal to 99.9%
  • a comparison result is obtained by comparing the second sub-information with the third sub-information, and then the second authentication result is determined based on the comparison result.
  • the received second sub-information is compared with the third sub-information calculated by the first ECU. Since the comparison is between the second sub-information and the third sub-information, the amount of data required for comparison is reduced, thereby improving the comparison efficiency.
  • the above S302, determining the bidirectional identity authentication result of the first ECU and the second ECU based on the first authentication result and the second authentication result can be implemented as follows:
  • the first authentication result is that the identity authentication is passed
  • the second authentication result is that the identity authentication is passed
  • determining that the two-way identity authentication result is that the two-way identity authentication is passed
  • the result of the two-way identity authentication is determined to be that the two-way identity authentication is not passed.
  • bidirectional identity authentication is achieved between the first ECU and the second ECU.
  • FIG5 is a flowchart of another identity authentication method provided by an embodiment of the present application. This embodiment relates to a flowchart of how a first ECU determines whether a second ECU has passed the identity authentication of the first ECU. Based on the above embodiment, the method includes the following steps:
  • the first ECU can determine that the second ECU has failed the identity authentication of the first ECU, that is, if the first authentication result received by the first ECU is that the identity authentication fails, the first ECU will not subsequently send communication data to the second ECU, thereby improving the security of the communication data.
  • the first authentication result received by the first ECU is that the identity authentication fails, then even if the first ECU has received the second sub-information sent by the second ECU, it is not necessary to compare the second sub-information with the third sub-information, that is, there is no need to authenticate the identity of the second ECU, and the identity authentication of other ECUs can be performed next, thereby improving the efficiency of communication authentication.
  • the first ECU may be an ECU that actively initiates an identity authentication request
  • the ECU that actively initiates an identity authentication request may be an ECU that actively sends data to another ECU.
  • FIG6 is a flow chart of a method for sending an identity authentication request provided in an embodiment of the present application. Based on the above embodiment, the method includes the following steps:
  • the first ECU may send a first identity authentication request to the second ECU in real time.
  • S602 Receive a first random number sent by the second ECU, and use the first random number as initial data.
  • the second ECU can send the first random number generated by itself to the first ECU, and accordingly, the first ECU uses the received first random number as initial data.
  • the first ECU After the first ECU obtains the initial data, it can encrypt the initial data based on the preset key to obtain new encrypted information, that is, for each first identity authentication request, the encrypted information obtained by the first ECU may be different, that is, K1 and K3 in the encrypted information obtained by the first ECU each time may be different.
  • the method provided in the embodiment of the present application realizes the non-fixedness of the initial data by sending a first identity authentication request to the second ECU, receiving a first random number sent by the second ECU, and using the first random number as initial data, thereby improving the credibility of the first authentication result obtained by the second ECU authenticating the first ECU.
  • the above S601, sending the first identity authentication request to the second ECU may be implemented in the following manner:
  • the first ECU may send a first identity authentication request to the second ECU at a preset time interval. For example, the first ECU may repeatedly send a first identity authentication request to the second ECU every 5 seconds, that is, multiple identity authentications may be performed in a driving period from vehicle startup to vehicle shutdown. For each first identity authentication request sent by the first ECU, the second ECU will generate a new first random number S.
  • the first ECU sends a first identity authentication request to the second ECU at a preset time interval, so that the first random number sent by the second ECU received by the first ECU each time is different, and then the initial data obtained based on the first random number is different, so as to achieve the non-fixedness of the initial data, thereby improving the credibility of the first authentication result obtained by the second ECU for identity authentication of the first ECU, making the entire communication process more secure and able to resist replay attacks well.
  • the first identity authentication request is sent to the second ECU at a preset time interval, the number of first identity authentication requests sent by the first ECU can be reduced, and the communication load rate can be reduced.
  • the first ECU may actively send a communication message to the second ECU, and the steps of sending the communication message to the second ECU are as follows:
  • a communication message is sent to the second ECU; the communication message includes communication data and verification information, the verification information is determined according to the encrypted information, and the verification information is used for the second ECU to verify the communication data.
  • Figure 7 is a schematic diagram of a communication message format provided in an embodiment of the present application.
  • the first ECU when the result of the two-way authentication is that the two-way authentication is passed, the first ECU sends a communication message to the second ECU, and the verification information included in the communication message is determined based on the encrypted information, thereby improving the security of the entire communication process and being able to resist replay attacks well.
  • the encrypted information is the 8-byte encrypted information introduced in the above embodiment
  • the encrypted information includes the first sub-information
  • the verification information may include part of the information in K1 and/or part of the information in K3.
  • the verification information includes the upper 4 bits in the first sub-information K1 and the lower 4 bits in the third sub-information K3.
  • the first ECU uses the first random number sent by the second ECU as the initial data, since the first random number corresponding to each first authentication request may be different, the initial data may be different, so that the encryption information corresponding to each first authentication request is different, and the verification information will also change with the encryption information. This can make the entire communication process more secure and can resist replay attacks well.
  • the verification information includes first verification information and/or second verification information, the first verification information is information in the first sub-information located within a third preset area, and the second verification information is information in the third sub-information located within a fourth preset area.
  • the third preset area range may be a part of or the entire area in the first sub-information
  • the fourth preset area range may be a part of or the entire area in the third sub-information.
  • the first verification information can be composed of the upper 4 bits of the first sub-information, and the third preset area range refers to the area range where the upper 4 bits of the first sub-information are located; the second verification information can be composed of the lower 4 bits of the third sub-information, and the fourth preset area range refers to the area range where the lower 4 bits of the third sub-information are located.
  • the amount of data of the verification information can be reduced and the verification efficiency can be improved.
  • Figure 8 is a schematic diagram of the verification information format provided in an embodiment of the present application.
  • the verification information shown in Figure 8 is 1 byte, and the upper 4 bits of the 1 byte are used as the first verification information, and the lower 4 bits of the 1 byte are used as the second verification information.
  • the upper 4 bits are the upper 4 bits in the first sub-information, and the lower 4 bits are the lower 4 bits in the third sub-information.
  • the first verification information may be composed of the upper 4 bits of the first sub-information, and the third preset area range refers to the area range where the upper 4 bits of the first sub-information are located; the second verification information may be composed of the upper 4 bits of the third sub-information, and the fourth preset area range refers to the area range where the upper 4 bits of the third sub-information are located.
  • the security of the communication data is improved.
  • Figure 9 is a signaling flow chart of a two-way authentication method provided in an embodiment of the present application.
  • the first ECU actively sends an authentication request to the second ECU as an example.
  • the first ECU sends a first identity authentication request to the second ECU.
  • the second ECU receives the first identity authentication request sent by the first ECU.
  • the second ECU generates a first random number in response to the first identity authentication request.
  • S903 The second ECU sends a first random number to the first ECU.
  • the second ECU sends a first random number to the first ECU to challenge the first ECU.
  • the second ECU uses the first random number as initial data and uses a pre-stored preset key to The authentication information is encrypted and divided into fourth sub-information and second sub-information.
  • the fourth sub-information may be a sub-information of a preset length starting from the highest bit of the authentication information
  • the second sub-information K may be a sub-information of a preset length starting from the lowest bit of the authentication information.
  • the fourth sub-information is K4 as described in the above embodiment
  • the second sub-information is K2, that is, the second ECU divides the authentication information into the upper 4 bytes of K4 and the lower 4 bytes of K2.
  • the first ECU uses the first random number as initial data, encrypts the acquired initial data based on a preset key to obtain encrypted information, and decomposes the encrypted information into first sub-information and third sub-information.
  • the first sub-information may be K1 introduced in the above embodiment, and the third sub-information may be K3 introduced in the above embodiment.
  • S906 The first ECU sends the first sub-information to the second ECU.
  • the second ECU receives the first sub-information sent by the first ECU.
  • the second ECU compares the received first sub-information with the fourth sub-information to obtain a first authentication result.
  • the first authentication result is determined to be identity authentication passed. If the first sub-information is inconsistent with the fourth sub-information, the first authentication result is determined to be identity authentication failed. If the first authentication result is identity authentication passed, the second ECU can send the first authentication result and the second sub-information to the first ECU.
  • the second ECU sends the first authentication result and the second sub-information to the first ECU.
  • the first ECU receives the first authentication result and the second sub-information sent by the second ECU.
  • S909 The first ECU compares the second sub-information with the third sub-information in the encrypted information.
  • the first ECU determines that the second ECU is a trusted ECU.
  • the first ECU sends a communication message to the second ECU.
  • the second ECU verifies the communication data in the communication message based on the authentication information and the verification information.
  • the second ECU receives the communication message and verifies the verification information included in the communication message based on the authentication information calculated by itself. For example, if the first verification information is composed of the upper 4 bits of the first sub-information, and the second verification information is composed of the lower 4 bits of the third sub-information, the second ECU can use the upper 4 bits in the fourth sub-information to compare with the first verification information to obtain a first comparison result, and use the lower 4 bits in the second sub-information to compare with the second verification information to obtain a second comparison result, and then determine whether the received communication message is a credible message based on the first comparison result and the second comparison result.
  • the received communication message is determined to be a credible message; if the first comparison result is that the lower 4 bits of the second sub-information are inconsistent with the second verification information, and/or the second comparison result is that the lower 4 bits of the second sub-information are inconsistent with the second verification information, then the received communication message is determined to be an untrustworthy message.
  • the first ECU may be an ECU that passively performs an identity authentication request.
  • the ECU that passively performs the identity authentication request may be the ECU that receives the data sent by the second ECU, that is, if the second ECU needs to actively send data to the first ECU, the second ECU may send a second identity authentication request to the first ECU.
  • FIG10 is a flow chart of another identity authentication request sending method provided in an embodiment of the present application. Based on the above embodiment, the method includes the following steps:
  • the first ECU receives a second identity authentication request sent by the second ECU, it can generate a second random number in response to the second identity authentication request, and send the second random number to the second ECU, and use the second random number as initial data.
  • the first ECU uses a preset key to encrypt the initial data to obtain encrypted information, and the subsequent execution process of the first ECU is the same as the execution process of the second ECU introduced in the above embodiment. To avoid repetition, it will not be repeated here.
  • the first ECU can actively send a first identity authentication request to the second ECU to enable the second ECU to authenticate the first ECU, or it can passively receive a second identity authentication request sent by the second ECU to enable the first ECU to authenticate the second ECU, thereby improving the efficiency of two-way identity authentication.
  • a vehicle comprising a first ECU and a second ECU as shown in FIG1 ;
  • the first ECU is used to encrypt the acquired initial data based on a preset key to obtain encrypted information
  • the first ECU is used to send the first sub-information in the encrypted information to the second ECU;
  • the second ECU is used to perform identity authentication on the first ECU based on the first sub-information to obtain a first authentication result.
  • the second ECU is further used to encrypt the acquired initial data based on a preset key to obtain authentication information, perform identity authentication on the first ECU based on the first sub-information and the fourth sub-information in the authentication information, and send the second sub-information in the authentication information to the first ECU;
  • the second sub-information is the sub-information in the authentication information that is within the second preset area
  • the fourth sub-information is the sub-information in the authentication information that is within the first preset area;
  • the first ECU is further used to receive the second sub-information sent by the second ECU, and perform identity authentication on the second ECU based on the third sub-information in the encrypted information and the second sub-information to obtain a second authentication result.
  • the second sub-information is the sub-information in the authentication information that is located within the second preset area, that is, the area where the second sub-information is located in the authentication information corresponds to the area where the third sub-information is located in the encrypted information.
  • the third sub-information is information of a lowest byte of the encrypted information
  • the second sub-information is information of a lowest byte in the authentication information.
  • the fourth sub-information is the sub-information in the authentication information that is within the first preset area, that is, the area where the fourth sub-information is located in the authentication information corresponds to the area where the first sub-information is located in the encrypted information. For example, when the first sub-information is the highest byte of the encrypted information, the fourth sub-information is the highest byte of the authentication information.
  • the embodiment of the present application also provides an identity authentication device for implementing the identity authentication method involved above.
  • the implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more identity authentication device embodiments provided below can refer to the limitations on the identity authentication method above, and will not be repeated here.
  • FIG. 11 is a structural block diagram of an identity authentication device provided in an embodiment of the present application.
  • the device 1100 is provided in a first ECU, and the device 1100 includes:
  • the encryption module 1101 is used to encrypt the acquired initial data based on a preset key to obtain encrypted information
  • the first sending module 1102 is used to send the first sub-information in the encrypted information to the second electronic control unit ECU; the first sub-information is used by the second ECU to perform identity authentication on the first ECU to obtain a first authentication result.
  • the method further comprises:
  • the first receiving module is used to receive the second sub-information and the first authentication result sent by the second ECU, and perform identity authentication on the second ECU based on the second sub-information and the third sub-information in the encrypted information to obtain a second authentication result;
  • the first determination module is used to determine the bidirectional identity authentication result of the first ECU and the second ECU based on the first authentication result and the second authentication result.
  • the first sub-information is sub-information in the encrypted information that is located within a first preset area
  • the third sub-information is sub-information in the encrypted information that is located within a second preset area.
  • the first receiving module is specifically used to compare the second sub-information with the third sub-information to obtain a comparison result; if the comparison result is that the second sub-information is consistent with the third sub-information, the second authentication result is determined to be identity authentication passed; if the comparison result is that the second sub-information is inconsistent with the third sub-information, the second authentication result is determined to be identity authentication failed.
  • the first determination module is specifically used to determine that the result of the two-way identity authentication is the two-way identity authentication passed if the first authentication result is that the identity authentication passed and the second authentication result is that the identity authentication passed; if the first authentication result is that the identity authentication passed and the second authentication result is that the identity authentication failed, then determine that the result of the two-way identity authentication is the two-way identity authentication failed.
  • the apparatus 1100 may further include:
  • the second receiving module is used to receive the first authentication result sent by the second ECU; if the first authentication result is that the identity authentication fails, it is determined that the identity authentication of the first ECU by the second ECU fails.
  • the apparatus 1100 may further include:
  • a second sending module is used to send a first identity authentication request to the second ECU; the first identity authentication request is used to trigger the second ECU to generate a first random number;
  • the third receiving module is used to receive the first random number sent by the second ECU and use the first random number as initial data.
  • the second sending module is specifically configured to send the first identity authentication request to the second ECU at preset time intervals.
  • the apparatus 1100 may further include:
  • the third sending module is used to send a communication message to the second ECU if the result of the two-way identity authentication is that the two-way identity authentication is passed; the communication message includes communication data and verification information, the verification information is determined according to the encrypted information, and the verification information is used for the second ECU to verify the communication data.
  • the verification information includes first verification information and/or second verification information, the first verification information is information in the first sub-information located within a third preset area, and the second verification information is information in the third sub-information located within a fourth preset area.
  • the apparatus 1100 may further include:
  • a fourth receiving module used for receiving a second identity authentication request sent by a second ECU
  • the fourth sending module is used to generate a second random number in response to the second identity authentication request, send the second random number to the second ECU, and use the second random number as initial data.
  • Each module in the above-mentioned identity authentication device can be implemented in whole or in part by software, hardware or a combination thereof.
  • Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
  • an electronic control unit including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
  • the first sub-information in the encrypted information is sent to the second electronic control unit ECU; the first sub-information is used by the second ECU to perform identity authentication on the first ECU to obtain a first authentication result.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • a bidirectional identity authentication result of the first ECU and the second ECU is determined.
  • the first sub-information is sub-information in the encrypted information that is located within a first preset area
  • the third sub-information is sub-information in the encrypted information that is located within a second preset area.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • the second authentication result is determined to be identity authentication passed
  • the second authentication result is determined to be identity authentication failure. Pass.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • the first authentication result is that the identity authentication is passed
  • the second authentication result is that the identity authentication is passed
  • determining that the two-way identity authentication result is that the two-way identity authentication is passed
  • the result of the two-way identity authentication is determined to be that the two-way identity authentication is not passed.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • the first authentication result is that the identity authentication fails, it is determined that the identity authentication of the first ECU by the second ECU fails.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • the first identity authentication request is used to trigger the second ECU to generate a first random number
  • a first random number sent by the second ECU is received, and the first random number is used as initial data.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • a first identity authentication request is sent to the second ECU at preset time intervals.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • a communication message is sent to the second ECU; the communication message includes communication data and verification information, the verification information is determined according to the encrypted information, and the verification information is used for the second ECU to verify the communication data.
  • the verification information includes first verification information in the first sub-information that is located within a third preset area and/or second verification information in the third sub-information that is located within a fourth preset area.
  • the processor when the processor executes the computer program, the processor further implements the following steps:
  • a second random number is generated in response to the second identity authentication request, and the second random number is sent to the second ECU, and the second random number is used as initial data.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the first sub-information in the encrypted information is sent to the second electronic control unit ECU; the first sub-information is used by the second ECU to perform identity authentication on the first ECU to obtain a first authentication result.
  • a bidirectional identity authentication result of the first ECU and the second ECU is determined.
  • the first sub-information is sub-information in the encrypted information that is located within a first preset area
  • the third sub-information is sub-information in the encrypted information that is located within a second preset area.
  • the second authentication result is determined to be identity authentication passed
  • the second authentication result is determined to be identity authentication failure.
  • the first authentication result is that the identity authentication is passed
  • the second authentication result is that the identity authentication is passed
  • determining that the two-way identity authentication result is that the two-way identity authentication is passed
  • the result of the two-way identity authentication is determined to be that the two-way identity authentication is not passed.
  • the first authentication result is that the identity authentication fails, it is determined that the identity authentication of the first ECU by the second ECU fails.
  • the first identity authentication request is used to trigger the second ECU to generate a first random number
  • a first random number sent by the second ECU is received, and the first random number is used as initial data.
  • a first identity authentication request is sent to the second ECU at preset time intervals.
  • a communication message is sent to the second ECU; the communication message includes communication data and verification information, the verification information is determined according to the encrypted information, and the verification information is used for the second ECU to verify the communication data.
  • the verification information includes first verification information and/or second verification information, the first verification information is information in the first sub-information located within a third preset area, and the second verification information is information in the third sub-information located within a fourth preset area.
  • a second random number is generated in response to the second identity authentication request, and the second random number is sent to the second ECU, and the second random number is used as initial data.
  • a computer program product comprising a computer program, which, when executed by a processor, implements the following steps:
  • the first sub-information in the encrypted information is sent to the second electronic control unit ECU; the first sub-information is used by the second ECU to perform identity authentication on the first ECU to obtain a first authentication result.
  • a bidirectional identity authentication result of the first ECU and the second ECU is determined.
  • the first sub-information is sub-information in the encrypted information that is located within a first preset area
  • the third sub-information is sub-information in the encrypted information that is located within a second preset area.
  • the second authentication result is determined to be identity authentication passed
  • the second authentication result is determined to be identity authentication failure.
  • the first authentication result is that the identity authentication is passed
  • the second authentication result is that the identity authentication is passed
  • determining that the two-way identity authentication result is that the two-way identity authentication is passed
  • the result of the two-way identity authentication is determined to be that the two-way identity authentication is not passed.
  • the first authentication result is that the identity authentication fails, it is determined that the identity authentication of the first ECU by the second ECU fails.
  • the first identity authentication request is used to trigger the second ECU to generate a first random number
  • a first random number sent by the second ECU is received, and the first random number is used as initial data.
  • a first identity authentication request is sent to the second ECU at preset time intervals.
  • a communication message is sent to the second ECU; the communication message It includes communication data and verification information, the verification information is determined according to the encrypted information, and the verification information is used for the second ECU to verify the communication data.
  • the verification information includes first verification information and/or second verification information, the first verification information is information in the first sub-information located within a third preset area, and the second verification information is information in the third sub-information located within a fourth preset area.
  • a second random number is generated in response to the second identity authentication request, and the second random number is sent to the second ECU, and the second random number is used as initial data.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory.
  • Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc.
  • Volatile memory can include random access memory (RAM) or external cache memory, etc.
  • RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • the database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database.
  • Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this.
  • the processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Power Engineering (AREA)
  • Lock And Its Accessories (AREA)

Abstract

本申请涉及一种身份认证方法、装置、车辆、电子控制单元和存储介质。所述方法包括:基于预设密钥对获取的初始数据进行加密得到加密信息,并向第二电子控制单元ECU发送加密信息中的第一子信息,从而使第二ECU基于第一子信息对第一ECU进行身份认证,获得第一认证结果,从而实现第二ECU对第一ECU的身份认证。并且,由于第一ECU仅向第二ECU发送加密信息中的部分信息,从而降低了所发送的信息的数据量,降低了身份认证的负载率,提高了身份认证的通信效率。

Description

身份认证方法、装置、车辆、电子控制单元和存储介质
交叉引用
本申请引用于2023年04月06日申请的,申请号为2023103611542,名称为“身份认证方法、装置、车辆、电子控制单元和存储介质”的中国专利申请的优先权,在此将其全文引入作为参考
技术领域
本申请涉及车内网技术领域,特别是涉及一种身份认证方法、装置、车辆、电子控制单元和存储介质。
背景技术
车内网是实现单车智能网联的基础技术。车内网是指基于成熟的控制区域网络(controller area network,CAN)、局域互联网络(Local Interconnect Network)或以太网等技术建立的标准化整车网络,实现车内各电子控制单元(Electronic Control Unit,简称ECU)之间的通信。
为了实现两个ECU之间的安全通信,需要对ECU进行身份认证。然而,目前,车内网中缺少对ECU进行身份认证的方案,因此,如何对ECU进行身份认证成为本领域亟待解决的技术问题。
发明内容
基于此,有必要针对上述技术问题,提供一种能够对ECU进行身份认证的身份认证方法、装置、车辆、电子控制单元和存储介质。
第一方面,本申请提供了一种身份认证方法。该方法应用于第一电子控制单元ECU,该方法包括:
基于预设密钥对获取的初始数据进行加密得到加密信息;
向第二电子控制单元ECU发送该加密信息中的第一子信息;该第一子信息用于该第二ECU对该第一ECU进行身份认证,获得第一认证结果。
本申请实施例中,通过基于预设密钥对获取的初始数据进行加密得到加密信息,并向第二电子控制单元ECU发送加密信息中的第一子信息,从而使第二ECU基于第一子信息对第一ECU进行身份认证,获得第一认证结果,从而实现第二ECU对第一ECU的身份认证。并且,由于第一ECU仅向第二ECU发送加密信息中的部分信息,从而降低了所发送的信息 的数据量,降低了身份认证的负载率,提高了身份认证的通信效率。
在其中一个实施例中,该方法还包括:
接收该第二ECU发送的第二子信息和该第一认证结果,并基于该第二子信息、以及该加密信息中的第三子信息,对该第二ECU进行身份认证,获得第二认证结果;
基于该第一认证结果和该第二认证结果,确定该第一ECU与该第二ECU的双向身份认证结果。
本申请实施例中,通过接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果,并基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果,从而实现第一ECU和第二ECU之间的双向身份认证。并且,由于第一ECU基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果,即第二ECU仅向第一ECU发送第二子信息,从而降低了第一ECU所接收的信息的数据量,从而降低了双向身份认证的负载率,提高了双向身份认证的通信效率。
在其中一个实施例中,该第一子信息为该加密信息中位于第一预设区域范围内的子信息,该第三子信息为该加密信息中位于第二预设区域范围内的子信息。
本申请实施例中,第一子信息为该加密信息中位于第一预设区域范围内的子信息,第三子信息为该加密信息中位于第二预设区域范围内的子信息,从而实现第一ECU根据第一预设区域范围即可快速确定第一子信息,根据第二预设区域范围即可快速确定第三子信息,从而提高身份认证的效率。
在其中一个实施例中,该基于该第二子信息、以及该加密信息中的第三子信息,对该第二ECU进行身份认证,获得第二认证结果,包括:
将该第二子信息与该第三子信息进行比对得到比对结果;
若该比对结果为该第二子信息与该第三子信息一致,则确定该第二认证结果为身份认证通过;
若该比对结果为该第二子信息与该第三子信息不一致,则确定该第二认证结果为身份认证未通过。
本申请实施例中,通过将第二子信息与第三子信息进行比对得到比对结果,进而根据比较结果确定第二认证结果,将接收到的第二子信息与第一ECU计算出的第三子信息进行比对,由于比对的是第二子信息和第三子信息,从而降低了所需比对的数据量,提高比对效率。
在其中一个实施例中,该基于该第一认证结果和该第二认证结果,确定该第一ECU与该第二ECU的双向身份认证结果,包括:
若该第一认证结果为身份认证通过、且该第二认证结果为身份认证通过,则确定该双向身份认证结果为双向身份认证通过;
若该第一认证结果为身份认证通过、且该第二认证结果为身份认证未通过,则确定该双向身份认证结果为双向身份认证未通过。
本实施例中,基于第一认证结果和第二认证结果,从而实现第一ECU与第二ECU之间的双向身份认证。
在其中一个实施例中,该方法还包括:
接收该第二ECU发送的该第一认证结果;
若该第一认证结果为身份认证未通过,则确定该第二ECU对该第一ECU的身份认证未通过。
本申请实施例中,若第一ECU接收到第一认证结果,且第一认证结果为身份认证未通过,则第一ECU可以确定第二ECU对第一ECU的身份认证未通过,即第一ECU接收到的第一认证结果如果为身份认证未通过,则第一ECU后续可以不向第二ECU发送通信数据,提高通信数据的安全性。
在其中一个实施例中,该方法还包括:
向该第二ECU发送第一身份认证请求;该第一身份认证请求用于触发该第二ECU生成第一随机数;
接收该第二ECU发送的该第一随机数,并将该第一随机数作为该初始数据。
本申请实施例中,通过向第二ECU发送第一身份认证请求,并接收第二ECU发送的第一随机数,并将第一随机数作为初始数据,从而实现初始数据的不固定性,进而提高第二ECU对第一ECU进行身份认证得到的第一认证结果的可信度。
在其中一个实施例中,该向该第二ECU发送第一身份认证请求,包括:
每隔预设时长向该第二ECU发送该第一身份认证请求。
本申请实施例中,本申请实施例提供的方法,第一ECU每隔预设时长向第二ECU发送第一身份认证请求,从而使第一ECU每次接收到的第二ECU发送的第一随机数不同,进而基于第一随机数得到的初始数据不同,实现初始数据的不固定性,进而提高第二ECU对第一ECU进行身份认证得到的第一认证结果的可信度,使得整个通信过程更加安全,能够很好的抵抗重放攻击。并且,由于每隔预设时长向第二ECU发送第一身份认证请求,能够降低第一ECU发送的第一身份认证请求的次数,降低通信负载率。
在其中一个实施例中,该方法还包括:
若该双向身份认证结果为双向身份认证通过,则向该第二ECU发送通信报文;该通信报文包括通信数据和校验信息,该校验信息根据该加密信息确定,该校验信息用于供该第二ECU对该通信数据进行校验。
本申请实施例中,在双向身份认证结果为双向身份认证通过的情况下,第一ECU向第二ECU发送通信报文,并且通信报文中包括的校验信息根据加密信息确定,从而可以提高 整个通信过程的安全性,能够很好的抵抗重放攻击。
在其中一个实施例中,该校验信息包括第一校验信息和/或第二校验信息,该第一校验信息为该第一子信息中位于第三预设区域范围内的信息,该第二校验信息为该第三子信息中位于第四预设区域范围的信息。
本申请实施例中,通过在通信包括中增加包括第一校验信息和/或第二校验信息的校验信息,从而提高了通信数据的安全性。
在其中一个实施例中,该方法还包括:
接收该第二ECU发送的第二身份认证请求;
响应于该第二身份认证请求生成第二随机数,并向该第二ECU发送该第二随机数,并将该第二随机数作为该初始数据。
本申请实施例中,第一ECU可以为主动向第二ECU发送第一身份认证请求,实现第二ECU对第一ECU进行身份认证,也可以同时被动接收第二ECU发送的第二身份认证请求,从而实现第一ECU对第二ECU进行身份认证,提高双向身份认证的效率。
第二方面,本申请还提供了一种身份认证装置。该装置设置于第一ECU,该装置包括:
加密模块,用于基于预设密钥对获取的初始数据进行加密得到加密信息;
发送模块,用于向第二电子控制单元ECU发送该加密信息中的第一子信息;该第一子信息用于该第二ECU对该第一ECU进行身份认证,获得第一认证结果。
第三方面,本申请还提供了一种车辆,其中,该车辆包括第一电子控制单元ECU和第二ECU;
该第一ECU,用于基于预设密钥对获取的初始数据进行加密得到加密信息;
该第一ECU,用于向该第二ECU发送该加密信息中的第一子信息;
该第二ECU,用于基于该第一子信息对该第一ECU进行身份认证,获得第一认证结果。
在其中一个实施例中,该第二ECU,还用于基于该预设密钥对获取的初始数据进行加密得到认证信息,基于该第一子信息和该认证信息中的第四子信息,对该第一ECU进行身份认证,并向该第一ECU发送该认证信息中的第二子信息;该第二子信息为该认证信息中位于第二预设区域范围内的子信息,该第四子信息为该认证信息中位于第一预设区域范围内的子信息;
该第一ECU,还用于接收该第二ECU发送的该第二子信息,并基于该加密信息中的第三子信息、以及该第二子信息,对该第二ECU进行身份认证,获得第二认证结果。
第四方面,本申请还提供了一种电子控制单元,包括存储器和处理器,该存储器存储有计算机程序,其中,该处理器执行该计算机程序时实现上述的方法的步骤。
第五方面,本申请还提供了一种计算机可读存储介质。该计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述的方法的步骤。
第六方面,本申请还提供了一种计算机程序产品。该计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述的方法的步骤。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据附图获得其他的附图:
图1为一个实施例中身份认证方法的应用环境图;
图2是本申请实施例提供的一种身份认证方法的流程示意图;
图3是本申请实施例提供的一种双向身份认证方法的流程示意图;
图4是本申请实施例提供的一种第二认证结果获得方法的流程示意图;
图5是本申请实施例提供的另一种身份认证方法的流程示意图;
图6是本申请实施例提供的一种身份认证请求发送方法的流程示意图;
图7是本申请实施例提供的一种通信报文格式示意图;
图8是本申请实施例提供的校验信息格式的示意图;
图9是本申请实施例提供的一种双向身份认证方法的信令流程图;
图10是本申请实施例提供的另一种身份认证请求发送方法的流程示意图;
图11是本申请实施例提供的一种身份认证装置的结构框图。
具体实施方式
下面将结合附图对本申请技术方案的实施例进行详细的描述。以下实施例仅用于更加清楚地说明本申请的技术方案,因此只作为示例,而不能以此来限制本申请的保护范围。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。
在本申请实施例的描述中,技术术语“第一”“第二”等仅用于区别不同对象,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量、特定顺序或主次关系。 在本申请实施例的描述中,“多个”的含义是两个以上,除非另有明确具体的限定。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
在本申请实施例的描述中,术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
在本申请实施例的描述中,术语“多个”指的是两个以上(包括两个),同理,“多组”指的是两组以上(包括两组),“多片”指的是两片以上(包括两片)。
在本申请实施例的描述中,技术术语“中心”“纵向”“横向”“长度”“宽度”“厚度”“上”“下”“前”“后”“左”“右”“竖直”“水平”“顶”“底”“内”“外”“顺时针”“逆时针”“轴向”“径向”“周向”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请实施例和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请实施例的限制。
在本申请实施例的描述中,除非另有明确的规定和限定,技术术语“安装”“相连”“连接”“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;也可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请实施例中的具体含义。
车内网是实现单车智能网联的基础技术。车内网是指基于成熟的CAN、局域互联网络或以太网等技术建立的标准化整车网络,实现车内各ECU之间的通信。
为了实现两个ECU之间的安全通信,需要对ECU进行身份认证。然而,目前,车内网中缺少对ECU进行身份认证的方案,因此,如何对ECU进行身份认证成为本领域亟待解决的技术问题。
本申请实施例中,为了实现对ECU进行身份认证,第一ECU基于预设密钥对获取的初始数据进行加密得到加密信息,并向第二ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果,实现第二ECU对第一ECU进行身份认证。
本申请实施例提供的身份认证方法,可以应用于如图1所示的应用环境中。其中,第一ECU通过网络与第二ECU进行通信。第一ECU基于预设密钥对获取的初始数据进行加密得到加密信息,第一ECU向第二ECU发送加密信息中的第一子信息,第二ECU基于第一子信息对第一ECU进行身份认证,获得对第一ECU进行身份认证的第一认证结果,从而实现 对ECU进行身份认证。
在一个实施例中,如图2所示,图2是本申请实施例提供的一种身份认证方法的流程示意图,该方法应用于车辆中的ECU,在本实施例中以应用于图1中的第一ECU为例进行说明,该方法包括以下步骤:
S201、基于预设密钥对获取的初始数据进行加密得到加密信息。
其中,第一ECU可以采用密码学算法,基于预设密钥对获取的初始数据进行加密得到加密信息。密码学算法数据加密标准(Data Encryption Standard,DES)加密算法、高级加密标准(Advanced Encryption Standard,AES)加密算法、信息摘要算法(message-digest algorithm5,MD5)加密算法等。预设密钥和密码学算法可以在出厂时集成于第一ECU中。
初始数据可以为预设数据,第一ECU和第二ECU中可以预先存储有预设数据,在车辆启动后,双方可以同时基于预设密钥对预先存储的预设数据进行加密得到加密信息。或者,初始数据也可以为第一ECU接收的第二ECU发送的随机数。
S202、向第二电子控制单元ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果。
第一ECU得到加密信息后,可以将加密信息中的部分信息发送给第二ECU,即将加密信息中的第一子信息发送给第二ECU,从而使第二ECU能够基于第一子信息对第一ECU进行身份认证,获得第一认证结果。
在一种实现方式中,第一ECU将加密信息的最高比特位作为起始位置,将第一预设长度的比特位数作为第一子信息,第一预设长度可以等于加密信息的总长度的二分之一,也可以等于其他长度。例如,加密信息的长度为8字节,可以将高4字节命名为K1,将低4字节命名为K3,第一ECU可以将K1作为第一子信息,则第一ECU仅将K1发送给第二ECU。
在另一种实现方式中,第一ECU将加密信息的最低比特位作为起始位置,将第二预设长度的比特位数作为第一子信息,第二预设长度可以等于加密信息的总长度的二分之一,也可以等于其他长度,例如,第一ECU可以将K3作为第一子信息,则第一ECU仅将K3发送给第二ECU。
需要说明的是,ECU之间可以通过协议确定发送K1还是K3,若协议第一ECU得到加密信息后发送K1,则第一ECU向第二ECU发送K1。若协议第一ECU得到加密信息后发送K3,则第一ECU向第二ECU发送K3。为了便于介绍,本实施例中以第一ECU向第二ECU发送K1为例进行说明。
第二ECU在出厂时也集成有预设密钥和密码学算法,车辆启动后,第二ECU可以采用集成的密码学算法对预设密钥进行加密得到认证信息,该认证信息的长度为8字节,将认证信息中的高4字节命名为K4,将认证信息中的低4字节命名为K2。第二ECU接收到K1后,第二ECU对第一ECU进行身份认证的过程例如为:第二ECU将K1与自身计算得到的 K4进行比对,若K1与K4一致,则确定第一认证结果为身份认证通过;若K1与K4不一致,则确定第一认证结果为身份认证未通过。其中,若第二ECU在出厂时也集成的预设密钥与第一ECU相同,且第二ECU集成的密码学算法与第一ECU的相同,则第二ECU将K1与自身计算得到的K4进行比对得到的第一认证结果为身份认证通过的结果,否则,得到的第一认证结果为身份认证未通过的结果。
本申请实施例提供的方法,通过基于预设密钥对获取的初始数据进行加密得到加密信息,并向第二电子控制单元ECU发送加密信息中的第一子信息,从而使第二ECU基于第一子信息对第一ECU进行身份认证,获得第一认证结果,从而实现第二ECU对第一ECU的身份认证。并且,由于第一ECU仅向第二ECU发送加密信息中的部分信息,从而降低了所发送的信息的数据量,降低了身份认证的负载率,提高了身份认证的通信效率。
在一个实施例中,如图3所示,图3是本申请实施例提供的一种双向身份认证方法的流程示意图。该方法包括如下步骤:
S301、基于预设密钥对获取的初始数据进行加密得到加密信息。
S302、向第二电子控制单元ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果。
S303、接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果。
以第一子信息为K1为例,则第二子信息例如为上述实施例中的K2。若第二ECU得到的第一认真结果为身份认证通过,即第二ECU确定第一ECU为可信的ECU,则第二ECU可以向第一ECU发送K2和第一认证结果,相应的,第一ECU接收到K2和第一认证结果,并基于K2以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果。其中,第三子信息为K3。
若K2与K3一致,则第一ECU确定第二认证结果为身份认证通过,即第一ECU确定第二ECU为可信的ECU。若K2与K3一致,则第一ECU确定第二认证结果为身份认证未通过,即第一ECU确定第二ECU为不可信的ECU。
需要说明的是,第二ECU对第一ECU的认证、第一ECU对第二ECU的认证可以同时进行,即车辆启动后,第一ECU得到加密信息,第二ECU得到认证信息,并且,第一ECU向第二ECU发送K1,第二ECU向第一ECU发送K2。其中,第一ECU向第二ECU发送K1,从而使第二ECU基于K1和K4实现对第一ECU的身份认证;第二ECU向第一ECU发送K2,从而使第一ECU基于K2和K3实现对第二ECU的身份认证。
S304、基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果。
其中,若第一认证结果为身份认证未通过、且第二认证结果为身份认证通过,则确定 双向身份认证结果为双向身份认证未通过;
若第一认证结果为身份认证未通过、且第二认证结果为身份认证未通过,则确定双向身份认证结果为双向身份认证未通过。
本实施例提供的方法,通过接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果,并基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果,从而实现第一ECU和第二ECU之间的双向身份认证。并且,由于第一ECU基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果,即第二ECU仅向第一ECU发送第二子信息,从而降低了第一ECU所接收的信息的数据量,从而降低了双向身份认证的负载率,提高了双向身份认证的通信效率。
在一个实施例中,第一子信息为加密信息中位于第一预设区域范围内的子信息,第三子信息为加密信息中位于第二预设区域范围内的子信息。
例如,若加密信息的长度为8字节,可以将加密信息的一个最高字节的信息作为第一子信息,将加密信息的一个最低字节的信息作为第三子信息,该最高字节即为第一预设区域范围,该最低字节为第二预设区域范围。
或者,将加密信息的最高字节和最低字节作为第一子信息,将加密信息中除第一子信息之外的其他子信息作为第三子信息。
本申请实施例中,第一子信息为该加密信息中位于第一预设区域范围内的子信息,第三子信息为该加密信息中位于第二预设区域范围内的子信息,从而实现第一ECU根据第一预设区域范围即可快速确定第一子信息,根据第二预设区域范围即可快速确定第三子信息,从而提高身份认证的效率。
在一个实施例中,如图4所示,图4是本申请实施例提供的一种第二认证结果获得方法的流程示意图。本实施例涉及的是如何基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果的一种可能的实现方式。在上述实施例的基础上,上述的S303中的“基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果”可以包括如下步骤:
S401、将第二子信息与第三子信息进行比对得到比对结果。
S402、若比对结果为第二子信息与第三子信息一致,则确定第二认证结果为身份认证通过。
S403、若比对结果为第二子信息与第三子信息不一致,则确定第二认证结果为身份认证未通过。
以第二子信息为K2,第三子信息为K3为例,则K2与K3一致,则确定第二认证结果为身份认证通过。若K2与K3不一致,则确定第二认证结果为身份认证未通过。
第二子信息与第三子信息一致可以指第二子信息与第三子信息相同。或者第二子信息与第三子信息的相似度大于等于预设阈值,例如,预设阈值为99.8%,第二子信息与第三子信息的相似度等于99.9%,则认为第二子信息与第三子信息一致。
本申请实施例中,通过将第二子信息与第三子信息进行比对得到比对结果,进而根据比较结果确定第二认证结果,将接收到的第二子信息与第一ECU计算出的第三子信息进行比对,由于比对的是第二子信息和第三子信息,从而降低了所需比对的数据量,提高比对效率。
在一个实施例中,上述的S302、基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果,可以通过如下方式实现:
若第一认证结果为身份认证通过、且第二认证结果为身份认证通过,则确定双向身份认证结果为双向身份认证通过;
若第一认证结果为身份认证通过、且第二认证结果为身份认证未通过,则确定双向身份认证结果为双向身份认证未通过。
本实施例中,基于第一认证结果和第二认证结果,从而实现第一ECU与第二ECU之间的双向身份认证。
在一个实施例中,如图5所示,图5是本申请实施例提供的另一种身份认证方法的流程示意图。本实施例涉及的是第一ECU如何确定第二ECU是否对第一ECU的身份认证通过的流程示意图。在上述实施例的基础上,该方法包括如下步骤:
S501、接收第二ECU发送的第一认证结果。
S502、若第一认证结果为身份认证未通过,则确定第二ECU对第一ECU的身份认证未通过。
本申请实施例中,若第一ECU接收到第一认证结果,且第一认证结果为身份认证未通过,则第一ECU可以确定第二ECU对第一ECU的身份认证未通过,即第一ECU接收到的第一认证结果如果为身份认证未通过,则第一ECU后续不向第二ECU发送通信数据,提高通信数据的安全性。
需要说明的是,若第一ECU接收到的第一认证结果为身份认证未通过,则第一ECU即使已经接收到第二ECU发送的第二子信息,也不用将第二子信息与第三子信息进行比对,即无需对第二ECU的身份进行认证,可以接着对其他ECU进行身份认证,从而提高通信认证效率。
在一些实施例中,第一ECU可以是主动发起身份认证请求的ECU,主动发起身份认证请求的ECU可以为主动向另一个ECU发送数据的ECU。例如如图6所示,图6是本申请实施例提供的一种身份认证请求发送方法的流程示意图。在上述实施例的基础上,该方法包括如下步骤:
S601、向第二ECU发送第一身份认证请求;第一身份认证请求用于触发第二ECU生 成第一随机数。
其中,第一ECU可以实时向第二ECU发送第一身份认证请求。
S602、接收第二ECU发送的第一随机数,并将第一随机数作为初始数据。
第二ECU可以向第一ECU发送自身产生的第一随机数,相应的,第一ECU将接收到的第一随机数作为初始数据。第一ECU获取到初始数据后,可以基于预设密钥对初始数据进行加密得到新的加密信息,也即针对每个第一身份认证请求,第一ECU得到的加密信息可能不同,即第一ECU每次得到的加密信息中的K1可能不同,以及K3可能不同。
本申请实施例提供的方法,通过向第二ECU发送第一身份认证请求,并接收第二ECU发送的第一随机数,并将第一随机数作为初始数据,从而实现初始数据的不固定性,进而提高第二ECU对第一ECU进行身份认证得到的第一认证结果的可信度。
在一些实施例中,上述的S601、向第二ECU发送第一身份认证请求可以通过如下方式实现:
第一ECU可以每隔预设时长向第二ECU发送第一身份认证请求,例如,第一ECU每隔5秒重复向第二ECU发送一次第一身份认证请求,即车辆启动到熄火之间的一次驾驶时间段内,可以进行多次身份认证。针对第一ECU发送的每次第一身份认证请求,第二ECU会产生新的第一随机数S。
本申请实施例提供的方法,第一ECU每隔预设时长向第二ECU发送第一身份认证请求,从而使第一ECU每次接收到的第二ECU发送的第一随机数不同,进而基于第一随机数得到的初始数据不同,实现初始数据的不固定性,进而提高第二ECU对第一ECU进行身份认证得到的第一认证结果的可信度,使得整个通信过程更加安全,能够很好的抵抗重放攻击。并且,由于每隔预设时长向第二ECU发送第一身份认证请求,能够降低第一ECU发送的第一身份认证请求的次数,降低通信负载率。
在一些实施例中,若第一ECU为主动发起身份认证请求的ECU,则在第一ECU和第二ECU之间的双向身份认证结果为双向身份认证通过的情况下,第一ECU可以主动向第二ECU发送通信报文,向第二ECU发送通信报文的步骤如下:
若双向身份认证结果为双向身份认证通过,则向第二ECU发送通信报文;通信报文包括通信数据和校验信息,校验信息根据加密信息确定,校验信息用于供第二ECU对通信数据进行校验。其中,一帧通信报文的格式如图7所示,图7是本申请实施例提供的一种通信报文格式示意图。
本申请实施例中,在双向身份认证结果为双向身份认证通过的情况下,第一ECU向第二ECU发送通信报文,并且通信报文中包括的校验信息根据加密信息确定,从而可以提高整个通信过程的安全性,能够很好的抵抗重放攻击。
例如,若加密信息为上述实施例介绍的8字节的加密信息,该加密信息包括第一子信 息K1和第三子信息K3,则校验信息可以包括K1中的部分信息和/或K3中的部分信息。例如,校验信息包括中第一子信息K1中的高4比特位和第三子信息K3中的低4比特位。
需要说明的是,若第一ECU将接收的第二ECU发送的第一随机数作为初始数据,由于每次的第一认证请求对应的第一随机数可能不同,因此,初始数据可能不同,使得每次的第一认证请求对应的加密信息不同,校验信息也会随加密信息变化二变化,这样可以使得整个通信过程更加安全,能够很好的抵抗重放攻击。
在一些实施例中,校验信息包括第一校验信息和/或第二校验信息,第一校验信息为第一子信息中位于第三预设区域范围内的信息,第二校验信息为第三子信息中位于第四预设区域范围的信息。
其中,第三预设区域范围可以为第一子信息中的部分区域或全部区域,第四预设区域范围可以为第三子信息中的部分区域或全部区域。
例如,以第三预设区域范围为第一子信息中的部分区域,第四预设区域范围为第三子信息中的部分区域为例,则第一校验信息可以为由第一子信息的高4比特位组成,第三预设区域范围指第一子信息中高4比特位所在的区域范围;第二校验信息可以为第三子信息的低4比特位组成,第四预设区域范围指第三子信息中低4比特位所在的区域范围,此种情况下,可以减少校验信息的数据量,提高校验效率。如图8所示,图8是本申请实施例提供的校验信息格式的示意图,图8中示出的校验信息为1字节,该1字节的高4比特位作为第一校验信息,该1字节的低4比特位作为第二校验信息,该高4比特位为第一子信息中的高4比特位,该低4比特位为第三子信息中的低4比特位。
或者,第一校验信息可以为由第一子信息的高4比特位组成,第三预设区域范围指第一子信息中高4比特位所在的区域范围;第二校验信息可以为第三子信息的高4比特位组成,第四预设区域范围指第三子信息中高4比特位所在的区域范围。
本申请实施例中,通过在通信包括中增加包括第一校验信息和/或第二校验信息的校验信息,从而提高了通信数据的安全性。
为了对第一ECU和第二ECU之间的双向身份认证过程进行更清楚的介绍,下面结合图9进行说明,图9是本申请实施例提供的一种双向身份认证方法的信令流程图。本实施例中以第一ECU主动向第二ECU发送身份认证请求为例。
S901、第一ECU向第二ECU发送第一身份认证请求。
相应的,第二ECU接收第一ECU发送的第一身份认证请求。
S902、第二ECU响应于第一身份认证请求生成第一随机数。
S903、第二ECU向第一ECU发送第一随机数。
第二ECU向第一ECU发送第一随机数,向第一ECU发起挑战。
S904、第二ECU将第一随机数作为初始数据,采用预先存储的预设密钥对初始数据 进行加密得到认证信息,并将认证信息分为第四子信息和第二子信息。
其中,第四子信息可以为从认证信息的最高比特位开始的预设长度的子信息,第二子信息K可以为从认证信息的最低比特位开始的预设长度的子信息。例如,第四子信息为上述实施例中举例介绍的K4,第二子信息为K2,即第二ECU将认证信息分为高4字节的K4和低4字节的K2。
S905、第一ECU将第一随机数作为初始数据,基于预设密钥对获取的初始数据进行加密得到加密信息,并将加密信息分解为第一子信息和第三子信息。
其中,第一子信息可以为上述实施例中介绍的K1,第三子信息可以为上述实施例中介绍的K3。
S906、第一ECU向第二ECU发送第一子信息。
相应的,第二ECU接收第一ECU发送的第一子信息。
S907、第二ECU将接收到的第一子信息与第四子信息进行比对,得到第一认证结果。
若第一子信息与第四子信息一致,则确定第一认证结果为身份认证通过。若第一子信息与第四子信息不一致,则确定第一认证结果为身份认证未通过。若第一认证结果为身份认证通过,则可以第二ECU可以向第一ECU发送第一认证结果和第二子信息。
S908、第二ECU向第一ECU发送第一认证结果和第二子信息。
相应的,第一ECU接收第二ECU发送的第一认证结果和第二子信息。
S909、第一ECU将第二子信息与加密信息中的第三子信息进行比对。
若第二子信息与第三子信息一致,则第一ECU确定第二ECU为可信的ECU。
S910、第一ECU向第二ECU发送通信报文。
S911、第二ECU基于认证信息和校验信息对通信报文中的通信数据进行校验。
相应的,第二ECU接收到通信报文,并基于自身计算得到的认证信息对通信报文中包括的校验信息进行校验。例如,若第一校验信息由第一子信息的高4比特位组成,第二校验信息由第三子信息的低4比特位组成,则第二ECU可以采用第四子信息中的高4比特位与第一校验信息进行比对得到第一比对结果,并采用第二子信息中的低4比特位与第二校验信息进行比对得到第二比对结果,进而根据第一比对结果和第二比对结果,确定接收到的通信报文是否为可信报文。
例如,第一比对结果为第二子信息中的低4比特位与第二校验信息一致,且第二比对结果为第二子信息中的低4比特位与第二校验信息一致,则确定接收到的通信报文为可信报文;若第一比对结果为第二子信息中的低4比特位与第二校验信息不一致,和/或,第二比对结果为第二子信息中的低4比特位与第二校验信息不一致,则确定接收到的通信报文为不可信报文。
需要说明的是,在一些实施例中,第一ECU可以是被动进行身份认证请求的ECU, 被动进行身份认证请求的ECU可以为接收第二ECU发送的数据的ECU,即第二ECU若需要主动向第一ECU发送数据,则第二ECU可以向第一ECU发送第二身份认证请求。例如如图10所示,图10是本申请实施例提供的另一种身份认证请求发送方法的流程示意图。在上述实施例的基础上,该方法包括如下步骤:
S1001、接收第二ECU发送的第二身份认证请求。
S1002、响应于第二身份认证请求生成第二随机数,并向第二ECU发送第二随机数,并将第二随机数作为初始数据。
若第一ECU接收到第二ECU发送的第二身份认证请求,则可以响应于第二身份认证请求生成第二随机数,并向第二ECU发送第二随机数,并将第二随机数作为初始数据,第一ECU采用预设密钥对初始数据进行加密得到加密信息,并且第一ECU后续执行的流程与上述实施例中介绍的第二ECU的执行流程相同,为避免重复,此处不再赘述。
本申请实施例中,第一ECU可以为主动向第二ECU发送第一身份认证请求,实现第二ECU对第一ECU进行身份认证,也可以同时被动接收第二ECU发送的第二身份认证请求,从而实现第一ECU对第二ECU进行身份认证,提高双向身份认证的效率。
在本申请实施例中,还提供了一种车辆,车辆包括如图1示出的第一ECU和第二ECU;
第一ECU,用于基于预设密钥对获取的初始数据进行加密得到加密信息;
第一ECU,用于向第二ECU发送加密信息中的第一子信息;
第二ECU,用于基于第一子信息对第一ECU进行身份认证,获得第一认证结果。
在一些实施例中,第二ECU,还用于基于预设密钥对获取的初始数据进行加密得到认证信息,基于第一子信息和认证信息中的第四子信息,对第一ECU进行身份认证,并向第一ECU发送认证信息中的第二子信息;第二子信息为认证信息中位于第二预设区域范围内的子信息,第四子信息为认证信息中位于第一预设区域范围内的子信息;
第一ECU,还用于接收第二ECU发送的第二子信息,并基于加密信息中的第三子信息、以及第二子信息,对第二ECU进行身份认证,获得第二认证结果。
其中,第二子信息为认证信息中位于第二预设区域范围内的子信息,即第二子信息在认证信息中所处的区域与第三子信息在加密信息中所处的区域对应。例如,第三子信息为加密信息的一个最低字节的信息的情况下,第二子信息为认证信息中一个最低字节的信息。
第四子信息为认证信息中位于第一预设区域范围内的子信息,即第四子信息在认证信息中所处的区域与第一子信息在加密信息中所处的区域对应。例如,第一子信息为加密信息的一个最高字节的信息的情况下,第四子信息为认证信息中一个最高字节的信息。
应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上的各 实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的身份认证方法的身份认证装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个身份认证装置实施例中的具体限定可以参见上文中对于身份认证方法的限定,在此不再赘述。
在一个实施例中,如图11所示,图11是本申请实施例提供的一种身份认证装置的结构框图,该装置1100设置于第一ECU,该装置1100包括:
加密模块1101,用于基于预设密钥对获取的初始数据进行加密得到加密信息;
第一发送模块1102,用于向第二电子控制单元ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果。
在一个实施例中,方法还包括:
第一接收模块,用于接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果;
第一确定模块,用于基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果。
在一个实施例中,第一子信息为加密信息中位于第一预设区域范围内的子信息,第三子信息为加密信息中位于第二预设区域范围内的子信息。
在一个实施例中,第一接收模块,具体用于将第二子信息与第三子信息进行比对得到比对结果;若比对结果为第二子信息与第三子信息一致,则确定第二认证结果为身份认证通过;若比对结果为第二子信息与第三子信息不一致,则确定第二认证结果为身份认证未通过。
在一个实施例中,第一确定模块,具体用于若第一认证结果为身份认证通过、且第二认证结果为身份认证通过,则确定双向身份认证结果为双向身份认证通过;若第一认证结果为身份认证通过、且第二认证结果为身份认证未通过,则确定双向身份认证结果为双向身份认证未通过。
在一个实施例中,装置1100还可以包括:
第二接收模块,用于接收第二ECU发送的第一认证结果;若第一认证结果为身份认证未通过,则确定第二ECU对第一ECU的身份认证未通过。
在一个实施例中,装置1100还可以包括:
第二发送模块,用于向第二ECU发送第一身份认证请求;第一身份认证请求用于触发第二ECU生成第一随机数;
第三接收模块,用于接收第二ECU发送的第一随机数,并将第一随机数作为初始数据。
在一个实施例中,第二发送模块,具体用于每隔预设时长向第二ECU发送第一身份认证请求。
在一个实施例中,装置1100还可以包括:
第三发送模块,用于若双向身份认证结果为双向身份认证通过,则向第二ECU发送通信报文;通信报文包括通信数据和校验信息,校验信息根据加密信息确定,校验信息用于供第二ECU对通信数据进行校验。
在一个实施例中,校验信息包括第一校验信息和/或第二校验信息,第一校验信息为第一子信息中位于第三预设区域范围内的信息,第二校验信息为第三子信息中位于第四预设区域范围的信息。
在一个实施例中,装置1100还可以包括:
第四接收模块,用于接收第二ECU发送的第二身份认证请求;
第四发送模块,用于响应于第二身份认证请求生成第二随机数,并向第二ECU发送第二随机数,并将第二随机数作为初始数据。
上述身份认证装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种电子控制单元,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:
基于预设密钥对获取的初始数据进行加密得到加密信息;
向第二电子控制单元ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果;
基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果。
在一个实施例中,第一子信息为加密信息中位于第一预设区域范围内的子信息,第三子信息为加密信息中位于第二预设区域范围内的子信息。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
将第二子信息与第三子信息进行比对得到比对结果;
若比对结果为第二子信息与第三子信息一致,则确定第二认证结果为身份认证通过;
若比对结果为第二子信息与第三子信息不一致,则确定第二认证结果为身份认证未通 过。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
若第一认证结果为身份认证通过、且第二认证结果为身份认证通过,则确定双向身份认证结果为双向身份认证通过;
若第一认证结果为身份认证通过、且第二认证结果为身份认证未通过,则确定双向身份认证结果为双向身份认证未通过。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
接收第二ECU发送的第一认证结果;
若第一认证结果为身份认证未通过,则确定第二ECU对第一ECU的身份认证未通过。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
向第二ECU发送第一身份认证请求;第一身份认证请求用于触发第二ECU生成第一随机数;
接收第二ECU发送的第一随机数,并将第一随机数作为初始数据。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
每隔预设时长向第二ECU发送第一身份认证请求。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
若双向身份认证结果为双向身份认证通过,则向第二ECU发送通信报文;通信报文包括通信数据和校验信息,校验信息根据加密信息确定,校验信息用于供第二ECU对通信数据进行校验。
在一个实施例中,校验信息包括第一子信息中位于第三预设区域范围内的第一校验信息和/或第三子信息中位于第四预设区域范围的第二校验信息。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
接收第二ECU发送的第二身份认证请求;
响应于第二身份认证请求生成第二随机数,并向第二ECU发送第二随机数,并将第二随机数作为初始数据。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
基于预设密钥对获取的初始数据进行加密得到加密信息;
向第二电子控制单元ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果;
基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果。
在一个实施例中,第一子信息为加密信息中位于第一预设区域范围内的子信息,第三子信息为加密信息中位于第二预设区域范围内的子信息。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
将第二子信息与第三子信息进行比对得到比对结果;
若比对结果为第二子信息与第三子信息一致,则确定第二认证结果为身份认证通过;
若比对结果为第二子信息与第三子信息不一致,则确定第二认证结果为身份认证未通过。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
若第一认证结果为身份认证通过、且第二认证结果为身份认证通过,则确定双向身份认证结果为双向身份认证通过;
若第一认证结果为身份认证通过、且第二认证结果为身份认证未通过,则确定双向身份认证结果为双向身份认证未通过。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
接收第二ECU发送的第一认证结果;
若第一认证结果为身份认证未通过,则确定第二ECU对第一ECU的身份认证未通过。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
向第二ECU发送第一身份认证请求;第一身份认证请求用于触发第二ECU生成第一随机数;
接收第二ECU发送的第一随机数,并将第一随机数作为初始数据。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
每隔预设时长向第二ECU发送第一身份认证请求。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
若双向身份认证结果为双向身份认证通过,则向第二ECU发送通信报文;通信报文包括通信数据和校验信息,校验信息根据加密信息确定,校验信息用于供第二ECU对通信数据进行校验。
在一个实施例中,校验信息包括第一校验信息和/或第二校验信息,第一校验信息为第一子信息中位于第三预设区域范围内的信息,第二校验信息为第三子信息中位于第四预设区域范围的信息。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
接收第二ECU发送的第二身份认证请求;
响应于第二身份认证请求生成第二随机数,并向第二ECU发送第二随机数,并将第二随机数作为初始数据。
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:
基于预设密钥对获取的初始数据进行加密得到加密信息;
向第二电子控制单元ECU发送加密信息中的第一子信息;第一子信息用于第二ECU对第一ECU进行身份认证,获得第一认证结果。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
接收第二ECU发送的第二子信息和第一认证结果,并基于第二子信息、以及加密信息中的第三子信息,对第二ECU进行身份认证,获得第二认证结果;
基于第一认证结果和第二认证结果,确定第一ECU与第二ECU的双向身份认证结果。
在一个实施例中,第一子信息为加密信息中位于第一预设区域范围内的子信息,第三子信息为加密信息中位于第二预设区域范围内的子信息。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
将第二子信息与第三子信息进行比对得到比对结果;
若比对结果为第二子信息与第三子信息一致,则确定第二认证结果为身份认证通过;
若比对结果为第二子信息与第三子信息不一致,则确定第二认证结果为身份认证未通过。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
若第一认证结果为身份认证通过、且第二认证结果为身份认证通过,则确定双向身份认证结果为双向身份认证通过;
若第一认证结果为身份认证通过、且第二认证结果为身份认证未通过,则确定双向身份认证结果为双向身份认证未通过。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
接收第二ECU发送的第一认证结果;
若第一认证结果为身份认证未通过,则确定第二ECU对第一ECU的身份认证未通过。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
向第二ECU发送第一身份认证请求;第一身份认证请求用于触发第二ECU生成第一随机数;
接收第二ECU发送的第一随机数,并将第一随机数作为初始数据。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
每隔预设时长向第二ECU发送第一身份认证请求。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
若双向身份认证结果为双向身份认证通过,则向第二ECU发送通信报文;通信报文 包括通信数据和校验信息,校验信息根据加密信息确定,校验信息用于供第二ECU对通信数据进行校验。
在一个实施例中,校验信息包括第一校验信息和/或第二校验信息,第一校验信息为第一子信息中位于第三预设区域范围内的信息,第二校验信息为第三子信息中位于第四预设区域范围的信息。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
接收第二ECU发送的第二身份认证请求;
响应于第二身份认证请求生成第二随机数,并向第二ECU发送第二随机数,并将第二随机数作为初始数据。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同 替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围,其均应涵盖在本申请的权利要求和说明书的范围当中。尤其是,只要不存在结构冲突,各个实施例中所提到的各项技术特征均可以任意方式组合起来。本申请并不局限于文中公开的特定实施例,而是包括落入权利要求的范围内的所有技术方案。

Claims (17)

  1. 一种身份认证方法,其中,所述方法应用于第一电子控制单元ECU,所述方法包括:
    基于预设密钥对获取的初始数据进行加密得到加密信息;
    向第二电子控制单元ECU发送所述加密信息中的第一子信息;所述第一子信息用于所述第二ECU对所述第一ECU进行身份认证,获得第一认证结果。
  2. 根据权利要求1所述的方法,其中,所述方法还包括:
    接收所述第二ECU发送的第二子信息和所述第一认证结果,并基于所述第二子信息、以及所述加密信息中的第三子信息,对所述第二ECU进行身份认证,获得第二认证结果;
    基于所述第一认证结果和所述第二认证结果,确定所述第一ECU与所述第二ECU的双向身份认证结果。
  3. 根据权利要求2所述的方法,其中,所述第一子信息为所述加密信息中位于第一预设区域范围内的子信息,所述第三子信息为所述加密信息中位于第二预设区域范围内的子信息。
  4. 根据权利要求2或3所述的方法,其中,所述基于所述第二子信息、以及所述加密信息中的第三子信息,对所述第二ECU进行身份认证,获得第二认证结果,包括:
    将所述第二子信息与所述第三子信息进行比对得到比对结果;
    若所述比对结果为所述第二子信息与所述第三子信息一致,则确定所述第二认证结果为身份认证通过;
    若所述比对结果为所述第二子信息与所述第三子信息不一致,则确定所述第二认证结果为身份认证未通过。
  5. 根据权利要求2-4任一项所述的方法,其中,所述基于所述第一认证结果和所述第二认证结果,确定所述第一ECU与所述第二ECU的双向身份认证结果,包括:
    若所述第一认证结果为身份认证通过、且所述第二认证结果为身份认证通过,则确定所述双向身份认证结果为双向身份认证通过;
    若所述第一认证结果为身份认证通过、且所述第二认证结果为身份认证未通过,则确定所述双向身份认证结果为双向身份认证未通过。
  6. 根据权利要求1所述的方法,其中,所述方法还包括:
    接收所述第二ECU发送的所述第一认证结果;
    若所述第一认证结果为身份认证未通过,则确定所述第二ECU对所述第一ECU的身份认证未通过。
  7. 根据权利要求1-6任一项所述的方法,其中,所述方法还包括:
    向所述第二ECU发送第一身份认证请求;所述第一身份认证请求用于触发所述第二ECU生成第一随机数;
    接收所述第二ECU发送的所述第一随机数,并将所述第一随机数作为所述初始数据。
  8. 根据权利要求7所述的方法,其中,所述向所述第二ECU发送第一身份认证请求,包括:
    每隔预设时长向所述第二ECU发送所述第一身份认证请求。
  9. 根据权利要求2-5任一项所述的方法,其中,所述方法还包括:
    若所述双向身份认证结果为双向身份认证通过,则向所述第二ECU发送通信报文;所述通信报文包括通信数据和校验信息,所述校验信息根据所述加密信息确定,所述校验信息用于供所述第二ECU对所述通信数据进行校验。
  10. 根据权利要求9所述的方法,其中,所述校验信息包括第一校验信息和/或第二校验信息,所述第一校验信息为所述第一子信息中位于第三预设区域范围内的信息,所述第二校验信息为所述第三子信息中位于第四预设区域范围的信息。
  11. 根据权利要求1-6任一项所述的方法,其中,所述方法还包括:
    接收所述第二ECU发送的第二身份认证请求;
    响应于所述第二身份认证请求生成第二随机数,并向所述第二ECU发送所述第二随机数,并将所述第二随机数作为所述初始数据。
  12. 一种身份认证装置,其中,所述装置设置于第一ECU,所述装置包括:
    加密模块,用于基于预设密钥对获取的初始数据进行加密得到加密信息;
    发送模块,用于向第二电子控制单元ECU发送所述加密信息中的第一子信息;所述第一子信息用于所述第二ECU对所述第一ECU进行身份认证,获得第一认证结果。
  13. 一种车辆,其中,所述车辆包括第一电子控制单元ECU和第二ECU;
    所述第一ECU,用于基于预设密钥对获取的初始数据进行加密得到加密信息;
    所述第一ECU,用于向所述第二ECU发送所述加密信息中的第一子信息;
    所述第二ECU,用于基于所述第一子信息对所述第一ECU进行身份认证,获得第一认证结果。
  14. 根据权利要求13所述的车辆,其中,
    所述第二ECU,还用于基于所述预设密钥对获取的初始数据进行加密得到认证信息,基于所述第一子信息和所述认证信息中的第四子信息,对所述第一ECU进行身份认证,并向所述第一ECU发送所述认证信息中的第二子信息;所述第二子信息为所述认证信息中位于第二预设区域范围内的子信息,所述第四子信息为所述认证信息中位于第一预设区域范围内的子信息;
    所述第一ECU,还用于接收所述第二ECU发送的所述第二子信息,并基于所述加密信息中的第三子信息、以及所述第二子信息,对所述第二ECU进行身份认证,获得第二认证结果。
  15. 一种电子控制单元,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现权利要求1至11中任一项所述的方法的步骤。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至11中任一项所述的方法的步骤。
  17. 一种计算机程序产品,包括计算机程序,其中,该计算机程序被处理器执行时实现权利要求1至11中任一项所述的方法的步骤。
PCT/CN2023/133558 2023-04-06 2023-11-23 身份认证方法、装置、车辆、电子控制单元和存储介质 Ceased WO2024207754A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310361154.2 2023-04-06
CN202310361154.2A CN118784251A (zh) 2023-04-06 2023-04-06 身份认证方法、装置、车辆、电子控制单元和存储介质

Publications (1)

Publication Number Publication Date
WO2024207754A1 true WO2024207754A1 (zh) 2024-10-10

Family

ID=92970879

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/133558 Ceased WO2024207754A1 (zh) 2023-04-06 2023-11-23 身份认证方法、装置、车辆、电子控制单元和存储介质

Country Status (2)

Country Link
CN (1) CN118784251A (zh)
WO (1) WO2024207754A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109921908A (zh) * 2019-02-13 2019-06-21 北京仁信证科技有限公司 一种can总线身份认证方法及身份认证系统
US20190288849A1 (en) * 2016-07-18 2019-09-19 The Regents Of The University Of Michigan Hash-chain based sender identification scheme
CN111813078A (zh) * 2020-06-24 2020-10-23 北京天融信网络安全技术有限公司 一种车辆的安全诊断方法、装置、设备及介质
CN111865922A (zh) * 2020-06-23 2020-10-30 国汽(北京)智能网联汽车研究院有限公司 一种通信方法、装置、设备及存储介质
CN113132098A (zh) * 2021-03-12 2021-07-16 北京航空航天大学 面向大规模车内网络的可扩展can总线安全通信方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190288849A1 (en) * 2016-07-18 2019-09-19 The Regents Of The University Of Michigan Hash-chain based sender identification scheme
CN109921908A (zh) * 2019-02-13 2019-06-21 北京仁信证科技有限公司 一种can总线身份认证方法及身份认证系统
CN111865922A (zh) * 2020-06-23 2020-10-30 国汽(北京)智能网联汽车研究院有限公司 一种通信方法、装置、设备及存储介质
CN111813078A (zh) * 2020-06-24 2020-10-23 北京天融信网络安全技术有限公司 一种车辆的安全诊断方法、装置、设备及介质
CN113132098A (zh) * 2021-03-12 2021-07-16 北京航空航天大学 面向大规模车内网络的可扩展can总线安全通信方法及装置

Also Published As

Publication number Publication date
CN118784251A (zh) 2024-10-15

Similar Documents

Publication Publication Date Title
CN110268691B (zh) 具有经验证的区块链和共识协议的联盟区块链网络
US11184164B2 (en) Secure crypto system attributes
AU2013101034B4 (en) Registration and authentication of computing devices using a digital skeleton key
WO2021013245A1 (zh) 一种数据密钥保护方法、系统及电子设备和存储介质
CN103246842A (zh) 用于验证和数据加密的方法和设备
CN114553557B (zh) 密钥调用方法、装置、计算机设备和存储介质
CN110868294B (zh) 一种密钥更新方法、装置及设备
CN114666151B (zh) 设备绑定方法、装置、终端、物联网设备及存储介质
WO2020000491A1 (zh) 一种文件存储方法、装置及存储介质
CN114944949B (zh) 一种基于区块链的数据授权方法、系统、装置及存储介质
CN116248390B (zh) 服务器登录验证方法、装置、计算机设备和存储介质
CN115865448B (zh) 一种数据自加密装置和方法
CN112653553A (zh) 物联网设备身份管理系统
CN117692134A (zh) 密钥更新管理系统和密钥更新管理方法
CN115514492B (zh) Bios固件验证方法、装置、服务器、存储介质和程序产品
WO2023070831A1 (zh) 一种区块确认方法及装置
CN114049121B (zh) 基于区块链的账户重置方法和设备
WO2026103126A1 (zh) 身份认证方法和系统
CN118540059A (zh) 密钥生成方法、装置、设备、介质及程序产品
CN115348107B (zh) 物联网设备安全登陆方法、装置、计算机设备和存储介质
JP7545490B2 (ja) 情報検証装置、電子制御装置、及び情報検証方法
CN118784251A (zh) 身份认证方法、装置、车辆、电子控制单元和存储介质
CN116366289B (zh) 无人机遥感数据的安全监管方法及装置
CN115001864B (zh) 智能家具的通信认证方法、装置、计算机设备和存储介质
CN114650182B (zh) 身份认证方法、系统、装置、网关设备、设备和终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23931800

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 23931800

Country of ref document: EP

Kind code of ref document: A1