Secure communication method, system and chip

By placing the secure communication module and encryption protocol stack within the hardware security module to handle freshness values ​​and message authentication codes, the problems of high computational resource consumption, increased latency, and information leakage in existing technologies are solved, achieving more efficient information security protection and reducing data transmission latency.

CN121750285APending Publication Date: 2026-03-27CHENGDU CHIPSEA INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In the existing automotive ECU software security communication architecture, placing the security communication logic on the HOST side results in high computational resource consumption, increased latency, complex modifications, and the risk of information leakage.

Method used

The secure communication module and encryption protocol stack are placed inside the hardware security module. The hardware security module processes the freshness value and message authentication code, reducing the computational burden on the main control module. Only data transmission control is performed between the main control module and the hardware security module.

Benefits of technology

It reduces the computing resource consumption of the main control module, lowers data transmission latency, and enhances information security protection, avoiding the risk of information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121750285A_ABST
    Figure CN121750285A_ABST
Patent Text Reader

Abstract

The invention discloses a secure communication method, system and chip, the secure communication method is applied to a secure communication module, and the secure communication module is located in a hardware security module. The method comprises the following steps: in response to a data verification request, obtaining and verifying a freshness value in a target data packet; if the freshness value passes the verification, generating a to-be-verified code according to the freshness value, and sending the to-be-verified code and a message authentication code in the target data packet to an encryption protocol stack; and feeding back a verification result from the encryption protocol stack to the main control module, so that the main control module processes the to-be-verified receiving data in the target data packet according to the verification result. According to the secure communication method, sensitive operations related to secure communication such as processing of the freshness value and generation of the to-be-checked code are executed through the secure communication module, occupation of computing resources of the main control module is reduced, and protection of information security is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of vehicle communication information security, and particularly relates to a secure communication method, a secure communication system and a chip. BACKGROUND

[0002] The current software secure communication architecture of an ECU (Electronic Control Unit) of an automobile mainly includes two sides of a HOST and a hardware security module (HSM). The HOST side is mainly used as a "business master node" of the system, is responsible for interaction with the outside and execution of non-sensitive functions, and the HSM side is mainly used as a "security root of trust" of the system and processes high-sensitive security operations.

[0003] However, under the requirements of a traditional AUTOSAR (Automotive Open System Architecture), part of the logic in secure communication needs to be placed on the HOST side, which leads to security risks of information leakage and occupation of more computing resources of the HOST side. SUMMARY

[0004] In view of the above problems, the present application provides a secure communication method, a secure communication system and a chip to solve the above technical problems.

[0005] In a first aspect, the present application provides a secure communication method, which is applied to a secure communication module, the secure communication module is located in a hardware security module, the hardware security module further includes an encryption protocol stack, and the secure communication module is in communication connection with the encryption protocol stack and a master control module; the secure communication method comprises the following steps: In response to a data verification request from the master control module, a freshness value in a target data packet is obtained and verified; If the freshness value passes the verification, a to-be-verified code is generated according to the freshness value, and the to-be-verified code and a message authentication code in the target data packet are sent to the encryption protocol stack; wherein the encryption protocol stack is used for verifying the to-be-verified code and the message authentication code; A verification result from the encryption protocol stack is fed back to the master control module, so that the master control module processes to-be-verified received data in the target data packet according to the verification result.

[0006] In the secure communication method, the freshness value is verified and the to-be-verified code is generated by the secure communication module of the hardware security module, so that the protection of information security is strengthened; at the same time, since sensitive operations are all completed by the secure communication module, only data transmission control operations are performed between the master control module and the secure communication module, so that the occupation of computing resources of the master control module is reduced, and the time delay of data transmission is also reduced.

[0007] In a second aspect, the application provides a secure communication method, which is applied to a secure communication module, the secure communication module is located in a hardware security module, the hardware security module further comprises an encryption protocol stack, and the secure communication module is in communication connection with the encryption protocol stack and a master module; the secure communication method comprises: In response to a generation authentication code request from the master module, a freshness value and to-be-sent data are acquired, and a to-be-processed data packet is generated according to the freshness value and the to-be-sent data and sent to the encryption protocol stack; wherein the encryption protocol stack is used for generating a message authentication code according to the to-be-processed data packet; If the message authentication code is successfully generated, a to-be-sent data packet is generated according to the message authentication code, the freshness value and the to-be-sent data and stored in a shared memory area; The second address and the generation result are fed back to the master module, so that the master module processes the to-be-sent data packet according to the generation result; wherein the second address is a storage address of the to-be-sent data packet in the shared memory area, and the generation result is used to represent whether the message authentication code is successfully generated.

[0008] In a third aspect, the application provides a secure communication method, which is applied to a hardware security routing module, the hardware security routing module is located in a master module, the master module is in communication connection with a hardware security module, the master module further comprises a protocol data unit routing module, and the hardware security routing module is in communication connection with the protocol data unit routing module and the hardware security module; the secure communication method comprises: A target data packet from the protocol data unit routing module is stored in a shared memory area; wherein the target data packet carries to-be-verified received data, a freshness value and a message authentication code; A data verification request and a first address are sent to the hardware security module, so that the hardware security module verifies the freshness value and the message authentication code; wherein the first address is a storage address of the target data packet in the shared memory area; The to-be-verified received data is processed according to a verification result from the hardware security module.

[0009] In the secure communication method, the hardware security routing module of the master module only needs to send a data verification request and a data packet address to the hardware security module, and the verification of the freshness value and the message authentication code related to sensitive operations is completed by the hardware security module, so that the protection of information security is strengthened, the occupation of the computing resources of the master module is reduced, and the time delay of data transmission is also reduced.

[0010] In a fourth aspect, the application provides a secure communication method, which is applied to a hardware security routing module, the hardware security routing module is located in a master module, the master module is in communication connection with a hardware security module, the master module further comprises a protocol data unit routing module, and the hardware security routing module is in communication connection with the protocol data unit routing module and the hardware security module; the secure communication method comprises: storing the to-be-sent data from the protocol data unit routing module into a shared memory area; sending a generation authentication code request and a data address to the hardware security module, so that the hardware security module generates a message authentication code and a to-be-sent data packet; wherein the data address is a storage address of the to-be-sent data in the shared memory area; processing the to-be-sent data packet according to a generation result and a second address from the hardware security module; wherein the second address is a storage address of the to-be-sent data packet in the shared memory area, and the generation result is used to represent whether the message authentication code is generated successfully.

[0011] In a fifth aspect, the application further provides a secure communication system, which comprises a master module and a hardware security module in communication connection, a security communication module of the hardware security module is used to execute the steps of any one of the secure communication methods in the first aspect and the second aspect, and a hardware security routing module of the master module is used to execute the steps of any one of the secure communication methods in the third aspect and the fourth aspect.

[0012] In a sixth aspect, the application further provides a chip, which comprises the secure communication system in the fifth aspect.

[0013] From the above, the application has the following beneficial effects: The secure communication method provided by the application reduces the occupation of the computing resources of the master module by executing the processing of the freshness value and the sensitive operations related to the generation of the to-be-verified code by the security communication module, and strengthens the protection of information security. BRIEF DESCRIPTION OF DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0015] Figure 1 is a schematic diagram of an architecture of secure communication of vehicle-mounted software in the related art; Figure 2 is a schematic diagram of an application scenario of the secure communication method provided in the embodiments of the application; Figure 3is a method flow diagram of a secure communication method provided in an embodiment of the present application; Figure 4 is a data format diagram of a target data packet provided in an embodiment of the present application; Figure 5 is another method flow diagram of a secure communication method provided in an embodiment of the present application; Figure 6 is still another method flow diagram of a secure communication method provided in an embodiment of the present application; Figure 7 is still another method flow diagram of a secure communication method provided in an embodiment of the present application; Figure 8 is a receiving flow diagram of a secure communication system provided in an embodiment of the present application; Figure 9 is a sending flow diagram of a secure communication system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] Embodiments of the present application are described below by way of example only with reference to the accompanying drawings. Best Mode for Carrying Out the Invention

[0017] In order that the schemes of the present application can be well understood, the technical schemes in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0018] In the embodiments of the present application, it should be noted that, in this document, relational terms such as first and second and the like are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between or among the entities or actions.

[0019] Moreover, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element preceded by "comprising" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the stated elements.

[0020] In the description of the embodiments of the present application, the word "example" or "for example" is used to represent example, illustration, or description. Any embodiment or design scheme described as "example" or "for example" in the embodiments of the present application is not interpreted as more preferred or having more advantages than another embodiment or design scheme. The word "example" or "for example" and the like are intended to present a relative concept in a clear manner.

[0021] In addition, "multiple" in the embodiments of the present application refers to two or more than two, and therefore "multiple" in the embodiments of the present application can also be understood as "at least two". "At least one" can be understood as one or more, for example, understood as one, two or more. For example, including at least one means including one, two or more, and does not limit which ones are included, for example, including at least one of A, B and C, then the included can be A, B, C, A and B, A and C, B and C, or A and B and C.

[0022] It should be noted that "connection" in the embodiments of the present application can be understood as electrical connection, and the connection between two electrical elements can be direct or indirect connection between the two electrical elements. For example, A and B are connected, which can be direct connection between A and B, or indirect connection between A and B through one or more other electrical elements.

[0023] Before introducing the safety communication method, system and chip of the present application, first introduce the related terms and background information of the embodiments of the present application.

[0024] RTE (Runtime Environment, runtime environment) is a key part in the AUTOSAR architecture, which abstracts and interfaces the software components and the underlying hardware to realize the separation of application software and hardware platform.

[0025] COM (Communication Module, communication module) is a core functional module responsible for "external communication management" and "communication data processing", which is used to abstract the differences of underlying communication hardware, uniformly manage various communication protocols, and ensure that the HOST side business logic can efficiently and reliably interact with the outside for data exchange.

[0026] PduR (Protocol Data Unit Router, protocol data unit router) is a core module responsible for "cross-communication protocol data routing and forwarding", which is used to receive "protocol data unit (PDU)" from the upper layer or a protocol interface, and forward it to the target protocol interface or the upper layer module according to the preconfigured routing rules, to realize cross-protocol and cross-interface data interaction.

[0027] CAN (Controller Area Network) is a serial communication protocol bus designed for real-time applications.

[0028] CanIf (CAN Interface) is the standard interface for accessing the CAN bus.

[0029] SecOC (Secure Onboard Communication) is a key module in the AUTOSAR architecture, aiming to provide security for vehicle network communication. By adding security-related information at the protocol data unit level, all parties involved in communication can verify the authenticity and integrity of received messages.

[0030] FvM (Freshness Value Manager) is the core component of the AUTOSAR SecOC mechanism, responsible for generating and maintaining freshness values (FV) to ensure the security and integrity of data transmission.

[0031] Csm (Crypto Service Manager) is part of the AUTOSAR basic software, responsible for providing aggregation and management of encryption services. Csm encapsulates different encryption libraries and hardware encryption interfaces, providing a set of unified APIs (Application Programming Interface) so that upper-layer applications do not have to worry about underlying encryption algorithms and hardware details.

[0032] CryIf (Crypto Interface) is the interface module called by Csm, and each encryption primitive in CryIf corresponds to a service in Csm. CryIf also supports distributing related tasks and further calling different drivers.

[0033] IPC (Interprocessor Communication) is also known as core-to-core communication, which is a core component of the AUTOSAR architecture, enabling different software components to communicate and work together to achieve the functionality of the entire vehicle system.

[0034] As shown in Figure 1 , the current architecture of automotive software secure communication mainly includes HOST and HSM sides.

[0035] When receiving data, the HOST side transmits the message from the bus to the SecOC module by the communication protocol stack, and the SecOC module calls the FvM module to check whether the freshness value in the received message meets the requirement; after the freshness value meets the requirement, the data is transmitted to the HSM side for MAC (Message Authentication Code) verification by the encryption protocol stack, and finally the verification result fed back by the HSM side is transmitted from the encryption protocol stack back to the SecOC module; if the verification passes, the PduR module transmits the message data to the Com module, and if the verification does not pass, the message is discarded.

[0036] When transmitting data, the COM module of the HOST side transmits the data to the SecOC module through the PduR module, then obtains the freshness value through the FvM module interface, and then transmits the data and the freshness value to the HSM side to generate the MAC through the encryption protocol stack; finally, the freshness value, the data and the MAC fed back by the HSM side are assembled and transmitted to the communication protocol stack through the PduR module and sent to the bus.

[0037] The software security communication of the automobile ECU in the related art mostly adopts Figure 1 the architecture shown in the figure, but this communication architecture has the following problems: First, as the automobile electronic and electrical architecture develops from a distributed to a centralized domain controller, the communication data volume of a single ECU significantly increases, thereby the CPU load occupied becomes larger and larger, and the CPU load optimization in the domain controller becomes more and more critical.

[0038] Second, due to the requirements of automatic driving and high functional safety, the time delay requirement of signal transmission is getting shorter and shorter, and the required safety communication under the traditional AUTOSAR architecture must be processed too much on the HOST side, which not only occupies the CPU load but also increases the time delay of signal transmission.

[0039] Third, with the implementation of the national mandatory standard GB 44495-2024 "Automobile Whole Vehicle Information Security Technical Requirements", more and more ECUs increase the requirement of safety communication; if the existing platform software is upgraded according to the traditional AUTOSAR architecture, not only a series of modules such as SecOC, FvM and Csm need to be added to make the existing software architecture more complex, but also the existing platform software needs to be greatly modified, which finally leads to a longer development cycle of software upgrade.

[0040] Fourth, Figure 1 The architecture shown in the figure places part of the logic in safety communication, such as freshness value management and unpacking and packaging of safety communication data, on the HOST side, which has a security risk of information leakage.

[0041] Based on this, the embodiment of the present application provides a secure communication method, system and chip, which are described in detail below.

[0042] Please refer to Figure 2 , Figure 2 is an application scenario diagram of the secure communication method provided in the embodiment of the present application. The execution subject of the secure communication method can be a secure communication module (SecureCom) on the HSM side, or a hardware security routing module (PduHR) on the HOST side.

[0043] In the embodiment of the present application, the operations related to secure communication, such as freshness value management and MAC check sensitive operations, are all completed by the HSM side, i.e. the hardware security module. The HOST side, i.e. the master module, only leaves the data transmission control operation between the HOST and the HSM, reducing the occupation of the HOST side computing resources and also reducing the data transmission delay.

[0044] Those skilled in the art can understand that Figure 2 the application environment shown in the above embodiment is only one application scenario suitable for the scheme of the present application, and does not constitute a limitation on the application scenarios of the scheme of the present application. The secure communication method of the present application can be applied in a car or other application scenarios requiring secure communication, and the specific application scenarios are not limited here.

[0045] Firstly, the embodiment of the present application provides a secure communication method, please refer to Figure 3 , Figure 3 is a method flow diagram of the secure communication method provided in the embodiment of the present application. The execution subject of the secure communication method can be a secure communication module SecureCom, please refer to Figure 2 The secure communication module SecureCom is located in the hardware security module HSM, and the hardware security module HSM further includes an encryption protocol stack (Csm, CryIf, Crypto). The secure communication module SecureCom is in communication connection with the encryption protocol stack and the master module, i.e. the HOST side. The secure communication method includes the following steps: Step S301, in response to a data check request from the master module, obtaining and verifying the freshness value in the target data packet.

[0046] In this embodiment, the main control module is also known as the HOST side or the main system. When acting as the receiver, after receiving data, the main control module can send a data verification request to the secure communication module SecureCom to perform security verification on the received data. Upon receiving the data verification request, the secure communication module SecureCom can obtain the freshness value in the target data packet and verify the freshness value.

[0047] Understandably, the data format of this target data packet can be consistent with the AUTOSAR specification, thereby ensuring compatibility of secure communication between the current ECU node and other ECU nodes. For example... Figure 4 As shown, the target data packet may include four parts: Secured PDU Header, Authentic PDU, Freshness Value, and Authenticator.

[0048] The Secured PDU Header is optional and its selection depends on the vehicle's secure communication requirements. This header is generally used to represent secure communication PDUs. The Authentic PDU is the actual data that needs to be transmitted between the two ECU nodes, typically the physical signal between the ECU nodes. The Freshness Value is mainly used to prevent replay attacks and is updated simultaneously by both the receiving and sending nodes according to the logic of the vehicle's secure communication requirements. The Authenticator is used to verify whether the data has been tampered with and is generally a MAC generated by a HASH or AES algorithm.

[0049] The SecureCom secure communication module can extract the corresponding freshness value from the target data packet based on the known data format.

[0050] Step S302: If the freshness value verification passes, a verification code is generated based on the freshness value, and the verification code and the message authentication code in the target data packet are sent to the encryption protocol stack; wherein, the encryption protocol stack is used to verify the verification code and the message authentication code.

[0051] In this embodiment of the application, after the freshness value verification is passed, the secure communication module SecureCom can generate a verification code based on the freshness value, and provide the verification code and the message authentication code (MAC) extracted from the target data packet to the encryption protocol stack, which then compares and verifies the verification code and the message authentication code (MAC).

[0052] Understandably, the encryption protocol stack can compare the verification code and the message authentication code (MAC) after receiving them. If they match, the data is considered complete and authentic, and the verification passes. If they do not match, the data is considered to have been tampered with or is forged, and the verification fails.

[0053] Step S303: Feed back the verification result from the encryption protocol stack to the main control module so that the main control module can process the received data to be verified in the target data packet according to the verification result.

[0054] In this embodiment of the application, after receiving the verification result, the SecureCom secure communication module can directly feed the verification result back to the main control module through IPC, so that the main control module can process the received data to be verified in the target data packet according to the verification result.

[0055] For example, if the verification result indicates that the verification is successful, the main control module can transmit the received data to be verified to the protocol data unit routing module PduR, so that the protocol data unit routing module PduR can transmit the received data to be verified back to the communication protocol stack for processing; conversely, if the verification result indicates that the verification is unsuccessful, the main control module can directly discard the received data to be verified to free up storage space and store the processing result for subsequent troubleshooting.

[0056] In this embodiment, the Secure Communication module SecureCom performs sensitive operations related to secure communication, such as processing freshness values ​​and generating verification codes, thereby reducing the computational resource consumption of the main control module and strengthening information security protection.

[0057] In some embodiments of this application, obtaining and verifying the freshness value in the target data packet in step S301 may further include: The target data packet is obtained based on the first address from the main control module; where the first address is the storage address of the target data packet in the shared memory area; the target data packet is unpacked to obtain a freshness value, and the freshness value is verified.

[0058] In this embodiment of the application, after receiving the target data packet from the sender, the main control module can store the target data packet in the shared memory area of ​​the main control module and the hardware security module HSM, and then send the storage address of the target data packet, i.e. the first address, to the secure communication module SecureCom.

[0059] Understandably, the first address can be included in the data verification request and sent to the secure communication module SecureCom via IPC; or, the first address can be sent to the secure communication module SecureCom independently of the data verification request via IPC. The specific choice can be determined based on the actual application scenario, and is not limited here.

[0060] After receiving the first address, the SecureCom secure communication module can obtain the target data packet from the shared memory area based on the first address, and then unpack the target data packet according to the pre-set data format to extract the received data to be verified, the freshness value, and the message authentication code (MAC).

[0061] Because freshness values ​​can be used to prevent replay attacks (where attackers intercept legitimate historical data and resend it, deceiving the receiver), in secure communication, a dynamic value that changes over time or frequency can be added to each communication to ensure that the receiver only accepts the latest or most valid data.

[0062] As an example, the freshness value can be generated using a counter. Specifically, the sender and receiver can share an initial counter value, which is incremented after each communication (e.g., count = count + 1). When checking the freshness value of this communication, the receiver can only accept data whose counter value is greater than the previous value.

[0063] As another example, freshness values ​​can also be implemented using timestamps. Specifically, the sender can append the current time (such as the system time accurate to milliseconds) to the data, and the receiver can verify whether the timestamp is within the "valid time window" (such as ±500ms) when checking the freshness value of this communication.

[0064] As another example, the freshness value can also be implemented using random numbers. Specifically, the receiver can first send a random number to the sender, who then includes this random number in the data before sending it. When the receiver checks the freshness value for this communication, it can verify whether the received random number is consistent with the one it sent.

[0065] In other words, the SecureCom secure communication module in this embodiment can compare the freshness value extracted from the target data packet with a locally recorded baseline value. If a counter is used, the verification is confirmed to pass if the extracted freshness value is greater than the locally recorded baseline value; otherwise, the verification fails. If a timestamp is used, the verification is confirmed to pass if the extracted freshness value falls within the local time and allowable deviation range; otherwise, the verification fails. If a random number is used, the verification is confirmed to pass if the extracted freshness value matches the locally generated random number; otherwise, the verification fails.

[0066] In some embodiments of this application, the step S302 of generating the verification code based on the freshness value may further include: Based on the shared key, freshness value, and received data to be verified, a verification code is generated; where the shared key is a key shared by the sender that sends the received data to be verified and the receiver where the secure communication module SecureCom is located.

[0067] In secure communication, message authentication codes (MACs) verify the integrity (data has not been tampered with) and authenticity (data comes from a legitimate sender). Using a shared key between the sender and receiver, the sender can generate a fixed-length MAC for the "data and freshness value" and send it in the target data packet. The receiver verifies the data by recalculating the MAC and comparing it.

[0068] In this embodiment, after the freshness value verification is passed, the SecureCom secure communication module can generate a verification code using a shared key and a set encryption algorithm. For example, the verification code = f(K, freshness value + received data to be verified); where K is the freshness value, and the encryption function f() can be a MAC algorithm based on a hash function (such as SHA-256) (such as HMAC-SHA256), a MAC algorithm based on a symmetric encryption algorithm (such as AES) (AES-CMAC), a Galois counter mode based on a block cipher, etc. The specific method can be determined according to the actual application scenario, and is not limited here.

[0069] Please see Figure 5 , Figure 5 This is a schematic flowchart of another secure communication method provided in the embodiments of this application. The executing entity of this secure communication method can also be the secure communication module SecureCom. This secure communication method includes the following steps: Step S501: In response to the request to generate an authentication code from the main control module, obtain the freshness value and the data to be sent, and generate a data packet to be processed based on the freshness value and the data to be sent, and send it to the encryption protocol stack; wherein, the encryption protocol stack is used to generate a message authentication code based on the data packet to be processed.

[0070] In this embodiment, when acting as the sender, the main control module can send a request to the secure communication module SecureCom to generate an authentication code. Upon receiving this request, SecureCom determines that the current ECU node needs to securely communicate with other ECU nodes. Therefore, SecureCom can obtain the freshness value and the data to be sent for secure communication. Based on the freshness value and the data to be sent, it generates a data packet to be processed and sends it to the encryption protocol stack. The encryption protocol stack can then generate a message authentication code (MAC) based on the received data packet.

[0071] Specifically, the freshness value can be implemented using a counter, a timestamp, or a random number from the receiver; the encryption protocol stack can use the shared key K with the receiver to calculate the message authentication code MAC using a set encryption algorithm, for example, message authentication code MAC = f(K, freshness value + data to be sent).

[0072] Step S502: If the message authentication code (MAC) is successfully generated, then the data packet to be sent is generated and stored in the shared memory area based on the message authentication code (MAC), the freshness value, and the data to be sent.

[0073] In this embodiment of the application, after the message authentication code (MAC) is successfully generated, the encryption protocol stack will send the generated message authentication code (MAC) back to the secure communication module SecureCom, so that the secure communication module SecureCom can generate a data packet to be sent based on the message authentication code (MAC), the freshness value and the data to be sent, and store the generated data packet to be sent in the shared memory area.

[0074] Step S503: Feed back the second address and the generation result to the main control module so that the main control module can process the data packet to be sent according to the generation result; wherein, the second address is the storage address of the data packet to be sent in the shared memory area, and the generation result is used to characterize whether the message authentication code has been successfully generated.

[0075] Upon receiving the Message Authentication Code (MAC), the SecureCom module confirms successful MAC generation. It then sends the generation result and the storage address of the data packet to be sent within the shared memory area (the second address) back to the main control module. The main control module can then confirm successful MAC generation based on the result, retrieve the data packet to be sent using the second address, and transmit the data packet back to the communication protocol stack for processing.

[0076] Understandably, if the message authentication code (MAC) generation fails, the secure communication module SecureCom can directly report the failure to the main control module. The main control module can then discard the data to be sent based on the failure result to free up storage space and store the processing result for later investigation.

[0077] In this embodiment, the freshness value is managed and data is packaged through the secure communication module of the hardware security module, which strengthens the protection of information security. At the same time, since sensitive operations are all completed by the secure communication module, the main control module and the secure communication module only perform data transmission control operations, thus reducing the occupation of the main control module's computing resources and also reducing the latency of data transmission.

[0078] In some embodiments of this application, obtaining the freshness value and the data to be sent in step S501 may further include: The data to be sent is obtained based on the data address from the main control module; where the data address is the storage address of the data to be sent in the shared memory area.

[0079] In this embodiment of the application, when data needs to be sent, the main control module can store the data to be sent that requires secure communication into the shared memory area, and then send the storage address of the data to be sent, i.e. the data address, to the secure communication module SecureCom.

[0080] Understandably, this data address can be included in the authentication code generation request and sent to the secure communication module SecureCom via IPC; alternatively, this data address can be sent to the secure communication module SecureCom independently of the data verification request via IPC. The specific choice can be determined based on the actual application scenario, and is not limited here.

[0081] After receiving a data address, the SecureCom secure communication module can retrieve the data to be sent from the shared memory area based on that data address.

[0082] In some embodiments of this application, step S502, which generates a data packet to be sent and stores it in a shared memory area based on the message authentication code (MAC), freshness value, and data to be sent, may further include: The message authentication code, freshness value, and data to be sent are packaged according to the preset secure communication data format, and the resulting data packet is stored in the shared memory area.

[0083] In this embodiment of the application, to ensure that the current ECU node can communicate securely and compatiblely with other ECU nodes, the preset secure communication data format can be adopted. Figure 4The data format shown is as follows. In other words, the SecureCom secure communication module can assemble the data to be sent, the acquired freshness value, and the generated message authentication code (MAC) based on the secure communication PDU format, forming a data packet to be sent and storing it in the shared memory area.

[0084] Please see Figure 6 , Figure 6 This is a flowchart illustrating another method of the secure communication method provided in this application embodiment. The executing entity of this secure communication method can be a hardware secure routing module PduHR, as shown below. Figure 2 The hardware security routing module PduHR is located within the main control module, i.e., on the HOST side. The main control module is communicatively connected to the hardware security module HSM. The main control module also includes a protocol data unit routing module PduR. The hardware security routing module PduHR is communicatively connected to both the protocol data unit routing module PduR and the hardware security module HSM. This secure communication method includes the following steps: Step S601: Store the target data packet from the Protocol Data Unit Routing Module PduR into the shared memory area; wherein, the target data packet carries the received data to be verified, the freshness value and the message authentication code MAC.

[0085] In this embodiment of the application, when receiving data, the processor of the main control module sends the target data packet that needs to be verified to the hardware security routing module PduHR through the protocol data unit routing module PduR. Then, the hardware security routing module PduHR can store the target data packet in the shared memory area after receiving it.

[0086] Understandably, the target data packet is a data packet sent by the sender that conforms to the secure communication PDU format. Therefore, the target data packet carries the received data to be verified, the freshness value, and the message authentication code (MAC).

[0087] Step S602: Send a data verification request and a first address to the hardware security module HSM so that the hardware security module HSM can verify the freshness value and message authentication code MAC; wherein, the first address is the storage address of the target data packet in the shared memory area.

[0088] In this embodiment of the application, in order to ensure the security of received data and resist replay attacks, data tampering and forgery attacks, the hardware security routing module PduHR can send a data verification request and a first address to the hardware security module HSM.

[0089] As described in the foregoing embodiments, the first address can be carried in the data verification request and sent to the hardware security module HSM via IPC; or, the first address can be sent to the hardware security module HSM independently of the data verification request via IPC. The specific method can be determined according to the actual application scenario and is not limited here.

[0090] The hardware security module (HSM) can retrieve the target data packet from the shared memory region based on the first address, and then unpack the target data packet according to a pre-defined data format to extract the received data to be verified, the freshness value, and the message authentication code (MAC). Subsequently, according to the description in the aforementioned embodiment, the extracted freshness value and the MAC are verified. The working process and principle of the hardware security module (HSM) can be referred to... Figure 3 The description of the secure communication method corresponding to any embodiment will not be repeated here.

[0091] Step S603: Process the received data to be verified based on the verification result from the hardware security module HSM.

[0092] In this embodiment of the application, the hardware security module HSM can feed back the verification result to the hardware security routing module PduHR through IPC, and the hardware security routing module PduHR can process the received data to be verified according to the received verification result.

[0093] For example, if the verification result indicates that the verification is successful, the hardware security routing module PduHR can transmit the received data to be verified to the protocol data unit routing module PduR, so that the protocol data unit routing module PduR can transmit the received data to be verified back to the communication protocol stack for processing; conversely, if the verification result indicates that the verification is unsuccessful, the hardware security routing module PduHR can directly discard the received data to be verified to free up storage space and store the processing result for subsequent investigation.

[0094] Please see Figure 7 , Figure 7 This is a schematic flowchart of another method of the secure communication method provided in the embodiments of this application. The executing entity of this secure communication method can also be the hardware secure routing module PduHR. This secure communication method includes the following steps: Step S701: Store the data to be sent from the Protocol Data Unit Routing Module PduR into the shared memory area.

[0095] In this embodiment of the application, when sending data, the processor of the main control module uses the protocol data unit routing module PduR to store the data to be sent that requires secure communication in the shared memory area.

[0096] Step S702: Send a request to generate an authentication code and a data address to the hardware security module HSM, so that the hardware security module HSM generates a message authentication code (MAC) and a data packet to be sent; wherein, the data address is the storage address of the data to be sent in the shared memory area.

[0097] In this embodiment, the hardware security routing module PduHR can send an authentication code generation request and the storage address (i.e., the data address) of the data to be sent in the shared memory area to the hardware security module HSM via IPC. The hardware security module HSM can then refer to... Figure 5 The description of the secure communication method in any embodiment involves generating a message authentication code (MAC) and a data packet to be sent, which will not be repeated here.

[0098] Step S703: Process the data packet to be sent based on the generation result and the second address from the hardware security module HSM; wherein, the second address is the storage address of the data packet to be sent in the shared memory area, and the generation result is used to characterize whether the message authentication code has been successfully generated.

[0099] Understandably, if the message authentication code (MAC) generation fails, the hardware security routing module PduHR, upon receiving a result indicating the generation failure, can discard the data to be sent to free up storage space and store the processing result for subsequent investigation.

[0100] Conversely, if the message authentication code (MAC) is successfully generated, the hardware security routing module PduHR can obtain the data packet to be sent from the shared memory area based on the received second address, and then send the data packet back to the communication protocol stack for processing.

[0101] In this embodiment, the management of freshness values ​​and the assembly and disassembly of data are both completed by the hardware security module HSM, which not only strengthens the protection of information security, but also reduces the occupation of the main control module's computing resources and reduces the latency of data transmission.

[0102] Based on the above embodiments, this application also provides a secure communication system. This secure communication system may include a main control module (HOST side) for communication connection and a hardware security module (HSM). The secure communication module SecureCom of the hardware security module (HSM) is used to perform actions such as... Figure 3 to Figure 5 Corresponding to the steps of the secure communication method in any embodiment, the hardware secure routing module PduHR of the main control module is used to execute... Figure 6 to Figure 7 The steps of the secure communication method corresponding to any embodiment.

[0103] Please refer to Figure 8 , Figure 8This is a schematic diagram of a receiving process of a secure communication system provided in this application embodiment. When receiving data, the CPU on the HOST side stores the target data packet that needs to be verified into the shared memory area through the hardware security routing module PduHR, and then transmits the storage address of the target data packet and the data verification request to the HSM side through the IPC protocol.

[0104] The subsequent secure communication logic will be processed in parallel by the CPU on the HSM side. The SecureCom secure communication module on the HSM side will unpack the received target data packet according to the secure communication data format, and then check the extracted freshness value. The freshness value processing logic here is defined by the OEM manufacturer. After the freshness value passes the check, it is combined with the received data to be verified in the target data packet to construct the verification code. The verification code and the message authentication code (MAC) in the target data packet are passed to the encryption protocol stack CrytoStack for verification. The verification result is transmitted back to the HOST side via the IPC protocol, triggering the hardware secure routing module PduHR to process the data according to the verification result. If the verification passes, the received data to be verified is transmitted back to the communication protocol stack for processing. If the verification fails, the received data to be verified is discarded directly, and the processing result is stored.

[0105] Please refer to Figure 9 , Figure 9 This is a schematic diagram of a sending process of a secure communication system provided in this application embodiment. When sending data, the CPU on the HOST side stores the data to be sent that needs to be securely communicated into the shared memory area through the hardware secure routing module PduHR, and then transmits the data address and the request to generate an authentication code to the HSM side through the IPC protocol.

[0106] The SecureCom module on the HSM side obtains the freshness value through the freshness value update logic (usually defined by the OEM manufacturer), and then constructs a data packet for generating a MAC address together with the data to be sent. The constructed data packet is then passed to the CryptoStack encryption protocol stack to generate the MAC address. SecureCom then assembles the generated MAC address, freshness value, and data packet according to the secure communication data format, stores the assembled data packet in the shared memory area, and then transmits the result of whether the generation was successful and the address of the data packet to be sent back to the HOST side via the IPC protocol. The hardware secure routing module PduHR is triggered to process the data to be sent based on the generation result. If the generation is successful, the data packet to be sent is obtained according to the address of the data packet to be sent, and the data packet to be sent is transmitted back to the communication protocol stack for processing. If the generation fails, the data packet to be sent is discarded directly, and the processing result is stored.

[0107] The secure communication solutions in related technologies have four major problems: First, the computing power consumption on the host side increases with the increase of secure communication data volume; second, too many redundant operations on the host side lead to excessive signal transmission and reception delays, which do not meet the requirements of autonomous driving and functional safety; third, the existing solutions require significant modifications, which is not conducive to the migration of platform technologies; and finally, placing some sensitive secure communication operations on the host side poses a certain risk of information security leakage.

[0108] The secure communication system in this application embodiment, by placing all secure communication-related operations on the HSM side, firstly reduces the consumption of computing power on the HOST side by leveraging the increasing computing power of existing HSM CPUs; secondly, it allows the HOST and HSM to operate in parallel during secure communication processing, reducing the latency of sending and receiving communication signals; thirdly, it facilitates the addition of secure communication support to the software platform by reducing modifications to the HOST side software architecture; and finally, by placing all secure communication operations on the HSM side, it increases hardware-level protection.

[0109] Based on the above embodiments, this application also provides a chip that may include the aforementioned secure communication system.

[0110] The chip in this application embodiment can be a single chip, or it can be composed of two or more chips spliced ​​together. For example, if it is a single chip, the HOST and HSM are integrated on the same chip; if it is two or more chips, the HOST and HSM can be integrated on different chips. The specific method can be determined according to the actual application scenario, and is not limited here.

[0111] The chip can be an integrated circuit (IC), also known as a microcircuit, microchip, or wafer / chip. The chip can be, but is not limited to, a system-on-chip (SOC) or a system-in-package (SIP) chip. Because the chip is equipped with the secure communication system of the above embodiments, it has all the beneficial effects of the secure communication system in any of the above embodiments, which will not be repeated here.

[0112] This application also provides a vehicle, which may include a vehicle body and a security communication system or chip as described above, disposed on the vehicle body. In this application embodiment, the vehicle includes, but is not limited to, new energy vehicles and gasoline-powered vehicles.

[0113] Because the vehicle is equipped with the safety communication system of the above embodiments, it has all the beneficial effects of the safety communication system in any of the above embodiments, which will not be repeated here.

[0114] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0115] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.

Claims

1. A secure communication method, characterized in that, The method is applied to a secure communication module, which is located within a hardware security module. The hardware security module also includes an encryption protocol stack, and the secure communication module is communicatively connected to both the encryption protocol stack and the main control module. In response to a data verification request from the main control module, the freshness value in the target data packet is obtained and verified; If the freshness value verification passes, a verification code is generated based on the freshness value, and the verification code and the message authentication code in the target data packet are sent to the encryption protocol stack; wherein, the encryption protocol stack is used to verify the verification code and the message authentication code; The verification result from the encryption protocol stack is fed back to the main control module, so that the main control module can process the received data to be verified in the target data packet according to the verification result.

2. The secure communication method according to claim 1, characterized in that, The process of acquiring and verifying the freshness value in the target data packet includes: The target data packet is obtained based on the first address from the main control module; wherein, the first address is the storage address of the target data packet in the shared memory region; The target data packet is unpacked to obtain the freshness value, and the freshness value is then verified.

3. The secure communication method according to claim 1, characterized in that, The step of generating a verification code based on the freshness value includes: The verification code is generated based on the shared key, the freshness value, and the received data to be verified; wherein, the shared key is a key shared by the sender that sends the received data to be verified and the receiver where the secure communication module is located.

4. A secure communication method, characterized in that, The method is applied to a secure communication module, which is located within a hardware security module. The hardware security module also includes an encryption protocol stack, and the secure communication module is communicatively connected to both the encryption protocol stack and the main control module. In response to a request from the main control module to generate an authentication code, a freshness value and data to be sent are obtained, and a data packet to be processed is generated and sent to the encryption protocol stack based on the freshness value and the data to be sent; wherein, the encryption protocol stack is used to generate a message authentication code based on the data packet to be processed; If the message authentication code is successfully generated, a data packet to be sent is generated and stored in the shared memory area based on the message authentication code, the freshness value, and the data to be sent. The second address and the generation result are fed back to the main control module so that the main control module can process the data packet to be sent according to the generation result; wherein, the second address is the storage address of the data packet to be sent in the shared memory area, and the generation result is used to characterize whether the message authentication code is successfully generated.

5. The secure communication method according to claim 4, characterized in that, The process of obtaining the freshness value and the data to be sent includes: The data to be sent is obtained based on the data address from the main control module; wherein, the data address is the storage address of the data to be sent in the shared memory area.

6. The secure communication method according to claim 4, characterized in that, The step of generating a data packet to be sent and storing it in a shared memory area based on the message authentication code, the freshness value, and the data to be sent includes: The message authentication code, the freshness value, and the data to be sent are packaged according to a preset secure communication data format, and the resulting data packet is stored in the shared memory area.

7. A secure communication method, characterized in that, The method is applied to a hardware security routing module, which is located within a main control module. The main control module is communicatively connected to the hardware security module. The main control module also includes a protocol data unit routing module. The hardware security routing module is communicatively connected to both the protocol data unit routing module and the hardware security module. The target data packet from the protocol data unit routing module is stored in the shared memory area; wherein the target data packet carries the received data to be verified, the freshness value and the message authentication code; A data verification request and a first address are sent to the hardware security module so that the hardware security module can verify the freshness value and the message authentication code; wherein, the first address is the storage address of the target data packet in the shared memory area; The received data to be verified is processed based on the verification result from the hardware security module.

8. A secure communication method, characterized in that, The method is applied to a hardware security routing module, which is located within a main control module. The main control module is communicatively connected to the hardware security module. The main control module also includes a protocol data unit routing module. The hardware security routing module is communicatively connected to both the protocol data unit routing module and the hardware security module. The data to be sent from the protocol data unit routing module is stored in the shared memory area; A request to generate an authentication code and a data address are sent to the hardware security module so that the hardware security module generates a message authentication code and a data packet to be sent; wherein, the data address is the storage address of the data to be sent in the shared memory area; The data packet to be sent is processed based on the generation result from the hardware security module and the second address; wherein, the second address is the storage address of the data packet to be sent in the shared memory area, and the generation result is used to characterize whether the message authentication code has been successfully generated.

9. A secure communication system, characterized in that, The system includes a main control module and a hardware security module for communication connection. The secure communication module of the hardware security module is used to execute the steps of the secure communication method according to any one of claims 1 to 6, and the hardware secure routing module of the main control module is used to execute the steps of the secure communication method according to claim 7 or 8.

10. A chip, characterized in that, Including the secure communication system as described in claim 9.