CN117597688A - Key verification method and related device - Google Patents
Key verification method and related device Download PDFInfo
- Publication number
- CN117597688A CN117597688A CN202180100210.6A CN202180100210A CN117597688A CN 117597688 A CN117597688 A CN 117597688A CN 202180100210 A CN202180100210 A CN 202180100210A CN 117597688 A CN117597688 A CN 117597688A
- Authority
- CN
- China
- Prior art keywords
- key
- information
- verification
- integrity
- ecu
- 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.)
- Pending
Links
- 238000012795 verification Methods 0.000 title claims abstract description 324
- 238000000034 method Methods 0.000 title claims abstract description 210
- 230000006870 function Effects 0.000 claims description 153
- 230000015654 memory Effects 0.000 claims description 44
- 238000004590 computer program Methods 0.000 claims description 20
- 230000004044 response Effects 0.000 abstract description 18
- 238000004422 calculation algorithm Methods 0.000 description 99
- 238000007726 management method Methods 0.000 description 77
- 238000013461 design Methods 0.000 description 46
- 230000008569 process Effects 0.000 description 30
- 238000004891 communication Methods 0.000 description 26
- 230000011664 signaling Effects 0.000 description 23
- 238000004364 calculation method Methods 0.000 description 18
- 238000004519 manufacturing process Methods 0.000 description 18
- 230000007246 mechanism Effects 0.000 description 18
- 238000009795 derivation Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 238000012423 maintenance Methods 0.000 description 6
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000008439 repair process Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013478 data encryption standard Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Lock And Its Accessories (AREA)
Abstract
Description
本申请实施例涉及信息安全领域,尤其涉及一种密钥验证方法及相关装置。Embodiments of the present application relate to the field of information security, and in particular, to a key verification method and related devices.
信息安全是自动驾驶的前提。目前整车系统中可以通过多种功能密钥来保护整车的信息安全。例如,可通过板端加密通讯(security onboard communication,SecOC)密钥(SecOC key)来保护车载通信网络的安全,也可通过用于设备认证的设备密钥(device key)来保证设备的真实性等。Information security is a prerequisite for autonomous driving. Currently, various function keys can be used in the vehicle system to protect the information security of the vehicle. For example, the security of the in-vehicle communication network can be protected through the security onboard communication (SecOC) key (SecOC key), and the authenticity of the device can also be ensured through the device key (device key) used for device authentication. wait.
一般来说,功能密钥的正常使用需要通过认证密钥的认证,因此如何保证认证密钥的完整性,进而保证功能密钥的正常使用是本领域技术人员亟待解决的技术问题。Generally speaking, the normal use of the function key requires authentication by the authentication key. Therefore, how to ensure the integrity of the authentication key and thereby ensure the normal use of the function key is an urgent technical problem that needs to be solved by those skilled in the art.
发明内容Contents of the invention
本申请实施例公开了一种密钥验证方法及相关装置,可以实现认证密钥的完整性验证,进而保证功能密钥的正常使用以及整车的信息安全。The embodiment of the present application discloses a key verification method and related devices, which can realize the integrity verification of the authentication key, thereby ensuring the normal use of the function key and the information security of the entire vehicle.
第一方面,提供了一种密钥验证方法,该方法可以由电子控制单元或配置于电子控制单元中的芯片执行。该方法包括:通过客户端接收第一信息,所述第一信息来自密钥管理实体,所述第一信息通过第二密钥的信息指示第一密钥,所述第二密钥被配置用于认证第一电子控制单元的至少一个功能密钥,所述至少一个功能密钥对应所述第一电子控制单元的至少一个业务功能;接收来自所述客户端的第一验证参数;根据所述第二密钥和所述第一验证参数,生成第一验证信息,所述第一验证信息用于表征所述第一密钥的完整性;向所述客户端发送所述第一验证信息。In a first aspect, a key verification method is provided, which method can be executed by an electronic control unit or a chip configured in the electronic control unit. The method includes: receiving, by a client, first information from a key management entity, the first information indicating a first key through information of a second key, the second key being configured with For authenticating at least one function key of the first electronic control unit, the at least one function key corresponding to at least one business function of the first electronic control unit; receiving a first verification parameter from the client; according to the first The second key and the first verification parameter are used to generate first verification information, and the first verification information is used to characterize the integrity of the first key; and the first verification information is sent to the client.
在一种可选的设计中,该方法也可以由包含电子控制单元的功能部件或配置于该功能部件中的芯片执行。示例性地,该功能部件为包含一个或多个电子控制单元的域控制器。In an optional design, the method may also be executed by a functional component including an electronic control unit or a chip configured in the functional component. Illustratively, the functional component is a domain controller containing one or more electronic control units.
根据本申请提供的密钥验证方法,由于用于表征第一密钥完整性的第一验证信息是基于第二密钥和第一验证参数得到的,因此,可以通过第一密钥的完整性间接验证第二密钥的完整性,保证第二密钥的完整性以及安全性,进而保证功能密钥的正常使用以及整车的信息安全。此外,又由于第一信息是通过第二密钥的信息指示第一密钥且第一信息是由客户端通过密钥管理实体转发给第一电子控制单元,因此避免了第二密钥以明文形式暴露在密钥管理实体和电子控制单元之外,进而保证了整车厂核心资产的安全。According to the key verification method provided by this application, since the first verification information used to characterize the integrity of the first key is obtained based on the second key and the first verification parameter, the integrity of the first key can be Indirectly verify the integrity of the second key to ensure the integrity and security of the second key, thereby ensuring the normal use of the function key and the information security of the entire vehicle. In addition, since the first information indicates the first key through the information of the second key and the first information is forwarded by the client to the first electronic control unit through the key management entity, it is avoided that the second key is expressed in plain text. The form is exposed outside the key management entity and electronic control unit, thereby ensuring the security of the OEM's core assets.
结合第一方面,在第一方面的某些实现方式中,该方法还包括:接收来自所述客户端的第五信息,所述第五信息来自密钥管理实体,所述第五信息通过第五密钥的信息指示所述第二密钥,其中,所述第五密钥用于认证所述第二密钥。In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving fifth information from the client, the fifth information coming from the key management entity, and the fifth information passing through a fifth The information of the key indicates the second key, wherein the fifth key is used to authenticate the second key.
采用该方案,可以先通过第五信息,将第二密钥写入第一电子控制单元,可以满足整车产线和/或整车厂授权的维修方将第二密钥正确写入第一电子控制单元的需求,进而为后续功能密钥的写入提供认证条件,保证功能密钥的正常使用以及整车的信息安全。Using this solution, the second key can be written into the first electronic control unit through the fifth information, which can satisfy the requirements of the vehicle production line and/or the maintenance party authorized by the vehicle manufacturer to correctly write the second key into the first electronic control unit. The requirements of the electronic control unit will provide authentication conditions for subsequent writing of function keys, ensuring the normal use of function keys and the information security of the entire vehicle.
结合第一方面,在第一方面的某些实现方式中,该方法还包括:根据所述第一信息和挑战-应答机制,生成第九信息,所述第九信息包括用于验证所述第一密钥完整性的信息; 向所述客户端发送所述第九信息。In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: generating ninth information according to the first information and the challenge-response mechanism, the ninth information including a method for verifying the first Key integrity information; sending the ninth information to the client.
该方案中,基于挑战-应答机制生成的第九信息可以实现对第一密钥的完整性验证,简化了验证流程,提高了验证效率。In this solution, the ninth information generated based on the challenge-response mechanism can realize the integrity verification of the first key, simplifying the verification process and improving verification efficiency.
结合第一方面,在第一方面的某些实现方式中,该方法还包括:根据所述第五信息和挑战-应答机制,生成第十信息,所述第十信息包括用于验证所述第二密钥完整性的信息;向所述客户端发送所述第十信息。In connection with the first aspect, in some implementations of the first aspect, the method further includes: generating tenth information according to the fifth information and the challenge-response mechanism, the tenth information including a method for verifying the first 2. Key integrity information; sending the tenth information to the client.
该方案中,基于挑战-应答机制生成的第十信息可以实现对第二密钥的完整性验证,简化了验证流程,提高了验证效率。In this solution, the tenth information generated based on the challenge-response mechanism can realize the integrity verification of the second key, simplifying the verification process and improving verification efficiency.
在一种可选的设计中,所述第一验证信息包括通过所述第一密钥对所述第一验证参数进行完整性保护得到的信息。由于第一信息是通过第二密钥的信息来指示第一密钥,因此只有当第一电子控制单元本地保存的第二密钥与密钥管理实体保存的第二密钥一致时,第一密钥才能基于第一信息被正确写入到该第一电子控制单元中。基于此,通过所述第一密钥对所述第一验证参数进行完整性保护得到的信息,可以实现对第二密钥完整性的间接验证。In an optional design, the first verification information includes information obtained by performing integrity protection on the first verification parameter using the first key. Since the first information indicates the first key through the information of the second key, only when the second key saved locally by the first electronic control unit is consistent with the second key saved by the key management entity, the first Only then can the key be correctly written into the first electronic control unit based on the first information. Based on this, indirect verification of the integrity of the second key can be achieved through the information obtained by integrity protecting the first verification parameter with the first key.
第二方面,提供了一种密钥验证方法,该方法可以由密钥管理实体或配置于密钥管理实体中的芯片执行。该方法包括:生成第一信息和第二验证信息,所述第一信息通过第二密钥的信息指示第一密钥,所述第二密钥被配置用于认证第一电子控制单元的至少一个功能密钥,所述至少一个功能密钥对应所述第一电子控制单元的至少一个业务功能,所述第二验证信息包括用于所述第一密钥的完整性验证的信息;向客户端发送所述第一信息和所述第二验证信息。In the second aspect, a key verification method is provided, which method can be executed by a key management entity or a chip configured in the key management entity. The method includes generating first information and second verification information, the first information being indicative of a first key through information of a second key, the second key being configured to authenticate at least one of the first electronic control units. A function key, the at least one function key corresponds to at least one business function of the first electronic control unit, and the second verification information includes information for integrity verification of the first key; to the customer The terminal sends the first information and the second verification information.
在一种可选的设计中,所述密钥管理实体包括密钥管理服务器(key management server,KMS)。In an optional design, the key management entity includes a key management server (KMS).
根据本申请提供的密钥验证方法,通过向客户端发送指示第一密钥的第一信息和可以用于第一密钥完整性验证的第二验证信息,可以实现第一密钥的写入以及对第一密钥完整性的验证。又由于第一信息通过第二密钥的信息指示第一密钥,因此,通过对第一密钥完整性的验证可以间接验证第二密钥的完整性,保证第二密钥的安全。另一方面,又由于第一信息是由密钥管理实体发送给客户端且第一信息是通过第二密钥的信息指示第一密钥,因此避免了第二密钥以明文形式暴露在密钥管理实体和电子控制单元之外,进而保证了整车厂核心资产的安全。此外,通过第一密钥的完整性间接验证第二密钥的完整性不需要依赖电子控制单元的标识信息,因此不需要整车产线提前收集待更新第二密钥的所有目标电子控制单元的标识信息,降低了整车产线的负担和管理成本。According to the key verification method provided by this application, writing of the first key can be achieved by sending first information indicating the first key and second verification information that can be used for integrity verification of the first key to the client. and verification of the integrity of the first key. And because the first information indicates the first key through the information of the second key, the integrity of the second key can be indirectly verified by verifying the integrity of the first key, ensuring the security of the second key. On the other hand, since the first information is sent to the client by the key management entity and the first information indicates the first key through the information of the second key, it is avoided that the second key is exposed in the form of plain text. In addition to key management entities and electronic control units, it ensures the security of the core assets of the OEM. In addition, indirectly verifying the integrity of the second key through the integrity of the first key does not need to rely on the identification information of the electronic control unit, so the vehicle production line does not need to collect in advance all target electronic control units that need to update the second key. The identification information reduces the burden and management costs of the vehicle production line.
通过该方案,密钥管理实体还可以预先准备好用于第一密钥完整性验证的信息(例如第一信息,第二验证信息),并提前将其发送给客户端,基于此可以实现对电子控制单元的认证密钥(即第二密钥)的离线验证,即使不依赖于KMS,也可以实现对第二密钥完整性的实时验证,减少了时间开销。Through this solution, the key management entity can also prepare the information for the first key integrity verification (such as the first information, the second verification information) in advance and send it to the client in advance. Based on this, the Offline verification of the electronic control unit's authentication key (i.e., the second key), even if it does not rely on KMS, can achieve real-time verification of the integrity of the second key, reducing time overhead.
在一种可选的设计中,所述第二验证信息包括所述第一密钥,以使得所述客户端根据所述第一密钥再结合本地生成的第一验证参数,确定本地验证信息,其中,该本地验证信息可以用于所述第一密钥和/或所述第二密钥的完整性验证;或者,所述第二验证信息包括 第二验证参数,以及通过所述第一密钥对所述第二验证参数进行完整性保护得到的信息。In an optional design, the second verification information includes the first key, so that the client determines the local verification information based on the first key combined with a locally generated first verification parameter. , wherein the local verification information can be used for integrity verification of the first key and/or the second key; or the second verification information includes a second verification parameter, and the second verification information is passed through the first key. Information obtained by performing integrity protection on the second verification parameter using the key.
结合第二方面,在第二方面的某些实现方式中,该方法还包括:向所述客户端发送第五信息,所述第五信息通过第五密钥的信息指示所述第二密钥,其中,所述第五密钥用于认证所述第二密钥。In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: sending fifth information to the client, the fifth information indicating the second key through information of the fifth key , wherein the fifth key is used to authenticate the second key.
通过该方案,可以实现第二密钥的写入,从而满足整车产线和/或整车厂授权的维修方将第二密钥正确写入第一电子控制单元的需求,进而为后续功能密钥的写入提供认证条件,保证功能密钥的正常使用以及整车的信息安全。此外,该方案可以适配于第二密钥待写入的各种场景,通过适配于各种场景的统一解决方案,可以简化密钥管理实体或整车厂的密钥管理流程,简化密钥写入流程。Through this solution, the writing of the second key can be realized, thereby meeting the needs of the vehicle production line and/or the maintenance party authorized by the vehicle manufacturer to correctly write the second key into the first electronic control unit, thereby providing sufficient support for subsequent functions. The writing of the key provides authentication conditions to ensure the normal use of the function key and the information security of the entire vehicle. In addition, this solution can be adapted to various scenarios where the second key needs to be written. Through a unified solution adapted to various scenarios, the key management process of the key management entity or the OEM can be simplified. Key writing process.
结合第二方面,在第二方面的某些实现方式中,该方法还包括:接收来自所述客户端的第二密钥更新请求信息,所述第二密钥更新请求信息用于请求更新所述第二密钥,或者用于请求验证所述第一电子控制单元本地保存的第二密钥的完整性。In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: receiving second key update request information from the client, the second key update request information being used to request to update the the second key, or used to request verification of the integrity of the second key stored locally in the first electronic control unit.
通过该方案,通过该第二密钥更新请求信息,生成适配于第二密钥更新或第二密钥完整性验证的信息,进而实现第二密钥的完整性验证,保证功能密钥的正常使用以及整车的信息安全。Through this solution, the second key update request information is used to generate information adapted to the second key update or the second key integrity verification, thereby realizing the integrity verification of the second key and ensuring the function key's integrity. Normal use and vehicle information security.
结合第二方面,在第二方面的某些实现方式中,该方法还包括:接收来自所述客户端的所述第二密钥的更新结果。In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: receiving an update result of the second key from the client.
通过该方案,可以获知该第二密钥的更新情况,进而判断功能密钥是否能被写入,以此保证功能密钥的正常使用以及整车的信息安全。Through this solution, the update status of the second key can be known, and then it can be determined whether the function key can be written, thereby ensuring the normal use of the function key and the information security of the entire vehicle.
第三方面,提供了一种密钥验证方法,该方法可以由客户端或配置于客户端中的芯片执行。该方法包括:接收来自密钥管理实体的第一信息;向第一电子控制单元发送所述第一信息,所述第一信息通过第二密钥的信息指示第一密钥,所述第二密钥被配置用于认证所述第一电子控制单元的至少一个功能密钥,所述至少一个功能密钥对应所述第一电子控制单元的至少一个业务功能;向所述第一电子控制单元发送第一验证参数,所述第一验证参数用于验证所述第一密钥的完整性;接收来自所述第一电子控制单元的第一验证信息,所述第一验证信息用于表征所述第一密钥的完整性;根据本地验证信息与所述第一验证信息,确定所述第二密钥的完整性,其中所述本地验证信息包括通过所述第一密钥对所述第一验证参数进行完整性保护得到的信息。In the third aspect, a key verification method is provided, which method can be performed by the client or a chip configured in the client. The method includes: receiving first information from a key management entity; sending said first information to a first electronic control unit, said first information indicating a first key through information of a second key, said second The key is configured to authenticate at least one function key of the first electronic control unit, the at least one function key corresponding to at least one business function of the first electronic control unit; to the first electronic control unit Send a first verification parameter, the first verification parameter is used to verify the integrity of the first key; receive first verification information from the first electronic control unit, the first verification information is used to characterize the The integrity of the first key; determining the integrity of the second key according to local verification information and the first verification information, wherein the local verification information includes pairing the third key with the first key. A verification parameter is used to perform integrity protection on the information obtained.
在一种可选的设计中,所述客户端包括OEM密钥刷写装置,或者包括经销商诊断仪。In an optional design, the client includes an OEM key flashing device or a dealer diagnostic instrument.
通过该方案,客户端作为密钥管理实体与第一电子控制单元之间的中间介质,可以将来密钥管理实体的第一信息转发给第一电子控制单元,进而实现第一密钥在第一电子控制单元侧的写入,再根据本地验证信息通过验证第一密钥的完整性间接实现对第二密钥完整性的验证。由于第一信息是通过第二密钥的信息指示第一密钥,因此保证了第二密钥不以明文形式暴露在密钥管理实体和电子控制单元之外,进而保证了整车厂核心资产的安全。此外,通过客户端作为中间介质实现对第二密钥的完整性验证,实现简单,适配整车产线组装、售后维修场景以及零部件开发商密钥刷写场景,进而可以降低密钥管理实体或整车厂的管理成本。Through this solution, the client serves as an intermediary between the key management entity and the first electronic control unit, and can forward the first information of the key management entity to the first electronic control unit, thereby realizing the first key in the first electronic control unit. Writing on the electronic control unit side indirectly verifies the integrity of the second key by verifying the integrity of the first key based on the local verification information. Since the first information indicates the first key through the information of the second key, it is ensured that the second key is not exposed in plain text outside the key management entity and the electronic control unit, thus ensuring that the core assets of the OEM safety. In addition, the integrity verification of the second key is implemented through the client as an intermediate medium, which is simple to implement and adapts to vehicle production line assembly, after-sales maintenance scenarios, and parts developer key rewriting scenarios, thereby reducing key management Entity or OEM administrative costs.
在一种可选的设计中,所述第一验证参数来自所述密钥管理实体,例如对应于来自所 述密钥管理实体的第二验证参数,即客户端将来自所述密钥管理实体的第二验证参数转发给第一电子控制单元,用于验证所述第一密钥的完整性;或者,所述第一验证参数包括所述客户端生成的信息。In an optional design, the first verification parameter comes from the key management entity, for example, corresponds to the second verification parameter from the key management entity, that is, the client will come from the key management entity The second verification parameter is forwarded to the first electronic control unit for verifying the integrity of the first key; or the first verification parameter includes information generated by the client.
在一种可选的设计中,所述本地验证信息来自所述密钥管理实体,例如对应于来自所述密钥管理实体的通过所述第一密钥对所述第二验证参数进行完整性保护得到的信息;或者所述本地验证信息是由所述客户端确定的信息。In an optional design, the local verification information comes from the key management entity, for example, corresponds to the integrity of the second verification parameter through the first key from the key management entity. The obtained information is protected; or the local verification information is information determined by the client.
结合第三方面,在第三方面的某些实现方式中,根据本地验证信息与所述第一验证信息,确定所述第二密钥的完整性,包括:若本地验证信息与所述第一验证信息匹配,则确定所述第二密钥是完整的;或者,若本地验证信息与所述第一验证信息不匹配,则确定所述第二密钥是不完整的。Combined with the third aspect, in some implementations of the third aspect, determining the integrity of the second key according to the local verification information and the first verification information includes: if the local verification information and the first verification information If the verification information matches, it is determined that the second key is complete; or, if the local verification information does not match the first verification information, it is determined that the second key is incomplete.
通过该方案,客户端可以实现对第二密钥完整性的判断,进而判断功能密钥是否能被写入,以此保证功能密钥的正常使用。Through this solution, the client can judge the integrity of the second key, and then judge whether the function key can be written, thereby ensuring the normal use of the function key.
结合第三方面,在第三方面的某些实现方式中,所述方法还包括:向所述第一电子控制单元发送第五信息,所述第五信息通过第五密钥的信息指示所述第二密钥,其中,所述第五密钥用于认证所述第二密钥。In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: sending fifth information to the first electronic control unit, the fifth information indicating the A second key, wherein the fifth key is used to authenticate the second key.
通过该方案,可以满足整车产线和/或整车厂授权的维修方将第二密钥正确写入第一电子控制单元的需求,进而为后续功能密钥的写入提供认证条件,保证功能密钥的正常使用以及整车的信息安全。Through this solution, it can meet the needs of the vehicle production line and/or the maintenance party authorized by the vehicle manufacturer to correctly write the second key into the first electronic control unit, thereby providing authentication conditions for subsequent writing of the function key, ensuring Normal use of function keys and information security of the entire vehicle.
结合第三方面,在第三方面的某些实现方式中,所述方法还包括:向所述密钥管理实体发送来自所述第一电子控制单元的第九信息,所述第九信息包括用于验证所述第一密钥完整性的信息;所述客户端不解析所述第九信息。In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: sending ninth information from the first electronic control unit to the key management entity, the ninth information including using Information for verifying the integrity of the first key; the client does not parse the ninth information.
通过该方案,可以使密钥管理实体获取第一密钥的完整性验证结果,且客户端不解析所述第九信息还可以保证第一密钥的安全性,简化客户端操作。Through this solution, the key management entity can obtain the integrity verification result of the first key, and the client can ensure the security of the first key without parsing the ninth information, simplifying client operations.
结合第三方面,在第三方面的某些实现方式中,所述方法还包括:向所述密钥管理实体发送来自所述第一电子控制单元的第十信息,所述第十信息包括用于验证所述第二密钥完整性的信息;所述客户端不解析所述第十信息。In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: sending tenth information from the first electronic control unit to the key management entity, the tenth information including Information for verifying the integrity of the second key; the client does not parse the tenth information.
通过该方案,可以使密钥管理实体获取第二密钥的完整性验证结果,且客户端不解析所述第十信息还可以保证第一密钥的安全性,简化客户端操作。Through this solution, the key management entity can obtain the integrity verification result of the second key, and the client can ensure the security of the first key without parsing the tenth information, simplifying client operations.
结合第三方面,在第三方面的某些实现方式中,所述方法还包括:向所述密钥管理实体发送第二密钥更新请求信息,所述第二密钥更新请求信息用于请求更新所述第二密钥,或者用于请求验证所述第一电子控制单元本地保存的第二密钥的完整性。With reference to the third aspect, in some implementations of the third aspect, the method further includes: sending second key update request information to the key management entity, the second key update request information being used to request Update the second key, or be used to request verification of the integrity of the second key stored locally in the first electronic control unit.
通过该方案,可以辅助密钥管理实体通过该第二密钥更新请求信息,生成适配于第二密钥更新或第二密钥完整性验证的信息,进而实现第二密钥的完整性验证,保证功能密钥的正常使用以及整车的信息安全。Through this solution, the key management entity can be assisted to generate information adapted to the second key update or the second key integrity verification through the second key update request information, thereby realizing the integrity verification of the second key. , ensuring the normal use of function keys and the information security of the entire vehicle.
结合第三方面,在第三方面的某些实现方式中,所述方法还包括:向所述密钥管理实体发送所述第二密钥的更新结果。With reference to the third aspect, in some implementations of the third aspect, the method further includes: sending the update result of the second key to the key management entity.
通过该方案,可以辅助密钥管理实体获知第二密钥的更新情况,进而判断功能密钥是否能被写入,以此保证功能密钥的正常使用以及整车的信息安全。Through this solution, the key management entity can be assisted to learn the update status of the second key, and then determine whether the function key can be written, thereby ensuring the normal use of the function key and the information security of the entire vehicle.
结合第二方面和第三方面,在第二方面和第三方面的某些实现方式中,所述第二密钥更新请求信息包括如下信息中的一项或多项:所述客户端的身份认证信息,待更新第二密钥的电子控制单元的数量,电子控制单元所属的整车的识别码,电子控制单元本地保存的认证密钥的版本号,电子控制单元的版本号。Combining the second aspect and the third aspect, in some implementations of the second aspect and the third aspect, the second key update request information includes one or more of the following information: identity authentication of the client Information, the number of electronic control units to be updated with the second key, the identification code of the vehicle to which the electronic control unit belongs, the version number of the authentication key stored locally in the electronic control unit, and the version number of the electronic control unit.
在一种可选的设计中,所述客户端的身份认证信息用于表征所述客户端具有从所述密钥管理实体获取密钥写入信息的权限,其中所述密钥写入信息包括如下信息中的一项或多项:所述第一信息,所述第五信息,所述第二验证信息。通过所述第二密钥更新请求信息中包含所述客户端的身份认证信息,可以保证密钥写入信息只提供给密钥管理实体授权的客户端,进而保证了密钥的安全性。In an optional design, the client's identity authentication information is used to represent that the client has the authority to obtain key writing information from the key management entity, where the key writing information includes the following One or more items of information: the first information, the fifth information, and the second verification information. By including the identity authentication information of the client in the second key update request information, it can be ensured that the key writing information is only provided to clients authorized by the key management entity, thereby ensuring the security of the key.
此外,通过所述第二密钥更新请求信息中包含如下信息中的一项或多项:待更新第二密钥的电子控制单元的数量,电子控制单元所属的整车的识别码,电子控制单元本地保存的认证密钥的版本号,电子控制单元的版本号,还便于密钥管理实体确定待写入的第二密钥,实现第二密钥的批量写入和/或第二密钥的批量完整性验证,降低密钥管理的成本。In addition, the second key update request information includes one or more of the following information: the number of electronic control units to be updated with the second key, the identification code of the vehicle to which the electronic control unit belongs, the electronic control unit The version number of the authentication key stored locally in the unit and the version number of the electronic control unit also facilitate the key management entity to determine the second key to be written and realize batch writing of the second key and/or the second key Batch integrity verification reduces the cost of key management.
结合第二方面和第三方面,在第二方面和第三方面的某些实现方式中,所述第二密钥的更新结果包括以下一项或多项:所述第二密钥的完整性信息,所述第一电子控制单元的身份标识,所述第一密钥的完整性信息,其中,所述第一电子控制单元的身份标识用于唯一标识所述第一电子控制单元。Combining the second aspect and the third aspect, in some implementations of the second aspect and the third aspect, the update result of the second key includes one or more of the following: integrity of the second key information, the identity of the first electronic control unit, and the integrity information of the first key, wherein the identity of the first electronic control unit is used to uniquely identify the first electronic control unit.
通过该方案,密钥管理实体可以基于所述第二密钥的更新结果,确定所述第二密钥是否写入第一电子控制单元和/或确定第一电子控制单元本地保存的认证密钥是否为所述第二密钥,以此保证功能密钥的正常使用以及整车的信息安全。此外,通过收集所述第一电子控制单元的身份标识,还便于密钥管理实体实现对写入所述第二密钥的电子控制单元的管理。Through this solution, the key management entity can determine whether the second key is written to the first electronic control unit and/or determine the authentication key saved locally by the first electronic control unit based on the update result of the second key. Whether it is the second key, thereby ensuring the normal use of the function key and the information security of the entire vehicle. In addition, collecting the identity of the first electronic control unit also facilitates the key management entity to manage the electronic control unit that writes the second key.
结合第一方面、第二方面和第三方面,在第一方面、第二方面和第三方面的某些实现方式中,所述第一信息包括通过所述第二密钥的派生密钥进行加密和/或完整性保护得到的信息。In combination with the first aspect, the second aspect and the third aspect, in some implementations of the first aspect, the second aspect and the third aspect, the first information includes a key derived from the second key. Encrypt and/or integrity protect the resulting information.
通过该方案,可以实现在第一密钥安全的情况下,将第一密钥写入到第一电子控制单元,以及保证第二密钥不以明文的形式暴露在密钥管理实体和电子控制单元之外。Through this solution, it is possible to write the first key to the first electronic control unit while the first key is safe, and to ensure that the second key is not exposed in plain text to the key management entity and the electronic control unit. outside the unit.
结合第一方面、第二方面和第三方面,在第一方面、第二方面和第三方面的某些实现方式中,所述第一信息包括:至少通过所述第一电子控制单元的身份信息、所述第一密钥的索引和所述第二密钥的索引级联得到的第二信息,通过第三密钥对所述第一密钥加密得到的第三信息,以及通过第四密钥,对至少由所述第二信息和所述第三信息级联的信息进行完整性保护得到的第四信息,其中,所述第三密钥和所述第四密钥是所述第二密钥的派生密钥。Combining the first aspect, the second aspect and the third aspect, in some implementations of the first aspect, the second aspect and the third aspect, the first information includes: at least the identity of the first electronic control unit information, the second information obtained by concatenating the index of the first key and the index of the second key, the third information obtained by encrypting the first key with a third key, and the fourth information The key is the fourth information obtained by performing integrity protection on the information concatenated by at least the second information and the third information, wherein the third key and the fourth key are the third information. The derived key of the second key.
通过该方案,可以实现在第一密钥安全的情况下,将第一密钥写入到第一电子控制单元,以及保证第二密钥不以明文的形式暴露在密钥管理实体和电子控制单元之外,且实现简单。Through this solution, it is possible to write the first key to the first electronic control unit while the first key is safe, and to ensure that the second key is not exposed in plain text to the key management entity and the electronic control unit. Outside the unit, and easy to implement.
结合第一方面、第二方面和第三方面,在第一方面、第二方面和第三方面的某些实现 方式中,所述第五信息包括通过所述第五密钥的派生密钥进行加密和/或完整性保护得到的信息。In combination with the first aspect, the second aspect and the third aspect, in some implementations of the first aspect, the second aspect and the third aspect, the fifth information includes a key derived from the fifth key. Encrypt and/or integrity protect the resulting information.
通过该方案,可以实现在保证第二密钥安全的情况下,将第二密钥写入到第一电子控制单元。Through this solution, it is possible to write the second key to the first electronic control unit while ensuring the security of the second key.
结合第一方面、第二方面和第三方面,在第一方面、第二方面和第三方面的某些实现方式中,所述第五信息包括:至少通过所述第一电子控制单元的身份信息、所述第二密钥的索引和所述第五密钥的索引级联得到的第六信息,通过第六密钥对所述第二密钥加密得到的第七信息,以及通过第七密钥对至少由所述第六信息和所述第七信息级联的信息进行完整性保护得到的第八信息,其中,所述第六密钥和所述第七密钥是所述第五密钥的派生密钥。Combining the first aspect, the second aspect and the third aspect, in some implementations of the first aspect, the second aspect and the third aspect, the fifth information includes: at least the identity of the first electronic control unit information, the sixth information obtained by concatenating the index of the second key and the index of the fifth key, the seventh information obtained by encrypting the second key with the sixth key, and the seventh information obtained by encrypting the second key with the sixth key. The key performs integrity protection on the eighth information obtained by at least concatenating the sixth information and the seventh information, wherein the sixth key and the seventh key are the fifth information. The derived key for the key.
通过该方案,通过该方案,可以实现在保证第二密钥安全的情况下,将第二密钥写入到第一电子控制单元,且实现简单。Through this solution, it is possible to write the second key to the first electronic control unit while ensuring the security of the second key, and the implementation is simple.
结合第一方面、第二方面和第三方面,在第一方面、第二方面和第三方面的某些实现方式中,所述第一电子控制单元的身份信息包括所述第一电子控制单元的身份标识或者所述第一电子控制单元的组标识,其中,所述第一电子控制单元的身份标识用于唯一标识所述第一电子控制单元;所述第一电子控制单元的组标识用于标识所述第一电子控制单元所属的设备组。Combining the first aspect, the second aspect and the third aspect, in some implementations of the first aspect, the second aspect and the third aspect, the identity information of the first electronic control unit includes the first electronic control unit The identity identifier or the group identifier of the first electronic control unit, wherein the identity identifier of the first electronic control unit is used to uniquely identify the first electronic control unit; the group identifier of the first electronic control unit is To identify the equipment group to which the first electronic control unit belongs.
在一种可选的设计中,所述第一电子控制单元的组标识中包含至少一个通配符。In an optional design, the group identifier of the first electronic control unit includes at least one wildcard.
通过该方案,基于第一电子控制单元的组标识,可以实现密钥管理实体对多个电子控制单元的第一密钥和/或第二密钥的批量写入,以及对第二密钥完整性的批量验证,简化流程,节省开销;基于第一电子控制单元的身份标识,可以实现点对点的第一密钥和/或第二密钥的写入,以及对第二密钥完整性的验证。Through this solution, based on the group identification of the first electronic control unit, it is possible for the key management entity to batch write the first keys and/or second keys of multiple electronic control units, and to complete the second key Persistent batch verification, simplifying the process and saving costs; based on the identity of the first electronic control unit, point-to-point writing of the first key and/or the second key can be achieved, as well as verification of the integrity of the second key. .
第四方面,提供了一种控制装置,所述控制装置包括用于执行上述第一方面的任一种可能实现方式中的方法的单元或模块,或者用于执行上述第二方面的任一种可能实现方式中的方法的单元或模块,或者用于执行上述第三方面的任一种可能实现方式中的方法的单元或模块。A fourth aspect provides a control device, which includes a unit or module for executing the method in any possible implementation of the above first aspect, or for executing any one of the above second aspects. A unit or module that may implement the method in the possible implementation manner, or a unit or module that is used to perform the method in any possible implementation manner of the above third aspect.
第五方面,提供了一种控制装置,所述控制装置包括处理器和存储器。所述存储器用于存储计算机程序或指令,所述处理器用于调用所述存储器中的所述计算机程序或指令,以使得所述控制装置执行上述第一方面的任一种可能实现方式中的方法,或者用于执行上述第二方面的任一种可能实现方式中的方法,或者用于执行上述第三方面的任一种可能实现方式中的方法。在一种可选的设计中,该控制装置还包括通信接口,该通信接口与处理器耦合,该通信接口用于输入和/或输出信息,所述信息例如包含如下信息中的一项或多项:所述第一信息、所述第五信息、所述第一验证参数,所述第一验证信息,所述第二验证信息,所述第二密钥更新请求信息,所述第二密钥的更新结果。In a fifth aspect, a control device is provided, the control device including a processor and a memory. The memory is used to store computer programs or instructions, and the processor is used to call the computer program or instructions in the memory, so that the control device executes the method in any possible implementation of the first aspect. , or used to perform the method in any possible implementation of the above second aspect, or used to perform the method in any possible implementation of the above third aspect. In an optional design, the control device further includes a communication interface, the communication interface is coupled to the processor, the communication interface is used to input and/or output information, the information includes, for example, one or more of the following information Items: the first information, the fifth information, the first verification parameter, the first verification information, the second verification information, the second key update request information, the second password Key update result.
在一种可选的设计中,所述处理器为一个或多个,所述存储器为一个或多个。In an optional design, there are one or more processors and one or more memories.
在一种可选的设计中,所述存储器可以与所述处理器集成在一起,或者所述存储器与处理器分离设置。In an optional design, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
结合第四方面和第五方面,在一种可选的设计中,用于执行上述第一方面的任一种可 能实现方式中的方法的控制装置可以为电子控制单元或者包含一个或多个电子控制单元的域控制器。In combination with the fourth and fifth aspects, in an optional design, the control device used to perform the method in any possible implementation of the first aspect may be an electronic control unit or include one or more electronic The domain controller of the control unit.
第六方面,提供了一种电子部件,所述电子部件包括实现上述第一方面的任一种可能实现方式中的方法的控制装置。示例性地,所述电子部件包括ECU。A sixth aspect provides an electronic component, which includes a control device that implements the method in any possible implementation of the first aspect. Illustratively, the electronic component includes an ECU.
第七方面,提供了一种车辆,所述车辆包括实现上述第一方面的任一种可能实现方式中的方法的控制装置,或者所述车辆包括上述第六方面提供的电子部件。A seventh aspect provides a vehicle, which includes a control device that implements the method in any possible implementation of the first aspect, or the vehicle includes the electronic component provided in the sixth aspect.
第八方面,提供了一种密钥管理实体,可以实现上述第二方面的任一种可能实现方式中的方法。在一种可选的设计中,所述密钥管理实体可以是密钥管理服务器。An eighth aspect provides a key management entity that can implement the method in any possible implementation manner of the second aspect. In an optional design, the key management entity may be a key management server.
第九方面,提供了一种密钥刷写工具,可以实现上述第三方面的任一种可能实现方式中的方法。在一种可选的设计中,所述密钥刷写工具可以是OEM密钥刷写工具或者经销商诊断仪。A ninth aspect provides a key flashing tool that can implement any of the possible implementation methods of the third aspect. In an optional design, the key flash tool may be an OEM key flash tool or a dealer diagnostic tool.
第十方面,提供了一种系统,所述系统包括上述第六方面提供的电子部件,上述第七方面提供的车辆,上述第八方面提供的密钥管理实体或者上述第九方面提供的密钥刷写工具中的一个或多个。In a tenth aspect, a system is provided, which system includes the electronic component provided in the sixth aspect, the vehicle provided in the seventh aspect, the key management entity provided in the eighth aspect, or the key provided in the ninth aspect. One or more of the flash tools.
第十一方面,提供了一种系统,所述系统包括用于执行上述第一方面的任一种可能实现方式中的方法的控制装置,用于执行上述第二方面的任一种可能实现方式中的方法的控制装置或者用于执行上述第三方面的任一种可能实现方式中的方法的控制装置中的一个或多个。In an eleventh aspect, a system is provided, which system includes a control device for executing the method in any possible implementation of the above-mentioned first aspect, and a control device for executing any possible implementation of the above-mentioned second aspect. One or more of the control devices for the method in or for executing the method in any possible implementation of the third aspect.
第十二方面,提供了一种芯片,所述芯片包括一个或多个处理器和接口电路,所述接口电路用于为所述一个或多个处理器提供信息输入和/或输出,所述芯片用于执行上述第一方面的任一种可能实现方式中的方法,或者用于执行上述第二方面的任一种可能实现方式中的方法,或者用于执行上述第三方面的任一种可能实现方式中的方法。In a twelfth aspect, a chip is provided, the chip includes one or more processors and an interface circuit, the interface circuit is used to provide information input and/or output for the one or more processors, the The chip is used to execute the method in any possible implementation of the above first aspect, or to execute the method in any possible implementation of the above second aspect, or to execute any of the above third aspects. Methods in possible implementations.
第十三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序或指令,当所述计算机程序或指令被处理器执行时,使得所述处理器执行上述第一方面的任一种可能实现方式中的方法,或者用于执行上述第二方面的任一种可能实现方式中的方法,或者用于执行上述第三方面的任一种可能实现方式中的方法。In a thirteenth aspect, a computer-readable storage medium is provided. Computer programs or instructions are stored in the computer-readable storage medium. When the computer programs or instructions are executed by a processor, the processor is caused to execute the above-mentioned The method in any possible implementation of the first aspect, or used to perform the method in any possible implementation of the second aspect, or used to perform the method in any possible implementation of the third aspect method.
第十四方面,提供了一种计算机程序产品,当所述计算机程序产品在一个或多个处理器上运行时,使得所述一个或多个处理器执行上述第一方面的任一种可能实现方式中的方法,或者用于执行上述第二方面的任一种可能实现方式中的方法,或者用于执行上述第三方面的任一种可能实现方式中的方法。A fourteenth aspect provides a computer program product, which when the computer program product is run on one or more processors, causes the one or more processors to execute any possible implementation of the first aspect. The method in the above-mentioned aspect, or used to perform the method in any possible implementation manner of the above-mentioned second aspect, or used to perform the method in any possible implementation manner of the above-mentioned third aspect.
以下对本申请实施例用到的附图进行介绍。The drawings used in the embodiments of this application are introduced below.
图1是本申请实施例提供的一种可能的密钥验证方法的网络架构;Figure 1 is a network architecture of a possible key verification method provided by an embodiment of the present application;
图2为本申请实施例提供的一种可能的密钥验证方法的示意性流程图;Figure 2 is a schematic flow chart of a possible key verification method provided by the embodiment of the present application;
图3为本申请实施例提供的一种可能的密钥写入方法的示意性流程图;Figure 3 is a schematic flow chart of a possible key writing method provided by an embodiment of the present application;
图4为本申请实施例提供的一种可能的实现密钥更新请求和密钥更新结果的方法的示意性流程图;Figure 4 is a schematic flow chart of a possible method for implementing a key update request and a key update result provided by an embodiment of the present application;
图5为本申请实施例提供的一种可能的实现密钥验证信息的方法的示意性流程图;Figure 5 is a schematic flow chart of a possible method for implementing key verification information provided by an embodiment of the present application;
图6为本申请实施例提供的又一种可能的实现密钥验证信息的方法的示意性流程图;Figure 6 is a schematic flow chart of another possible method for implementing key verification information provided by the embodiment of the present application;
图7是本申请实施例提供的一种可能的控制装置的示意图;Figure 7 is a schematic diagram of a possible control device provided by an embodiment of the present application;
图8是本申请实施例提供的另一种可能的控制装置的示意图;Figure 8 is a schematic diagram of another possible control device provided by the embodiment of the present application;
图9是本申请实施例提供的一种可能的芯片结构的示意图。FIG. 9 is a schematic diagram of a possible chip structure provided by an embodiment of the present application.
下面结合本申请实施例中的附图对本申请实施例进行描述。需要说明的是,本申请中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。The embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It should be noted that in this application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
本申请中实施例提到的“至少一项(个)”是指一项(个)或者多项(个),“多项(个)”是指两项(个)或两项(个)以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b、或c中的至少一项(个),可以表示:a、b、c、(a和b)、(a和c)、(b和c)、或(a和b和c),其中a、b、c可以是单个,也可以是多个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B这三种情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。"At least one item" mentioned in the embodiments of this application refers to one item (item) or multiple items (items), and "multiple items (item)" refers to two items (items) or two items (items). above. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c can represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship.
以及,除非有相反的说明,本申请实施例使用“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一信息和第二信息,只是为了区分不同的信息,而并不是表示这两种信息的内容、优先级、发送顺序或者重要程度等的不同。And, unless otherwise stated, the use of ordinal numbers such as "first" and "second" in the embodiments of this application is used to distinguish multiple objects and is not used to limit the order, timing, priority or importance of multiple objects. degree. For example, the first information and the second information are only used to distinguish different information, but do not indicate the difference in content, priority, sending order or importance of the two types of information.
首先,对本申请实施例中涉及的技术术语进行简单说明。First, the technical terms involved in the embodiments of this application will be briefly explained.
1.电子控制单元(Electronic Control Unit,ECU)1. Electronic Control Unit (ECU)
电子控制单元ECU也可以称为车载控制器,可用于控制整车使用中的各种功能。ECU例如可以包括但不限于:具有发动机控制功能的ECU、具有手柄控制功能的ECU、具有制动器控制功能的ECU。The electronic control unit ECU can also be called an on-board controller and can be used to control various functions in the vehicle. For example, ECUs may include but are not limited to: ECUs with engine control functions, ECUs with handle control functions, and ECUs with brake control functions.
示例性地,ECU还可以理解为具有完整性保护功能和加密功能且包括安全内存的电子单元。其中,安全内存可以基于非易失性存储(non-volatile memory,NvM)实现。安全内存具有严格的访问控制机制可以控制关键密钥材料的读取和使用。示例性地,安全内存例如为汽车开放系统架构(automotive open system architecture,AUTOSAR)安全硬件扩展(secure hardware extension,SHE)中的安全存储区。For example, an ECU can also be understood as an electronic unit that has integrity protection functions and encryption functions and includes secure memory. Among them, secure memory can be implemented based on non-volatile memory (NvM). Secure memory has strict access control mechanisms to control the reading and use of critical key materials. For example, the secure memory is a secure storage area in an automotive open system architecture (AUTOSAR) secure hardware extension (SHE).
需要说明的是,在某些技术场景中,具备相类似控制整车使用中的各种功能的电子单元的名称也可能不称为ECU,具有完整性保护功能和加密功能且包括安全内存的电子单元的名称也可能不称为ECU,但是为了方便描述,本申请实施例中将具有控制整车使用中的各种功能的电子单元统称为ECU,将具有完整性保护功能和加密功能且包括安全内存的电子单元也统称为ECU。It should be noted that in some technical scenarios, the name of an electronic unit with similar functions that control various functions used in the vehicle may not be called ECU. Electronic units with integrity protection functions and encryption functions and including secure memory may not be called ECUs. The name of the unit may not be called ECU, but for the convenience of description, in the embodiment of this application, the electronic unit that controls various functions used in the vehicle is collectively called ECU, which has integrity protection functions and encryption functions and includes security The electronic unit of memory is also collectively referred to as ECU.
2.认证密钥2. Authentication key
认证密钥用于功能密钥的认证,电子控制单元ECU只有拥有正确的认证密钥,才能实现功能密钥的写入和/或完整性验证。基于此,认证密钥还可以理解为功能密钥的认证密钥或功能密钥的权限密钥。示例性地,ECU具有正确的认证密钥,可以理解为,ECU本地保存的认证密钥与KMS本地保存的认证密钥相同。The authentication key is used to authenticate the function key. Only when the electronic control unit ECU has the correct authentication key can the function key be written and/or integrity verified. Based on this, the authentication key can also be understood as the authentication key of the function key or the authority key of the function key. For example, the ECU has a correct authentication key. It can be understood that the authentication key stored locally by the ECU is the same as the authentication key stored locally by the KMS.
此外,认证密钥除了可以用于功能密钥的认证,还可以用于认证ECU的硬件功能密钥,其中该硬件功能密钥也可以用于功能密钥的认证。示例性地,该认证密钥可以用于认证该认证密钥的后续版本所对应的密钥(作为硬件功能密钥的一例)。以认证密钥为ECU主密钥(master ECU key,MEK)为例,电子控制单元ECU只有拥有正确的MEK的在先版本,才能实现新版本的MEK的写入和/或完整性验证。具体地,如果当前密钥管理服务器保存的MEK最新版本为2.0(为便于描述,记为MEK2.0),若使得该MEK2.0能够被成功写入目标ECU,需要该目标ECU拥有正确的MEK在先版本例如MEK1.0。基于此,认证密钥还可以理解为ECU硬件功能密钥的认证密钥或ECU硬件功能的权限密钥。In addition, in addition to being used for the authentication of the function key, the authentication key can also be used to authenticate the hardware function key of the ECU, where the hardware function key can also be used for the authentication of the function key. For example, the authentication key can be used to authenticate a key corresponding to a subsequent version of the authentication key (as an example of a hardware function key). Taking the authentication key as the ECU master key (MEK) as an example, the electronic control unit ECU can only write and/or integrity verify the new version of the MEK if it has the correct previous version of the MEK. Specifically, if the latest MEK version saved by the current key management server is 2.0 (for ease of description, denoted as MEK2.0), if MEK2.0 can be successfully written to the target ECU, the target ECU needs to have the correct MEK Previous versions such as MEK1.0. Based on this, the authentication key can also be understood as the authentication key of the ECU hardware function key or the permission key of the ECU hardware function.
认证密钥可以对应一款车型包括的所有整车,或者也可以对应一台整车,或者也可以对应整车内的一个功能部件,或者对应整车内的一个ECU,相应地,一款车型包括的所有整车具有相同的认证密钥,不同车型的整车具有不同的认证密钥,或者一台整车具有一个认证密钥,不同整车具有不同的认证密钥,或者,整车内的一个功能部件具有一个认证密钥,该整车内的其他功能部件具有其他认证密钥,亦或者,整车内的一个ECU具有一个认证密钥,不同的ECU具有不同的认证密钥。这里的功能部件可以包括由多个ECU组成的功能部件,例如由多个ECU组成的用于座舱控制的功能部件。The authentication key can correspond to all the entire vehicles included in a model, or it can correspond to one entire vehicle, or it can also correspond to a functional component in the entire vehicle, or it can correspond to one ECU in the entire vehicle. Correspondingly, a model All included vehicles have the same authentication key, and vehicles of different models have different authentication keys, or one vehicle has one authentication key, and different vehicles have different authentication keys, or, in the vehicle A functional component in the vehicle has an authentication key, and other functional components in the vehicle have other authentication keys, or an ECU in the vehicle has an authentication key, and different ECUs have different authentication keys. The functional components here may include functional components composed of multiple ECUs, such as functional components composed of multiple ECUs for cabin control.
在本申请实施例中,ECU主密钥MEK也可以称为ECU硬件权限密钥。In the embodiment of this application, the ECU master key MEK may also be called the ECU hardware authority key.
3.功能密钥3. Function key
功能密钥也可以称为业务密钥,可用于加密整车中各类功能的ECU密钥,从而保障整车计算机系统的安全。功能密钥例如可以包括但不限于:预共享密钥(pre-shared key,PSK),用于业务应用的主密钥(master key,MK),会话密钥(session key,SK)。其中,PSK可以包含用于保护车载网络通信安全的板端加密通讯(security onboard communication,SecOC)的密钥(SecOC key)和用于设备认证的设备密钥(device key)。Function keys can also be called business keys, which can be used to encrypt ECU keys for various functions in the vehicle to ensure the security of the vehicle computer system. Function keys may include, for example, but are not limited to: pre-shared key (PSK), master key (MK) for business applications, session key (SK). Among them, the PSK may include a security onboard communication (SecOC) key (SecOC key) used to protect vehicle network communication security and a device key (device key) used for device authentication.
在本申请实施例中,功能密钥可以是基于一台整车、一个业务来分配的。示例性地,对于一台整车而言,用于同一业务的一个或多个ECU可以共用同一个功能密钥。而对于不同的整车而言,同一业务的ECU可以是不同的。比如,若同一整车中的多个ECU用于板端加密通讯,该多个ECU可共用同一个功能密钥,该多个ECU相互之间均可基于该功能密钥来进行加密通信。具体的,相互通信的ECU之间,可以基于相同的功能密钥来对消息进行加密和解密,以达到对消息的加密和完整性保护。又比如,若同一整车中的多个ECU用于设备认证,该多个ECU也可共用同一个功能密钥。该多个ECU中的任意一个ECU基于该功能密钥来对该业务的其他ECU进行认证。In the embodiment of this application, the function key may be allocated based on a complete vehicle and a service. For example, for a complete vehicle, one or more ECUs used for the same service may share the same function key. For different vehicles, the ECUs of the same business can be different. For example, if multiple ECUs in the same vehicle are used for board-side encrypted communication, the multiple ECUs can share the same function key, and the multiple ECUs can perform encrypted communication with each other based on the function key. Specifically, ECUs communicating with each other can encrypt and decrypt messages based on the same function key to achieve encryption and integrity protection of messages. For another example, if multiple ECUs in the same vehicle are used for device certification, the multiple ECUs can also share the same function key. Any ECU among the plurality of ECUs authenticates other ECUs of the service based on the function key.
可以理解,用于板端加密通讯的功能密钥和用于设备认证的功能密钥是不同业务的密钥,因此是不同的密钥。在本申请实施例中,板端加密通讯和设备认证可以理解为不同业务。It can be understood that the function key used for board-side encrypted communication and the function key used for device authentication are keys for different services, and therefore are different keys. In the embodiment of this application, board-end encrypted communication and device authentication can be understood as different services.
此外,该功能密钥也可以基于更小的粒度来分配。示例性地,功能密钥可以是基于一台整车、一个业务、一对ECU来分配的。例如,若多个ECU用于同一业务,该多个ECU中的每两个ECU可以组成一对ECU。每对ECU可以共用一个功能密钥。具体地,比如该多个ECU包括ECU-1、ECU-2和ECU-3。ECU-1和ECU-2之间可共用同一个功能密钥,比如记为功能密钥1;ECU-2和ECU-3之间可共用另一个功能密钥,比如记为功能密钥2;ECU-1和ECU-3之间可共用功能密钥,比如记为功能密钥3。Additionally, the feature key can also be distributed on a smaller granularity basis. For example, the function key may be allocated based on a complete vehicle, a service, or a pair of ECUs. For example, if multiple ECUs are used for the same service, every two ECUs in the multiple ECUs can form a pair of ECUs. Each pair of ECUs can share a function key. Specifically, for example, the plurality of ECUs include ECU-1, ECU-2 and ECU-3. ECU-1 and ECU-2 can share the same function key, such as function key 1; ECU-2 and ECU-3 can share another function key, such as function key 2; The function key can be shared between ECU-1 and ECU-3, for example, it is recorded as function key 3.
4.消息认证码(message authentication code,MAC)4.Message authentication code (MAC)
消息认证码(MAC)是密码学中通信实体双方使用的一种验证机制,是用于保证消息完整性的一种工具。示例性地,在发送消息之前,发送方首先使用通信双方协商好的完整性保护算法(或者还包括密钥)计算出MAC。之后,MAC和数据一起被发送。接收方收到该消息后,用和发送方同样的完整性保护算法(或者还包括密钥)计算出MAC,并比较自己计算的MAC和收到的MAC是否一致。若两者一致,则消息通过完整性验证。Message Authentication Code (MAC) is a verification mechanism used by both communicating entities in cryptography and is a tool used to ensure message integrity. For example, before sending a message, the sender first calculates the MAC using an integrity protection algorithm (or a key) negotiated by both communicating parties. Afterwards, the MAC is sent along with the data. After receiving the message, the receiver uses the same integrity protection algorithm (or key) as the sender to calculate the MAC, and compares the calculated MAC with the received MAC to see whether it is consistent. If the two are consistent, the message passes integrity verification.
5.完整性保护算法5. Integrity protection algorithm
MAC可以通过完整性保护算法来生成,该完整性保护算法也可以称为MAC算法或者完保算法。一般来说,完整性保护算法至少包含以下三个算法:(1)密钥生成算法,用于生成标签计算密钥和验证密钥,该标签计算密钥可以与该验证密钥相同(如用于消息认证码的密钥),也可以不同(如用于数字签名(digital signature)的密钥);(2)标签计算算法,以标签计算密钥、待保护信息为输入,产生对应于该待保护信息的保护标签;(3)验证算法,以验证密钥、标签计算密钥、待保护信息为输入,当且仅当验证通过时,输出逻辑真值。此外,完整性保护算法组还至少需满足以下两个性质。(1)正确性(correctness),即使用标签计算密钥和标签计算算法所生成的保护标签必然可被验证密钥和验证算法所验证为真。(2)抗伪造性(unforgeability),即若攻击者不掌握标签计算密钥时,无法以非可忽略(non-negligible)的概率为待保护信息伪造标签。MAC can be generated by an integrity protection algorithm, which may also be called a MAC algorithm or a integrity protection algorithm. Generally speaking, the integrity protection algorithm includes at least the following three algorithms: (1) Key generation algorithm, used to generate the label calculation key and verification key. The label calculation key can be the same as the verification key (such as using (different from the key of the message authentication code), or it can be different (such as the key used for digital signature); (2) The label calculation algorithm takes the label calculation key and the information to be protected as input, and generates a corresponding The protection label of the information to be protected; (3) Verification algorithm, which takes the verification key, the label calculation key, and the information to be protected as input, and outputs a logical true value if and only if the verification is passed. In addition, the integrity protection algorithm group must also satisfy at least the following two properties. (1) Correctness, that is, the protection label generated using the label calculation key and label calculation algorithm must be verified as true by the verification key and verification algorithm. (2) Unforgeability, that is, if the attacker does not master the tag calculation key, he cannot forge a tag for the information to be protected with a non-negligible probability.
示例性地,例如,基于哈希算法实现的完整性保护算法称为基于哈希的消息认证码(hash-based message authentication code,HMAC)算法,其中的哈希算法可以为MD5、SHA-1、SHA-256中的一个,或者为其他实现方式,不做具体限定。这些不同的HMAC实现通常可以标记为:HMAC-MD5,HMAC-SHA1,HMAC-SHA256。再如,基于密码算法来实现的MAC算法可以称为基于密码的消息认证码(Cipher-based Message Authentication Code,CMAC)算法,其中的分组加密算法可以为高级加密标准(Advanced Encryption Standard,AES),由于AES分组加密的工作模式包括但不限于ECB,CBC,CFB,OFB,基于不同的工作模式的分组加密算法实现的完整性保护算法可以分别称为:ECB-MAC算法、CBC-MAC算法,CFB-MAC算法,OFB-MAC算法。此外,完整性保护算法还可以包括伽罗瓦消息验证码(Galois message authentication code mode,GMAC)、祖冲之密码算法(如ZUC128、ZUC256等)。Illustratively, for example, the integrity protection algorithm implemented based on a hash algorithm is called a hash-based message authentication code (HMAC) algorithm, where the hash algorithm can be MD5, SHA-1, One of SHA-256, or other implementation methods, without specific limitations. These different HMAC implementations can usually be labeled: HMAC-MD5, HMAC-SHA1, HMAC-SHA256. For another example, the MAC algorithm implemented based on the cryptographic algorithm can be called the Cipher-based Message Authentication Code (CMAC) algorithm, and the block encryption algorithm can be the Advanced Encryption Standard (AES). Since the working modes of AES block encryption include but are not limited to ECB, CBC, CFB, and OFB, the integrity protection algorithms implemented based on the block encryption algorithms of different working modes can be respectively called: ECB-MAC algorithm, CBC-MAC algorithm, CFB -MAC algorithm, OFB-MAC algorithm. In addition, the integrity protection algorithm can also include Galois message authentication code mode (GMAC) and Zu Chongzhi cryptographic algorithms (such as ZUC128, ZUC256, etc.).
需要说明的是,在本申请实施例中,完整性保护算法可以有其他形式,不做具体限定。It should be noted that in the embodiment of the present application, the integrity protection algorithm may have other forms and is not specifically limited.
6.加密算法6. Encryption algorithm
加密算法包括对称加密算法和非对称加密算法。通常来说,对称加密算法的加密密钥与解密密钥相同,非对称加密算法的加密密钥与解密密钥不同。常见的对称加密算法包括 但不限于:数据加密标准(data encryption standard,DES)、三重数据加密算法(triple data encryption algorithm,3DES)、AES;常见的非对称算法包括但不限于:RSA加密算法。Encryption algorithms include symmetric encryption algorithms and asymmetric encryption algorithms. Generally speaking, the encryption key and decryption key of symmetric encryption algorithm are the same, and the encryption key and decryption key of asymmetric encryption algorithm are different. Common symmetric encryption algorithms include, but are not limited to: data encryption standard (DES), triple data encryption algorithm (triple data encryption algorithm, 3DES), and AES; common asymmetric algorithms include, but are not limited to: RSA encryption algorithm.
需要说明的是,在一些具体场景中,通过认证加密算法,对于给定的原文既可以加密数据也可以生成消息认证码,因此认证加密算法既可以作为加密算法也可以作为完保算法。例如,基于GMAC和计数加密模式的AES算法(AES-Galois/Counter Mode,AES-GCM)、基于CMAC和计数加密模式的AES算法(AES-CMAC/Counter Mode,AES-CCM)均可以对消息进行认证加密,而进行认证加密的过程中能够生成MAC来保护消息的完整性。It should be noted that in some specific scenarios, through the authenticated encryption algorithm, the data can be encrypted and the message authentication code can be generated for a given original text. Therefore, the authenticated encryption algorithm can be used as both an encryption algorithm and a complete security algorithm. For example, the AES algorithm based on GMAC and counting encryption mode (AES-Galois/Counter Mode, AES-GCM), the AES algorithm based on CMAC and counting encryption mode (AES-CMAC/Counter Mode, AES-CCM) can all process messages. Authentication encryption, and the MAC can be generated during the authentication encryption process to protect the integrity of the message.
此外,还有一类不需要密钥的散列算法,比如用于基于加密算法或基于完保算法所生产的信息中的部分信息的生成。散列算法包括但不限于:安全散列算法(secure hash algorithm 1,SHA-1)、信息摘要(message digest,MD)算法(如MD2、MD4或MD5)。In addition, there is a type of hash algorithm that does not require a key, such as for the generation of partial information in information produced based on encryption algorithms or based on integrity algorithms. Hash algorithms include but are not limited to: secure hash algorithm (secure hash algorithm 1, SHA-1), message digest (message digest, MD) algorithm (such as MD2, MD4 or MD5).
7.密钥派生算法7. Key derivation algorithm
密钥派生是从一个密钥中派生出一个或多个密钥的过程,而用于派生密钥的算法称为密钥派生算法(key derivation function,KDF),又称为密钥导出算法。例如,通过密钥Key派生出的新的密钥可以表示为:DK=KDF(Key)。常用的密钥派生算法包括但不限于:基于密码的密钥派生函数(password-based key derivation function,PBKDF)、斯克里普特(scrypt)算法。其中,PBKDF算法又包括第一代PBKDF1和第二代PBKDF2。Key derivation is the process of deriving one or more keys from a key, and the algorithm used to derive keys is called the key derivation function (KDF), also known as the key derivation algorithm. For example, the new key derived from the key Key can be expressed as: DK=KDF(Key). Commonly used key derivation algorithms include but are not limited to: password-based key derivation function (PBKDF) and scrypt algorithm. Among them, the PBKDF algorithm includes the first generation PBKDF1 and the second generation PBKDF2.
需要说明的是,在本申请各实施例中,为了方便描述各个密钥派生过程使用的KDF,会使用“第一KDF”、“第二KDF”和“第三KDF”进行描述,该“第一KDF”“第二KDF”和“第三KDF”可以是不同的KDF,也可以是相同的KDF。It should be noted that in each embodiment of the present application, in order to conveniently describe the KDF used in each key derivation process, the "first KDF", "second KDF" and "third KDF" will be used for description. The "third KDF" The first KDF, the second KDF and the third KDF can be different KDFs or the same KDF.
8.挑战-应答机制8. Challenge-Response Mechanism
挑战-应答机制为认证协议中的一种模式。一个实现了挑战-应答机制的认证协议中通常包含2个参与方。挑战方(challenger)通常是需要验证对方身份的一方,应答方(responder)为需要自证身份的一方。The challenge-response mechanism is a mode in the authentication protocol. An authentication protocol that implements a challenge-response mechanism usually involves two parties. The challenger is usually the party that needs to verify the identity of the other party, and the responder is the party that needs to self-certify its identity.
挑战-应答机制准则如下:挑战方将挑战(challenge)发送给应答方,应答方基于本地保存的认证信息(或秘密认证信息)和该挑战,确定相应的应答(response)发送给挑战方。挑战方结合挑战和自己持有的验证信息,来验证应答方是否通过了挑战,和/或判断应答方是否应该被认证。示例性地,挑战方可以将包含新鲜的随机字符串的信息或包含伪随机字符串的信息作为挑战。The criteria of the challenge-response mechanism are as follows: the challenger sends a challenge to the responder, and the responder determines the corresponding response (response) to send to the challenger based on the locally saved authentication information (or secret authentication information) and the challenge. The challenger combines the challenge with the verification information it holds to verify whether the responder has passed the challenge, and/or determines whether the responder should be authenticated. For example, the challenging party may use information containing a fresh random string or information containing a pseudo-random string as a challenge.
其次,对本申请实施例的系统架构和业务场景进行描述。需要说明的是,本申请描述的系统架构及业务场景是为了更加清楚的说明本申请的技术方案,并不构成对于本申请提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请提供的技术方案对于类似的技术问题,同样适用。Secondly, the system architecture and business scenarios of the embodiments of this application are described. It should be noted that the system architecture and business scenarios described in this application are for the purpose of explaining the technical solution of this application more clearly and do not constitute a limitation on the technical solution provided by this application. Those of ordinary skill in the art will know that with the system architecture With the evolution of the Internet and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
请参见图1,图1是本申请实施例提供的一种可能的密钥验证方法的网络架构。如图1所示,该网络架构100可以包括密钥管理服务器,OEM密钥刷写装置(也可以称为OEM工具(OEM tool))、整车和ECU。KMS和OEM密钥刷写装置之间,OEM密钥刷写装置和ECU之间,均可以通过本地连接(例如本地局域网,硬件直接相连(比如密钥刷写装置与ECU直接))来通信,也可通过安全连接协议(比如,传输层安全协议(transport layer security specification,TLS)或虚拟专用网络(virtual private network,VPN))来通信,以 保证通信安全。Please refer to Figure 1. Figure 1 is a network architecture of a possible key verification method provided by an embodiment of the present application. As shown in FIG. 1 , the network architecture 100 may include a key management server, an OEM key writing device (also called an OEM tool), a complete vehicle, and an ECU. Communication between KMS and the OEM key flashing device, and between the OEM key flashing device and the ECU, can be accomplished through local connections (such as local area networks, direct hardware connections (such as the key flashing device and the ECU directly)). Communication can also be carried out through a secure connection protocol (such as transport layer security specification (TLS) or virtual private network (VPN)) to ensure communication security.
可以理解,对于整车生产而言,上述OEM具体可以是指整车制造商或代工厂。It can be understood that for the production of complete vehicles, the above-mentioned OEM may specifically refer to the complete vehicle manufacturer or foundry.
应理解,图1仅为便于理解,示出了用于整车生产线中密钥写入/验证流程,但这不应对本申请构成任何限定。本申请提供的密钥写入/验证方法也可应用于售后服务中,比如用于售后服务的密钥更新流程。在应用于售后服务时,图1中的OEM密钥刷写装置可以替换为经销商诊断仪(也可以称为经销商诊断工具(tester tool))。上述KMS经销商诊断仪之间,经销商诊断仪与ECU之间也可通过本地连接或安全连接来通信。It should be understood that Figure 1 is only for ease of understanding and shows the key writing/verification process used in the vehicle production line, but this should not constitute any limitation on this application. The key writing/verification method provided by this application can also be applied to after-sales service, such as the key update process for after-sales service. When used in after-sales service, the OEM key flashing device in Figure 1 can be replaced by a dealer diagnostic instrument (also called a dealer diagnostic tool (tester tool)). The above-mentioned KMS dealer diagnostic tools, dealer diagnostic tools and ECU can also communicate through local connection or secure connection.
可以理解,由于OEM服务器与经销商服务器的功能相似,应用场景不同,因此OEM服务器与经销商服务器的硬件结构可以是相似的。OEM密钥刷写装置与经销商诊断仪的功能相似,应用场景不同,因此OEM密钥刷写装置与经销商诊断仪的硬件结构也可以是相似的。It can be understood that since the functions of OEM servers and dealer servers are similar and their application scenarios are different, the hardware structures of OEM servers and dealer servers can be similar. The OEM key writing device and the dealer diagnostic instrument have similar functions but different application scenarios. Therefore, the hardware structures of the OEM key writing device and the dealer diagnostic instrument may also be similar.
在一种可选的设计中,KMS还进一步包括KMS前置服务器和KMS后台服务器。KMS前置服务器主要负责与外部的通信,可理解为是KMS后台服务器与外部通信的接口。KMS后台服务器主要负责密钥生成、密钥查找等。KMS前置服务器与KMS后台服务器可以是物理上独立的两个设备,也可以集成在同一个物理设备中。本申请实施例对此不作限定。In an optional design, KMS further includes a KMS front-end server and a KMS back-end server. The KMS front-end server is mainly responsible for communicating with the outside world, and can be understood as the interface between the KMS back-end server and the outside world. The KMS background server is mainly responsible for key generation, key search, etc. The KMS front-end server and the KMS back-end server can be two physically independent devices, or they can be integrated into the same physical device. The embodiments of the present application do not limit this.
还应理解,图1中示出了两辆车以及部署在每辆车上的一个或多个ECU。本申请对于该网络架构中的整车数量以及所部署的ECU的数量均不作限定。It should also be understood that two vehicles are shown in Figure 1 along with one or more ECUs deployed on each vehicle. This application does not limit the number of complete vehicles in the network architecture and the number of deployed ECUs.
需要说明的是,为了描述清楚,本申请各实施例中的下述内容以MEK作为认证密钥的一个示例进行描述,可以理解的是,MEK也可以替换为其他认证密钥。It should be noted that, for the sake of clarity of description, the following content in each embodiment of the present application uses MEK as an example of the authentication key. It can be understood that MEK can also be replaced with other authentication keys.
由于MEK的密钥属性(例如MEK用作整车包括的功能密钥的认证密钥或权限密钥),MEK可以认为是原始设备制造商(original equipment manufacturer,OEM)的核心资产,因此MEK禁止以明文的形式被外传泄露给第三方(例如部件开发商,OEM授权的经销商,售后4S店),并且也不允许暴露在KMS之外。基于此,现有的整车厂通过在安全监控的环境下将MEK写入到电子控制单元中。在缺乏安全监控的情况下(例如当实现远程密钥刷写时),MEK的安全性无法保证,有被篡改的风险。Due to the key properties of MEK (for example, MEK is used as an authentication key or authority key for function keys included in the entire vehicle), MEK can be considered a core asset of the original equipment manufacturer (OEM), so MEK is prohibited It is leaked to third parties (such as component developers, OEM authorized dealers, after-sales 4S stores) in the form of clear text, and is not allowed to be exposed outside KMS. Based on this, existing vehicle manufacturers write MEK into the electronic control unit under a safe monitoring environment. In the absence of security monitoring (for example, when implementing remote key flashing), the security of the MEK cannot be guaranteed and there is a risk of being tampered with.
鉴于此,本申请实施例提供一种密钥验证的方法,在该方法中,客户端接收来自密钥管理实体的第一信息,并向第一电子控制单元发送该第一信息,该第一信息通过第二密钥的信息指示第一密钥,该第二密钥被配置用于认证该第一电子控制单元的至少一个功能密钥,该至少一个功能密钥对应该第一电子控制单元的至少一个业务功能;该客户端还向该第一电子控制单元发送第一验证参数,该第一验证参数用于验证上述第一密钥的完整性。该第一电子控制单元接收来自该客户端的第一信息和第一验证参数,并根据第二密钥和该第一验证参数,生成第一验证信息,该第一验证信息用于表征该第一密钥的完整性;该第一电子控制单元向该客户端发送该第一验证信息。该客户端接收该第一验证信息,并根据该第一验证信息和本地验证信息,确定该第二密钥的完整性。该方案中,由于用于表征第一密钥完整性的第一验证信息是基于第二密钥和第一验证参数得到的,因此,可以通过第一密钥的完整性间接验证第二密钥的完整性,保证第二密钥的完整性以及安全性,防止第二密钥被篡改,进而保证功能密钥的正常使用以及整车的信息安全。此外,又由于第一信 息是通过第二密钥的信息指示第一密钥且第一信息是由客户端通过密钥管理实体转发给第一电子控制单元,因此避免了第二密钥以明文形式暴露在密钥管理实体和电子控制单元之外,进而保证了整车厂核心资产的安全。In view of this, embodiments of the present application provide a method for key verification. In this method, the client receives the first information from the key management entity and sends the first information to the first electronic control unit. The first The information indicates the first key through the information of the second key, the second key being configured to authenticate at least one function key of the first electronic control unit, the at least one function key corresponding to the first electronic control unit At least one business function; the client also sends a first verification parameter to the first electronic control unit, and the first verification parameter is used to verify the integrity of the above-mentioned first key. The first electronic control unit receives the first information and the first verification parameter from the client, and generates first verification information according to the second key and the first verification parameter. The first verification information is used to characterize the first The integrity of the key; the first electronic control unit sends the first verification information to the client. The client receives the first verification information and determines the integrity of the second key based on the first verification information and local verification information. In this solution, since the first verification information used to characterize the integrity of the first key is obtained based on the second key and the first verification parameter, the second key can be indirectly verified through the integrity of the first key. The integrity of the key is guaranteed to ensure the integrity and security of the second key, preventing the second key from being tampered with, thereby ensuring the normal use of the function key and the information security of the entire vehicle. In addition, since the first information indicates the first key through the information of the second key and the first information is forwarded by the client to the first electronic control unit through the key management entity, it is avoided that the second key is expressed in plain text. The form is exposed outside the key management entity and electronic control unit, thereby ensuring the security of the OEM's core assets.
下面结合具体实施例对本申请实施例提供的密钥验证方法进行介绍。需要说明的是,在本申请实施例中,对密钥进行验证可以包括验证该密钥的完整性,或可以理解为对该密钥进行完整性验证。示例性地,对该密钥进行完整性验证可以包括验证该密钥是否被完整写入ECU,或者是否被正确写入ECU。具体地,例如如果ECU的存储区域包括未经篡改的该密钥,则可以表示该密钥被正确写入或完整写入ECU。示例性地,这里的密钥包括功能密钥(例如SecOC key,device key)和/或认证密钥(例如MEK)。The key verification method provided by the embodiment of the present application will be introduced below with reference to specific embodiments. It should be noted that in this embodiment of the present application, verifying the key may include verifying the integrity of the key, or may be understood as verifying the integrity of the key. For example, integrity verification of the key may include verifying whether the key is completely written into the ECU, or whether it is correctly written into the ECU. Specifically, for example, if the storage area of the ECU includes the key without tampering, it can mean that the key is correctly written or completely written into the ECU. Illustratively, the key here includes a function key (eg SecOC key, device key) and/or an authentication key (eg MEK).
请参见图2,图2是本申请实施例提供的一种可能的密钥验证方法的流程示意图。进一步的,该方法可以基于图1的架构来实现。该方法可以包括:Please refer to Figure 2, which is a schematic flowchart of a possible key verification method provided by an embodiment of the present application. Further, this method can be implemented based on the architecture of Figure 1. The method can include:
S201,密钥管理实体生成第一信息和第二验证信息。S201. The key management entity generates first information and second verification information.
在本申请实施例中,密钥管理实体用于管理密钥,例如密钥管理实体可以实现如下一项或多项功能:生成密钥、对密钥的授权使用、对密钥的注销管理。需要说明的是,这里的密钥包括车内使用的各种密钥,例如功能密钥和认证密钥,以及其他形式的密钥比如在密钥刷写过程中使用的临时密钥。In this embodiment of the present application, the key management entity is used to manage keys. For example, the key management entity can implement one or more of the following functions: generating keys, authorizing the use of keys, and managing the cancellation of keys. It should be noted that the keys here include various keys used in the car, such as function keys and authentication keys, as well as other forms of keys such as temporary keys used during the key flashing process.
示例性地,该密钥管理实体可以为KMS,进一步地,该KMS受OEM管理,进而保证了车内使用的各种密钥的安全性;或者,该密钥管理实体也可以为包括KMS的OEM服务器,或者该密钥管理实体也可以为整车厂,或者该密钥管理实体也可以直接为OEM服务器。KMS的描述可以参考前述描述,此处不再赘述。此外,为了描述清楚,本申请各实施例以KMS作为密钥管理实体的一个示例进行描述,可以理解的是,KMS也可以替换为密钥管理实体的其他形式。For example, the key management entity can be a KMS. Further, the KMS is managed by the OEM, thereby ensuring the security of various keys used in the car; or the key management entity can also be a KMS that includes a KMS. OEM server, or the key management entity can also be the OEM, or the key management entity can also be directly the OEM server. For the description of KMS, please refer to the foregoing description and will not be repeated here. In addition, for the sake of clarity of description, the embodiments of this application are described using KMS as an example of a key management entity. It is understandable that KMS can also be replaced by other forms of key management entities.
在本申请实施例中,第一信息通过第二密钥的信息指示第一密钥,其中,第二密钥被配置用于认证第一ECU的至少一个功能密钥,该至少一个功能密钥对应该第一ECU的至少一个业务功能。可替换地,第一信息与第二密钥相关联,或者第一信息与第二密钥的信息相关联。为了描述清楚,本申请各实施例以第一信息通过第二密钥的信息指示第一密钥来说明,应理解,第一信息与第二密钥相关联,或者第一信息与第二密钥的信息相关联,可以对应第一信息通过第二密钥的信息指示第一密钥的实现方式。In this embodiment of the present application, the first information indicates the first key through the information of the second key, wherein the second key is configured to authenticate at least one function key of the first ECU, and the at least one function key Corresponds to at least one service function of the first ECU. Alternatively, the first information is associated with the second key, or the first information is associated with information of the second key. For clarity of description, each embodiment of the present application uses the first information to indicate the first key through the information of the second key. It should be understood that the first information is associated with the second key, or the first information is associated with the second key. The information of the second key can be associated with the first information, and the implementation method of the first key can be indicated by the information of the second key corresponding to the first information.
为了描述清楚,本申请各实施例以ECU-1作为第一ECU的一个示例进行描述,应理解,ECU-1也可以替换为第一ECU的其他表示形式。For clarity of description, each embodiment of the present application uses ECU-1 as an example of the first ECU. It should be understood that ECU-1 can also be replaced by other representations of the first ECU.
示例性地,第二密钥为认证密钥,例如MEK。如前所述,MEK除了可以用于认证ECU-1的至少一个功能密钥,还可以用于认证ECU-1的硬件功能密钥。这里的硬件功能密钥可以是多个,也可以是一个,不做具体限定。作为一种可能的实现方式,该MEK可以从KMS处获取。Illustratively, the second key is an authentication key, such as MEK. As mentioned before, in addition to being used to authenticate at least one function key of ECU-1, MEK can also be used to authenticate the hardware function key of ECU-1. The hardware function key here can be multiple or one, and there is no specific limit. As a possible implementation, the MEK can be obtained from KMS.
需要说明的是,ECU-1的至少一个功能密钥,可以包括如下一种实现方式:It should be noted that at least one function key of ECU-1 can include one of the following implementation methods:
方式1:ECU-1的一个功能密钥。进一步地,该功能密钥可以对应该ECU-1的一个或多个业务功能。例如,该功能密钥可以用于板端加密通讯和/或设备认证。Method 1: A function key for ECU-1. Further, the function key may correspond to one or more service functions of the ECU-1. For example, this function key can be used for board-side encrypted communication and/or device authentication.
方式2:ECU-2的多个功能密钥。进一步地,例如该ECU-1可以用于多个业务,因此 该ECU可能具有多个功能密钥,这多个功能密钥可以对应该ECU-1的多个业务功能;又例如ECU-1的多个功能密钥也可以用于同一种业务,比如ECU-1和不同的ECU(例如ECU-2和ECU-3)进行车内通信时,可以使用不同的功能密钥(比如板端加密通讯密钥)实现板端加密通讯,即ECU-1和ECU-2之间可共用同一个功能密钥,比如记为功能密钥1;ECU-2和ECU-3之间可共用另一个功能密钥,比如记为功能密钥2。Method 2: Multiple function keys of ECU-2. Further, for example, the ECU-1 can be used for multiple services, so the ECU may have multiple function keys, and these multiple function keys can correspond to multiple service functions of the ECU-1; for example, the ECU-1 Multiple function keys can also be used for the same service. For example, when ECU-1 communicates with different ECUs (such as ECU-2 and ECU-3) in the vehicle, different function keys (such as board-side encrypted communication) can be used. key) to achieve board-side encrypted communication, that is, ECU-1 and ECU-2 can share the same function key, for example, recorded as function key 1; ECU-2 and ECU-3 can share another function key. key, for example, recorded as function key 2.
此外,如前所述,MEK还可以被配置用于认证多个ECU的至少一个功能密钥,该至少一个功能密钥对应该多个ECU的至少一个业务功能。示例性地,该多个ECU的至少一个业务功能,可以包括如下一种实现方式:In addition, as mentioned above, the MEK can also be configured to authenticate at least one function key of multiple ECUs, and the at least one function key corresponds to at least one service function of the multiple ECUs. Illustratively, at least one business function of the multiple ECUs may include one of the following implementation methods:
方式A:多个ECU的一个功能密钥。进一步地,该功能密钥可以对应该多个ECU的一个或多个业务功能。例如,若多个ECU均用于板端加密通讯,则该多个ECU可以使用相同的功能密钥(比如板端加密通讯密钥)实现板端加密通讯,或者该功能密钥除了可以对应板端加密通讯,还可以用于设备认证。Method A: One function key for multiple ECUs. Further, the function key may correspond to one or more business functions of the multiple ECUs. For example, if multiple ECUs are used for board-side encrypted communication, the multiple ECUs can use the same function key (such as the board-side encrypted communication key) to implement board-side encrypted communication, or the function key can be used in addition to the board-side encrypted communication key. End-to-end encrypted communication can also be used for device authentication.
方式B:多个ECU的多个功能密钥。进一步地,该多个功能密钥可以对应该多个ECU的一个业务功能或多个业务功能。例如,该多个ECU均可以用于板端加密通讯,但不同的ECU可以通过不同的功能密钥实现板端加密通讯;又例如,该多个ECU中有的ECU对应一种业务,有的ECU对应另外一种业务,此时这多个功能密钥可以分别对应不同的业务。Method B: Multiple function keys for multiple ECUs. Further, the multiple function keys may correspond to one business function or multiple business functions of the multiple ECUs. For example, the multiple ECUs can all be used for board-side encrypted communication, but different ECUs can implement board-side encrypted communication through different function keys; for another example, some of the multiple ECUs correspond to one type of business, and some The ECU corresponds to another service. At this time, these multiple function keys can correspond to different services respectively.
需要说明的是,在本申请实施例中,功能密钥对应业务功能,可以理解为,在实现该业务功能的过程中,会使用该功能密钥。It should be noted that in the embodiment of the present application, the function key corresponds to a business function, which can be understood to mean that the function key will be used in the process of realizing the business function.
示例性地,第一密钥可以为功能密钥,或者为临时密钥。其中,临时密钥可以包括MEK或者功能密钥的派生密钥,用于加密和/或完整性保护产生的中间密钥。在本申请实施例中,为了实现对MEK的完整性验证,可以使用第一密钥作为中间密钥。在一种可能的实现方式中,该第一密钥可以从KMS处获取。示例性地,第一密钥可以是KMS预先生成并保存在本地维护的数据库中的密钥,也可以是随机生成的密钥。本申请实施例中对此不做限定。为了简化描述,本申请实施例中的下述内容以VRF_K作为第一密钥的一种表示形式进行描述,可以理解的是,第一密钥也可以具有其他的表示形式。For example, the first key may be a functional key or a temporary key. The temporary key may include a MEK or a derived key of the function key, which is used for encryption and/or integrity protection of the generated intermediate key. In this embodiment of the present application, in order to implement integrity verification of the MEK, the first key can be used as the intermediate key. In a possible implementation manner, the first key can be obtained from KMS. For example, the first key may be a key pre-generated by KMS and stored in a locally maintained database, or it may be a randomly generated key. This is not limited in the embodiments of the present application. In order to simplify the description, the following content in the embodiment of the present application is described using VRF_K as a representation form of the first key. It can be understood that the first key may also have other representation forms.
在一种可能的实现方式中,第一信息包括通过MEK进行加密和/或完整性保护得到的信息。基于此,KMS可实现第一信息通过第二密钥的信息指示第一密钥。示例性地,例如第一信息可以包括通过加密算法和/或完整性保护算法,基于认证密钥MEK以及待写入的密钥VRK_K生成的信息,且该第一信息可以用于写入第一密钥。In a possible implementation, the first information includes information encrypted and/or integrity protected through MEK. Based on this, KMS can realize that the first information indicates the first key through the information of the second key. For example, for example, the first information may include information generated based on the authentication key MEK and the key VRK_K to be written through an encryption algorithm and/or an integrity protection algorithm, and the first information may be used to write the first key.
在又一种可能的实现方式中,第一信息包括通过MEK的派生密钥进行加密和/或完整性保护得到的信息。基于此,KMS可以实现第一信息通过第二密钥的信息指示第一密钥。第一信息可以是通过MEK的一个或多个派生密钥进行加密和/或完整性保护计算所得到的信息,进一步地,在一种可选的设计中,该第一信息可以用于写入VRK_K。由于第一信息包括通过MEK的派生密钥进行加密和/或完整性保护得到的信息,因此保证了MEK没有以明文形式暴露在KMS之外,保证了MEK的安全性。需要说明的是,在本申请各实施例中,通过MEK的派生密钥进行完整性保护得到的信息,可以包括通过MEK的派生密钥结合完整性保护算法中的一个算法或多个算法得到的信息,本申请实施例不做具体限定。例如通过MEK的派生密钥结合完整性保护算法中的标签计算算法得到的信息,可以理解为 通过MEK的派生密钥进行完整性保护得到的信息。应理解,一个派生密钥可以用于加密和完整性保护计算,或者也可以只用于加密或者完整性保护计算。基于此,当一个派生密钥仅用于加密或者完整性保护计算时,第一信息需要通过MEK的多个派生密钥实现加密和完整性保护计算。In yet another possible implementation, the first information includes information encrypted and/or integrity protected using the derived key of the MEK. Based on this, KMS can realize that the first information indicates the first key through the information of the second key. The first information may be information obtained by encrypting and/or integrity protecting calculations using one or more derived keys of the MEK. Further, in an optional design, the first information may be used to write VRK_K. Since the first information includes information obtained by encryption and/or integrity protection using the derived key of the MEK, it is ensured that the MEK is not exposed outside the KMS in plain text, and the security of the MEK is ensured. It should be noted that in various embodiments of the present application, the information obtained by integrity protection using the MEK derived key may include information obtained by using the MEK derived key combined with one or more algorithms in the integrity protection algorithm. Information is not specifically limited in the embodiments of this application. For example, the information obtained by combining the MEK derived key with the label calculation algorithm in the integrity protection algorithm can be understood as the information obtained by integrity protection using the MEK derived key. It should be understood that a derived key can be used for encryption and integrity protection calculations, or it can be used only for encryption or integrity protection calculations. Based on this, when a derived key is only used for encryption or integrity protection calculations, the first information needs to implement encryption and integrity protection calculations through multiple derived keys of the MEK.
示例性地,KMS可以通过KDF,基于MEK、参数Key_update_ENC_C以及Key_update_MAC_C,派生出与MEK对应的K1’、K2’两个派生密钥,这两个派生密钥分别用于加密和完整性保护。其中,参数Key_update_ENC_C和Key_update_MAC_C的具体取值可以是预定义的,比如在相关的技术规范中预定义。所述技术规范例如可以AUTOSAR组织发布的安全硬件扩展SHE技术规范。K1’、K2’例如可通过如下公式(1)和公式(2)实现:For example, KMS can use KDF to derive two derived keys K1' and K2' corresponding to MEK based on MEK, parameters Key_update_ENC_C and Key_update_MAC_C. These two derived keys are used for encryption and integrity protection respectively. Among them, the specific values of the parameters Key_update_ENC_C and Key_update_MAC_C may be predefined, for example, in relevant technical specifications. The technical specifications may be, for example, the security hardware extension SHE technical specifications released by the AUTOSAR organization. K1’, K2’ can be realized by the following formula (1) and formula (2), for example:
K1’=第一KDF(MEK,Key_update_ENC_C) 公式(1)K1’ = first KDF (MEK, Key_update_ENC_C) formula (1)
K2’=第一KDF(MEK,Key_update_MAC_C) 公式(2)K2’ = first KDF (MEK, Key_update_MAC_C) formula (2)
此后,KMS可以通过加密算法基于上述K1’对VRK_K加密得到第一信息中包括的第三信息,例如KMS使用AES算法实现K1’对VRK_K的加密;KMS还可以使用MAC算法基于K2’对VRF_K进行完整性保护得到第一信息中包括的第四信息。应理解,加密算法和完整性保护算法包括但不限于上述描述的具体实现方式,本申请实施例在此不做具体限定。Thereafter, KMS can encrypt VRK_K based on the above K1' through the encryption algorithm to obtain the third information included in the first information. For example, KMS uses the AES algorithm to encrypt VRK_K by K1'; KMS can also use the MAC algorithm to encrypt VRF_K based on K2'. Integrity protection results from fourth information included in the first information. It should be understood that encryption algorithms and integrity protection algorithms include but are not limited to the specific implementations described above, and are not specifically limited in the embodiments of the present application.
进一步地,KMS还可以将ECU-1的身份信息、VRF_K的索引以及MEK的索引级联,以得到第一信息中包括的第二信息。Further, the KMS can also concatenate the identity information of ECU-1, the index of VRF_K, and the index of MEK to obtain the second information included in the first information.
其中,VRF_K的索引可以用于唯一标识VRF_K,MEK的索引可以用于唯一标识MEK。应理解,不同的密钥在ECU内需要分别保存,以保证不同的密钥不会相互覆盖,进而保证不同密钥的正常使用。基于此,在一种可选的设计中,VRF_K的索引也可以理解为用于指示该VRF_K在ECU-1内保存的地址信息,类似地,MEK的索引可以用于指示MEK在ECU-1内保存的地址信息。不同密钥在ECU内保存的地址信息例如可在相关的技术规范中预定义,比如在SHE技术规范中,规定了MEK对应的地址信息为0x1,KEY1~KEY10对应的地址信息分别为0x4~0xd,RAM_KEY对应的地址信息为0xe,这里KEY1~KEY10可以对应功能密钥,RAM_KEY可以对应临时密钥。Among them, the index of VRF_K can be used to uniquely identify VRF_K, and the index of MEK can be used to uniquely identify MEK. It should be understood that different keys need to be stored separately in the ECU to ensure that different keys do not cover each other, thereby ensuring the normal use of different keys. Based on this, in an optional design, the index of VRF_K can also be understood as indicating the address information of the VRF_K stored in ECU-1. Similarly, the index of MEK can be used to indicate that MEK is stored in ECU-1. Saved address information. The address information stored in the ECU for different keys can be predefined in relevant technical specifications. For example, in the SHE technical specifications, it is stipulated that the address information corresponding to MEK is 0x1, and the address information corresponding to KEY1~KEY10 is 0x4~0xd respectively. , the address information corresponding to RAM_KEY is 0xe, where KEY1~KEY10 can correspond to function keys, and RAM_KEY can correspond to temporary keys.
ECU-1的身份信息为该ECU-1的身份标识或者为ECU-1的组标识。The identity information of ECU-1 is the identity identifier of ECU-1 or the group identifier of ECU-1.
在本申请实施例中,ECU-1的身份标识用于唯一标识该ECU-1。示例性地,ECU-1的身份标识包括:ECU-1的设备识别码和该ECU-1的设备类型。其中,ECU-1的设备识别码例如可以是零件编号(part number,PART#),ECU-1的设备类型例如可以包括但不限于:发动机管理系统(engine management system,EMS)、自动变速箱控制单元(transmission control unit,TCU)、车身控制模块(body control module,BCM)、电子稳定控制系统(electronic stability program,ESP)、电池管理系统(battery management system,BMS)、整车控制器(vehicle control unit,VCU)等。在有些情况下,ECU-1的设备识别码中可以包括该ECU-1的设备类型的指示信息,在这种情况下,ECU-1可以直接由设备识别码来标识。In this embodiment of the present application, the identity of ECU-1 is used to uniquely identify the ECU-1. For example, the identity of ECU-1 includes: the device identification code of ECU-1 and the device type of ECU-1. The device identification code of ECU-1 may be, for example, a part number (PART#), and the device type of ECU-1 may include, for example, but is not limited to: engine management system (engine management system, EMS), automatic transmission control Transmission control unit (TCU), body control module (BCM), electronic stability program (ESP), battery management system (BMS), vehicle control unit, VCU), etc. In some cases, the device identification code of ECU-1 may include indication information of the device type of the ECU-1. In this case, ECU-1 may be directly identified by the device identification code.
在本申请实施例中,ECU-1的组标识用于标识该ECU-1所属的设备组,该设备组中包括的所有ECU具有公共的属性。示例性地,ECU-1的组标识可以用于标识该ECU-1对应 的产线批次,对应地,该ECU-1所属的设备组中包括的所有ECU属于相同的产线批次;和/或ECU-1的组标识可以用于标识该ECU-1对应的设备类型,对应地,该ECU-1所属的设备组中包括的所有ECU对应相同的设备类型;和/或,该ECU-1的组标识可以用于标识该ECU-1对应的业务功能,对应地,该ECU-1所属的设备组中包括的所有ECU对应相同的业务功能。例如,ECU的设备识别码由W位数字组成,其中的W1位数字表示该ECU对应的以下一项或多项:产线批次,设备类型,业务功能,W2位数字表示该ECU不同于该设备组中的其他ECU所特有的信息,W=W1+W2。在这种情况下,ECU-1的组标识中可以包括至少一个通配符,用于表示该设备组中包括的所有ECU各自对应的特有信息,该通配符可以通过特殊字符例如#、%、#等实现,也可以通过特殊的数字组合例如全0数字组合实现。应理解,基于ECU-1的组标识中包括通配符,可以实现第二信息对多个ECU有效,进而实现KMS对多个ECU的第一密钥的批量刷写,节省了信令开销。In this embodiment of the present application, the group identifier of ECU-1 is used to identify the device group to which the ECU-1 belongs, and all ECUs included in the device group have common attributes. For example, the group identifier of ECU-1 can be used to identify the production line batch corresponding to the ECU-1. Correspondingly, all ECUs included in the equipment group to which the ECU-1 belongs belong to the same production line batch; and /or the group identifier of ECU-1 can be used to identify the device type corresponding to the ECU-1. Correspondingly, all ECUs included in the device group to which the ECU-1 belongs correspond to the same device type; and/or, the ECU- The group identifier of 1 can be used to identify the service function corresponding to the ECU-1. Correspondingly, all ECUs included in the device group to which the ECU-1 belongs correspond to the same service function. For example, the equipment identification code of an ECU consists of W digits, of which the W1 digit indicates one or more of the following corresponding to the ECU: production line batch, equipment type, business function, and the W2 digit indicates that the ECU is different from the Information unique to other ECUs in the device group, W=W1+W2. In this case, the group identifier of ECU-1 may include at least one wildcard character, which is used to represent the unique information corresponding to all ECUs included in the device group. The wildcard character may be implemented by special characters such as #, %, #, etc. , can also be achieved through special number combinations such as all-0 number combinations. It should be understood that wildcards are included in the group identifier based on ECU-1, so that the second information can be valid for multiple ECUs, thereby enabling KMS to flash the first keys of multiple ECUs in batches, thus saving signaling overhead.
为了进一步地理解第一信息是如何通过MEK的信息指示VRF_K,下述示例了一种第一信息的实现方式。具体的,第一信息包括第二信息M1’、第三信息M2’以及第四信息M3’,示例性地,例如第一信息可以表示为M1’||M2’||M3’。其中M1’可以为M1’=UID||VRF_K_ID||MEK_ID,UID表示ECU-1的身份信息,VRF_K_ID和MEK_ID分别表示第一密钥的索引和MEK的索引,||表示信息级联运算,例如A||B表示将信息A和B级联。M2’可以为M2’=ENC CBC,K1’,IV’=0(C ID’||F ID’||VRF_K),即KMS将C ID’、F ID'和VRF_K级联后,再以K1’为密钥通过CBC模式加密形成第三信息。M3’可以为M3’=CMAC K2’(M1’||M2’),即KMS通过将M1’和M2’级联后,再以K2’为密钥经过CMAC计算而成的MAC值即为M3’。在上述过程中,K1’和K2’均为MEK的派生密钥。C ID’是由KMS本地的计数器(count,CNT)输出的计数值,可用于计数,每次加密前可以自动加1,后续通过验证接收到的CNT与本地生成的CNT的大小关系,可以达到防重放攻击的目的,所谓的重放攻击就是攻击者发送一个目的主机已接收过的包,来达到欺骗系统的目的,主要用于身份认证过程,破坏认证的正确性。F ID’用于配置VRF_K_ID所对应的存储区域的安全标志,安全标志例如可以包括AUTOSAR技术规范中定义的安全标志,该安全标志可以包括写保护标志(WRITE_PROTECTION),启动保护标志(BOOT_PROTECTION),调试保护标志(DEBUGGER_PROTECTION),密钥用途标志(KEY_USAGE),通配符标志(WILDCARD),IV’=0表示基于CBC模式加密所使用的初始化向量为全0向量。需要说明的是,在本申请实施例中,上述级联信息除了包括如上信息之外,还可以包括其他信息,本申请实施例不做具体限定。应理解,在此列举的用于生成M2’的加密算法和用于生成M3’的MAC算法仅为示例,不应对本申请实施例构成任何限定,加密算法和完整性保护算法还可以包括但不限于上述描述的具体实现方式,本申请实施例在此不做具体限定。 In order to further understand how the first information indicates VRF_K through the MEK information, the following illustrates an implementation of the first information. Specifically, the first information includes second information M1', third information M2' and fourth information M3'. For example, the first information can be expressed as M1'||M2'||M3'. Where M1' can be M1'=UID||VRF_K_ID||MEK_ID, UID represents the identity information of ECU-1, VRF_K_ID and MEK_ID represent the index of the first key and the index of MEK respectively, || represents the information cascade operation, for example A||B means concatenating information A and B. M2' can be M2'=ENC CBC,K1',IV'=0 (C ID '||F ID '||VRF_K), that is, after KMS cascades C ID ', F ID ' and VRF_K, and then K1 ' is the key that is encrypted in CBC mode to form the third information. M3' can be M3'=CMAC K2' (M1'||M2'), that is, the MAC value calculated by KMS through CMAC after concatenating M1' and M2' using K2' as the key is M3 '. In the above process, K1' and K2' are both derived keys of MEK. C ID ' is the count value output by the KMS local counter (count, CNT), which can be used for counting. It can be automatically added by 1 before each encryption. Subsequently, by verifying the size relationship between the received CNT and the locally generated CNT, it can be achieved The purpose of preventing replay attacks is that the attacker sends a packet that has been received by the destination host to deceive the system. It is mainly used in the identity authentication process to destroy the correctness of the authentication. F ID 'is used to configure the security flag of the storage area corresponding to VRF_K_ID. The security flag can include, for example, the security flag defined in the AUTOSAR technical specification. The security flag can include the write protection flag (WRITE_PROTECTION), the startup protection flag (BOOT_PROTECTION), the debugging Protection flag (DEBUGGER_PROTECTION), key usage flag (KEY_USAGE), wildcard flag (WILDCARD), IV'=0 indicates that the initialization vector used for encryption based on CBC mode is an all-0 vector. It should be noted that in the embodiment of the present application, in addition to the above information, the above-mentioned cascade information may also include other information, which is not specifically limited in the embodiment of the present application. It should be understood that the encryption algorithm used to generate M2' and the MAC algorithm used to generate M3' listed here are only examples and should not constitute any limitation on the embodiments of the present application. Encryption algorithms and integrity protection algorithms may also include but are not Limited to the specific implementation described above, the embodiments of the present application are not specifically limited here.
在本申请实施例中,第二验证信息包括用于VRF_K完整性验证的信息。例如,第二验证信息包括VRF_K,该VRF_K可用于VRF_K的完整性验证,具体地,客户端可以通过接收该VRF_K再结合本地生成的第一验证参数,确定本地验证信息,该本地验证信息可以用于VRF_K和/或MEK的完整性验证。又例如,第二验证信息包括第二验证参数,以及通过VRF_K对第二验证参数进行完整性保护得到的信息,其中第二验证参数用于验证VRF_K的完整性,第二验证参数可以是KMS随机生成的信息,也可以是KMS按照一定的规则生 成的信息,或者通过其他方式生成的信息,这里不做具体限定。在一种可选的设计中,第二验证参数(比如记为VRF_M)与通过VRF_K对第二验证参数进行完整性保护得到的信息(比如记为VRF_MAC)满足如下关系:VRF_MAC=CMAC VRF_K(VRF_M)。KMS以VRF_K为密钥经过CMAC计算生成VRF_K的完整性验证信息(即VRF_MAC),VRF_MAC可以用于表征VRF_K的完整性。 In this embodiment of the present application, the second verification information includes information used for VRF_K integrity verification. For example, the second verification information includes VRF_K, which can be used to verify the integrity of VRF_K. Specifically, the client can determine the local verification information by receiving the VRF_K and combining it with the locally generated first verification parameter. The local verification information can be used Integrity verification of VRF_K and/or MEK. For another example, the second verification information includes a second verification parameter and information obtained by performing integrity protection on the second verification parameter through VRF_K. The second verification parameter is used to verify the integrity of VRF_K. The second verification parameter may be KMS random. The generated information can also be information generated by KMS according to certain rules, or information generated by other methods, which is not specifically limited here. In an optional design, the second verification parameter (for example, marked as VRF_M) and the information obtained by integrity protecting the second verification parameter through VRF_K (for example, marked as VRF_MAC) satisfy the following relationship: VRF_MAC=CMAC VRF_K (VRF_M ). KMS uses VRF_K as the key to generate the integrity verification information (i.e. VRF_MAC) of VRF_K through CMAC calculation. VRF_MAC can be used to characterize the integrity of VRF_K.
S202,密钥管理实体向客户端发送第一信息和第二验证信息。S202: The key management entity sends the first information and the second verification information to the client.
相应地,该客户端接收来自密钥管理实体的第一信息和第二验证信息。Correspondingly, the client receives the first information and the second verification information from the key management entity.
在本申请实施例中,客户端可以用于密钥刷写,即通过客户端可以实现密钥(比如认证密钥、认证密钥以及其他临时密钥)写入到整车内的ECU中。客户端例如可以为OEM密钥刷写装置或者为经销商诊断仪或者为车载诊断(On Board Diagnostics,OBD)。OEM密钥刷写装置也可以被称为OEM诊断工具,或者被称为OEM诊断仪,经销商诊断仪也可以被称为经销商密钥刷写装置,本申请实施例不做具体限定。此外,客户端还可以包括OEM服务器或者包括经销商服务器。In this embodiment of the present application, the client can be used for key writing, that is, the client can write keys (such as authentication keys, authentication keys, and other temporary keys) into the ECU in the vehicle. For example, the client can be an OEM key flashing device, a dealer diagnostic instrument, or an on-board diagnostic (On Board Diagnostics, OBD). The OEM key writing device may also be called an OEM diagnostic tool or an OEM diagnostic instrument, and the dealer diagnostic instrument may also be called a dealer key writing device, which is not specifically limited in the embodiments of this application. In addition, the client can also include an OEM server or a dealer server.
示例性地,如果客户端为OEM密钥刷写装置,KMS向客户端发送第一信息和第二验证信息,可以包括:KMS直接向OEM密钥刷写装置发送第一信息和第二验证信息,或者KMS先将第一信息和第二验证信息发送给OEM服务器,再由OEM服务器将该第一信息和第二验证信息转发给该OEM密钥刷写装置。For example, if the client is an OEM key writing device, KMS sends the first information and the second verification information to the client, which may include: KMS directly sends the first information and the second verification information to the OEM key writing device. , or the KMS first sends the first information and the second verification information to the OEM server, and then the OEM server forwards the first information and the second verification information to the OEM key writing device.
示例性地,如果客户端包括OEM服务器和OEM密钥刷写装置,KMS向客户端发送第一信息和第二验证信息,可以包括:KMS直接向客户端发送第一信息和第二验证信息。进一步地,OEM服务器可以接收来自KMS的第一信息和第二验证信息,然后再将其转发给OEM密钥刷写装置。应理解,在这种情况下,上述的密钥管理实体可以不包括OEM服务器。For example, if the client includes an OEM server and an OEM key writing device, KMS sending the first information and the second verification information to the client may include: KMS directly sending the first information and the second verification information to the client. Further, the OEM server may receive the first information and the second verification information from the KMS, and then forward them to the OEM key flashing device. It should be understood that in this case, the above-mentioned key management entity may not include the OEM server.
示例性地,如果客户端为经销商诊断仪,KMS向客户端发送第一信息和第二验证信息,可以包括:KMS直接向经销商诊断仪发送第一信息和第二验证信息,或者KMS先将第一信息和第二验证信息发送给OEM服务器或者经销商服务器,再由该OEM服务器或者该经销商服务器将该第一信息和第二验证信息转发给该经销商诊断仪。For example, if the client is a dealer diagnostic device, the KMS sending the first information and the second verification information to the client may include: the KMS directly sending the first information and the second verification information to the dealer diagnostic device, or the KMS first sending the first information and the second verification information to the dealer diagnostic device. The first information and the second verification information are sent to the OEM server or the dealer server, and then the OEM server or the dealer server forwards the first information and the second verification information to the dealer diagnostic instrument.
示例性地,如果客户端包括经销商服务器和经销商诊断仪,KMS向客户端发送第一信息和第二验证信息,可以包括:KMS直接向该客户端发送第一信息和第二验证信息。进一步地,经销商服务器可以接收来自KMS或者来自OEM服务器的第一信息和第二验证信息,然后再将其转发给经销商诊断仪。其中,在后一种情况下,OEM服务器可以先从KMS处接收第一信息和第二验证信息。For example, if the client includes a dealer server and a dealer diagnostic instrument, the KMS sending the first information and the second verification information to the client may include: the KMS directly sending the first information and the second verification information to the client. Further, the dealer server may receive the first information and the second verification information from the KMS or the OEM server, and then forward them to the dealer diagnostic instrument. In the latter case, the OEM server may first receive the first information and the second verification information from the KMS.
为了描述清楚,本申请各实施例以OEM密钥刷写装置作为客户端的一个示例进行描述,可以理解的是,OEM密钥刷写装置也可以替换为客户端的其他形式。For clarity of description, the embodiments of this application are described using an OEM key writing device as an example of a client. It can be understood that the OEM key writing device can also be replaced by other forms of clients.
在本申请实施例中,第一信息可以应用于一个ECU,或者应用于多个ECU,第二验证信息可以应用于一个ECU,或者应用于多个ECU。示例性地,例如待进行MEK完整性验证的ECU包括ECU-1、ECU-2和ECU-3,一种情况下,这三个ECU可以对应相同的VRF_K,相应地,KMS可以通过相同的第一信息指示第一密钥,并且这三个ECU对应的第二验证信息也是相同的;另外一种情况下,这三个ECU可以对应不同的VRF_K,相应地,这三 个ECU对应的第一信息彼此不同,对应的第二验证信息也彼此不同。In this embodiment of the present application, the first information may be applied to one ECU or to multiple ECUs, and the second verification information may be applied to one ECU or to multiple ECUs. For example, the ECUs to be verified for MEK integrity include ECU-1, ECU-2 and ECU-3. In one case, these three ECUs can correspond to the same VRF_K. Correspondingly, the KMS can pass the same VRF_K. A message indicates the first key, and the second verification information corresponding to these three ECUs is also the same; in another case, these three ECUs can correspond to different VRF_K, and accordingly, the first verification information corresponding to these three ECUs The information is different from each other, and the corresponding second verification information is also different from each other.
应理解,KMS可以将第一信息和第二验证信息携带在同一条信令中发送,或者也可以通过不同的信令分别发送第一信息和第二验证信息。如果第一信息中包括多个信息,例如第一信息包括第二信息、第三信息以及第四信息,KMS可以用不同的信令分别发送第一信息中包括的不同信息,或者也可以通过同一条信令发送该第一信息包括的所有信息。此外,如果不同的ECU对应不同的第一密钥,相应地,基于该第一密钥生成的第一信息和第二验证信息也是不同的,例如记为第一信息-1,第一信息-2和第一信息-3,以及第二验证信息-1、第二验证信息-2,第二验证信息-3。在这种情况下KMS可以将不同的第一信息和不同的第二验证信息携带在同一条信令中发送,也可以通过不同的信令分别发送第一信息-1,第一信息-2以及第一信息-3、和第二验证信息-1、第二验证信息-2以及第二验证信息-3,或者也可以通过不同的信令将各自ECU所对应的第一信息和第二验证信息分别发送给OEM密钥刷写装置,比如通过信令1将第一信息-1和第一验证信息-1、通过信令2将第一信息-2和第一验证信息-2、通过信令3将第一信息-3和第一验证信息-3发送给OEM密钥刷写装置,进一步地,OEM密钥刷写装置可以将这些信息分别发送给各自对应的ECU。KMS还可以通过其他方式发送第一信息和第二验证信息,本申请实施例在此不做具体限定。It should be understood that the KMS may carry and send the first information and the second verification information in the same signaling, or may send the first information and the second verification information respectively through different signaling. If the first information includes multiple pieces of information, for example, the first information includes second information, third information and fourth information, the KMS can use different signaling to send the different information included in the first information respectively, or it can also send the different information included in the first information through the same process. One piece of signaling sends all the information included in the first information. In addition, if different ECUs correspond to different first keys, correspondingly, the first information and the second verification information generated based on the first key are also different, for example, recorded as first information-1, first information- 2 and the first information-3, as well as the second verification information-1, the second verification information-2, and the second verification information-3. In this case, KMS can carry different first information and different second verification information in the same signaling and send it, or it can send the first information-1, the first information-2 and the first information-2 through different signaling respectively. The first information-3, and the second verification information-1, the second verification information-2 and the second verification information-3, or the first information and the second verification information corresponding to the respective ECUs can also be used through different signaling. Send them to the OEM key flashing device respectively, such as the first information-1 and the first verification information-1 through signaling 1, the first information-2 and the first verification information-2 through signaling 2, and the first information-2 and first verification information-2 through signaling 2. 3. Send the first information-3 and the first verification information-3 to the OEM key flashing device. Further, the OEM key flashing device can send these information to respective corresponding ECUs. The KMS may also send the first information and the second verification information in other ways, which are not specifically limited in the embodiments of this application.
S203,OEM密钥刷写装置向ECU-1发送第一信息和第一验证参数。S203. The OEM key rewriting device sends the first information and the first verification parameter to the ECU-1.
相应地,ECU-1接收第一信息和第一验证参数。Accordingly, ECU-1 receives the first information and the first verification parameter.
OEM密钥刷写装置将来自KMS的第一信息转发给ECU-1,以使得ECU-1可以基于第一信息确定VRF_K。The OEM key flashing device forwards the first information from the KMS to the ECU-1, so that the ECU-1 can determine VRF_K based on the first information.
需要说明的是,在本申请各实施例中,转发可以理解为透传,即在此场景下,OEM密钥刷写装置可以将来KMS的第一信息直接透传给ECU-1,在此过程中,OEM密钥装置对第一信息不做任何处理。It should be noted that in each embodiment of the present application, forwarding can be understood as transparent transmission, that is, in this scenario, the OEM key flashing device can directly transparently transmit the first information of the KMS to ECU-1. In this process , the OEM key device does not perform any processing on the first information.
在本申请实施例中,第一验证参数用于验证VRF_K的完整性。例如,第一验证参数为第二验证参数,即OEM密钥刷写装置可以将来自KMS的第二验证参数直接转发给第一ECU。又例如,第一验证参数为OEM密钥刷写装置生成的信息,比如OEM密钥刷写装置随机生成的信息,又比如OEM密钥刷写装置按照一定的规则生成的信息。此外,OEM密钥刷写装置也可以通过其他方式生成第一验证参数,这里不做具体限定。应理解,第一验证参数也可以应用于多个ECU,即对于包括ECU-1的多个ECU而言,第一验证参数可以是相同的。In the embodiment of this application, the first verification parameter is used to verify the integrity of VRF_K. For example, the first verification parameter is the second verification parameter, that is, the OEM key flashing device can directly forward the second verification parameter from the KMS to the first ECU. For another example, the first verification parameter is information generated by the OEM key writing device, such as information generated randomly by the OEM key writing device, or information generated by the OEM key writing device according to certain rules. In addition, the OEM key flashing device can also generate the first verification parameter through other methods, which are not specifically limited here. It should be understood that the first verification parameter may also be applied to multiple ECUs, that is, the first verification parameter may be the same for multiple ECUs including ECU-1.
应理解,OEM密钥刷写装置将第一信息和第一验证参数携带在同一条信令中发送,节省信令开销,或者也可以通过不同的信令分别发送第一信息和第一验证参数,实现第一信息和第一验证参数指示的灵活性。It should be understood that the OEM key flashing device carries the first information and the first verification parameter in the same signaling and sends it to save signaling overhead, or it can also send the first information and the first verification parameter separately through different signaling. , achieving flexibility in indication of the first information and the first verification parameter.
需要说明的是,在本申请实施例中,OEM密钥刷写装置可以将第一信息和第一验证参数直接发送给该ECU-1,例如OEM密钥刷写装置直接与ECU-1相连,并将第一信息和第一验证参数发送给ECU-1;又或者,如果包括该ECU-1的功能部件支持转发机制,那么OEM密钥刷写装置可以将第一信息和第一验证参数先发送给包括该功能部件,再由功能部件通过内部的转发机制将第一信息和第一验证参数发送给ECU-1,这种情况下,可以理解的是,OEM密钥刷写装置可以与该功能部件直接相连。示例性地,该功能部件为包含一个 或多个ECU的域控制器(domain controller,DC)或者为车内的密钥管理系统。此外,在本申请各实施例中,域控制器也可以看为一个电子功能部件ECU,即该域控制器可以直接接收来自客户端的第一信息。It should be noted that in the embodiment of the present application, the OEM key writing device can directly send the first information and the first verification parameter to the ECU-1. For example, the OEM key writing device is directly connected to the ECU-1. and send the first information and the first verification parameter to ECU-1; or, if the functional component including the ECU-1 supports the forwarding mechanism, the OEM key flashing device can send the first information and the first verification parameter first. is sent to the functional component, and then the functional component sends the first information and the first verification parameter to ECU-1 through the internal forwarding mechanism. In this case, it can be understood that the OEM key flashing device can communicate with the Functional components are directly connected. For example, the functional component is a domain controller (DC) containing one or more ECUs or a key management system in the car. In addition, in various embodiments of the present application, the domain controller can also be regarded as an electronic functional component ECU, that is, the domain controller can directly receive the first information from the client.
S204,ECU-1根据MEK和第一验证参数,生成第一验证信息。S204, ECU-1 generates first verification information based on the MEK and the first verification parameter.
其中,该第一验证信息用于表征第一密钥的完整性。The first verification information is used to represent the integrity of the first key.
示例性地,ECU-1根据MEK和第一验证参数,生成第一验证信息,可以包括:ECU-1通过MEK对接收到的第一信息进行解密和/或完整性校验,以确定VRF_K,再根据该VRF_K与接收到的第一验证参数,生成用于表征第一密钥完整性的第一验证信息。进一步地,在一种可选的设计中,ECU-1通过MEK对接收到的第一信息进行解密和/或完整性校验,以确定VRF_K,可以包括:ECU-1先基于接收到的第一信息,确定通过MEK实现对该第一信息的解密和/或完整性校验,之后再通过本地保存的MEK对该第一信息执行具体的解密和/或完整性校验,进而确定VRF_K。此外ECU-1可以基于MAC算法,通过确定的VRF_K和第一验证参数,得到第一验证信息,例如第一验证信息(比如记为MAC_T)与第一验证参数(比如记为VRF_M)满足如下关系:MAC_T=CMAC VRF_K(VRF_M)。 Exemplarily, ECU-1 generates first verification information based on MEK and the first verification parameter, which may include: ECU-1 decrypts and/or integrity checks the received first information through MEK to determine VRF_K, Then, according to the VRF_K and the received first verification parameter, first verification information used to represent the integrity of the first key is generated. Further, in an optional design, ECU-1 decrypts and/or integrity checks the received first information through MEK to determine VRF_K, which may include: ECU-1 first based on the received first information For a piece of information, it is determined that the MEK is used to decrypt and/or integrity check the first information, and then the locally saved MEK is used to perform specific decryption and/or integrity check on the first information, and then the VRF_K is determined. In addition, ECU-1 can obtain the first verification information based on the MAC algorithm through the determined VRF_K and the first verification parameter. For example, the first verification information (such as MAC_T) and the first verification parameter (such as VRF_M) satisfy the following relationship :MAC_T=CMAC VRF_K (VRF_M).
在一种可选的设计中,该ECU-1确定VRF_K之后,可以将VRF_K存储在本地。In an optional design, after the ECU-1 determines VRF_K, it can store VRF_K locally.
对应于步骤S201中一种具体的第一信息实现方式,下述示例了一种ECU-1根据MEK和第一验证参数,生成第一验证信息的具体实现方式,在该例中,第一信息包括第二信息M1’、第三信息M2’以及第四信息M3’,其中M1’、M2’以及M3’具体实施方式可以参考步骤201中的相应描述,这里不做赘述。ECU-1根据接收到的M1’,确定MEK的索引(即MEK_ID),基于此,ECU-1将本地保存的且与MEK_ID所对应的密钥作为MEK,用于VRF_K的完整性验证和解密。例如,ECU-1可以先基于在本地保存的MEK和接收到的M3’,完成对VRF_K或第一信息的完整性校验,以保证VRF_K或第一信息未经篡改。在对VRF_K或第一信息的完整性验证成功的情况下,ECU-1再根据在本地保存的MEK解密M2’,以确定VRF_K。在一种可选的设计中,ECU-1确定VRF_K之后,可以基于M1’中包括的VRF_K的索引所指示的地址信息,将解密M2’确定得到的VRF_K保存在对应该地址信息的本地内存中。进一步地,ECU-1在确定VRF_K之后,可以根据确定得到的VRF_K和第一验证参数,生成第一验证信息,具体生成过程可以参考上述描述,这里不做赘述。Corresponding to a specific implementation method of the first information in step S201, the following example illustrates a specific implementation method for ECU-1 to generate the first verification information based on the MEK and the first verification parameter. In this example, the first information It includes second information M1', third information M2' and fourth information M3'. For the specific implementation of M1', M2' and M3', reference can be made to the corresponding description in step 201, which will not be described again here. ECU-1 determines the index of the MEK (i.e. MEK_ID) based on the received M1'. Based on this, ECU-1 uses the locally saved key corresponding to the MEK_ID as the MEK for integrity verification and decryption of the VRF_K. For example, ECU-1 can first complete the integrity check of VRF_K or the first information based on the locally saved MEK and the received M3' to ensure that the VRF_K or the first information has not been tampered with. If the integrity verification of VRF_K or the first information is successful, ECU-1 then decrypts M2' according to the locally saved MEK to determine VRF_K. In an optional design, after ECU-1 determines VRF_K, it can store the VRF_K determined by decrypting M2' in the local memory corresponding to the address information based on the address information indicated by the index of VRF_K included in M1'. . Further, after determining VRF_K, ECU-1 can generate the first verification information based on the determined VRF_K and the first verification parameter. For the specific generation process, please refer to the above description, which will not be described again here.
需要说明的是,ECU-1根据MEK和M3’进行完整性校验,包括根据MEK的派生密钥进行完整性校验,ECU-1根据MEK解密M2’,包括根据MEK的派生密钥解密M2’。应理解,ECU-1在确定VRF_K的过程中使用的派生算法与KMS在确定第一信息的过程中使用到的派生算法相同,该派生算法可以为预先配置于ECU-1中的算法。It should be noted that ECU-1 performs integrity verification based on MEK and M3', including integrity verification based on the derived key of MEK, and ECU-1 decrypts M2' based on MEK, including decrypting M2 based on the derived key of MEK. '. It should be understood that the derivation algorithm used by ECU-1 in the process of determining VRF_K is the same as the derivation algorithm used by KMS in the process of determining the first information. The derivation algorithm may be an algorithm pre-configured in ECU-1.
S205,ECU-1向OEM密钥刷写装置发送第一验证信息。S205, ECU-1 sends the first verification information to the OEM key flashing device.
相应地,OEM密钥刷写装置接收该第一验证信息。Correspondingly, the OEM key flashing device receives the first verification information.
S206,OEM密钥刷写装置根据本地验证信息和该第一验证信息,确定MEK的完整性,其中本地验证信息为通过VRF_K和第一验证参数进行完整性保护得到的信息。S206: The OEM key rewriting device determines the integrity of the MEK based on the local verification information and the first verification information, where the local verification information is information obtained by integrity protection through VRF_K and the first verification parameter.
在一种可能的实现方式中,本地验证信息直接来自KMS,例如本地验证信息即为步骤201中第二验证信息包括的通过VRF_K对第二验证参数进行完整性保护得到的信息(比如记为VRF_MAC)。在这种情况下,第一验证参数可以为第二验证信息中包括的第二验证参 数。OEM密钥刷写装置将来自KMS的VRF_MAC与来自ECU-1的第一验证信息(比如记为MAC_T)相比较,根据比较结果确定MEK的完整性。基于上述描述,应理解,由于VRF_MAC是KMS基于VRF_K和第二验证参数得到的,而MAC_T是ECU-1基于在本地确定得到的VRF_K与第一验证参数得到的,因此通过比较VRF_MAC和MAC_T,可以确定ECU-1在本地确定得到的VRF_K与来自KMS的VRF_K是否相同。又因为来自KMS的VRF_K是通过MEK的信息指示的,而ECU-1在本地确定得到的VRF_K是基于本地保存的MEK确定的,因此等效地,通过比较VRF_MAC和MAC_T,可以确定ECU-1本地保存的MEK与KMS保存的MEK是否相同,进而实现了对ECU-1本地保存的MEK的完整性验证。具体的,若VRF_MAC与MAC_T相匹配(比如MAC_T==VRF_MAC),则可以确定ECU-1本地保存的MEK是完整的,否则,则可以确定ECU-1本地保存的MEK是不完整的。示例性地,MAC_T==VRF_MAC可以表示MAC_T包括的每个比特位置的比特值与VRF_MAC包括的对应比特位置的比特值都相同。In a possible implementation, the local verification information comes directly from the KMS. For example, the local verification information is the information obtained by integrity protecting the second verification parameter through VRF_K (for example, recorded as VRF_MAC) included in the second verification information in step 201. ). In this case, the first verification parameter may be a second verification parameter included in the second verification information. The OEM key flashing device compares the VRF_MAC from the KMS with the first verification information (for example, marked as MAC_T) from the ECU-1, and determines the integrity of the MEK based on the comparison result. Based on the above description, it should be understood that since VRF_MAC is obtained by KMS based on VRF_K and the second verification parameter, and MAC_T is obtained by ECU-1 based on the locally determined VRF_K and the first verification parameter, therefore by comparing VRF_MAC and MAC_T, it can Determine whether the VRF_K determined locally by ECU-1 is the same as the VRF_K from the KMS. And because the VRF_K from KMS is indicated by the MEK information, and the VRF_K determined locally by ECU-1 is determined based on the locally saved MEK, therefore equivalently, by comparing VRF_MAC and MAC_T, the local VRF_K of ECU-1 can be determined Whether the saved MEK is the same as the MEK saved by KMS, thereby realizing the integrity verification of the MEK saved locally in ECU-1. Specifically, if VRF_MAC matches MAC_T (for example, MAC_T==VRF_MAC), it can be determined that the MEK locally saved by ECU-1 is complete; otherwise, it can be determined that the MEK locally saved by ECU-1 is incomplete. For example, MAC_T==VRF_MAC may indicate that the bit value of each bit position included in MAC_T is the same as the bit value of the corresponding bit position included in VRF_MAC.
需要说明的是,在一种可选的设计中,ECU-1本地保存的MEK是完整的,可以包括:ECU-1本地保存的MEK与KMS保存的MEK是相同的,或者ECU-1本地保存的MEK是有效的密钥。在一种可选的设计中,ECU-1本地保存的MEK是不完整的,可以包括:ECU-1本地保存的MEK与KMS保存的MEK不同,或者ECU-1本地保存的MEK不是有效的密钥。应理解,只有ECU-1本地保存的MEK是完整的,才能实现OEM密钥刷写装置基于MEK向该ECU-1写入功能密钥,进而保证该ECU-1在整车中的正常使用。It should be noted that in an optional design, the MEK saved locally by ECU-1 is complete and can include: the MEK saved locally by ECU-1 is the same as the MEK saved by KMS, or the MEK saved locally by ECU-1 The MEK is a valid key. In an optional design, the MEK saved locally by ECU-1 is incomplete, which may include: the MEK saved locally by ECU-1 is different from the MEK saved by KMS, or the MEK saved locally by ECU-1 is not a valid password. key. It should be understood that only if the MEK stored locally in the ECU-1 is complete, can the OEM key flashing device write the function key to the ECU-1 based on the MEK, thereby ensuring the normal use of the ECU-1 in the vehicle.
在又一种可能的实现方式中,本地验证信息是OEM密钥刷写装置在本地确定的信息。示例性地,OEM密钥刷写装置根据来自KMS的第二验证信息和在本地生成的第一验证参数确定本地验证信息,其中该第二验证信息中包括VRF_K。具体地,在这种方式下,本地验证信息(比如记为VRF_MAC)与第一验证参数(比如即为VRF_M)满足:VRF_MAC=CMAC VRF_K(VRF_M)。类似地,由于VRF_MAC是OEM密钥刷写装置根据来自KMS的VRF_K与本地生成的第一验证参数得到的,而MAC_T是ECU-1基于在本地确定得到的VRF_K与来自OEM密钥刷写装置的第一验证参数得到的,因此在这种方式下,通过比较VRF_MAC和MAC_T,也可以确定ECU-1在本地确定得到的VRF_K与来自KMS的VRF_K是否相同。进而等效地,通过比较VRF_MAC和MAC_T,可以确定ECU-1本地保存的MEK与KMS保存的MEK是否相同,从而实现了对ECU-1本地保存的MEK的完整性验证。通过VRF_MAC和MAC_T的比较结果,确定MEK完整性的具体实现可以参考上述描述,不做具体赘述。 In another possible implementation manner, the local verification information is information determined locally by the OEM key flashing device. Exemplarily, the OEM key flashing device determines local verification information based on the second verification information from the KMS and the locally generated first verification parameters, where the second verification information includes VRF_K. Specifically, in this manner, the local verification information (for example, recorded as VRF_MAC) and the first verification parameter (for example, as VRF_M) satisfy: VRF_MAC=CMAC VRF_K (VRF_M). Similarly, since VRF_MAC is obtained by the OEM key flashing device based on the VRF_K from the KMS and the locally generated first verification parameter, and MAC_T is obtained by ECU-1 based on the VRF_K determined locally and the VRF_K from the OEM key flashing device. The first verification parameter is obtained, so in this way, by comparing VRF_MAC and MAC_T, it can also be determined whether the VRF_K determined locally by ECU-1 is the same as the VRF_K from KMS. Equivalently, by comparing VRF_MAC and MAC_T, it can be determined whether the MEK saved locally by ECU-1 is the same as the MEK saved by KMS, thereby achieving integrity verification of the MEK saved locally by ECU-1. Through the comparison results of VRF_MAC and MAC_T, the specific implementation of determining MEK integrity can refer to the above description, and will not be described in detail.
基于上述描述,可以理解的是,本申请实施例通过第一密钥的完整性间接验证了第二密钥的完整性,不仅实现了对第二密钥的完整性验证,保证了功能密钥的正常使用以及整车的信息安全,而且由于介于KMS与ECU-1之间的OEM密钥刷写装置是通过直接转发来自KMS的第一信息来指示第一密钥,因此,避免了第二密钥以明文形式暴露在KMS和ECU之外,进而保证了整车厂核心资产的安全。此外,用于第一密钥完整性验证的信息中不包括ECU的标识信息,因此,整车产线不需要提前收集待更新第二密钥的所有目标ECU的标识信息,从而降低了整车产线的负担和管理成本。进一步地,KMS还可以预先准备好用于第一密钥完整性验证的灌装密钥材料(例如上述实施例中的第一信息和第二验证信息), 并将其提前发送给OEM密钥刷写装置,基于此还可以实现对ECU的第二密钥的离线验证,即不依赖于KMS,也可以实现第二密钥完整性的实时验证,减少了时间开销。应理解,通过该方案,也避免了在现有的整车产线就近部署KMS,简化了整车产线的设计,降低了整车厂的管理成本。Based on the above description, it can be understood that the embodiment of the present application indirectly verifies the integrity of the second key through the integrity of the first key, which not only realizes the integrity verification of the second key, but also ensures that the functional key normal use and information security of the entire vehicle, and because the OEM key flashing device between KMS and ECU-1 indicates the first key by directly forwarding the first information from KMS, therefore, the second key is avoided. The second key is exposed outside the KMS and ECU in plain text, thereby ensuring the security of the OEM's core assets. In addition, the information used for the integrity verification of the first key does not include the identification information of the ECU. Therefore, the vehicle production line does not need to collect the identification information of all target ECUs to be updated with the second key in advance, thereby reducing the cost of the entire vehicle. The burden and management costs of the production line. Further, the KMS can also prepare the filling key material for the first key integrity verification in advance (such as the first information and the second verification information in the above embodiment), and send it to the OEM key in advance The flash writing device can also realize offline verification of the second key of the ECU based on this, that is, it does not rely on KMS and can also realize real-time verification of the integrity of the second key, reducing time overhead. It should be understood that this solution also avoids the deployment of KMS near the existing vehicle production line, simplifies the design of the vehicle production line, and reduces the management cost of the vehicle factory.
通过图2所示的密钥验证方法,可以实现对第二密钥的完整性验证。在一种可选的设计中,KMS在发送第一信息之前,还可以通过客户端先将第二密钥写入到ECU中。示例性地,当ECU本地保存的第二密钥与KMS保存的第二密钥不同时,为了保证ECU的功能密钥的正常使用,KMS需要先将KMS本地保存的第二密钥写入到ECU中。例如,在整车生产过程中,OEM可以先将一些预置根密钥传递给部件开发商(例如Tier1零部件开发商),由部件开发商先将这些预置根密钥写入到ECU中作为ECU的初始硬件权限密钥。然后这些已写入预置根密钥的ECU被运输到整车产线,OEM在整车产线再将ECU的预置根密钥替换为MEK,从而保证功能密钥可以写入到ECU中,保证ECU的正常使用。应理解,由于MEK的密钥属性,在此场景下,ECU本地保存的第二密钥(可以理解为预置根密钥,或初始硬件权限密钥)与KMS保存的第二密钥(待写入的MEK)不同;又例如,在整车的使用过程中,不可避免存在硬件损坏或者硬件升级的状况,此时要求由OEM或者部件开发商授权的维修方(例如4S店)将已损坏或者需要升级的ECU替换为新的ECU,应理解,在此场景下,新的ECU本地保存的第二密钥与KMS保存的第二密钥可以不同。此时为了保证替换后的ECU可以正常工作,需要给新的ECU写入功能密钥,而如前所述,功能密钥的成功写入需要认证密钥对其先进行认证,因此需要4S店先通过密钥刷写装置将KMS保存的第二密钥写入到ECU中。KMS将第二密钥写入到ECU之后,再基于图2所示的实施例中的方法,实现对第二密钥的完整性验证。Through the key verification method shown in Figure 2, the integrity verification of the second key can be achieved. In an optional design, before sending the first information, KMS can also write the second key into the ECU through the client. For example, when the second key saved locally by the ECU is different from the second key saved by the KMS, in order to ensure the normal use of the function key of the ECU, the KMS needs to first write the second key saved locally by the KMS into in the ECU. For example, during the vehicle production process, the OEM can first pass some preset root keys to component developers (such as Tier1 component developers), and the component developers will first write these preset root keys into the ECU. As the initial hardware permission key for the ECU. Then these ECUs with preset root keys written into them are transported to the vehicle production line, where the OEM replaces the ECU's preset root keys with MEK to ensure that the function key can be written into the ECU. , to ensure the normal use of the ECU. It should be understood that due to the key attribute of MEK, in this scenario, the second key saved locally by the ECU (which can be understood as the preset root key, or the initial hardware permission key) and the second key saved by the KMS (to be The written MEK) is different; for another example, during the use of the vehicle, there will inevitably be hardware damage or hardware upgrades. At this time, a repair party (such as a 4S store) authorized by the OEM or component developer is required to repair the damaged Or the ECU that needs to be upgraded is replaced with a new ECU. It should be understood that in this scenario, the second key saved locally by the new ECU may be different from the second key saved by the KMS. At this time, in order to ensure that the replaced ECU can work normally, the function key needs to be written to the new ECU. As mentioned above, the successful writing of the function key requires the authentication key to be authenticated first, so the 4S store needs to first The second key saved by KMS is written into the ECU through the key flashing device. After the KMS writes the second key into the ECU, it implements integrity verification of the second key based on the method in the embodiment shown in FIG. 2 .
基于此,作为一种可能的实现方式,本申请实施例所述的密钥验证方法,还可以包括图3所示的步骤S301-S304,这些步骤可用于向ECU写入第二密钥,对于某些具体的场景可以是必须的。Based on this, as a possible implementation method, the key verification method described in the embodiment of the present application can also include steps S301-S304 shown in Figure 3. These steps can be used to write the second key to the ECU. For Certain specific scenarios may be necessary.
需要说明的是,为了更好地理解下述各实施例所述的方法与上述图2所示的实施例中的方法之间的关系,下文仍以ECU-1为第一ECU的一个示例,KMS为密钥管理实体的一个示例,OEM密钥刷写装置为客户端的一个示例,MEK作为第二密钥的一个示例,VRF_K作为第一密钥的一个示例进行说明。步骤S301-S304具体如下:It should be noted that, in order to better understand the relationship between the methods described in the following embodiments and the method in the embodiment shown in FIG. 2, ECU-1 is still used as an example of the first ECU below. KMS is an example of the key management entity, the OEM key flash device is an example of the client, MEK is an example of the second key, and VRF_K is an example of the first key. The details of steps S301-S304 are as follows:
S301,KMS生成第五信息。S301, KMS generates fifth information.
其中,第五信息通过第五密钥的信息指示MEK,第五密钥用于认证MEK。示例性地,第五密钥可以为预置于ECU-1中的预备ECU主密钥(pre-master ECU key,PMEK),或者也可以为ECU-1本地保存的MEK的在先版本。例如,KMS本地保存的MEK为MEK2.0,而ECU-1中本地保存的MEK的在先版本为MEK1.0,此时需要通过ECU-1本地保存的MEK1.0的认证,才可以将ECU-1中的MEK1.0替换为MEK2.0,进而保证该ECU-1功能密钥的正常使用。为了描述清楚,本申请各实施例中以PMEK作为第五密钥的一个示例进行描述,可以理解的是,PMEK也可以替换为其他用于认证MEK的认证密钥。The fifth information indicates the MEK through the information of the fifth key, and the fifth key is used to authenticate the MEK. For example, the fifth key may be a pre-master ECU key (PMEK) preset in ECU-1, or may be a previous version of the MEK stored locally in ECU-1. For example, the MEK saved locally in KMS is MEK2.0, and the previous version of the MEK saved locally in ECU-1 is MEK1.0. In this case, the MEK1.0 saved locally in ECU-1 needs to be authenticated before the ECU can be MEK1.0 in -1 is replaced with MEK2.0 to ensure the normal use of the ECU-1 function key. For clarity of description, each embodiment of the present application uses PMEK as an example of the fifth key. It can be understood that PMEK can also be replaced by other authentication keys used to authenticate MEK.
在一种可能的实现方式,第五信息通过PMEK的信息指示MEK,可以包括:第五信息包括通过PMEK进行加密和/或完整性保护计算得到的信息。基于此,KMS可实现第五 信息通过PMEK的信息指示第二密钥。示例性地,例如第五信息可以包括通过加密算法和/或完整性保护算法,基于认证密钥PMEK以及待写入的密钥MEK生成的信息,且该第五信息可以用于写入MEK。In a possible implementation manner, the fifth information indicates MEK through PMEK information, and may include: the fifth information includes information obtained by encryption and/or integrity protection calculation through PMEK. Based on this, KMS can realize that the fifth information indicates the second key through the PMEK information. Illustratively, for example, the fifth information may include information generated based on the authentication key PMEK and the key MEK to be written through an encryption algorithm and/or an integrity protection algorithm, and the fifth information may be used to write the MEK.
在又一种可能的实现方式中,第五信息通过PMEK的信息指示MEK,可以包括:第五信息包括通过PMEK的派生密钥进行加密和/或完整性保护得到的信息。基于此,KMS可以实现第五信息通过PMEK的信息指示MEK。第五信息可以是通过PMEK的一个或多个派生密钥进行加密和/或完整性保护计算所得到的信息且该第五信息可以用于写入MEK。这里,一个派生密钥可以同时用于加密和完整性保护计算,或者也可以只用于加密或者完整性保护计算。应理解,当一个派生密钥仅用于加密或者完整性保护计算时,第五信息需要通过PMEK的多个派生密钥实现加密和完整性保护计算。In yet another possible implementation manner, the fifth information indicates the MEK through the PMEK information, and may include: the fifth information includes information obtained by encrypting and/or integrity protecting using the derived key of the PMEK. Based on this, KMS can realize that the fifth information indicates MEK through PMEK information. The fifth information may be information obtained by encryption and/or integrity protection calculations using one or more derived keys of the PMEK and the fifth information may be used to write the MEK. Here, a derived key can be used for both encryption and integrity protection calculations, or it can be used only for encryption or integrity protection calculations. It should be understood that when one derived key is only used for encryption or integrity protection calculations, the fifth information needs to implement encryption and integrity protection calculations through multiple derived keys of PMEK.
示例性地,KMS可以通过KDF,基于PMEK、参数Key_update_ENC_C以及Key_update_MAC_C,派生出与PMEK对应的K1、K2两个派生密钥,这两个派生密钥分别用于加密和完整性保护。其中,参数Key_update_ENC_C和Key_update_MAC_C的具体取值可以是预定义的,比如在相关的技术规范中预定义。所述技术规范例如可以是AUTOSAR组织发布的SHE技术规范。K1、K2例如可通过如下公式(3)和公式(4)实现:For example, KMS can use KDF to derive two derived keys K1 and K2 corresponding to PMEK based on PMEK, parameters Key_update_ENC_C and Key_update_MAC_C. These two derived keys are used for encryption and integrity protection respectively. Among them, the specific values of the parameters Key_update_ENC_C and Key_update_MAC_C may be predefined, for example, in relevant technical specifications. The technical specification may be, for example, the SHE technical specification published by the AUTOSAR organization. K1 and K2 can be realized by the following formula (3) and formula (4), for example:
K1=第二KDF(PMEK,Key_update_ENC_C) 公式(3)K1=Second KDF(PMEK,Key_update_ENC_C) Formula (3)
K2=第二KDF(PMEK,Key_update_MAC_C) 公式(4)K2 = second KDF (PMEK, Key_update_MAC_C) formula (4)
此后,KMS可以通过加密算法基于上述K1对MEK加密得到第五信息中包括的第七信息,例如KMS使用AES算法实现K1对MEK的加密;KMS还可以使用MAC算法基于K2对MEK进行完整性保护得到第五信息中包括的第八信息。应理解,加密算法和完整性保护算法包括但不限于上述描述的具体实现方式,本申请实施例在此不做具体限定。Thereafter, KMS can encrypt MEK based on the above K1 through the encryption algorithm to obtain the seventh information included in the fifth information. For example, KMS uses the AES algorithm to encrypt MEK by K1; KMS can also use the MAC algorithm to protect the integrity of MEK based on K2. The eighth information included in the fifth information is obtained. It should be understood that encryption algorithms and integrity protection algorithms include but are not limited to the specific implementations described above, and are not specifically limited in the embodiments of the present application.
进一步地,KMS还可以将ECU-1的身份信息、MEK的索引以及PMEK的索引级联,以得到第五信息中包括的第六信息。其中,ECU-1的身份信息以及MEK的索引可参考上述S201中的具体描述,此处不再赘述。PMEK的索引用于唯一标识PMEK,可以用于指示PMEK在ECU-1内保存的地址信息。需要说明的是,当ECU-1的身份信息为包含通配符的组标识时,可以实现第五信息对多个ECU有效,进而实现KMS对多个ECU的第二密钥的批量刷下,节省了信令开销。Further, the KMS may also concatenate the identity information of the ECU-1, the index of the MEK, and the index of the PMEK to obtain the sixth information included in the fifth information. Among them, the identity information of ECU-1 and the index of MEK can refer to the specific description in S201 above, which will not be described again here. The index of PMEK is used to uniquely identify PMEK and can be used to indicate the address information of PMEK stored in ECU-1. It should be noted that when the identity information of ECU-1 is a group identifier containing wildcard characters, the fifth information can be effective for multiple ECUs, thereby enabling KMS to batch flash the second keys of multiple ECUs, saving time. Signaling overhead.
为了进一步地理解第五信息是如何通过PMEK的信息指示MEK,下述示例了一种第五信息的实现方式。具体的,第五信息包括第六信息M1、第七信息M2以及第八信息M3。其中M1可以为M1=UID||MEK_ID||PMEK_ID,UID表示ECU-1的身份信息,MEK_ID和PMEK_ID分别表示MEK的索引和PMEK的索引,||表示信息级联运算,例如A||B表示将信息A和B级联。M2可以为M2=ENC CBC,K1,IV=0(C ID||F ID||MEK),即KMS将C ID、F ID和MEK级联后,再以K1为密钥通过CBC模式加密形成第七信息。M3可以为M3=CMAC K2(M1||M2),即KMS通过将M1和M2级联后,再以K2为密钥经过CMAC计算而成的MAC值即为M3。在上述过程中,K1和K2均为PMEK的派生密钥。C ID是由KMS本地的计数器CNT输出的计数值,可用于计数,每次加密前可以自动加1,后续通过验证接收到的CNT与本地生成的CNT的大小关系,可以达到防重放攻击的目的。F ID用于配置 MEK_ID所对应的存储区域的安全标志,安全标志的具体说明可以参考S201中的相关说明,这里不做赘述。IV=0表示基于CBC模式加密所使用的初始化向量为全0向量。需要说明的是,在本申请实施例中,上述级联信息除了包括如上信息之外,还可以包括其他信息,本申请实施例不做具体限定。应理解,在此列举的用于生成M2的加密算法和用于生成M3的MAC算法仅为示例,不应对本申请实施例构成任何限定。本领域的技术人员可知,加密算法和完整性保护算法还可以包括但不限于上述描述的具体实现方式,本申请实施例在此不做具体限定。 In order to further understand how the fifth information indicates MEK through PMEK information, the following illustrates an implementation method of the fifth information. Specifically, the fifth information includes sixth information M1, seventh information M2, and eighth information M3. Where M1 can be M1=UID||MEK_ID||PMEK_ID, UID represents the identity information of ECU-1, MEK_ID and PMEK_ID represent the index of MEK and the index of PMEK respectively, || represents information cascade operation, for example, A||B represents Concatenate information A and B. M2 can be M2=ENC CBC, K1, IV=0 (C ID ||F ID ||MEK), that is, KMS concatenates C ID , F ID and MEK, and then uses K1 as the key to encrypt it in CBC mode. Seventh message. M3 can be M3=CMAC K2 (M1||M2), that is, the MAC value calculated by KMS through CMAC after concatenating M1 and M2 using K2 as the key is M3. In the above process, K1 and K2 are both derived keys of PMEK. C ID is the count value output by the local counter CNT of KMS. It can be used for counting. It can be automatically incremented by 1 before each encryption. Subsequently, by verifying the size relationship between the received CNT and the locally generated CNT, it can prevent replay attacks. Purpose. F ID is used to configure the security flag of the storage area corresponding to MEK_ID. For specific instructions on the security flag, please refer to the relevant instructions in S201, which will not be described here. IV=0 means that the initialization vector used for encryption based on CBC mode is an all-0 vector. It should be noted that in the embodiment of the present application, in addition to the above information, the above-mentioned cascade information may also include other information, which is not specifically limited in the embodiment of the present application. It should be understood that the encryption algorithm used to generate M2 and the MAC algorithm used to generate M3 listed here are only examples, and should not constitute any limitation on the embodiment of the present application. Those skilled in the art know that the encryption algorithm and the integrity protection algorithm may also include but are not limited to the specific implementation methods described above, and are not specifically limited here in the embodiments of the present application.
S302,KMS向OEM密钥刷写装置发送第五信息。S302: KMS sends fifth information to the OEM key writing device.
相应地,OEM密钥刷写装置接收该第五信息。类似地,如果第五信息中包括多个信息,例如第五信息中包括第六信息、第七信息以及第八信息,KMS可以用不同的信令分别发送第五信息中包括的不同信息,或者也可以通过同一条信令发送第五信息中包括的所有信息。此外,KMS还可以将第五信息(或第五信息中包括的部分信息)与其他发送给OEM密钥刷写装置的信息(比如第一信息或者第一信息中包括的部分信息)携带在同一条信令中发送,或者也可以通过不同的信令发送。本申请实施例对实现第五信息发送的具体方式不做限定。Correspondingly, the OEM key flashing device receives the fifth information. Similarly, if the fifth information includes multiple pieces of information, for example, the fifth information includes sixth information, seventh information and eighth information, the KMS can use different signaling to send different information included in the fifth information respectively, or All information included in the fifth information may also be sent through the same signaling. In addition, the KMS can also carry the fifth information (or part of the information included in the fifth information) together with other information sent to the OEM key flashing device (such as the first information or part of the information included in the first information). It can be sent in one signaling, or it can be sent in different signaling. The embodiments of this application do not limit the specific manner of transmitting the fifth information.
S303,OEM密钥刷写装置向ECU-1发送该第五信息。S303. The OEM key writing device sends the fifth information to ECU-1.
相应地,ECU-1接收该第五信息。OEM密钥刷写装置将来自KMS的第五信息转发给ECU-1,以使得ECU-1可以基于第五信息确定MEK。OEM密钥刷写装置向ECU-1发送第五信息的具体实现方式可以参考S203中的相应描述,这里不做赘述。Accordingly, ECU-1 receives the fifth information. The OEM key flashing device forwards the fifth information from the KMS to the ECU-1, so that the ECU-1 can determine the MEK based on the fifth information. For the specific implementation method of the OEM key flashing device sending the fifth information to the ECU-1, please refer to the corresponding description in S203, which will not be described again here.
S304,ECU-1根据该第五信息,确定MEK。S304, ECU-1 determines the MEK based on the fifth information.
示例性地,ECU-1根据该第五信息,确定MEK,可以包括:ECU-1根据PMEK,对接收到的第五信息进行解密和/或完整性校验,以确定MEK。具体地,例如ECU-1先基于接收到的第五信息,确定通过PMEK实现对第五信息的解密和/或完整性校验,之后再通过本地保存的PMEK对该第五信息执行具体的解密和/或完整性校验,进而确定MEK。For example, ECU-1 determines the MEK based on the fifth information, which may include: ECU-1 decrypts and/or integrity checks the received fifth information based on the PMEK to determine the MEK. Specifically, for example, ECU-1 first determines to use PMEK to decrypt and/or integrity check the fifth information based on the received fifth information, and then performs specific decryption of the fifth information through the locally saved PMEK. and/or integrity check to determine the MEK.
对应于步骤S301中一种具体的第五信息实现方式,下述示例了一种ECU-1根据第五信息,确定MEK的具体实现方式,在该例中,第五信息包括第六信息M1、第七信息M2以及第八信息M3,其中M1、M2以及M3的具体实施方式可以参考步骤S301中的相应描述,这里不做赘述。ECU-1根据接收到的M1,确定PMEK的索引(即PMEK_ID),基于此,ECU-1将本地保存的且与PMEK_ID所对应的密钥作为PMEK,用于MEK的完整性验证和解密。例如,ECU-1可以先基于在本地保存的PMEK和接收到的M3,完整对MEK或第五信息的完整性校验,以保证MEK或者第五信息未经篡改。在对MEK或第五信息的完整性验证成功的情况下,ECU-1再根据在本地保存的PMEK解密M2,以确定MEK。Corresponding to a specific implementation method of the fifth information in step S301, the following example illustrates a specific implementation method for ECU-1 to determine MEK based on the fifth information. In this example, the fifth information includes sixth information M1, For the seventh information M2 and the eighth information M3, the specific implementation of M1, M2 and M3 can refer to the corresponding description in step S301, and will not be described again here. ECU-1 determines the index of the PMEK (ie, PMEK_ID) based on the received M1. Based on this, ECU-1 uses the locally saved key corresponding to the PMEK_ID as the PMEK for integrity verification and decryption of the MEK. For example, ECU-1 can first complete the integrity check of the MEK or the fifth information based on the locally saved PMEK and the received M3 to ensure that the MEK or the fifth information has not been tampered with. When the integrity verification of the MEK or the fifth information is successful, ECU-1 then decrypts M2 based on the locally saved PMEK to determine the MEK.
进一步地,该ECU-1确定MEK之后,将MEK存储在本地。示例性地,ECU-1可以基于M1中包括的MEK的索引(即MEK_ID)所指示的地址信息,将解密M2确定得到的MEK保存在对应该地址信息的本地内存中,或者将本地保存的PMEK替换为该MEK。Further, after determining the MEK, the ECU-1 stores the MEK locally. For example, ECU-1 may store the MEK determined by decrypting M2 in the local memory corresponding to the address information based on the address information indicated by the index of the MEK included in M1 (ie, MEK_ID), or store the locally saved PMEK Replace with this MEK.
基于图3所示的实施例中的方法,在验证MEK之前,可以先将MEK写入到ECU中,从而满足整车产线和/或整车厂授权的维修方将MEK正确写入第一电子控制单元的需求,进而为后续功能密钥的写入提供认证条件,保证功能密钥的正常使用以及整车的信息安全。 上述描述的MEK写入ECU的方法可以适配于MEK待写入的各种场景,通过适配于各种场景的统一解决方案,可以简化密钥管理实体或整车厂的密钥管理流程,简化密钥写入流程。此外,由于第二信息包括通过对MEK进行加密和/或完整性保护得到的信息,也可以避免在MEK写入过程中,MEK以明文形式暴露在KMS和ECU之外,进而保证了整车厂核心资产的安全。Based on the method in the embodiment shown in Figure 3, before verifying the MEK, the MEK can be written into the ECU first, thereby satisfying the requirements of the vehicle production line and/or the repair party authorized by the vehicle manufacturer to correctly write the MEK first. The requirements of the electronic control unit will provide authentication conditions for subsequent writing of function keys, ensuring the normal use of function keys and the information security of the entire vehicle. The method of writing MEK to ECU described above can be adapted to various scenarios where MEK is to be written. Through a unified solution adapted to various scenarios, the key management process of key management entities or OEMs can be simplified. Simplify the key writing process. In addition, since the second information includes information obtained by encrypting and/or integrity protecting the MEK, it can also be avoided that the MEK is exposed in plain text outside the KMS and ECU during the writing process of the MEK, thereby ensuring that the OEM Security of core assets.
进一步地,在一种可选的设计中,本申请各实施例中所述的密钥验证方法,还可以包括图4所示的步骤S401-S404中的一个或多个步骤,该一个或多个步骤对于某些具体场景可以是必须的。步骤S401-S404具体如下:Further, in an optional design, the key verification method described in the embodiments of this application may also include one or more of steps S401-S404 shown in Figure 4. The one or more steps This step may be necessary for some specific scenarios. The details of steps S401-S404 are as follows:
步骤S401,OEM密钥刷写装置向KMS发送MEK更新请求信息。Step S401: The OEM key rewriting device sends MEK update request information to the KMS.
相应地,KMS接收该MEK更新请求信息。Correspondingly, KMS receives the MEK update request information.
该MEK更新请求信息用于请求更新ECU-1的MEK。可替换地,该MEK更新信息可以用于请求KMS验证ECU-1本地保存的MEK完整性,或者该MEK更新请求信息可以用于请求KMS将MEK写入至ECU-1(包括对MEK的完整性验证)。The MEK update request information is used to request to update the MEK of ECU-1. Alternatively, the MEK update information can be used to request KMS to verify the integrity of the MEK stored locally in ECU-1, or the MEK update request information can be used to request KMS to write the MEK to ECU-1 (including the integrity of the MEK verify).
在一种可选的设计中,该MEK更新请求信息中还可以包括如下信息中的一项或多项:OEM密钥刷写装置的身份认证信息,待更新MEK的ECU的数量(或者待验证MEK完整性的ECU的数量),ECU所属的整车的识别码VIN,ECU本地保存的认证密钥的版本号,ECU的不同版本号。其中,该身份认证信息可以用于表征该OEM密钥刷写装置是否有权限获取本申请各实施例中所包括的客户端从密钥管理实体获取的一项或多项信息,例如第一信息、第五信息、第二验证信息。VIN可以用于标识一台整车。ECU的不同版本号可用于标识该ECU本地保存的认证密钥的版本号,例如本地保存的认证密钥为PMEK,或者为MEK1.0,或者为MEK2.0等。应理解,上述待更新MEK的ECU或者带验证MEK完整性的ECU中包括ECU-1。In an optional design, the MEK update request information may also include one or more of the following information: the identity authentication information of the OEM key flashing device, the number of ECUs to be updated with the MEK (or the number of ECUs to be verified). The number of ECUs with MEK integrity), the identification code VIN of the vehicle to which the ECU belongs, the version number of the authentication key stored locally in the ECU, and the different version numbers of the ECU. The identity authentication information can be used to represent whether the OEM key writing device has the authority to obtain one or more pieces of information obtained from the key management entity by the client included in the embodiments of this application, such as the first information. , fifth information, and second verification information. VIN can be used to identify a complete vehicle. Different version numbers of the ECU can be used to identify the version number of the locally saved authentication key of the ECU. For example, the locally saved authentication key is PMEK, or MEK1.0, or MEK2.0, etc. It should be understood that the above-mentioned ECU to be updated with MEK or the ECU with MEK integrity verification includes ECU-1.
步骤S402,KMS校验该MEK更新请求信息。Step S402: KMS verifies the MEK update request information.
相应地,KMS在接收到该MEK更新请求信息后,可以校验该MEK更新请求信息。并根据校验结果,确定是否通过或确定通过上述本申请实施例中所述的方法,将用于指示第一密钥的第一信息和用于该第一密钥完整性验证的第二验证信息发送给OEM密钥刷写装置,或者将用于指示第一密钥的第一信息、用于该第一密钥完整性验证的第二验证信息以及用于指示第二密钥的第五信息发送给OEM密钥刷写装置。Correspondingly, after receiving the MEK update request information, the KMS can verify the MEK update request information. And based on the verification result, it is determined whether or not the method described in the embodiment of the present application is passed, and the first information used to indicate the first key and the second verification used for the integrity verification of the first key are The information is sent to the OEM key flashing device, or the first information used to indicate the first key, the second verification information used to verify the integrity of the first key, and the fifth information used to indicate the second key. Information is sent to the OEM key flashing device.
在一种可选的设计中,KMS校验该MEK更新请求信息,可以包括如下一项或多项:KMS校验该MEK更新请求信息的合法性,KMS确定用于写入MEK(包括对MEK的完整性验证)的具体信息,KMS确定用于验证MEK完整性的具体信息。In an optional design, KMS verifies the MEK update request information, which may include one or more of the following: KMS verifies the validity of the MEK update request information, and KMS determines whether to write the MEK (including the MEK The KMS determines the specific information used to verify the integrity of the MEK.
示例性地,KMS校验该MEK更新请求信息的合法性可以理解为:KMS确定发起该MEK更新请求信息的OEM密钥刷写装置是否有权限获取与MEK写入和/或完整性验证相关的信息,例如本申请各实施例中的第一信息、第五信息、第二验证信息;或者,KMS校验该MEK更新请求信息的合法性也可以理解为:KMS通过OEM密钥刷写装置的身份认证信息确定该OEM密钥刷写装置是否为OEM授权的密钥刷写装置。如果该OEM密钥刷写装置是OEM授权的密钥刷写装置,则可以默认该OEM密钥刷写装置有权限获取与MEK写入和/或完整性验证相关的信息,例如本申请各实施例中的第一信息、第五信息、第二验 证信息。具体的例如针对售后维修场景,该身份认证信息可以表征发起该MEK更新请求的4S店或维修方是否为经OEM授权的经销商。应理解,在此场景下,OEM密钥刷写装置可替换为经销商诊断仪。如果该身份认证信息可以表征该4S店或维修方为经OEM授权的经销商,则KMS可以将MEK写入和/或完整性验证相关的信息发送给经销商诊断仪。基于此,可以保证MEK写入和/或完整性验证相关的信息只提供给KMS或整车厂授权的客户端,进而保证了MEK的安全性。For example, KMS verifying the legality of the MEK update request information can be understood as: KMS determines whether the OEM key flash device that initiated the MEK update request information has the authority to obtain the key information related to MEK writing and/or integrity verification. Information, such as the first information, the fifth information, and the second verification information in the embodiments of the present application; or, KMS verifying the legitimacy of the MEK update request information can also be understood as: KMS uses the OEM key flash device The identity authentication information determines whether the OEM key writing device is an OEM-authorized key writing device. If the OEM key flash device is an OEM-authorized key flash device, it can be assumed that the OEM key flash device has the authority to obtain information related to MEK writing and/or integrity verification, such as the implementation of this application. The first information, the fifth information, and the second verification information in the example. For example, for after-sales maintenance scenarios, the identity authentication information can indicate whether the 4S store or maintenance party that initiated the MEK update request is an OEM-authorized dealer. It should be understood that in this scenario, the OEM key flash device can be replaced by a dealer diagnostic device. If the identity authentication information can represent the 4S store or repair party as an OEM-authorized dealer, KMS can send MEK writing and/or integrity verification-related information to the dealer diagnostic instrument. Based on this, it can be ensured that information related to MEK writing and/or integrity verification is only provided to KMS or clients authorized by the OEM, thus ensuring the security of MEK.
示例性地,KMS通过MEK更新请求信息中包括的如下信息中的一项或多项,可以确定用于写入MEK(包括对MEK的完整性验证)的具体信息或用于验证MEK完整性的具体信息。其中,如下信息为:待更新MEK的ECU的数量(或者待验证MEK完整性的ECU的数量),ECU所属的整车的识别码(vehicle identification number,VIN),ECU本地保存的认证密钥的版本号,ECU的不同版本号。例如,KMS通过待更新MEK的ECU的数量或待验证MEK完整性的ECU的数量,可以确定如下信息中的一项或多项:第一信息的数量,第二验证信息的数量,第五信息的数量,进而可以实现对批量ECU的MEK批量写入和/或MEK批量完整性验证,降低密钥管理的成本。又例如,KMS通过ECU的不同版本号或ECU本地保存的认证密钥的版本号,可以确定待写入的MEK的版本号,进而保证有效的MEK写入,进而可以基于该MEK进一步写入功能密钥,以保证该ECU的正常使用。For example, KMS can determine the specific information used to write the MEK (including integrity verification of the MEK) or the information used to verify the integrity of the MEK through one or more of the following information included in the MEK update request information. specific information. Among them, the following information is: the number of ECUs whose MEK needs to be updated (or the number of ECUs whose integrity needs to be verified), the vehicle identification number (VIN) to which the ECU belongs, and the authentication key stored locally in the ECU. Version number, different version numbers of the ECU. For example, KMS can determine one or more of the following information through the number of ECUs whose MEK needs to be updated or the number of ECUs whose MEK integrity needs to be verified: the number of first information, the number of second verification information, and the fifth information. The number can then realize batch writing of MEK and/or batch integrity verification of MEK for batch ECUs, reducing the cost of key management. For another example, KMS can determine the version number of the MEK to be written through different version numbers of the ECU or the version number of the authentication key stored locally in the ECU, thereby ensuring effective MEK writing, and further writing functions based on the MEK. key to ensure the normal use of the ECU.
在一种可选的设计中,在步骤S401之前,还可以包括步骤S403。步骤S403具体为:In an optional design, before step S401, step S403 may also be included. Step S403 is specifically as follows:
S403,ECU-1将本地保存的MEK的版本号发送给OEM密钥刷写装置。S403, ECU-1 sends the locally saved MEK version number to the OEM key flashing device.
相应地,OEM密钥刷写装置接收该本地保存的MEK的版本号。Correspondingly, the OEM key flashing device receives the version number of the locally saved MEK.
在一种可选的设计中,ECU-1还可以将如下信息中的一项或多项发送给OEM密钥刷写装置:ECU-1所属的整车的识别码即VIN,ECU-1的不同版本号,ECU-1的设备识别码、ECU-1的设备类型。In an optional design, ECU-1 can also send one or more of the following information to the OEM key flashing device: the identification code of the vehicle to which ECU-1 belongs, namely VIN, the Different version numbers, device identification code of ECU-1, and device type of ECU-1.
应理解,OEM密钥刷写装置可以通过收集多个ECU的上述信息,确定待更新MEK的ECU的数量或待验证MEK完整性的ECU的数量。It should be understood that the OEM key flashing device can determine the number of ECUs whose MEK needs to be updated or the number of ECUs whose MEK integrity needs to be verified by collecting the above information of multiple ECUs.
S404,OEM密钥刷写装置向KMS发送MEK的更新结果。S404: The OEM key rewriting device sends the MEK update result to the KMS.
相应地,KMS接收该OEM密钥刷写装置。Accordingly, the KMS receives the OEM key flashing device.
该MEK的更新结果包括如下一项或多项:MEK的完整性,VRF_K的完整性,ECU-1的身份标识。其中MEK的完整性用于表征MEK是否写入ECU-1并且通过了完整性验证,或者MEK的完整性用于表征KMS本地保存的MEK与ECU-1本地保存的MEK是否相同;VRF_K的完整性用于表征VRF_K是否写入ECU-1并且通过了完整性验证。The update result of the MEK includes one or more of the following: MEK integrity, VRF_K integrity, and ECU-1 identity. The integrity of the MEK is used to indicate whether the MEK is written to ECU-1 and passes the integrity verification, or the integrity of the MEK is used to indicate whether the MEK saved locally by KMS is the same as the MEK saved locally by ECU-1; the integrity of VRF_K Used to characterize whether VRF_K is written to ECU-1 and passes integrity verification.
示例性地,KMS基于该更新结果,可以确定MEK是否完整写入ECU-1,如果确定MEK没有被完整写入ECU-1,则可以重新尝试通过OEM密钥刷写装置将MEK写入到ECU-1中;如果确定MEK被完整写入ECU-1,则可以将该更新结果做备案处理,用于可能的后续应用。For example, based on the update result, KMS can determine whether the MEK has been completely written into ECU-1. If it is determined that the MEK has not been completely written into ECU-1, it can retry to write the MEK into the ECU through the OEM key flash device. -1; if it is determined that the MEK has been completely written into ECU-1, the update result can be filed for possible subsequent applications.
在一种可选的设计中,作为一种可能的实现方式,在上述各实施例的方法之前,可以包括图4所示的步骤S401-步骤S403,在上述各实施例中的方法之后,可以包括图4所示的步骤S404。In an optional design, as a possible implementation manner, before the methods in the above embodiments, steps S401 to S403 shown in Figure 4 may be included, and after the methods in the above embodiments, Including step S404 shown in Figure 4.
通过上述MEK更新请求信息,KMS可以生成适配于MEK更新或MEK完整性验证的 信息,进而实现MEK的完整性验证,保证功能密钥的正常使用以及整车的信息安全。通过上述更新结果,KMS可以确定MEK是否写入第一电子控制单元和/或确定第一电子控制单元本地保存的认证密钥是否为MEK,以此保证功能密钥的正常使用以及整车的信息安全。此外,通过收集所述ECU-1的身份标识,还便于密钥管理实体实现对写入所述MEK的电子控制单元和/或已验证认证密钥完整性的电子控制单元的管理。Through the above MEK update request information, KMS can generate information suitable for MEK update or MEK integrity verification, thereby realizing MEK integrity verification and ensuring the normal use of function keys and the information security of the entire vehicle. Through the above update results, the KMS can determine whether the MEK is written to the first electronic control unit and/or determine whether the authentication key stored locally in the first electronic control unit is the MEK, thereby ensuring the normal use of the function key and the information of the entire vehicle. Safety. In addition, collecting the identity of the ECU-1 also facilitates the key management entity to manage the electronic control unit that writes the MEK and/or the electronic control unit that has verified the integrity of the authentication key.
此外,作为一种可能的实现方式,本申请实施例中所述的密钥验证方法,还可以包括图5所示的步骤S501-步骤S502,或者还可以包括图5所示的步骤S501-步骤S503。步骤S501-S503具体如下:In addition, as a possible implementation manner, the key verification method described in the embodiment of the present application may also include step S501-step S502 shown in Figure 5, or may also include step S501-step shown in Figure 5 S503. The details of steps S501-S503 are as follows:
S501,ECU-1根据第一信息和挑战-应答机制,生成第九信息。S501, ECU-1 generates ninth information based on the first information and the challenge-response mechanism.
其中,第九信息包括用于验证VRF_K完整性的信息。示例性地,对应于步骤S201中一种具体的第一信息生成方式,这里生成的第九信息可以包括第十一信息和第十二信息,其中第十一信息为至少通过所述ECU-1的身份标识、VRF_K的索引、MEK的索引以及第十三信息级联得到的信息,第十二信息为通过VRF_K的派生密钥对该第十一信息进行完整性保护得到的信息,第十三信息为通过VRF_K的派生密钥对第一信息中包含的计数值(例如C ID’)加密得到的信息。应理解,基于此,不仅可以实现对VRF_K的完整性验证,还可以通过包括第十三信息的第十一信息,达到防重放估计的效果。需要说明的是,用于派生密钥生成的派生算法、加密算法以及完整性保护算法可以包括但不限于上述描述的具体实现方式,本申请实施例在此不做具体限定。 Among them, the ninth information includes information used to verify the integrity of VRF_K. For example, corresponding to a specific first information generation method in step S201, the ninth information generated here may include eleventh information and twelfth information, where the eleventh information is generated by at least the ECU-1 The identity identifier, the index of VRF_K, the index of MEK and the information obtained by cascading the thirteenth information. The twelfth information is the information obtained by integrity protecting the eleventh information through the derived key of VRF_K. The thirteenth information The information is information obtained by encrypting the count value (for example, C ID ') contained in the first information using the derived key of VRF_K. It should be understood that based on this, not only the integrity verification of VRF_K can be achieved, but also the effect of anti-replay estimation can be achieved through the eleventh information including the thirteenth information. It should be noted that the derivation algorithm, encryption algorithm and integrity protection algorithm used to generate the derived key may include but are not limited to the specific implementation methods described above, and are not specifically limited here in the embodiments of the present application.
S502,ECU-1向OEM密钥刷写装置发送该第九信息。S502, ECU-1 sends the ninth information to the OEM key flashing device.
相应地,该OEM密钥刷写装置接收该第九信息。Correspondingly, the OEM key flashing device receives the ninth information.
在一种可选的设计中,ECU-1可以将第九信息与其他发送给OEM密钥刷写装置的信息(比如第一验证信息)携带在同一条信令中发送,或者也可以通过不同的信令分别发送第九信息与其他发送给OEM密钥刷写装置的信息。In an optional design, ECU-1 can carry the ninth information and other information sent to the OEM key flashing device (such as the first verification information) in the same signaling, or it can also send it through different The signaling respectively sends the ninth information and other information sent to the OEM key flashing device.
S503,OEM密钥刷写装置向KMS发送该第九信息。S503. The OEM key rewriting device sends the ninth information to the KMS.
相应地,KMS接收该第九信息。Correspondingly, the KMS receives the ninth information.
在一种可选的设计中,OEM密钥刷写装置对于接收到的第九信息不做进一步处理,例如不解析第九信息。In an optional design, the OEM key flashing device does not further process the received ninth information, for example, does not parse the ninth information.
在一种可选的设计中,KMS根据该第九信息,可以确定ECU-1的身份标识,用于整车厂对已确认MEK完整性的ECU进行备案处理。In an optional design, KMS can determine the identity of ECU-1 based on the ninth information, which is used by the OEM to record the ECU that has confirmed the integrity of the MEK.
示例性地,此场景下,ECU-1可以对应于挑战-应答机制中的应答方,OEM密钥刷写装置可以对应于挑战-应答机制中的挑战方,第一信息中包括由挑战方发出的挑战,第九信息可以对应于应答方做出的相应应答。所不同的是,在该场景下,OEM密钥刷写装置不对该第九信息进行解析,而是将其发送给KMS进行进一步处理,由KMS确定应答方是否通过了挑战和/或判断应答方是否应该被认证。采用该方式,可以实现对VRF_K的完整性验证,且实现简单。For example, in this scenario, ECU-1 may correspond to the responder in the challenge-response mechanism, and the OEM key rewriting device may correspond to the challenger in the challenge-response mechanism. The first information includes a message sent by the challenger. For the challenge, the ninth information may correspond to the corresponding response made by the responding party. The difference is that in this scenario, the OEM key flash device does not parse the ninth information, but sends it to KMS for further processing. KMS determines whether the responder has passed the challenge and/or judges the responder. whether it should be certified. Using this method, the integrity verification of VRF_K can be achieved, and the implementation is simple.
需要说明的是,第九信息可以用于指示VRF_K的完整性,基于此,第九信息可以理解为VRF_K的完整性信息的一个示例。应理解,在OEM密钥刷写装置发送给KMS的VRF_K的更新结果中,可以包含该第九信息。It should be noted that the ninth information may be used to indicate the integrity of VRF_K. Based on this, the ninth information may be understood as an example of the integrity information of VRF_K. It should be understood that the ninth information may be included in the update result of VRF_K sent by the OEM key flashing device to the KMS.
此外,当本申请各实施例中所述的密钥验证方法包括图3所示的实施例中的方法时,本申请实施例中所述的密钥验证方法,还可以包括图6所示的步骤S601-步骤S602,或者还可以包括图6所示的步骤S601-步骤S603。步骤S601-S603具体如下:In addition, when the key verification method described in the embodiments of this application includes the method in the embodiment shown in Figure 3, the key verification method described in the embodiment of this application may also include the method shown in Figure 6 Step S601 to step S602, or may also include step S601 to step S603 shown in FIG. 6 . The details of steps S601-S603 are as follows:
S601,ECU-1根据第五信息和挑战-应答机制,生成第十信息。S601, ECU-1 generates the tenth information based on the fifth information and the challenge-response mechanism.
其中,第十信息包括用于验证MEK完整性的信息。示例性地,对应于步骤S301中一种具体的第五信息生成方式,这里生成的第十信息可以包括第十四信息和第十五信息,其中第十四信息为至少通过所述ECU-1的身份标识、MEK的索引、PMEK的索引以及第十六信息级联得到的信息,第十五信息为通过MEK的派生密钥对该第十四信息进行完整性保护得到的信息,第十六信息为通过MEK的派生密钥对第二信息中包含的计数值(例如C ID)加密得到的信息。应理解,基于此,不仅可以实现对MEK的完整性验证,还可以通过包括第十六信息的第十四信息,达到防重放估计的效果。需要说明的是,用于派生密钥生成的派生算法、加密算法以及完整性保护算法可以包括但不限于上述描述的具体实现方式,本申请实施例在此不做具体限定。 The tenth information includes information used to verify the integrity of the MEK. For example, corresponding to a specific fifth information generation method in step S301, the tenth information generated here may include fourteenth information and fifteenth information, where the fourteenth information is generated by at least the ECU-1 The identity identifier, the index of MEK, the index of PMEK and the information obtained by concatenating the sixteenth information. The fifteenth information is the information obtained by integrity protecting the fourteenth information through the derived key of MEK. The sixteenth information The information is information obtained by encrypting the count value (for example, C ID ) contained in the second information using the derived key of the MEK. It should be understood that based on this, not only the integrity verification of the MEK can be achieved, but also the effect of anti-replay estimation can be achieved through the fourteenth information including the sixteenth information. It should be noted that the derivation algorithm, encryption algorithm and integrity protection algorithm used to generate the derived key may include but are not limited to the specific implementation methods described above, and are not specifically limited here in the embodiments of the present application.
S602,ECU-1向OEM密钥刷写装置发送该第十信息。S602. ECU-1 sends the tenth information to the OEM key flashing device.
相应地,该OEM密钥刷写装置接收该第十信息。Correspondingly, the OEM key flashing device receives the tenth information.
在一种可选的设计中,ECU-1可以将第十信息与其他发送给OEM密钥刷写装置的信息(比如第一验证信息、第九信息)携带在同一条信令中发送,或者也可以通过不同的信令分别发送第十信息与其他发送给OEM密钥刷写装置的信息。In an optional design, ECU-1 can carry the tenth information and other information sent to the OEM key flashing device (such as the first verification information, the ninth information) in the same signaling and send it, or The tenth information and other information sent to the OEM key flashing device may also be sent separately through different signaling.
S603,OEM密钥刷写装置向KMS发送该第十信息。S603. The OEM key rewriting device sends the tenth information to the KMS.
相应地,KMS接收该第十信息。Correspondingly, the KMS receives the tenth information.
在一种可选的设计中,OEM密钥刷写装置对于接收到的第十信息不做进一步处理,例如不解析第十信息。In an optional design, the OEM key flashing device does not further process the received tenth information, for example, does not parse the tenth information.
在一种可选的设计中,KMS根据该第十信息,可以确定ECU-1的身份标识,用于整车厂对已确认MEK完整性的ECU进行备案处理。In an optional design, KMS can determine the identity of ECU-1 based on the tenth information, which is used by the OEM to record the ECU that has confirmed the integrity of the MEK.
示例性地,此场景下,ECU-1可以对应于挑战-应答机制中的应答方,OEM密钥刷写装置可以对应于挑战-应答机制中的挑战方,第五信息中包括由挑战方发出的挑战,第十信息可以对应于应答方做出的应答。所不同的是,在该场景下,OEM密钥刷写装置不对该第十信息进行解析,而是将其发送给KMS进行进一步处理,由KMS确定应答方是否通过了挑战和/或判断应答方是否应该被认证。采用该方式,可以实现对MEK的完整性验证,且实现简单。For example, in this scenario, ECU-1 may correspond to the responder in the challenge-response mechanism, the OEM key rewriting device may correspond to the challenger in the challenge-response mechanism, and the fifth information includes a message sent by the challenger. For the challenge, the tenth information may correspond to the response made by the responding party. The difference is that in this scenario, the OEM key flashing device does not parse the tenth information, but sends it to KMS for further processing. KMS determines whether the responder has passed the challenge and/or judges the responder. whether it should be certified. Using this method, the integrity verification of MEK can be achieved and the implementation is simple.
需要说明的是,第十信息可以用于指示MEK的完整性,基于此,第十信息可以理解为MEK的完整性信息的一个示例,即,在OEM密钥刷写装置发送给KMS的MEK的更新结果中,可以包含该第十信息。It should be noted that the tenth information can be used to indicate the integrity of the MEK. Based on this, the tenth information can be understood as an example of the integrity information of the MEK, that is, the MEK sent to the KMS by the OEM key flashing device. The update result may include the tenth information.
需要说明的是,本申请各实施例中的方法包括的步骤可以根据实际需要进行顺序调整、合并和删减。It should be noted that the steps included in the methods in the embodiments of the present application can be sequentially adjusted, combined, and deleted according to actual needs.
上面结合图2至图6介绍了本申请实施例提供的密钥验证方法,下面结合图7至图9详细说明本申请实施例提供的装置。The key verification method provided by the embodiment of the present application is introduced above with reference to Figures 2 to 6. The device provided by the embodiment of the present application will be described in detail below with reference to Figures 7 to 9.
图7为本申请实施例提供的控制装置的示意性框图。如图7所示,该控制装置可以包 括至少一个处理器和存储器,以执行上文中任一种可能实现方式中的方法。其中,存储器用于存储计算机程序或指令,该至少一个处理器用于调用所述存储器中的所述计算机程序或指令。示例性地,该至少一个处理器可以用于进行控制装置内的内部处理,例如根据所述第二密钥和所述第一验证参数,生成第一验证信息,所述第一验证信息用于表征所述第一密钥的完整性;又例如,生成第一信息和第二验证信息;再例如,根据本地验证信息与所述第一验证信息,确定所述第二密钥的完整性,其中所述本地验证信息包括通过所述第一密钥对所述第一验证参数进行完整性保护得到的信息。Figure 7 is a schematic block diagram of a control device provided by an embodiment of the present application. As shown in Figure 7, the control device may include at least one processor and a memory to execute the method in any of the above possible implementations. The memory is used to store computer programs or instructions, and the at least one processor is used to call the computer program or instructions in the memory. Exemplarily, the at least one processor may be used to perform internal processing within the control device, for example, generate first verification information based on the second key and the first verification parameter, and the first verification information is used to Characterizing the integrity of the first key; for another example, generating first information and second verification information; for another example, determining the integrity of the second key based on local verification information and the first verification information, The local verification information includes information obtained by performing integrity protection on the first verification parameter using the first key.
进一步地,在一种可选的设计中,该控制装置还可以包括收发器,如图8中所示。图8是本申请实施例提供的控制装置的示意性框图。其中,该收发器与该控制装置包括的至少一个处理器、存储器耦合,可以理解的是,该收发器、该至少一个处理器和该存储器通过内部连接通路互相通信。具体地,该收发器可以为该至少一个处理器和该存储器提供信息输入和/或输出,以使得该控制装置执行本申请实施例中任一种可能实现方式中的方法。例如,该收发器可以用于接收第一信息;又例如,该收发器可用于接收第一验证参数;再例如,该收发器可以用于发送第一验证信息等。Further, in an optional design, the control device may also include a transceiver, as shown in FIG. 8 . Figure 8 is a schematic block diagram of a control device provided by an embodiment of the present application. Wherein, the transceiver is coupled with at least one processor and memory included in the control device. It can be understood that the transceiver, the at least one processor and the memory communicate with each other through internal connection paths. Specifically, the transceiver can provide information input and/or output to the at least one processor and the memory, so that the control device executes the method in any possible implementation manner in the embodiments of the present application. For example, the transceiver can be used to receive the first information; for another example, the transceiver can be used to receive the first verification parameter; for another example, the transceiver can be used to send the first verification information, and so on.
在又一种实现方式中,该控制装置包括用于执行本申请实施例中任一种可能实现方式中的方法的单元。In yet another implementation manner, the control device includes a unit for executing the method in any possible implementation manner in the embodiments of the present application.
在一种可选的设计中,上述控制装置可以是电子部件的控制装置,用于执行上文中ECU-1所执行的任一方法;或者上述控制装置是密钥管理实体的控制装置,用于执行上文中KMS所执行的任一方法;或者上述控制装置是密钥刷写工具的控制装置,用于执行上文中OEM密钥刷写装置所执行的任一方法。In an optional design, the above-mentioned control device may be a control device of an electronic component, used to execute any of the methods executed by the ECU-1 above; or the above-mentioned control device may be a control device of a key management entity, used to execute Execute any method performed by the KMS above; or the above control device is a control device of the key flash tool, used to perform any method performed by the OEM key flash device above.
本申请实施例中还提供了一种车辆,该车辆包括实现上文中ECU-1所执行的任一种可能实现方式中的方法的控制装置,或者所述车辆包括实现上文中ECU-1所执行的任一种可能实现方式中的方法的电子部件。The embodiment of the present application also provides a vehicle. The vehicle includes a control device that implements any of the possible implementation methods executed by the ECU-1 above, or the vehicle includes a control device that implements the method executed by the ECU-1 above. Electronic components of the method in any of the possible ways.
本申请实施例中还提供了一种系统,该系统包括用于执行上文中ECU-1所执行的任一种可能实现方式中的方法的电子部件、包括用于执行上文中ECU-1所执行的任一种可能实现方式中的方法的控制装置的车辆、包括用于执行上文中ECU-1所执行的任一种可能实现方式中的方法的电子部件的车辆、用于执行上文中KMS所执行的任一种可能实现方式中的方法的密钥管理实体、或者用于执行上文中OEM密钥刷写装置所执行的任一种可能实现方式中的方法的密钥刷写工具中的一个或多个。The embodiment of the present application also provides a system, which system includes electronic components for executing any of the possible implementation methods executed by ECU-1 above, including electronic components for executing the method executed by ECU-1 above. A vehicle with a control device for the method in any possible implementation manner, a vehicle including an electronic component for executing the method in any possible implementation manner executed by the ECU-1 above, a vehicle for executing the above KMS method One of the key management entities that perform the method in any possible implementation manner, or the key flash tool used to perform the method in any possible implementation manner performed by the OEM key flash device above or more.
本申请实施例中还提供了一种系统,该系统包括用于执行上文中ECU-1所执行的任一种可能实现方式中的方法的控制装置,用于执行上文中KMS所执行的任一种可能实现方式中的方法的控制装置,或者用于执行上文中OEM密钥刷写装置所执行的任一种可能实现方式中的方法的控制装置中的一个或多个。The embodiment of the present application also provides a system, which includes a control device for executing any of the methods in the possible implementation manners executed by the ECU-1 above, and a control device for executing any of the methods executed by the KMS above. A control device for a method in any possible implementation manner, or one or more control devices for executing the method in any possible implementation manner performed by the OEM key flashing device above.
另外,本申请实施例中还提供了一种芯片,如图9所示。图9示出了一种芯片的结构示意图。芯片包括一个或多个处理器以及接口电路,该接口电路用于为该一个或多个处理器提供信息输入和/或输出用于执行上文中任一种可能实现方式中的方法。在一种可选的设计中,该芯片还可以包括总线。其中,示例性地,处理器是一种集成电路芯片,具有信号的处理能力。例如,该处理器可以是现场可编程门阵列(field programmable gate array,FPGA), 可以是通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。In addition, the embodiment of the present application also provides a chip, as shown in Figure 9. Figure 9 shows a schematic structural diagram of a chip. The chip includes one or more processors and an interface circuit, which is used to provide information input and/or output to the one or more processors for executing the method in any of the above possible implementations. In an optional design, the chip can also include a bus. Wherein, for example, the processor is an integrated circuit chip with signal processing capabilities. For example, the processor may be a field programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), or an application specific integrated circuit (ASIC). Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, system on chip (SoC), central processor (central unit processor, CPU), or network processing It can be a network processor (NP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips. Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
接口电路可以用于数据、指令或者信息的发送或者接收,处理器可以利用接口电路接收的数据、指令或者其它信息,进行加工,可以将加工完成信息通过接口电路发送出去。The interface circuit can be used to send or receive data, instructions or information. The processor can process the data, instructions or other information received by the interface circuit, and can send the processed information through the interface circuit.
在一种可选的设计中,芯片还包括存储器,可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。In an alternative design, the chip also includes memory, which may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (direct rambus RAM, DR RAM).
需要说明的是,处理器、接口电路各自对应的功能既可以通过硬件设计实现,也可以通过软件设计来实现,还可以通过软硬件结合的方式来实现,这里不作限制。It should be noted that the corresponding functions of the processor and the interface circuit can be realized through hardware design, software design, or a combination of software and hardware. There are no restrictions here.
需要说明的是,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行上文中第一节点所执行的任意可能的实现方式中的方法,或者执行上文中第二节点所执行的任意可能的实现方式中的方法。Embodiments of the present application also provide a computer program product. The computer program product includes: computer program code. When the computer program code is run on a computer, it causes the computer to execute any possible implementation performed by the first node above. method in the method, or execute the method in any possible implementation method executed by the second node above.
本申请还提供一种计算机可读介质,该计算机可读介质存储有程序代码,当该程序代码在计算机上运行时,使得该计算机执行上述任一种可能实现方式中的方法。This application also provides a computer-readable medium, which stores program code. When the program code is run on a computer, it causes the computer to execute the method in any of the above possible implementation modes.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地 产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,高密度数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disc,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated therein. The usable media may be magnetic media (eg, floppy disks, hard disks, tapes), optical media (eg, high-density digital video discs (DVD)), or semiconductor media (eg, solid state discs, SSD)) etc.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (30)
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2021/108185 WO2023000313A1 (en) | 2021-07-23 | 2021-07-23 | Key verification method and related apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117597688A true CN117597688A (en) | 2024-02-23 |
Family
ID=84980546
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202180100210.6A Pending CN117597688A (en) | 2021-07-23 | 2021-07-23 | Key verification method and related device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117597688A (en) |
WO (1) | WO2023000313A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115865533B (en) * | 2023-02-27 | 2023-07-28 | 蓝象智联(杭州)科技有限公司 | Proxy re-encryption management method and device under high concurrency scene and storage medium |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3605943B1 (en) * | 2014-11-13 | 2021-02-17 | Panasonic Intellectual Property Corporation of America | Key management method, vehicle-mounted network system, and key management device |
EP3148152A1 (en) * | 2015-09-22 | 2017-03-29 | BAE Systems PLC | Cryptographic key distribution |
JP6260066B2 (en) * | 2016-01-18 | 2018-01-17 | Kddi株式会社 | In-vehicle computer system and vehicle |
CN106027260B (en) * | 2016-05-12 | 2019-04-02 | 成都信息工程大学 | Automobile ECU integrity verification and encryption communication method based on cipher key pre-distribution |
JP6855918B2 (en) * | 2017-05-16 | 2021-04-07 | 株式会社デンソー | Vehicle systems and electronic control devices that process encryption keys |
JP7003976B2 (en) * | 2018-08-10 | 2022-01-21 | 株式会社デンソー | Vehicle master device, update data verification method and update data verification program |
CN112740212B (en) * | 2020-12-24 | 2022-08-09 | 华为技术有限公司 | Key writing method and device |
CN113056898B (en) * | 2021-02-26 | 2022-08-09 | 华为技术有限公司 | Method and device for obtaining secret key and secret key management system |
-
2021
- 2021-07-23 CN CN202180100210.6A patent/CN117597688A/en active Pending
- 2021-07-23 WO PCT/CN2021/108185 patent/WO2023000313A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2023000313A1 (en) | 2023-01-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11321074B2 (en) | Vehicle-mounted device upgrade method and related apparatus | |
US9838870B2 (en) | Apparatus and method for authenticating network devices | |
CN108496322B (en) | In-vehicle computer system, vehicle, key generation device, management method, key generation method, and computer-readable recording medium | |
CN106572106B (en) | Method for transmitting message between TBOX terminal and TSP platform | |
US12166899B2 (en) | Secure device communication | |
KR102450811B1 (en) | System for key control for in-vehicle network | |
CN112740212B (en) | Key writing method and device | |
WO2017115751A1 (en) | Onboard computer system, vehicle, management method, and computer program | |
CN102986161B (en) | For carrying out the method and system of cryptoguard to application | |
CN113439425A (en) | Message transmission method and device | |
CN113016201A (en) | Key provisioning method and related product | |
CN111836260B (en) | Authentication information processing method, terminal and network equipment | |
JP2016163265A (en) | Key management system, key management method, and computer program | |
WO2021170049A1 (en) | Method and apparatus for recording access behavior | |
WO2023000313A1 (en) | Key verification method and related apparatus | |
CN117223251A (en) | Key updating method and related equipment thereof | |
JP6203798B2 (en) | In-vehicle control system, vehicle, management device, in-vehicle computer, data sharing method, and computer program | |
CN117354016A (en) | Whole car OTA security upgrading method, device, equipment and medium | |
US20220210143A1 (en) | Apparatus and method for communicating data in in-vehicle network based on automotive ethernet | |
EP3942770B1 (en) | Chained trusted platform modules (tpms) as a secure bus for pre-placement of device capabilities | |
WO2022241799A1 (en) | Key generation method and apparatus | |
Shipman et al. | A Zero Trust Architecture for Automotive Networks | |
WO2017216874A1 (en) | Key management device, key management program, and key sharing method | |
US20240333479A1 (en) | Symmetric key attestation of removable circuits | |
JP2017208731A (en) | Management system, management apparatus, in-vehicle computer, management method, and computer program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20241111 Address after: 518129 Huawei Headquarters Office Building 101, Wankecheng Community, Bantian Street, Longgang District, Shenzhen, Guangdong Applicant after: Shenzhen Yinwang Intelligent Technology Co.,Ltd. Country or region after: China Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd. Country or region before: China |
|
TA01 | Transfer of patent application right |