ROS2 vehicle-mounted system safety communication method and system based on capability token and Chinese remainder theorem

By employing a secure communication method based on capability tokens and the Chinese Remainder Theorem, the dynamic nature of node identity authentication and access control in intelligent connected vehicles is addressed. This method enables lightweight authentication, fine-grained access control, and dynamic group key negotiation, thereby improving the real-time performance and security of the in-vehicle system.

CN121841822APending Publication Date: 2026-04-10ANHUI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-29
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing intelligent connected vehicle in-vehicle systems suffer from excessive burden and insufficient dynamism in node identity authentication and access control, low group key negotiation efficiency, and inability to meet the real-time requirements of high-frequency, multi-node concurrent communication. Furthermore, traditional solutions have single-point failure risks and applicability issues for resource-constrained nodes.

Method used

A secure communication method based on capability tokens and the Chinese Remainder Theorem is adopted. Lightweight HMAC handshake authentication and group key construction using the Chinese Remainder Theorem are used to achieve lightweight authentication, fine-grained access control and dynamic group key negotiation, ensuring two-way security control between publishers and subscribers.

Benefits of technology

It achieves real-time, secure, and scalable capabilities for in-vehicle systems, reduces authentication overhead, improves group key negotiation efficiency, and possesses forward and backward security, making it suitable for the highly dynamic environment of intelligent connected vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121841822A_ABST
    Figure CN121841822A_ABST
Patent Text Reader

Abstract

The invention discloses an ROS2 vehicle-mounted system secure communication method and system based on a capability token and the Chinese remainder theorem, and the method comprises the steps: achieving the fine-grained access control through the capability token at a node starting stage, and achieving the dynamic verification of a node authority through token derivation, tag calculation and Hash-based integrity verification; then, a point-to-point handshake mechanism is introduced, a bidirectional authentication channel is constructed through a token extension body with a frame structure, a symmetrically encrypted secure channel is established by using a derived key, and a group key negotiation mechanism based on the Chinese remainder theorem is used, so that all legal subscribers can recover consistent group session keys by using own private moduli; and the publisher carries out encryption by using the group session key and attaches the intermediate parameter to the header of the message, and the subscriber recovers the group session key through modular operation and decrypts the message. According to the method, the dynamic revocable, fine-grained and lightweight access control and group key updating capability is realized, millisecond-level response is kept in a frequent node joining / quitting scene, and the real-time performance, the safety and the expansibility of communication of a vehicle-mounted system are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the communication security technology of Internet of Vehicles, in particular to a ROS2 vehicle-mounted system secure communication method and system based on a capability token and Chinese remainder theorem. BACKGROUND

[0002] With the rapid popularization of intelligent networked vehicles in society, the communication scale in the vehicle-mounted system is continuously expanding, and the vehicle needs to continuously process environmental perception data, positioning information, vehicle state data and actuator control instructions during driving. ROS 2, as a high-reliability and high-real-time publish-subscribe communication framework, has been widely used in intelligent driving software systems and provides convenience for data collaboration between vehicle-mounted systems. However, the high dynamic network environment of the vehicle-mounted system also brings new security and privacy problems. In particular, with the increase in the number of nodes and the continuous change in the communication topology, the traditional static security mechanism has been difficult to meet the needs of dynamic access control and rapid authentication of the vehicle-mounted system.

[0003] In the secure communication of the ROS 2 system, the access control encryption technology is usually relied on to protect the data transmitted between nodes, so that only authorized nodes can decrypt and use sensitive data. The traditional access control mechanism is mostly based on fixed permission files or certificate chains, and only controls the permission from the perspective of the data receiver, that is, the receiver is allowed to access the encrypted data only after meeting certain strategies, which to some extent realizes the secure transmission of messages. However, this one-way access control model cannot cover all security requirements in the vehicle-mounted system. In particular, for the access control problem of the message publisher, the traditional scheme usually lacks effective means, meaning that a malicious or compromised node may broadcast false or malicious data to the system while maintaining a legitimate certificate, and the existing mechanism cannot constrain the permission from the publisher side. Therefore, relying only on the traditional access control encryption cannot realize the complete security control of both parties in the communication of the vehicle-mounted system.

[0004] In recent years, the academic and industrial communities have gradually increased their research on vehicular data security. Some mechanisms attempt to use attribute-based encryption, symmetric encryption, and hybrid encryption to achieve more flexible access control. For example, attribute-based encryption (ABE) can describe the identity of the access by policy, and only nodes that meet the attribute conditions can complete decryption. In the hybrid encryption mechanism, the system usually uses a symmetric key to quickly encrypt the data, and then uses attribute encryption to encrypt the symmetric key, thereby balancing efficiency and flexibility of access control. However, these technical methods still mainly focus on access control on the receiver side, and pay insufficient attention to the legitimacy of the identity and the authority of the publisher side and dynamic security. For intelligent connected vehicles, it is not enough to control who can receive data, but also necessary to ensure that only nodes with legitimate authority can publish data, otherwise malicious nodes may cause serious driving risks by broadcasting false sensor data, forging vehicle status information, and the like.

[0005] In addition, the existing technology also has obvious deficiencies in key negotiation efficiency. The ROS 2 native security mechanism relies heavily on bilateral Diffie-Hellman key exchange, and the publisher needs to establish an encrypted channel with each subscriber. When the number of subscribers is high, the computational and communication costs of this process increase linearly, which is difficult to apply to the scenario of high-frequency, multi-topic, and multi-node concurrent communication in a vehicular system. More seriously, once a node joins or exits, the system must re-perform multiple bilateral negotiations, which cannot meet the real-time requirements of intelligent driving for millisecond-level communication delay.

[0006] Existing research attempts to implement group key management through centralized key servers, hierarchical key trees, and multiple broadcast key updates, but these schemes have limitations in vehicular environments. For example, centralized servers pose a single point of failure risk and are not suitable for self-organizing communication modes that run offline within vehicles; hierarchical key structures require large memory and complex management logic, which are not suitable for resource-constrained nodes such as sensors or actuators; the multiple-round broadcast method has high latency and cannot adapt to rapidly changing vehicular environments. Therefore, existing schemes still cannot meet the practical requirements of intelligent connected vehicles in terms of group key management efficiency, dynamics, and security. SUMMARY

[0007] The present application provides a ROS2 vehicular system security communication method and system based on capability tokens and the Chinese remainder theorem, which addresses the high dynamicity of the internal environment of intelligent connected vehicles and implements a three-in-one security communication structure of "lightweight authentication + fine-grained permission control + dynamic group key negotiation", greatly improving the real-time, security, and scalability of vehicular systems.

[0008] Technical Solution: The present invention provides a secure communication method for a ROS2 vehicular system based on capability tokens and the Chinese Remainder Theorem, comprising the following steps:

[0009] Step 1: Node Startup and Token Loading; After power-on, the subscriber node loads the capability token and its unique corresponding private modulus parameter from the local trusted storage area. Once the subscriber node is loaded, it generates a random number for the current session. The random number is then appended as an extra frame to the Token to form the Token extension TE. The node uses the pre-shared tag key to perform an HMAC operation on the Token extension to obtain the tag. ,Label Authentication used during the handshake process;

[0010] Step 2: Point-to-point handshake and secure channel establishment; the subscriber node sends the main body of the token extension TE. With random numbers After being packaged, the message is sent to the publisher, forming the first handshake message. Upon receiving the first handshake message, the publisher recalculates the HMAC tag frame by frame using the system root token to verify the authenticity and validity of the token extension sent by the subscriber, and calculates... ;

[0011] Then the publisher generates their own random number. It then returns a second handshake message to the subscriber; this message contains... as well as This is used to prove to subscribers that the publisher has the correct tag values;

[0012] After the subscriber node receives it, it... Verification was conducted to confirm that the publisher was not forged, and calculations were performed. The message is returned to the publisher. Once the publisher successfully verifies it, both parties consider the mutual authentication complete. Subsequently, both parties will... The shared key is obtained as input through the key derivation function KDF. ;

[0013] Step 3: Encrypted transmission of the token and private parameters;

[0014] Subscribers use shared keys Regarding the ability token and private modulus parameters Encrypt separately to obtain the encrypted result. and and send it to the publisher; the publisher uses After decryption, strict legality verification is performed on the Token, and after verification, the modulus parameter corresponding to the subscriber is registered in the group key update module for subsequent Chinese remainder theorem solving;

[0015] Step 4, group key negotiation; when there are multiple subscribers under a certain topic, the publisher maintains a set containing all legal subscriber moduli ; the publisher generates a unique group session key used in the current session , and takes it as the uniform remainder of all congruence equations, and constructs an equation system based on the Chinese remainder theorem to calculate the group synchronization parameter :

[0016] Step 5, message encryption and broadcast; after obtaining the group session key , the publisher uses the symmetric cipher algorithm AES-CTR mode to encrypt the service message msg to obtain the ciphertext message ciphertext, and the publisher writes into the message header and broadcasts ciphertext to all subscribers; the message broadcast process does not need to distribute keys point-to-point, which greatly reduces the communication overhead;

[0017] Step 6, message decryption and recovery; the subscriber node receiving the message obtains and the modulus parameter held by itself through modular operation and uses the key to perform symmetric decryption to recover the service message content.

[0018] The access control of the application is embodied in the following two aspects:

[0019] First, in the process of joining the communication domain of the node, the publisher side as the edge control party will perform frame-by-frame verification on the capability token Token and the extension body TE submitted by the subscriber node, and then perform bidirectional authentication on the subscriber identity and token legality based on the three-way handshake mechanism. Only when the identity verification and permission verification are passed, the publisher allows the subscriber to join the corresponding topic, and registers the private modulus parameter of the subscriber in the group key negotiation module. If the token is counterfeit, the permission is insufficient, the timestamp is invalid, or the label chain is inconsistent, the publisher directly rejects the node to enter, thereby blocking the access request of the illegal node at the communication source.

[0020] Second, in the data broadcast and reception phase, the application uses the parameter constructed based on the Chinese remainder theorem as the basis for group key synchronization, and only the subscriber holding the legal modulus parameter can pass The group key is recovered to decrypt the service message. The node without publisher identity authentication, the node with unmatched authority and the revoked node cannot recover the session key , and thus cannot join the message flow. Through the two-layer mechanism, the application realizes the access control of the publisher to the subscriber and the secure access control of the subscriber to the service message, and guarantees the security of the system from the communication source and the receiving end.

[0021] In order to ensure that the subscriber can carry the necessary authority description into the communication domain and be identified by the publisher, while maintaining the integrity of the token in the storage and transmission process, the step 1 capability token Token is a structure composed of multiple authority frames, each frame containing a resource identifier, an allowed operation authority field and a tag field obtained by performing HMAC operation on the frame content, and the non-forgery and non-tamper of the token is guaranteed, and the calculation method of the tag is:

[0022] ;

[0023] In the above formula, denotes the resource identifier, denotes the authority type, is a system internal key.

[0024] In order to avoid the high overhead brought by traditional certificate chain verification, so that the node can establish a secure channel in milliseconds, the step 2 point-to-point handshake includes three strictly defined handshake messages, the first message is , sent by the subscriber to the publisher;

[0025] The publisher returns the second message after verifying the legality of the token extension body according to the message, and the subscriber verifies the identity of the publisher again and returns the third message , completing the mutual authentication.

[0026] Further, the step 3 verification of the capability token Token by the publisher includes the following four types: (structure legality, frame tag consistency, authority field coverage, timestamp validity)

[0027] 1. Verify the integrity of the token frame structure;

[0028] 2. Verify whether the recalculated HMAC of each frame with the system key and the tag are consistent;

[0029] 3. Verify whether the authority field covers the current topic;

[0030] 4. Verify whether the specified time interval in the token contains the current system time, and if any item does not meet the requirement, the publisher rejects the subscriber to join.

[0031] The time complexity of the application is approximately constant, does not linearly grow with the number of subscribers, and the addition or exit of a subscriber triggers the recalculation of , thereby ensuring that the group key has forward and backward security, step 4 the publisher generates a unique group session key , and constructs an equation set based on the Chinese remainder theorem to calculate the group synchronization parameter The detailed method is:

[0032] First, construct the overall modulus : ;

[0033] Calculate the product corresponding to each modulus : ;

[0034] And calculate: ;

[0035] Where all operations are performed in the field of large integers;

[0036] To be the only solution that can simultaneously satisfy the congruence relation on all ;

[0037] Where when the system detects a new subscriber joins or an old subscriber exits, the publisher reconstructs the modulus set and recalculates ;

[0038] Where is the multiplicative inverse of in the sense of modulus ; this As a group synchronization parameter, it does not contain the plaintext information of , but ensures that all legitimate subscribers can recover the same by and itself .

[0039] Further, step 6 uses AES-CTR mode to encrypt the service message, ensuring that the ciphertext does not leak structural information, and the encryption formula is:

[0040] ;

[0041] At the same time, calculate the integrity tag of the ciphertext using HMAC-SHA256.

[0042] This invention also discloses a secure communication system for a ROS2 vehicle system based on capability tokens and the Chinese Remainder Theorem, including a loader, a key negotiator, a token encryptor / verifier, a token manager, a group key updater, and a message encoder / decoder; the loader is used to load capability tokens and private parameters when the subscriber node starts up. The key exchanger is used to perform point-to-point handshakes, verify HMACs, and derive shared keys. ; Token encryptor / validator subscriber side is used to encrypt tokens and The publisher side is used for decryption and permission verification; the token manager runs on the publisher and is responsible for token validity checks, lifecycle management, and revocation; the group key updater is used for... The parameters of the set are calculated using the Chinese Remainder Theorem. Implements group session key updates; message encoder / decoder, used by the publisher. Encrypt business messages and attach Subscribers through and recover And decrypt the message.

[0043] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0044] (1) This invention uses capability tokens to control access to subscribers and uses the CRT mechanism to dynamically synchronize group keys, thereby achieving two-way permission and security control between publishers and subscribers.

[0045] (2) The present invention replaces traditional certificate verification with lightweight HMAC three-way handshake, which significantly reduces authentication overhead and makes the system more suitable for real-time vehicle scenarios.

[0046] (3) The time complexity of group key negotiation based on CRT is approximately constant, avoiding the linear overhead of traditional Diffie-Hellman multilateral negotiation.

[0047] (4) The present invention can update μ immediately when a node is added or removed, so that the revoked node cannot recover the future key, thus possessing both forward security and backward security. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of the system structure of the present invention;

[0049] Figure 2 This is an overall flowchart of the present invention;

[0050] Figure 3 This is a flowchart of node startup and token loading in this invention;

[0051] Figure 4 Flow chart for point-to-point handshake and secure channel establishment in the present application;

[0052] Figure 5 Flow chart for encrypted transmission of token and private parameter in the present application;

[0053] Figure 6 Flow chart for group key negotiation in the present application;

[0054] Figure 7 Flow chart for message encryption and broadcast in the present application;

[0055] Figure 8 Flow chart for message decryption and recovery in the present application;

[0056] Figure 9 is a comparison chart of experiments of various technical solutions of the embodiment. DETAILED DESCRIPTION

[0057] The technical solutions of the present application will be described in detail below, but the protection scope of the present application is not limited to the described embodiment.

[0058] As shown in Figure 1 and Figure 2 , the ROS2 vehicle-mounted system secure communication method based on capability token and Chinese remainder theorem of the present application comprises the following steps:

[0059] Step 1, node startup and token loading; after the subscriber node is powered on, load the capability token Token and the unique corresponding private modulus parameter from the local trusted storage area ; after the subscriber node is loaded, generate a random number used in the current session , and append the random number as an additional frame to the Token to form a token extension TE, and the node performs HMAC operation on the token extension using the pre-shared label key to obtain a label , the label is used for identity verification in the handshake process;

[0060] Step 2, point-to-point handshake and secure channel establishment; the subscriber node sends the main part of the token extension TE and the random number after being packed to the publisher to form the first handshake message; after the publisher receives the first handshake message, the system root token is used to recalculate the HMAC label frame by frame to verify whether the token extension sent by the subscriber is real and valid, and is calculated;

[0061] Then the publisher generates its own random number , and returns the second handshake message to the subscriber; the message contains and , to prove to the subscriber that the publisher has the correct label value;

[0062] The subscriber node receives and verifies , confirms that the publisher is not forged, and calculates and returns it to the publisher. After the publisher verifies successfully, both parties are considered to have completed mutual authentication. Subsequently, both parties will as input, and obtain the shared key through the key derivation function KDF.

[0063] Step 3, encrypted transmission of token and private parameters;

[0064] The subscriber uses the shared key to encrypt the capability token Token and the private modulus parameter respectively, obtaining the encrypted results and , and sends them to the publisher. After the publisher decrypts , it performs strict legality verification on Token. After verification, the modulus parameter corresponding to the subscriber is registered in the group key update module for subsequent Chinese remainder theorem solving.

[0065] Step 4, group key negotiation; when there are multiple subscribers under a certain topic, the publisher maintains a set containing all legal subscriber moduli ; the publisher generates a unique group session key for the current session and uses it as the uniform remainder of all congruence equations, and constructs an equation system based on the Chinese remainder theorem to calculate the group synchronization parameter :

[0066] Step 5, message encryption and broadcast; after obtaining the group session key , the publisher uses the symmetric cipher algorithm AES-CTR mode to encrypt the business message msg, obtaining the ciphertext message ciphertext. The publisher writes into the message header and broadcasts it to all subscribers together with ciphertext.

[0067] Step 6, message decryption and recovery; the subscriber node receiving the message obtains and its own modulus parameter through modular operation, and uses the key to perform symmetric decryption to recover the business message content.

[0068] ​The system of the present application comprises a vehicle-mounted computing platform running ROS2, at least one publisher node, a plurality of subscriber nodes, and a security enhancement module embedded in the middleware layer. The publisher node is usually deployed in a domain controller or central computing unit with higher computing power, and the subscriber node can be deployed in a sensor, actuator or algorithm module. The security enhancement module of the present application comprises three parts: negotiation layer, access control layer and transmission layer, which respectively complete token loading and handshake authentication, token verification and permission control, session key negotiation and business data encryption transmission functions

[0069] As shown in Figure 3 , the first step of the embodiment first selects a security parameter λ as an initialization input, randomly selects two groups of base points H and H', and selects random numbers s1 and s2 to generate a label key and a root token key; the system defines a resource set , generates a system permission structure according to the software architecture of the vehicle, and sets a permission type set for each type of resource .

[0070] Next, the system calculates the public key parameters of the root token: , , and generates the keys required for label calculation: .

[0071] Subsequently, for a node with an attribute set , the authentication center calculates a frame label for each permission frame according to a preset algorithm:

[0072] ;

[0073] The node finally obtains : ;

[0074] and obtains a unique modulus parameter , , which is a large random prime number assigned by the system. After token initialization, the node generates a random number , and constructs a token extension: ;

[0075] Then calculate the extension label: ;

[0076] Finally, the initial credential structure of the subscriber is obtained.

[0077] As shown in Figure 4 , after receiving the sent by the subscriber, the publisher performs frame-level reconstruction according to each frame information in the extension, and calculates the verification value:

[0078] ;

[0079] If the token is not tampered. The publisher then checks whether the permission rule is met, i.e.: ; ;

[0080] If the permission is insufficient, the communication is rejected. After the identity authentication, the publisher generates a random number and calculates: ;

[0081] Send to the subscriber.

[0082] The subscriber receives and executes: ;

[0083] Calculate: ;

[0084] and send to the publisher, the publisher successfully verifies , both parties complete mutual authentication, and according to: ;

[0085] The shared key is obtained.

[0086] As shown in Figure 5 , the publisher's verification of the capability token Token in step 3 of the embodiment includes the following four types: structural legality, frame label consistency, permission field coverage, and timestamp validity, which specifically refers to: the subscriber uses encrypts its own credentials:

[0087] ;

[0088] ;

[0089] The publisher decrypts and checks legality according to the following conditions:

[0090] HMAC chain consistency: ;

[0091] Permission coverage: ;

[0092] Timestamp legality: ;

[0093] If all are met, add to the set P.

[0094] As shown in Figure 6 , the publisher generates a unique group session key ​and construct equation set based on Chinese remainder theorem to calculate group synchronization parameters The detailed method is as follows:

[0095] First, construct the total modulus : ;

[0096] Wherein, the modulus set ;

[0097] Calculate the product corresponding to each modulus : ;

[0098] And calculate: ;

[0099] Wherein all operations are carried out in the field of large integers;

[0100] Is the unique solution that can satisfy the congruence relation simultaneously on all ;

[0101] Wherein when the system detects that a new subscriber joins or an old subscriber exits, the publisher reconstructs the modulus set, recalculates ;

[0102] Wherein is the multiplicative inverse of in the sense of modulus ; the As a group synchronization parameter, it does not contain the plaintext information of , but ensures that all legitimate subscribers can recover the same and itself . As shown in

[0103] and Figure 7 , step 6 uses AES-CTR mode to encrypt the service message, ensuring that the ciphertext does not leak structural information, and the encryption formula is: Figure 8

[0104] ;

[0105] At the same time, the HMAC-SHA256 is used to calculate the integrity label of the ciphertext.

[0106] The system of the ROS2 vehicle-mounted system secure communication method based on the capability token and Chinese remainder theorem, the loader, the key negotiator, the token encrypter / verifier, the token manager, the group key updater and the message encoder / decoder; the loader is used for loading the capability token Token and the private parameter ​The key exchanger is used to perform point-to-point handshakes, verify HMACs, and derive shared keys. ; Token encryptor / verifier subscriber side is used to encrypt tokens and The publisher side is used for decryption and permission verification; the token manager runs on the publisher and is responsible for token validity checks, lifecycle management, and revocation; the group key updater is used for... The parameters of the set are calculated using the Chinese Remainder Theorem. Implements group session key updates; message encoder / decoder, used by the publisher. Encrypt business messages and attach Subscribers through and recover And decrypt the message.

[0107] This invention belongs to the interdisciplinary field of vehicle middleware security enhancement, group key negotiation, and dynamic access control, and can be applied to secure communication between vehicle internal domain controllers, environmental sensing units, positioning control units, and actuator nodes. This invention also discloses a system for implementing the aforementioned ROS2 vehicle system secure communication method based on capability tokens and the Chinese Remainder Theorem. This system is deployed in a vehicle ROS2 communication environment and includes a vehicle computing platform running ROS2, at least one publisher node, one or more subscriber nodes, and a security enhancement module integrated into the ROS2 middleware. The security enhancement module consists of three parts: a negotiation layer, an access control layer, and a transport layer, each containing the following functional components:

[0108] The negotiation layer is used to complete token loading, peer-to-peer authentication, and shared key derivation during the node startup phase. The negotiation layer includes a loader, a key negotiator, a token manager, and a cache module. The loader is deployed on the subscriber node side and loads the capability token and private modulus parameters from local secure storage when the node starts. The token structure and tag are locally verified; key negotiators are deployed on both the subscriber and publisher sides, with the subscriber-side key negotiator responsible for constructing the token extension TE and generating random numbers. A three-way handshake is initiated, with the publishing key exchanger responsible for verifying the token extension and generating a random number. and together with the subscribers based on The shared key is obtained by performing KDF operations. The token manager, deployed on the publisher side, records the token status, permission information, and lifecycle of all online subscribers, and maintains a revocation list to provide a basis for subsequent group key updates. The caching module, deployed on the subscriber side, caches the tokens and private moduloes obtained in the most recently successfully negotiated transaction. And negotiate an intermediate value so that nodes can recover quickly after a brief offline event without having to re-execute the full handshake process.

[0109] The access control layer is used to securely transmit and verify capability tokens after a secure channel is established. The access control layer includes a token encryptor and a token verifier: the token encryptor is deployed on the subscriber node side and is activated after the handshake is completed and a shared key is obtained. After that, use Capability Tokens and Private Modulus Perform symmetric encryption to generate encrypted data. and And send it to the publisher; the token validator is deployed on the publisher node side to utilize... Decryption and Recover the Token and The token undergoes structural integrity verification, HMAC tag chain verification, permission coverage relationship check, and validity period check. Only subscribers who pass the verification will be registered as legitimate members and maintained by the token manager and group key updater.

[0110] The transport layer is used to achieve unified negotiation of session keys and encryption and decryption of business messages during the group communication phase. The transport layer includes a group key updater, a message encoder, and a message decoder: The group key updater is deployed on the publisher node side and is used to maintain the modulus set of all legitimate subscribers under the current topic. When a subscriber joins, leaves, or a token is revoked, the intermediate parameters are recalculated based on the Chinese Remainder Theorem. Such that for each i, the following condition is satisfied: This enables group session keys. Synchronous updates; the message encoder is deployed on the publisher side to utilize the latest session keys. Encrypt business messages in ROS2 topics using AES, and... After attaching the necessary version identifier to the message header, the message is broadcast to all subscribers; the message decoder is deployed on the subscriber node side to decode the message based on its locally held version identifier upon receipt. calculate Then use Decrypt and verify the integrity of business messages; only those with valid modulo values ​​are allowed. Only subscribers whose status has not been revoked can successfully restore plaintext data.

[0111] The security enhancement module is realized by extending the rclcpp, sros2 and rmw_fastrtps_cpp components of the ROS2 source code layer: embedding message encoders and decoders in the Publisher and Subscription construction and message processing path of rclcpp, so that the business code can obtain encryption and decryption capabilities without modification; integrating the generation, derivation and verification logic of the capability token in the keystore module of sros2, replacing the original static XML permission configuration; extending the message header format in rmw_fastrtps_cpp to carry the CRT intermediate parameters , so that the subscriber end can obtain the group session key according to and the local key.

[0112] The application can also be realized in the form of an independent function package, for example, ros2_token_auth is used to realize the generation, derivation, storage and encrypted transmission of the capability token, ros2_crt_keyexchange is used to realize the group key negotiation and calculation and distribution based on the Chinese remainder theorem.

[0113] In order to verify the effectiveness and engineering feasibility of the ROS2 vehicle system security communication method based on the capability token and the Chinese remainder theorem proposed in the application, the system is comprehensively performance tested in this embodiment, and a comparative experiment is carried out with the ROS2 native security mechanism (DDS-Security, based on TLS / PKI). The test focuses on four key stages:

[0114] (1) Token authentication and point-to-point channel establishment;

[0115] (2) Group key negotiation;

[0116] (3) Message encryption and publisher side transmission;

[0117] (4) Subscriber message decryption and recovery process.

[0118] Each experiment is repeated 1000 times in the same hardware environment, the mean, median, standard deviation and distribution range of the delay are counted, and the time consumption curve and bar distribution graph (as shown in Figures 9(a)-9(d)) are drawn. As can be seen from Figure 9, the application can be significantly better than the ROS2 native security mechanism in the four stages, especially in the group key negotiation and message encryption stages.

[0119] The privacy protection of the application is as follows:

[0120] The application fully considers the privacy protection requirements of sensitive contents such as sensing data, vehicle behavior information and control instructions in a vehicle-mounted system, and realizes strict isolation and protection of the identities, permissions and session keys of the communication parties through a capability token mechanism, a three-way handshake authentication mechanism and a group key negotiation mechanism based on the Chinese remainder theorem.

[0121] Firstly, the permission frame in the capability token of the application only carries resource identification and operation permission, does not contain any sensitive field that can identify the specific identity of the vehicle, and ensures that it cannot be forged and tampered through a hash tag chain, thereby avoiding privacy information leakage from the source. Secondly, the three-way handshake process between nodes only exchanges random numbers and token expansion body digests, and the handshake content does not contain vehicle behavior data or user attribute information, and all transmissions are based on shared key encryption, thereby ensuring the privacy and security of the authentication stage. In addition, the application uses a group session key to symmetrically encrypt business data, and subscribers can only recover the current session key, but cannot infer the private modulus parameters or historical keys of other nodes, thereby simultaneously having forward security and backward security.

[0122] Through the above mechanisms, the application ensures the safety of ROS2 vehicle-mounted communication while effectively avoiding the risk of leakage of sensitive information in node interaction, key negotiation and message broadcast processes, thereby realizing complete protection of vehicle privacy data.

[0123] 1) Realize fine-grained access control that can be dynamically updated, derived and revoked, overcome the defects of existing ROS2 that rely on static XML permission files, and enable the system to automatically adapt to permission updates in a complex and changing topology within the vehicle. 2) Establish a lightweight and efficient group key negotiation mechanism to replace the original DH multi-handshake mode of ROS2, so that the joining / leaving of new nodes does not bring linear expansion of key negotiation cost. 3) Meet the needs of intelligent connected vehicles for millisecond-level authentication and fast key synchronization, and ensure the real-time performance of high-concurrency sensor data and control signals. 4) Realize the forward security and backward security of group keys, so that the exiting nodes cannot continue to decrypt future messages, and the newly added nodes cannot calculate historical keys. 5) Deeply integrate the ROS2 node model, publish / subscribe mechanism and DDS security requirements to ensure that the system has good downward compatibility and deployability to existing ROS2 projects.

Claims

1. A ROS2 vehicle system security communication method based on capability token and Chinese remainder theorem, characterized in that, Includes the following steps: Step 1: Node startup and token loading; The subscriber node, upon power up, loads the capability token Token and the unique corresponding private modulus parameter from a local trusted storage area ; the subscriber node generates a random number used for the current session after loading is completed , and appends the random number as an additional frame to the Token to form a token extension TE, and the node performs an HMAC operation on the token extension using the pre-shared label key to obtain a label ; Step 2, Point-to-point handshake and secure channel establishment; the subscriber node extends the body of the token extension TE with a random number and sends it to the publisher after being packed, forming the first handshake message; After receiving the first handshake message, the publisher re-computes the HMAC tag frame by frame using the system root token to verify whether the token extension sent by the subscriber is real and valid, and calculates ; Then the publisher generates its own random number and returns the second handshake message to the subscriber; the message contains and ; the subscriber node receives it, verifies , confirms that the publisher is not forged, and calculates and returns it to the publisher. After the publisher verifies the success, both parties are considered to have completed mutual authentication. Subsequently, both parties will as input to obtain the shared key through the key derivation function KDF; Step 3: Encrypted transmission of the token and private parameters; Subscriber uses shared key To the capability token Token and private modulus parameter Respectively encrypted, get the encryption result And And send it to the publisher; the publisher uses After decryption, strict legality verification is performed on Token, and after verification, the modulus parameter corresponding to the subscriber Registered to the group key update module; Step 4, group key agreement; the publisher maintains a set containing all the moduli of legitimate subscribers when there are multiple subscribers under a topic ; The publisher generates a unique group session key for the current session use and as a uniform remainder of all congruence equations and based on the Chinese remainder theorem to construct the equation system to calculate the group synchronization parameters : Step 5, Message Encryption and Broadcast; Publisher gets group session key After that, the service message msg is encrypted using symmetric cipher algorithm AES-CTR mode to get ciphertext message ciphertext, and the publisher broadcasts ciphertext message ciphertext and the message header to all subscribers. Write message header, broadcast ciphertext and message header to all subscribers. Step 6, message decryption and recovery; the subscriber node receiving the message decrypts the message content using the key obtained from the message header and the modulus parameter held by itself , and obtains and performs symmetric decryption using the key to recover the service message content.

2. The ROS2 vehicular system secure communication method based on capability tokens and the Chinese Remainder Theorem as described in claim 1, characterized in that, The step 1 capability token Token is a structure composed of multiple permission frames, each frame containing a resource identifier, an allowed operation permission field, and a tag field obtained by performing an HMAC operation on the frame content, thereby ensuring the non-forgery and non-tampering of the token. The tag is calculated as follows: ; In the above formula, Indicates resource identifier, Indicates the permission type. This is the system's internal key.

3. The ROS2 vehicular system secure communication method based on capability tokens and the Chinese Remainder Theorem as described in claim 1, characterized in that, Step 2, the point-to-point handshake, includes three strictly defined handshake messages. The first message is... It is sent from subscribers to publishers; After verifying the validity of the token extension based on the message, the publisher returns a second message. After receiving the message, the subscriber verifies the publisher's identity again and receives a third message. Complete two-way authentication.

4. The ROS2 vehicular system secure communication method based on capability tokens and the Chinese Remainder Theorem as described in claim 1, characterized in that, Step 3, the verification of the capability token by the publisher, includes the following four categories:

1. Verify the legality and integrity of the token frame structure; 2. Verify that the HMAC of each frame is recalculated using the system key and compare the tags to see if they match; 3. Verify whether the permission fields cover the current topic; 4. Verify whether the time interval specified in the token includes the current system time. If any of these conditions are not met, the publisher will refuse the subscriber's joining.

5. The ROS2 vehicular system secure communication method based on capability tokens and the Chinese Remainder Theorem as described in claim 1, characterized in that, In step 4, the publisher generates a unique group session key. Based on the Chinese Remainder Theorem, a set of equations was constructed to calculate the group synchronization parameters. The detailed method is as follows: First construct the overall module : ; Calculate the product corresponding to each modulus : ; And calculate: ; All operations are performed within the large integer domain; In order to be able to in all The unique solution that simultaneously satisfies the congruence relation; When the system detects a new subscriber joining or an old subscriber leaving, the publisher reconstructs the modulus set and recalculates. ; in for In the model Multiplicative inverse in the sense of the multiplicative inverse; As a group synchronization parameter, it does not include Plaintext information, but guarantees that all legitimate subscribers can access it. and oneself Restore the same .

6. The ROS2 vehicular system secure communication method based on capability tokens and the Chinese Remainder Theorem as described in claim 1, characterized in that, Step 6 encrypts the business message using AES-CTR mode to ensure that the ciphertext does not reveal structural information. The encryption formula is as follows: ; Meanwhile, HMAC-SHA256 is used to calculate the integrity label for ciphertext.

7. A system for implementing the ROS2 vehicular system secure communication method based on capability tokens and the Chinese Remainder Theorem as described in any one of claims 1 to 6, characterized in that, Includes a loader, key negotiator, token encryptor / verifier, token manager, group key updater, and message encoder / decoder; The loader is used to load the capability token and private parameters when the subscriber node starts. ; The key exchanger is used to perform point-to-point handshakes, verify HMACs, and derive shared keys. ; Token encryptor / verifier subscriber side is used to encrypt tokens and The publisher uses this information for decryption and permission verification. The token manager runs on the issuer and is responsible for token validity checks, lifecycle management, and revocation. Group key updater is used for... The parameters of the set are calculated using the Chinese Remainder Theorem. This enables group session key updates. Message encoder / decoder, used by publishers Encrypt business messages and attach Subscribers through and recover And decrypt the message.