Communication method, communication apparatus and terminal

By negotiating the determination of the key derivation function (KDF) in a wireless short-range communication system and encrypting the transmission network key, the problem of how to ensure communication security while improving network security performance is solved, and efficient communication security and network inclusion are achieved.

WO2025059942A1PCT designated stage expired Publication Date: 2025-03-27HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/120189
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-09-20
Publication Date
2025-03-27

AI Technical Summary

Technical Problem

In wireless short-range communication systems, how to ensure communication security in the process of providing network keys to network entry nodes, especially when network security performance is improved, key transmission needs to be securely protected.

Method used

The key derived function (KDF) is determined through negotiation with the first node and the second node, and the information is verified through KDF to ensure the integrity and security of the information. Then, the first node uses an encryption method to send the network key of the first network to ensure the security of the key during transmission.

Benefits of technology

Improve communication security and ensure the security of network keys during transmission. It is suitable for nodes with different security capabilities to join the network, making the network more inclusive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023120189_27032025_PF_FP_ABST
    Figure CN2023120189_27032025_PF_FP_ABST
Patent Text Reader

Abstract

A communication method, a communication apparatus, and a terminal, which are applied to the technical field of communications. In the embodiments of the present application, a first node can send to a second node encrypted security protection parameters (such as a key) of a first network, so that the second node can securely acquire the security protection parameters of the first network, thereby improving the availability of the network. Furthermore, before sending the encrypted network key of the first network, the first node also needs to verify some transmitted information, that is, to verify whether the information transmitted by the two nodes has been tampered with, so as to ensure the information transmitted by the two nodes is accurate and has not been attacked. An algorithm for verifying the transmitted information can be negotiated by the first node and the second node, so as to adapt to a situation in which various nodes of different security capabilities join the network, such that the network can to be applied to environments in which various types of devices are provided, improving the inclusiveness of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Communication method, communication device and terminal Technical Field

[0001] The present application relates to the field of communication technology, and in particular to the field of short-range communication technology, such as communication in scenarios such as smart cars, smart homes, smart terminals, and smart manufacturing, and specifically to a communication method, a communication device, and a terminal. Background Art

[0002] With the continuous development of communication technology, intelligent application scenarios such as smart homes, smart cockpits, smart driving, smart manufacturing, and smart transportation have emerged. In the mobile Internet era, communication tools are more convenient to use than traditional computers, especially desktop workstations and servers.

[0003] For the sake of convenience, wireless short-range communication systems have roaming requirements. Many scenarios require the use of multi-hop networking, such as wireless BMS networks, smart home networks, smart manufacturing low-power networks, etc. Typical network topology types include star, tree, mesh networks, etc. When a node needs to join a new network, the nodes already in the network (referred to as in-network nodes) can send network information to the nodes that need to join the network (referred to as joining nodes). However, with the improvement of network security performance, the information transmitted in the network needs to be securely protected, and the parameters used for security protection (such as keys) also need to be provided to the newly joined nodes, so that the newly joined nodes can obtain the securely protected information transmitted in the network.

[0004] For networks that include wireless communications, keys cannot typically be transmitted directly via wireless signals. Therefore, how to ensure communication security when providing network keys to incoming nodes is a hot topic currently being studied by those skilled in the art.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a communication method, a communication device, and a terminal, which can improve communication security and enhance network availability in the process of providing network keys to network-entering nodes.

[0007] In a first aspect, an embodiment of the present application provides a communication method, the method comprising:

[0008] A first node sends a topology configuration message to a second node, the topology configuration message including information about the first network. The first node and the second node negotiate and determine a first key derivation function (KDF), where the first KDF is a KDF supported by the second node. The first node verifies the first information with the second node using the first KDF and, if the verification of the first information is successful, encrypts and sends the network key of the first network to the second node.

[0009] In some implementations, the network key of the first network is used to secure messages transmitted within the first network. For example, the network key of the first network is used to secure network-layer messages transmitted between nodes within the network, including encryption, integrity protection, and authenticated encryption. Alternatively, the network key of the first network is used to derive a session key, which is then used to secure the session.

[0010] Optionally, the first network includes the first node. Alternatively, the first node may obtain information about the first network. Optionally, the method may be implemented by a hardware module or a software module of the first node. The information about the first network may include one or more of an identifier of a security algorithm of the first network, an identifier (ID) of the first network, a topology type of the first network, a network priority of the first network, or an address allocation method of the first network, wherein the security algorithm may include one or more of an encryption algorithm, an integrity protection algorithm, an authenticated encryption algorithm, and the like.

[0011] In this embodiment of the present application, when a second node joins a first network, the first node already in the first network can send it a topology configuration message. The topology configuration message carries information about the first network, primarily including some network attributes. However, the first node does not directly carry some secret information of the first network, such as the network key, in the topology configuration message. Instead, the first node needs to encrypt and send it to the second node.

[0012] Furthermore, before encrypting and sending the network key of the first network, the first node and the second node need to perform information verification (taking verification of the first information as an example), that is, verifying whether the first information shared between the first node and the second node has been tampered with. The first information may, for example, include information transmitted between the first node and the second node, such as information contained in a topology configuration message and / or one or more of the information mentioned below. Furthermore, the first information may also include parameters and keys predetermined between the first node and the second node.

[0013] Specifically, when verifying information, each node needs to first generate a verification value and send it to the other party for verification. The generation of the verification value depends on the security algorithm. Due to the variety of nodes in the network, the security capabilities of the nodes joining the network may be different. However, in the present application, the first node and the second node can negotiate to obtain a first KDF, and verify the first information using the first KDF. This can adapt to the situation where nodes with multiple security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the network's inclusiveness.

[0014] In the present application, messages sent and received by the first node can be transmitted via wireless signals. When the first node and the second node are connected, the connection between the first node and the second node can be a wireless connection. Because wireless connections are vulnerable to attacks, the solution provided by the embodiments of the present application can significantly improve the security of communications in wireless transmission.

[0015] In one possible implementation of the first aspect, the method further includes: sending an ID of a network key of the first network to the second node. Optionally, the network key of the first network may be a number, a string, etc. Alternatively, the ID of the network key of the first network may be derived based on the network key of the first network.

[0016] In some solutions, the ID of the network key of the first network and the network key of the first network may be carried in the same message.

[0017] In a possible implementation of the first aspect, the information transmitted by the first node and the second node includes information included in a topology configuration message. That is, the first information includes the information included in the topology configuration message.

[0018] Optionally, the topology configuration message may include multiple pieces of information, in which case the first information may include part of the information in the topology configuration message. Alternatively, the first information may include all the information in the topology configuration message, or the entire topology configuration message.

[0019] In one possible implementation of the first aspect, verifying the first information with the second node using a first KDF includes: receiving a first verification value from the second node, and verifying the first verification value based on at least the first KDF and information included in a topology configuration message. The first verification value is associated with at least the first KDF and information included in the topology configuration message. Furthermore, successfully verifying the first information includes successfully verifying the first verification value. Optionally, the first verification value may be included in, or carried in, a third message.

[0020] In the above implementation, the second node can generate a verification value based at least on the first KDF and information contained in the topology configuration message, and the first node can verify the verification value based on the first KDF and information contained in the same topology configuration message. If the verification is successful, it indicates that the information contained in the topology configuration message received by the second node is consistent with the information sent to it by the first node, i.e., it has not been tampered with. This can confirm that the information received by the second node is accurate and that the communication environment between the two nodes is relatively secure, thereby improving communication security.

[0021] In a possible implementation of the first aspect, the first KDF may be the KDF with the highest priority among the KDFs supported by the second node. Alternatively, the first KDF may be a KDF supported by both the first node and the second node. In this case, the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.

[0022] In another possible implementation of the first aspect, the first node may select a first KDF from the KDFs supported by both the second node and the first node and indicate the selected first KDF to the second node. The first node is responsible for the task of selecting the KDF, which can concentrate the amount of calculation on the first node side. This is suitable for scenarios where the first node has stronger computing power and can increase the speed of network access. For example, in some wireless systems, the management node will create a network and connect other management nodes to form a network, and the terminal node joins the network created by a certain management node by accessing the management node. Therefore, compared with the network access node, the network node usually has stronger communication capabilities or computing capabilities. Therefore, the network node is responsible for the calculation work during selection, which can increase the speed of selecting the KDF and shorten the delay of the network access process.

[0023] In addition, when selecting KDF based on priority, the first node selects the KDF, and the nodes in the network can select the KDF based on consistent priorities, which is conducive to improving the uniformity of KDF standards selected by nodes in the network.

[0024] In another possible implementation of the first aspect, determining the first KDF through negotiation with the second node includes: receiving KDF capabilities of the second node from the second node, and sending indication information of the first KDF to the second node, wherein the KDF capabilities of the second node are used to indicate KDFs supported by the second node.

[0025] In some scenarios, the KDF capability of the second node and the indication information of the first KDF are also considered as the first information. In this way, the first node and the second node can verify whether this information has been tampered with, thereby improving security.

[0026] In another possible implementation of the first aspect, negotiating with the second node to determine the first KDF includes: receiving a first message from the second node and sending a second message to the second node. The first message includes the KDF capabilities of the second node, and the second message includes at least information indicating the first KDF. It should be understood that the first message and the second message may also include other information.

[0027] In another possible implementation of the first aspect, the information transmitted between the first node and the second node includes one or more items of information included in the second message, information included in the topology configuration message, and the like. Similarly, when the second message includes multiple items of information, the information included in the second message may be part of the information in the second message, or may be all of the information (or the entire second message).

[0028] In another possible implementation of the first aspect, verifying the first information with the second node through the first KDF includes: receiving a third message from the second node, the third message including a first verification value, and verifying the first verification value based on the first KDF, the first key, information included in the second message, and information included in the topology configuration message. The first verification value is associated with the first KDF, the first key, information included in the second message, and information included in the topology configuration message, and the first key may be a key obtained through negotiation between the first node and the second node. Furthermore, successfully verifying the first information includes successfully verifying the first verification value.

[0029] In this implementation, the first information can be understood as the information included in the second message and the information included in the topology configuration message. Alternatively, the first information can be understood as the first key, the information included in the second message, and the information included in the topology configuration message.

[0030] In another possible implementation of the first aspect, verifying the first information with the second node through the first KDF includes: receiving a third message from the second node, the third message including a first verification value, and verifying the first verification value based on the first KDF, the first parameter, the information included in the second message, and the information included in the topology configuration message. The first verification value is associated with the first KDF, the first parameter, the information included in the second message, and the information included in the topology configuration message, and the value of the first parameter is predefined. For example, the first parameter is 128 bits of data, and further, the 128 bits are all 0s. Furthermore, successfully verifying the first information includes successfully verifying the first verification value.

[0031] In this implementation, the first information is the information included in the second message and the information included in the topology configuration message. Alternatively, the first information is the first parameter, the information included in the second message and the information included in the topology configuration message.

[0032] In another possible implementation of the first aspect, the method further includes: sending the KDF capabilities of the first node to the second node, where the KDF capabilities of the first node indicate a KDF supported by the first node; and receiving indication information of the first KDF from the second node. In some scenarios, the KDF capabilities of the first node, the indication information of the first KDF, etc. also constitute the first information.

[0033] In another possible implementation of the first aspect, the process of verifying the first information with the second node through the first KDF is protected to further improve security.

[0034] Taking the verification of the first information by verifying a first verification value as an example, in one example, the first verification value is encrypted during transmission, for example, a message carrying the first verification value is encrypted at the access layer. In another example, the first verification value can be encrypted with a key to form ciphertext, and the second node can send the ciphertext of the first verification value. In another example, the parameters involved in generating the first verification value include a key. Furthermore, the key involved in generating the first verification value can be negotiated between the first node and the second node, or a shared key preconfigured between the first node and the second node.

[0035] In another possible implementation of the first aspect, the method further includes: sending a first random number to the second node. The random number may belong to the first information, so as to determine whether a message carrying the random number has been tampered with.

[0036] Optionally, the first random number may be included in the second message, that is, the aforementioned second message includes the first random number.

[0037] In another possible implementation of the first aspect, the method also includes: generating a second verification value based on the first KDF, information contained in the third message, information contained in the first message, information contained in the topology configuration message and the first key; and sending the second verification value to the second node.

[0038] Furthermore, the method further includes receiving a second random number from the second node. Optionally, the second random number is included in the third message.

[0039] Optionally, the second verification value is carried in a fifth message sent by the first node to the second node. Furthermore, the process of receiving the third message and sending the fifth message may be protected by security.

[0040] In another possible implementation of the first aspect, the method further includes:

[0041] Based on the first key agreement algorithm, the first key is determined by negotiation with the second node. The first key (DH key) or the key derived from the first key is used to securely protect the information transmitted between the first node and the second node. In other words, the first key can be directly used to encrypt information during the communication process, or optionally, the first key can be used to derive other keys, and the derived keys can be used to encrypt information during the communication process. In this embodiment, the first key agreement algorithm belongs to the algorithm supported by the second node, and can further be the key agreement algorithm with the highest priority among the key agreement algorithms supported by the second node. This can adapt to the scenario where nodes with different key agreement capabilities join the first network.

[0042] Optionally, the first key agreement algorithm also belongs to the key agreement algorithms supported by the first node. In other words, the first key agreement algorithm is a key agreement algorithm supported by both the first node and the second node and has the highest priority.

[0043] An exemplary process for negotiating a first key is as follows: a first node and a second node determine their respective private keys. The first node determines a first public key based on the first node's private key and a public key determined using a first key agreement algorithm, and provides the first public key to the second node. The second node determines a second public key based on the second node's private key and a public key determined using the first key agreement algorithm, and provides the second public key to the first node. The first node determines the first key based on the first node's private key and the second public key, while the second node determines the first key based on the second node's private key and the first public key. If the exchanged public keys have not been tampered with, the first keys determined by the two nodes are consistent.

[0044] Optionally, the first public key may be carried in the second message, and the second public key may be carried in the first message or the third message.

[0045] In another possible implementation of the first aspect, the first key agreement algorithm may be determined through negotiation between the first node and the second node. That is, the first node and the second node may negotiate and determine the first key agreement algorithm to facilitate subsequent key agreement. Alternatively, the first key agreement algorithm may be configured by the first node. For example, an identifier of the first key agreement algorithm may be carried in a key configuration message, e.g., the first key agreement algorithm may be the key agreement algorithm used by the first network.

[0046] As an implementation of determining the key agreement algorithm, the aforementioned communication method also includes: sending the key agreement algorithm capability of the first node to the second node, the key agreement algorithm capability of the first node is used to indicate the key agreement algorithm supported by the first node; and receiving indication information of the first key agreement algorithm sent from the second node.

[0047] Optionally, the key agreement algorithm capability of the first node is included in the topology configuration message, and the indication information of the first key agreement algorithm is included in the first message.

[0048] As another implementation of determining the key agreement algorithm, the aforementioned communication method also includes: receiving the key agreement algorithm capability of the second node from the second node, the key agreement algorithm capability of the second node including the key agreement algorithms supported by the second node; and sending indication information of the first key agreement algorithm to the second node.

[0049] Optionally, the key agreement algorithm capability of the second node is included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

[0050] In another possible implementation of the first aspect, encrypting and sending the network key of the first network to the second node includes:

[0051] deriving an encryption key based on the first key;

[0052] Encrypting the key of the first network layer using the encryption key to obtain a ciphertext of the network key of the first network;

[0053] The ciphertext of the network key of the first network is sent to the second node.

[0054] In this implementation, the first node and the second node obtain a key through negotiation, and secure transmission of the network key of the first network can be achieved based on the key.

[0055] Optionally, this embodiment may be performed when encryption is not enabled at the access layer between the first node and the second node. For example, the first node and the second node establish an access layer connection. When encryption is not enabled at the access layer connection, the first node and the second node negotiate based on a first key agreement algorithm to obtain a first key for encrypting the network key. Optionally, the key agreement algorithm is also determined before determining the first key.

[0056] In another possible implementation of the first aspect, before encrypting and sending the network key of the first network to the second node, the method further includes: establishing an access-layer connection with the second node. Furthermore, when encryption is not enabled for the access-layer connection between the first node and the second node, the first node and the second node implement the method of the first aspect. For example, when the access-layer connection is not enabled, the first node and the second node negotiate to determine a first key derivation function (KDF).

[0057] Optionally, when encryption of the access layer connection is enabled, the first node may not need to negotiate a KDF or verify the first information, and thus directly send the network key of the first network through the encrypted access layer.

[0058] In another possible implementation of the first aspect, encryption of the access layer connection between the first node and the second node is turned on, and the method further includes: sending a fourth message to the second node, the fourth message including a network key of the first network, and the fourth message is encrypted at the access layer.

[0059] In this embodiment, the second node establishes an access-layer connection with the first node before joining the first network. Because the access layer encrypts messages, the first node can securely transmit the network key of the first network using the access layer's encryption mechanism. Exemplarily, the first node can encrypt the fourth message within the access layer established by the first node.

[0060] Optionally, the fourth message further includes the ID of the network key of the first network.

[0061] In another possible implementation of the first aspect, the information about the security algorithm of the first network may not be carried in the topology configuration message. For example, the information about the security algorithm of the first network may also be carried in the second message.

[0062] In another possible implementation of the first aspect, the security algorithm of the first network is pre-configured in the first node, for example, by a management node or a control node.

[0063] In another possible implementation of the first aspect, the security algorithm of the first network is obtained through negotiation between the first node and the second node. Exemplarily, the aforementioned communication method further includes: receiving security capability information of the second node from the second node, the security capability information of the second node indicating the security algorithm supported by the second node; and determining the security algorithm of the first network, the security algorithm of the first network belonging to the security algorithms supported by the second node and the first node. Furthermore, the first node can provide the identifier of the determined security algorithm of the first network to the second node. This example is explained using the case where the first node selects the first key agreement algorithm as an example. In some scenarios, the second node may also select the security algorithm of the first network based on the security capability information of the first node.

[0064] Furthermore, the above embodiment can be implemented when a new node is first added to the first network. For example, when the first node is the only node in the first network before the second node joins the first network, the first node and the second node negotiate the session security key for the first network. For another example, when the first node is a management node, the management node can create the first network (in which case the first node is the only node in the first network). In this case, when the first second node joins the first network, the first node and the second node negotiate the session security key for the first network.

[0065] In another possible implementation of the first aspect, the method is applied when the second node supports the security algorithm of the first network. Further, the first node or the second node may determine whether the second node supports the security algorithm of the first network based on an identifier of the security algorithm used in the first network and the security capability of the second node.

[0066] If the second node does not support the security algorithm of the first network, the second node may choose to terminate the process of joining the first network or not join the first network. Furthermore, the failure of joining the first network may be indicated to the second node, for example, by sending a code indicating the reason for the failure. If the second node supports the security algorithm of the first network, the second node continues the process of joining the first network.

[0067] It should be noted that the second node may verify support for the first network's security algorithm at any stage. For example, after receiving the identifier of the first network's security algorithm, the second node may verify support for the first network's security algorithm. If the second node determines that it does not support the first network's security algorithm, it may terminate the current process of joining the first network. For example, it may transmit (e.g., send and / or receive) messages related to joining the first network with the first node.

[0068] For a first node, the first node may receive security capability information from a second node, where the security capability information of the second node indicates the security algorithms supported by the second node. If the second node does not support the security algorithms of the first network, a second message may be sent to the second node, indicating that joining the first network failed. Furthermore, the process of joining the second node to the first network may be terminated, for example, by not transmitting (e.g., sending and / or receiving) messages related to joining the first network to the second node.

[0069] Conversely, if the second node supports the security algorithm of the first network, the first node continues to perform the process of adding the second node to the first network. For example, if the second node supports the security algorithm of the first network, the step of encrypting and sending the network key of the first network to the second node is performed. In other words, the step of encrypting and sending the network key of the first network to the second node is performed only if the second node supports the security algorithm of the first network.

[0070] In a second aspect, an embodiment of the present application provides a communication method, including:

[0071] The second node receives a topology configuration message from the first node, which includes information about the first network. The second node negotiates with the first node to determine a first key derivation function (KDF). Based on the first KDF and the first information, the second node generates a first verification value and sends the first verification value to the first node. The first KDF is a KDF supported by the second node, and the first information includes information previously transmitted between the first and second nodes. The second node receives the encrypted network key of the first network sent by the first node. The network key of the first network is used to provide network layer security protection between nodes in the first network.

[0072] Optionally, the method may be implemented by a hardware module or a software module of the second node.

[0073] In a possible implementation of the second aspect, the information transmitted by the first node and the second node includes information included in a topology configuration message.

[0074] In a possible implementation of the second aspect, the first KDF may be the KDF with the highest priority among the KDFs supported by the second node. Alternatively, the first KDF may be a KDF supported by both the first node and the second node. In this case, the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.

[0075] In a possible implementation of the second aspect, determining the first KDF through negotiation with the second node includes:

[0076] The first node sends the second node's KDF capabilities to the first node and receives the first KDF indication from the first node. In some scenarios, the second node's KDF capabilities and the first KDF indication also constitute the first information. This allows the first and second nodes to verify whether this information has been tampered with, improving security.

[0077] In another possible implementation of the second aspect, the second node may select a first KDF from among KDFs supported by both the second node and the first node, and indicate the selected first KDF to the second node. Exemplarily, the second node receives the first node's KDF capabilities from the first node and sends the first KDF indication information to the first node. The first node's KDF capabilities indicate the KDFs supported by the first node.

[0078] The KDF capability of the first node may be carried in the topology configuration message, and the indication information of the first KDF may be carried in the first message or the third message. Alternatively, the KDF capability of the first node may be carried in the second message, and the indication information of the first KDF may be carried in the third message.

[0079] In some scenarios, the KDF capability of the first node can be sent via broadcast or multicast before establishing a connection with the networked device, so that the second node can obtain the KDF capability of the first node when scanning the first node (that is, after receiving the broadcast or multicast message), and thus carry the specified first KDF when initiating a connection to the first node, reducing signaling overhead.

[0080] In some scenarios, the first node provides its KDF capabilities to the second node. If the second node does not support any of the KDFs supported by the first node, the subsequent "joining the first network" process can be skipped, thereby saving signaling overhead and computational consumption. Furthermore, when the second node terminates the "joining the first network" process, the first node generally does not proactively indicate a join failure (or termination) to the first node.

[0081] In yet another possible implementation of the second aspect, the information transmitted by the first node and the second node includes information included in the second message and / or information included in the topology configuration message.

[0082] In another possible implementation of the second aspect, a first verification value is generated based at least on the first KDF, information contained in the second message, and information contained in the topology configuration message, including: generating the first verification value using the first key based on the information contained in the second message and the information contained in the topology configuration message, and sending a third message to the first node, wherein the third message contains the first verification value.

[0083] In another possible implementation of the second aspect, generating a first verification value based on the first KDF and the first information includes:

[0084] Generate a first verification value according to the first KDF, the first key, information included in the second message, and information included in the topology configuration message, where the first key is obtained through negotiation between the first node and the second node;

[0085] Sending the first verification value to the first node includes: sending a third message to the first node, where the third message includes the first verification value.

[0086] In another possible implementation of the second aspect, generating a first verification value based on the first KDF and the first information includes:

[0087] generating a first verification value according to the first KDF, the first parameter, information included in the second message, and information included in the topology configuration message, wherein the first key is obtained through negotiation between the first node and the second node, and the value of the first parameter is predefined;

[0088] Sending the first verification value to the first node includes: sending a third message to the first node, where the third message includes the first verification value.

[0089] The value of the first parameter is predefined, for example, 128 bits of all 0s.

[0090] In another possible implementation of the second aspect, the method further includes: receiving a first random number from the second node, where the first random number is used to participate in generating a verification value, or to derive a key, etc.

[0091] Optionally, the second random number may be included in the second message. Further, the first information includes the second random number in the second message, that is, the first random number may participate in generating the first verification value.

[0092] In another possible implementation of the second aspect, the method further includes:

[0093] Receive a second verification value from the first node, wherein the second verification value is associated with the first KDF and at least one of the following information: information contained in the third message, information contained in the first message, information contained in the topology configuration message, and the first key; and verify the first verification value based on the first KDF and the same information.

[0094] For example, the second verification value is associated with the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and the first key. The second node verifies the second verification value based on the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and the first key.

[0095] Optionally, the second verification value may be carried in a message and sent, for example, carried in a fifth message and sent.

[0096] In another possible implementation of the second aspect, the method further includes:

[0097] A first key is determined according to a first key agreement algorithm. The first key or a key derived from the first key is used to securely protect information transmitted between the first node and the second node.

[0098] In another possible implementation of the second aspect, the method further includes:

[0099] A first key agreement algorithm is determined through negotiation with the first node, where the first key agreement algorithm is a key agreement algorithm supported by the second node.

[0100] In yet another possible implementation of the second aspect, determining the first key agreement algorithm through negotiation with the first node includes:

[0101] receiving a key agreement algorithm capability of the first node from the first node, where the key agreement algorithm capability of the first node includes a key agreement algorithm supported by the first node;

[0102] Indication information of a first key agreement algorithm is sent to the first node, where the first key agreement algorithm is a key agreement algorithm supported by the second node.

[0103] Optionally, the key agreement algorithm capability of the first node is included in the topology configuration message, and the indication information of the first key agreement algorithm is included in the first message.

[0104] In yet another possible implementation of the second aspect, determining the first key agreement algorithm through negotiation with the first node includes:

[0105] Sending the key agreement algorithm capability of the second node to the first node, where the key agreement algorithm capability of the second node includes the key agreement algorithms supported by the second node;

[0106] Indication information of a first key agreement algorithm is received from the first node, where the first key agreement algorithm is a key agreement algorithm supported by the second node.

[0107] Optionally, the key agreement algorithm capability of the second node is included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

[0108] In another possible implementation of the second aspect, receiving the network key of the first network sent encrypted by the first node includes: receiving a ciphertext of the network key of the first network;

[0109] The method also includes:

[0110] deriving an encryption key based on the first key;

[0111] The ciphertext of the network key of the first network layer is decrypted using the encryption key to obtain the network key of the first network.

[0112] In another possible implementation of the second aspect, the method further includes:

[0113] Establishing an access layer connection with the first node, with encryption enabled on the access layer;

[0114] Receiving the network key of the first network encrypted and sent by the first node includes:

[0115] receiving a fourth message, where the fourth message includes a network key of the first network, and the fourth message is encrypted at the access layer;

[0116] The fourth message is decrypted at the access layer to obtain the network key of the first network.

[0117] Optionally, both the first node and the second node include an access layer, the fourth message may be encrypted at the access layer of the first node, and the second node may decrypt the fourth message at its own access layer to obtain the network key of the first network.

[0118] In another possible implementation of the second aspect, the method further includes:

[0119] The security capability information of the second node is sent to the first node, where the security capability information of the second node indicates a security algorithm supported by the second node.

[0120] In yet another possible implementation of the second aspect, the network key of the first network is sent if the second node supports a security algorithm of the first network;

[0121] The method further includes receiving a second message from the first node, the second message indicating that the second node has failed to join the first network.

[0122] In a third aspect, an embodiment of the present application provides a communication device, comprising a communication unit and a processing unit. The communication device is configured to implement any method of the first aspect; or to implement any method of the second aspect.

[0123] In a fourth aspect, an embodiment of the present application provides a communication device, comprising a processor. When the processor calls a computer program or instruction in a memory, the method of any one of the first aspect or the method of any one of the second aspect is implemented.

[0124] In a fifth aspect, an embodiment of the present application provides a communication device, including a logic circuit and an interface, wherein the logic circuit and the interface are coupled;

[0125] The interface is used to input data to be processed, and the logic circuit processes the data to be processed according to the method of any one of the first aspect or any one of the second aspect to obtain processed data. The interface is also used to output the processed data.

[0126] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store instructions or computer programs; when the instructions or computer programs are executed, any method of the first aspect is implemented, or any method of the second aspect is implemented.

[0127] In the seventh aspect, an embodiment of the present application provides a computer program product, which, when the instruction or computer program is executed, implements any method of the first aspect, or implements any method of the second aspect.

[0128] In an eighth aspect, an embodiment of the present application provides a terminal comprising the communication device of any one of aspects 3 to 5. Furthermore, the terminal may be an intelligent terminal or transportation tool such as a vehicle, a drone, or a robot.

[0129] In a ninth aspect, an embodiment of the present application provides a communication system, comprising a first node and a second node, wherein the first node is configured to implement any method of the first aspect, and the second node is configured to implement any method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0130] The following is a brief introduction to the drawings required for describing the embodiments.

[0131] FIG1 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application;

[0132] FIG2 is a flow chart of a communication method provided in an embodiment of the present application;

[0133] FIG3 is a schematic diagram of an association process without a security context;

[0134] FIG4 is a schematic diagram of an association process with a security context;

[0135] FIG5 is a flow chart of another communication method provided in an embodiment of the present application;

[0136] FIG6 is a flow chart of another communication method provided in an embodiment of the present application;

[0137] FIG7 is a flow chart of another communication method provided in an embodiment of the present application;

[0138] FIG8 is a flow chart of another communication method provided in an embodiment of the present application;

[0139] FIG9 is a flow chart of another communication method provided in an embodiment of the present application;

[0140] FIG10 is a flow chart of another communication method provided in an embodiment of the present application;

[0141] FIG11 is a flow chart of another communication method provided in an embodiment of the present application;

[0142] FIG12 is a flow chart of another communication method provided in an embodiment of the present application;

[0143] FIG13 is a schematic structural diagram of another communication device provided in an embodiment of the present application;

[0144] FIG14 is a schematic structural diagram of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0145] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0146] The following is an introduction to nodes. A node is a device with communication capabilities, including but not limited to one or more of user equipment, network equipment, and industrial equipment. Among them, user devices include handheld terminals, wearable terminals, vehicles, in-vehicle devices, sensing devices, smart home devices, or leisure and entertainment devices, etc. Handheld terminals include but are not limited to mobile phones, tablets, or laptops, etc. Wearable devices include but are not limited to headphones, smart bracelets, smart watches, or smart glasses, etc. Vehicles include but are not limited to vehicles, ships, aircraft, rail transit (such as subways, high-speed railways, etc.), or logistics robots (such as automated guided vehicles (AGVs)), etc. In-vehicle devices include but are not limited to domain controllers (DCs), screens, microphones, speakers, electronic keys, keyless entry, start system controllers, battery management systems (BMSs), battery packs, or battery cells, etc. Sensing devices include but are not limited to cameras, radars, lidars, light sensors, temperature sensors, or humidity sensors, etc. Smart home devices include but are not limited to projectors, smart TVs, smart refrigerators, smart home gateways, or security equipment, etc. Leisure and entertainment equipment such as virtual reality (VR) equipment, mixed reality (MR) equipment, massage chairs, home theaters, game control devices, or 4D theater cabins.

[0147] Network devices include but are not limited to routers, switches, or base stations, etc. Industrial equipment includes industrial robots or robotic arms, etc.

[0148] The nodes in the embodiments of this application can be applied to various scenarios such as smart cars, smart homes, smart terminals, smart manufacturing, or smart exhibition halls. In some application scenarios or certain network types, devices with similar communication capabilities may not be called nodes. However, for the convenience of description, in the embodiments of this application, devices with communication capabilities are collectively referred to as nodes.

[0149] It should be understood that the communication methods, communication devices, communication systems, or nodes of the embodiments of the present application are applicable to a variety of networks, such as wired communication networks, wireless communication networks, or networks that combine wired and wireless communication. For example, wireless communication networks include networks connected by the following communication technologies: SparkLink (or NearLink) 802.11b / g, Bluetooth, Zigbee, radio frequency identification (RFID), ultra-wideband (UWB) technology, or wireless short-range communication systems, or long-range connection technologies including communication technologies based on Long Term Evolution (LTE), fifth-generation mobile networks or fifth-generation wireless systems (5G or 5G technology), global system for mobile communications (GSM), general packet radio service (GPRS), universal mobile telecommunications system (UMTS), and other wireless access type technologies. For example, the wired communication network includes a network connected by the following communication technologies: one or more of fiber optic connection technology, vehicle-mounted wired communication technology, controller area network (CAN), local interconnect network bus (LIN), CAN flexible data rate (CAN FD), or vehicle-mounted Ethernet.

[0150] Please refer to Figure 1, which is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application. The communication system 10 may include a first node 101 and a second node 102.

[0151] The first node 101 and the second node 102 both have communication capabilities, and the communication capabilities here may include wireless communication capabilities, such as connection via short-range wireless communication technology (described below). In addition, the first node 101 and the second node 102 may establish a connection (as shown in FIG1 , where the two are connected by a solid line), and the communication connection here includes a direct connection, a connection through an intermediate node (such as a control node), etc. In the scheme shown in FIG1 , the connection between any two nodes may be wired, wireless, or a combination thereof. It should be understood that since the network model includes multiple layers, the connection here may include a connection between peer entities of some layers in the node, such as an access layer connection.

[0152] The first node 101 belongs to the first network 103. Of course, the first network 103 may also include other nodes in addition to the first node 101. The topology type formed by multiple nodes may belong to a star, tree, or mesh topology type, that is, the topology type of the first network may include one of the following types: star, tree, or mesh, etc. In the first network, a message from one node can be transmitted to another node in the network. In order to ensure security, in some scenarios, as the security performance of the network improves, the information transmitted in the network needs to be securely protected. Taking the example of the security protection parameter including the network key of the first network, the nodes in the first network can be configured with the network key of the first network, and the nodes in the first network can encrypt and decrypt the transmitted messages based on the network key.

[0153] Continuing with the example of a security protection parameter including the network key of a first network, when a new node (e.g., a second node) joins the first network, the network key of the first network needs to be sent to the second node so that the second node can obtain information encrypted by the network key in the first network. For example, the first node can configure the network key of the first network for the second node.

[0154] In an embodiment of the present application, the first node can send the security protection parameters (such as a key, etc.) of the first network to the second node in a secure manner, so that the second node can securely obtain the security protection parameters of the first network and improve the availability of the network. Taking the security protection parameter as a network key as an example, the first node can negotiate with the second node to obtain the first key, encrypt the network key with the first key to form a ciphertext, and transmit the network key in the form of ciphertext. Alternatively, the first node and the second node establish an access layer connection, and when encrypted transmission is enabled for data transmission at the access layer, the message carrying the network key can be sent to the second node after being encrypted at the access layer.

[0155] Furthermore, before encrypting and sending the network key of the first network, the first node also needs to verify the information received by the second node, that is, to verify whether the information received by the second node has been tampered with, thereby ensuring that the information transmitted by the two is accurate and not attacked.

[0156] In some solutions, verifying information requires generating a verification value, which relies on a security algorithm. Due to the diverse nature of nodes in a network, the security capabilities of nodes joining the network may vary. However, this application allows the first and second nodes to negotiate the verification algorithm. This allows for adapting to the situation where nodes with varying security capabilities join the network, allowing the network to be applied to scenarios with a variety of different types of devices, thereby improving network inclusiveness.

[0157] The following is an illustrative introduction to the method provided in the embodiments of the present application.

[0158] Please refer to Figure 2, which is a flow chart of a communication method provided in an embodiment of the present application. Optionally, the method can be implemented based on the communication system shown in Figure 1. The communication method shown in Figure 2 may include one or more steps from step S201 to step S204. It should be understood that for the convenience of description, the description is given in the order of S201 to S204, and it is not intended to limit the execution to the above order. The embodiment of the present application does not limit the order of execution, execution time, number of executions, etc. of the above one or more steps. S201 to step S204 are as follows:

[0159] Step S201: The first node sends a topology configuration message to the second node.

[0160] Accordingly, the second node may receive the topology configuration message from the first node. Optionally, the first network includes the first node. Alternatively, the first node may obtain information about the first network.

[0161] The topology configuration message includes information about the first network. The information about the first network may include one or more of an identifier of the security algorithm of the first network, an identifier (ID) of the first network, a topology type of the first network, a network priority of the first network, or an address allocation method of the first network. The security algorithm may include one or more of an encryption algorithm, an integrity protection algorithm, and an authenticated encryption algorithm. Optionally, the first network includes a first node, or the first node may obtain information about the first network. In some solutions, the information about the security algorithm of the first network may not be carried in the topology configuration message. For example, the information about the security algorithm of the first network may also be carried in the second message, the network key configuration message, etc. described below.

[0162] In some possible implementations, the security algorithm identifier indicates the security algorithm used by the first network, and the identifier includes, but is not limited to, the algorithm name, number, field value, etc. Exemplarily, the security algorithm includes a first encryption algorithm and / or a first integrity protection algorithm. Alternatively, the security algorithm includes a first authenticated encryption algorithm.

[0163] In one possible implementation, the second node may send a message to the first node, the message including a first field, and the value of the first field may be used to indicate the security algorithm of the first network. Table 1 provides an information table of possible security algorithms. Among them, the encryption algorithm may include 4 types, each algorithm corresponding to a 4-bit data segment. Exemplarily, the algorithm names may be exemplarily called ENC0, ENC1, ENC2, and ENC (adaptive design may be performed according to the supported algorithms during the specific implementation process), and the algorithm named "ENC0" corresponds to a value of 0000. For other cases, see Table 1. Taking Table 1 as an example, when the value of the first field is 0000, 0000 can be regarded as the identifier of the security algorithm of the first network. This value can indicate that the security algorithm used by the first network includes the encryption algorithm named "ENC0".

[0164] Similarly, the first field may include multiple fields, such as Field 1 and Field 2. Field 1 is used to indicate the encryption algorithm, and Field 2 is used to indicate the integrity protection algorithm. For example, when the value of Field 1 is 000 and the value of Field 2 is 010, it indicates that the security algorithms of the first network include the encryption algorithm named "ENC0" and the integrity protection algorithm named "INT1".

[0165] Similarly, when the value of the first field is 1000, it indicates that the security algorithm of the first network includes the authentication encryption algorithm with the algorithm name "AUTH1".

[0166] Table 1 Security algorithm information table

[0167] It should be understood that in the information table of algorithms shown in this application, the names of the algorithms, the corresponding values ​​of the algorithms, and the number of algorithms included in each algorithm are only examples.

[0168] Optionally, the identifier of the security algorithm of the first network may be included in the topology configuration message. Of course, the present application is also applicable to the case where the identifier is sent through other messages.

[0169] In some possible implementations, the security algorithm of the first network is pre-configured in the first node, for example, by a management node or a control node.

[0170] In some possible implementations, the first network may be created by a management node. When the first node applying to join the first network joins the first network through the management node, the security algorithm of the first network may be configured by the management node or determined through negotiation between the management node and the first network-joining device. Optionally, the management node may be the first node, and the first node applying to join the first network may be the second node.

[0171] As an implementation example, the security algorithm of the first network is obtained through negotiation between the first node and the second node. Exemplarily, the aforementioned communication method further includes: receiving security capability information of the second node from the second node, the security capability information of the second node indicating the security algorithm supported by the second node; determining the security algorithm of the first network, the security algorithm of the first network belongs to the security algorithm supported by the second node and the first node. Furthermore, the first node can provide the identifier of the determined security algorithm of the first network to the second node. This example is explained by taking the case where the first node selects the first key agreement algorithm as an example. In some scenarios, the second node may also select the security algorithm of the first network based on the security capability information of the first node.

[0172] Furthermore, the aforementioned implementation method of determining the security algorithm of the first network through negotiation between the first node and the second node can be implemented when a new node is first added to the first network. For example, when the first node is the only node in the first network before the second node joins the first network, the first node and the second node negotiate the session security key for the first network. For another example, when the first node is a management node, the management node can create the first network (in which case the first node is the only node in the first network). In this case, when the first second node joins the first network, the first node and the second node negotiate the session security key for the first network.

[0173] In one possible implementation, the method shown in FIG2 can be implemented when the second node supports the security algorithm of the first network. In some embodiments, the first node or the second node can determine whether the second node supports the security algorithm of the first network based on the identifier of the security algorithm used in the first network and the security capabilities of the second node.

[0174] If the second node does not support the security algorithm of the first network, the second node may choose to terminate the process of joining the first network or not join the first network. Furthermore, the second node may indicate to the first node that joining the first network failed, for example, by sending a code indicating the reason for the failure. If the second node supports the security algorithm of the first network, the second node continues the process of joining the first network. It should be noted that the second node may verify whether it supports the security algorithm of the first network at any stage. For example, after receiving the identifier of the security algorithm of the first network, the second node may verify whether it supports the security algorithm of the first network. If the verification result is negative, the current process of joining the first network is terminated. For example, the second node may transmit (e.g., send and / or receive) messages related to joining the first network with the first node. For example, if the topology configuration message includes the identifier of the security algorithm of the first network, the second node may determine whether it supports the security algorithm of the first network after receiving the topology configuration message. If it does, it may continue to execute some or all of the subsequent steps S202-S204. Otherwise, the process may be terminated, i.e., some or all of the steps S202-S204 are not executed.

[0175] For a first node, the first node may receive security capability information from a second node, where the security capability information of the second node indicates the security algorithms supported by the second node. If the second node does not support the security algorithms of the first network, a second message may be sent to the second node, indicating that joining the first network failed. Furthermore, the process of joining the second node to the first network may be terminated, for example, by not transmitting (e.g., sending and / or receiving) messages related to joining the first network to the second node.

[0176] On the other hand, if the second node supports the security algorithm of the first network, the first node continues to execute the process of adding the second node to the first network. For example, if the second node supports the security algorithm of the first network, the subsequent steps are executed, and the subsequent steps include step S204. That is, step S204 is executed if the second node supports the security algorithm of the first network.

[0177] It should be noted that in step S201, the topology configuration message may not be sent by the first node to the second node in a point-to-point manner. In some solutions, the first node may send the topology configuration message via broadcast or multicast. When the second node is within the range that can receive the topology configuration message, the topology configuration message can be considered to be sent to the second node.

[0178] Step S202: The first node and the second node negotiate to determine a first KDF.

[0179] Among them, KDF can derive another piece of information based on one piece of information. In some schemes, KDF can receive a secret key (or other weak key material) as input and output secure key material through a special function. During derivation, KDF usually adds a parameter as an encryption factor, which is called a salt. In some schemes, KDF can be implemented through hash functions, such as SHA1, SHA256, SHA512, etc. In other schemes, KDF can include one or more of the following algorithms: crypt (or its variant function), password-based key derivation function (PBKDF), Bcrypt (Blowfish crypt), Scrypt, Argon2 algorithm, etc.

[0180] Please refer to Table 2, which is an information diagram of a KDF provided in an embodiment of the present application. Among them, KDF can include 4 types, which are exemplarily called KDF0, KDF1, KDF2 and KDF3, and their corresponding values ​​can be shown in Table 2.

[0181] Table 2 KDF information table

[0182] Specifically, the first KDF is a KDF supported by the second node. The following examples illustrate several ways to determine the first KDF:

[0183] In method 1, the first node may select a first KDF from among the KDFs supported by the second node and indicate its selected first KDF to the second node. For example, the first node receives the second node's KDF capabilities from the second node, where the second node's KDF capabilities indicate the KDFs supported by the second node. After determining the first KDF, the first node sends an indication of the first KDF to the second node.

[0184] Please refer to Table 3. The KDF capability information of the second node may indicate that the second node supports the three KDFs KDF0, KDF1, and KDF2. For example, the KDF capability information of the second node includes "KDF0, KDF1, KDF2" or "0000, 0001, 0010". The first node may select one (or more) of the KDFs supported by the second node as the KDF used for subsequent verification, i.e., the first KDF. Of course, the names, identifiers, and number of KDFs here are only examples. Optionally, the first node may select the KDF with the highest priority from the KDFs supported by the second node as the first KDF.

[0185] Table 3 KDF capabilities of nodes

[0186] Furthermore, the first KDF may also be a KDF supported by the first node. Since the KDF is subsequently required to verify the information, the first node also needs to support this KDF to verify the first information or generate a verification value for the first information. Exemplarily, the first KDF is the KDF with the highest priority among the KDFs supported by both the first node and the second node.

[0187] Continuing to refer to Table 3, the first node supports four KDFs: KDF0, KDF1, KDF2, and KDF3. The first node can select one (or more) from KDF0, KDF1, and KDF2 supported by the first and second nodes as the KDF used for subsequent verification, that is, the first KDF.

[0188] In one possible implementation, the KDF capability of the second node is included in a message sent by the second node to the first node, thereby facilitating the distinction between the two messages and the first message. Furthermore, the first and second messages are network layer messages, which can be re-encapsulated by entities at a lower layer during transmission. For example, the first and second messages can be information transmitted between the first and second nodes when establishing a network layer connection.

[0189] Method 2: The second node can select the first KDF from the KDFs supported by both the second node and the first node and indicate the selected first KDF to the second node. For example, the second node receives the KDF capability of the first node from the first node, and indicates the KDF supported by the first node to the KDF capability of the first node. In conjunction with Table 3, the first node can indicate to the second node that it supports the four KDFs KDF0, KDF1, KDF2 and KDF3. The second node can select one (or more) from KDF0, KDF1, and KDF2 supported by the first node as the KDF used for subsequent verification, that is, the first KDF. Furthermore, the selected KDF can also be supported by the second node. Optionally, the second node can select the KDF with the highest priority from the KDFs supported by both the first node and the second node as the first KDF.

[0190] In some scenarios, if the first node and the second node do not have a KDF that is commonly supported, the first node or the second node may terminate the process, for example, not executing subsequent processes, discarding received messages, disconnecting the link, etc.

[0191] Step S203: The first node and the second node verify the first information through the first KDF.

[0192] Among them, the first information may include information transmitted by the first node and the second node, such as information contained in the topology configuration message and / or one or more information mentioned in this article that is transmitted before performing the verification action. For example, information contained in the first message, information contained in the second message, etc. Optionally, the first information may include all the information in the transmitted message, or may only include part of the information in the transmitted message. Taking the example that the first information includes the information contained in the topology configuration message, the topology configuration message may contain multiple pieces of information. During verification, part of the information in the topology configuration message, the topology type of the first network or the identifier of the security algorithm of the first network, etc. may be verified. Alternatively, all the messages in the topology configuration message may be verified during verification, or it may be called verification of the information contained in the entire topology configuration message.

[0193] Furthermore, the first information may also include parameters and keys predetermined between the first node and the second node. For example, the first information may include one or more of the first key, an encryption key derived based on the first key, an authenticated encryption key derived based on the first key, an integrity protection key derived based on the first key, or the first parameter.

[0194] In some scenarios, if the verification of the first information is successful, the first node or the second node continues to execute the process of adding the second node to the first network, such as the subsequent step S204. If the verification of the first information is unsuccessful, the first node or the second node may interrupt or terminate the process of adding the second node to the first network, such as not executing step S204.

[0195] The following examples illustrate several possible implementations of verifying the first information:

[0196] Implementation method 1: The second node generates a first verification value based on the first information, and sends the first verification value to the first node, which is verified by the first node. The first information includes information received or sent by the second node to the first node before the first verification value is generated, such as information of the topology configuration message, the KDF capability of the second node, the key negotiation algorithm capability of the second node, etc. Alternatively, the first information includes information shared by the first node and the second node before the first verification value is generated, such as parameters pre-configured in the first node and the second node, the first key obtained by negotiation between the first node and the second node, and the session security key (i.e., one or more of the encryption key, the integrity key, and the authentication encryption key) derived based on the first key.

[0197] As a possible implementation, the first verification value is related to the first KDF, and one or more of the following information: the first parameter, the first key, the information contained in the first message, the information contained in the second message, and the information contained in the topology configuration message. The first parameter is a parameter predefined by the first node and the second node, and its value may be fixed or may change. The first key is a key shared in advance by the first node and the second node, such as a negotiated key, a pre-set key, or a key derived based on the originally shared key. The topology configuration message may include information about the first network, an identifier of the security algorithm of the first network, etc. The second message includes a first public key (optional), a first random number (optional), a selected key agreement algorithm (optional), a selected KDF (regarded as indication information of the first KDF), etc.

[0198] The above embodiments provide a variety of possible scenarios. The following examples illustrate several possible designs:

[0199] Design 1: The second node can generate a first verification value based on the first KDF, the first key, the information contained in the second message, and the information contained in the topology configuration message, and send the first verification value to the first node. Furthermore, the first node can verify the first verification value based on the same parameters and the first KDF. For example, the first node can obtain a first test value based on the first KDF and the same parameters, and compare the first test value to the first verification value to see if they are the same. If they are the same, the verification of the first verification value is successful; otherwise, the verification fails.

[0200] Exemplarily, the first verification value may satisfy the following formula: first verification value = KDF(DH key, second message content, topology configuration message content). KDF is the KDF negotiated and determined by the first node and the second node, DH key represents a predetermined key between the first node and the second node (regarded as the first key), second message content = first random number || first public key || selected key agreement algorithm || selected key derivation function, topology configuration message content = encryption algorithm || integrity protection algorithm. It should be understood that "||" represents information concatenation or splicing. For example, if the first random number is 0x11111111 and the first public key is 0x00000000, then the first random number || first public key is 0x1111111100000000.

[0201] Design 2: The second node can generate a first verification value based on the first KDF, the first parameters, the information contained in the second message, and the information contained in the topology configuration message, and send the first verification value to the first node. Furthermore, the first node can verify the first verification value based on the same parameters and the first KDF.

[0202] Illustratively, the first verification value may satisfy the following formula: first verification value = KDF(ZERO, second message content, topology configuration message content). KDF is a KDF negotiated and determined by the first node and the second node, ZERO represents N bits of 0, for example, 128 bits of all 0s, second message content = the selected key derivation function, and topology configuration message content = encryption algorithm || integrity protection algorithm.

[0203] It should be noted that, during the specific implementation process, the parameters involved in generating the first verification value may be more or fewer. Taking Design 1 as an example, the content of the second message can be obtained by splicing only part of the information in the second message. For another example, the aforementioned first public key, selected key agreement algorithm, etc. refer to information in the key agreement scenario. In some implementation processes, the first node and the second node do not negotiate a key, then the first public key, selected key agreement algorithm and other parameters do not participate in generating the first verification value.

[0204] Design 3: The first verification value is related to the first key and the information included in the topology configuration message. For example, it can be expressed as: first verification value = KDF (DH key, topology configuration message content). Similarly, the first verification value is related to the first key and the information included in the topology configuration message. For example, it can be expressed as: first verification value = KDF (DH key, second message content).

[0205] Design 4: The first verification value is related to the first parameter and the information included in the topology configuration message. For example, it can be expressed as: first verification value = KDF (ZERO, topology configuration message content).

[0206] The above four designs are merely illustrative of operations related to the first verification value. In specific implementations, more information may be involved in generating the first verification value. For example, the KDF may also receive an algorithm indication to indicate which function to use internally. Furthermore, the above parameter order and representation (e.g., using KDF() to represent the KDF algorithm) are merely illustrative and do not limit the specific implementation.

[0207] In one possible implementation, the first verification value is included in a third message sent by the second node to the first node. Furthermore, the third message is sent later than the first message. The first random number can be included in a message sent by the first node to the second node, such as the second message, which is sent earlier than the third message.

[0208] Implementation method 2: The first node generates a second verification value based on the first information, and sends the second verification value to the second node, which performs verification.

[0209] As a possible implementation, the second verification value is associated with the first KDF and one or more of the following information: the first parameter, the first key, information included in the first message, information included in the second message, information included in the third message, and information included in the topology configuration message. The first message may include one or more of the following: KDF capabilities, key agreement algorithm capabilities, etc. The third message may include one or more of the following: the second public key, the second random number, the first verification value, etc.

[0210] Here are a few possible examples:

[0211] Example 1: The first node can generate a second verification value based on the first KDF, the first key, the information contained in the first message, the information contained in the third message, and the information contained in the topology configuration message, and send the second verification value to the second node. Furthermore, the second node can verify the second verification value based on the same parameters and the first KDF. For example, the second node can obtain a second test value based on the first KDF and the same parameters, and compare the second test value to see if it is the same as the second verification value. If they are the same, it indicates that the verification of the second verification value is successful; otherwise, it indicates that the verification failed.

[0212] Exemplarily, the second verification value may satisfy the following formula: second verification value = KDF(DH key, third message content, first message content, topology configuration message content). Here, KDF is the KDF negotiated and determined by the first node and the second node, DH key represents a predetermined key between the first node and the second node (referred to as the first key), third message content = second random number || second public key || first verification value, first message content = key agreement algorithm capability || key derivation function capability, and topology configuration message content = encryption algorithm || integrity protection algorithm.

[0213] Example 2: The first node may generate a second verification value based on the first KDF, the first parameters, the information contained in the first message, the information contained in the third message, and the information contained in the topology configuration message, and send the second verification value to the second node. Furthermore, the second node may verify the first verification value based on the same parameters and the first KDF.

[0214] Exemplarily, the second verification value may satisfy the following formula: second verification value = KDF(ZERO, third message content, first message content, topology configuration message content). KDF is the KDF negotiated and determined by the first node and the second node, ZERO represents N bits of zero, for example, 128 bits of all zeros, third message content = second random number || second public key || first verification value, first message content = key agreement algorithm capability || key derivation function capability, and topology configuration message content = encryption algorithm || integrity protection algorithm.

[0215] It should be noted that, during the specific implementation process, the parameters involved in generating the second verification value may be more or fewer.

[0216] Example 3: The second verification value is related to the first key, information contained in the third message, and the first key and information contained in the topology configuration message. For example, it can be expressed as: second verification value = KDF (DH key, third message content, topology configuration message content).

[0217] Example 4: The second verification value is related to the first parameter, the information contained in the third message and the information contained in the topology configuration message. For example, it can be expressed as: second verification value = KDF (ZERO, third message content, topology configuration message content).

[0218] Example 5: The second verification value is related to the first key and information included in the topology configuration message. For example, it can be expressed as: second verification value = KDF (DH key, third message content, topology configuration message content).

[0219] Example 6: The second verification value is related to the first parameter and the information included in the topology configuration message. For example, it can be expressed as: second verification value = KDF (ZERO, third message content, topology configuration message content).

[0220] In another possible implementation, the process of the first node and the second node verifying the first information through the first KDF is securely protected in order to further enhance security. For example, the aforementioned first verification value and / or second verification value can be securely protected. Taking the first verification value as an example, in one example, the first verification value is encrypted during transmission, for example, the message carrying the first verification value is encrypted at the access layer, and for another example, the first verification value (or the message carrying the first verification value) can be encrypted with a key to form a ciphertext, and the second node can send the first ciphertext. In another example, the parameters involved in generating the first verification value include a key, so that the first verification value is not easily cracked.

[0221] Step S204: The first node encrypts and sends the network key of the first network to the second node. Correspondingly, the second node receives the network key of the first network from the first node.

[0222] Optionally, encrypting the network key NetKey of the first network may also be achieved in the following manner: the NetKey is carried in a message, and the first node encrypts the entire message using the encryption key.

[0223] The network key of the first network is used to secure messages between nodes in the first network, for example, for one or more of encryption, integrity protection, or authenticated encryption. This includes direct use for encryption, integrity protection, or authenticated encryption, or it may be derived from the network key of the first network to obtain an encryption key, integrity protection key, or authenticated encryption key, and then use these derived keys to secure messages. Exemplarily, the encryption key Kenc can be derived as follows: Kenc = KDF(NetKey, algorithm identifier, "enc"), where NetKey is the network key of the first network, the algorithm identifier indicates the KDF algorithm used for derivation, and "enc" can be considered the KDF salt. This identifier is related to the encryption key, allowing the peer device to derive a consistent encryption key based on the same salt. Similarly, the integrity protection key Kint can be derived as follows: Kint = KDF(NetKey, algorithm identifier, "int"), where the algorithm identifier indicates the KDF algorithm used for derivation (which can be different from or the same as the algorithm used to derive the encryption key), and "int" can be considered the KDF salt. Similarly, the authentication encryption key Kac can be derived as follows: Kac = KDF(NetKey, algorithm identifier, "auth enc"), where the algorithm identifier indicates the KDF algorithm used for derivation, and "auth enc" can be considered the KDF salt. It should be noted that the above encryption key Kenc, integrity protection key Kint, and integrity protection key Kint can be used to securely protect messages in the first network.

[0224] In one possible implementation, the first node may also send the ID of the network key of the first network to the second node. Optionally, the network key of the first network may be a number, a string, or the like. Alternatively, the ID of the network key of the first network may be derived based on the network key of the first network. In some implementations, the ID of the network key of the first network and the network key of the first network may be carried in the same message.

[0225] Illustratively, after sending the network key of the first network to the second node, the first node and the second node may perform security protection on the network layers of the first node and the second node using the network key of the first network.

[0226] The following are two implementation methods for the first node to encrypt and send the network key of the first network:

[0227] Implementation method 1: When the access layer encrypts the message, the first node encrypts the network key of the first network and sends it through the encryption mechanism of the access layer. Specifically, the first node sends a fourth message to the second node, and the fourth message contains the network key of the first network. The fourth message is encrypted at the access layer. In this case, the first node and the second node first establish an access layer connection and the access layer encryption is turned on. The message carrying the network key of the first network layer can be encrypted in the access layer of the first node during transmission. Therefore, the message carrying the network key of the first network is encrypted at the access layer. Accordingly, when the second node receives the fourth message, the fourth message can be decrypted at the access layer of the second node to obtain the network key of the first network.

[0228] In a second implementation, the first and second nodes can encrypt the network key of the first network using a key previously shared (e.g., before transmitting the key) to obtain a ciphertext. During transmission, the first node sends the ciphertext of the network key of the first network to the second node. In response, the second node can obtain the ciphertext and decrypt it using the shared key to obtain the network key of the first network.

[0229] It should be understood that the above two methods of encrypted transmission are only examples, and the specific implementation process may include other methods that can encrypt and send the network key of the first network. In addition, the above two methods can also be combined without being mutually exclusive. For example, after the first node and the second node establish an access layer connection, if the access layer connection is not enabled, the network key of the first network is encrypted using a key to obtain a ciphertext, thereby achieving encrypted transmission of the network key of the first network. For example, if the access layer connection is not enabled, a key is exchanged based on a key agreement algorithm, and the network key of the first network is encrypted based on the key (directly or indirectly). If the access layer connection is enabled, the network key of the first network is encrypted and sent using the encryption mechanism of the access layer.

[0230] In a possible implementation, the shared key may be a key obtained through negotiation between the first node and the second node, or the shared key may be a key derived based on the key obtained through negotiation between the first node and the second node.

[0231] The following describes the process by which a first node and a second node negotiate to obtain a key. In some implementations, the first node can negotiate with the second node based on a first key agreement algorithm to determine a first key. The first key is used to securely protect information transmitted between the first and second nodes. Alternatively, the first key can be used directly to encrypt information during communication. Alternatively, the first key can be used to derive other keys, and the derived keys can be used to encrypt information during communication.

[0232] Among them, the first key agreement algorithm is an algorithm supported by both the first node and the second node. An exemplary process of negotiating to obtain the first key is as follows: the first node and the second node determine their respective private keys, the first node determines the first public key based on the private key of the first node and the public key determined by the first key agreement algorithm, and provides the first public key to the second node. The second node determines the second public key based on the private key of the second node and the public key determined by the first key agreement algorithm, and provides the second public key to the first node. The first node determines the key based on the private key and the second public key of the first node, which is called DHkey for easy distinction. The second node determines DHkey based on the private key of the second node and the first public key. If the exchanged public keys have not been tampered with, the DHkey determined by the two are consistent. Optionally, the first public key can be carried in the second message, and the second public key can be carried in the first message or the third message.

[0233] Optionally, DHkey can be used to generate the verification value, that is, DHkey can be the aforementioned first key. This includes directly using DHkey as the input of the first KDF, or calculating other secret values ​​based on DHkey and then using them as the input of the first KDF.

[0234] Furthermore, DHkey is used to derive other keys, including but not limited to encryption keys, integrity protection keys, integrity protection keys, etc. Exemplarily, encryption key = KDF (DHkey, algorithm identifier, encryption key identifier), wherein the algorithm identifier is used to indicate which algorithm is used in the KDF (or to specify a certain KDF), and the encryption key identifier is used to identify the derived key as an encryption key, for example, the encryption key identifier is "enc". Similarly, integrity protection key == KDF (DHkey, algorithm identifier, integrity protection key identifier), and the integrity protection key identifier is, for example, "int". Similarly, authentication encryption protection key = KDF (DHkey, algorithm identifier, authentication encryption protection key identifier), and the authentication encryption protection key identifier is, for example, "auth enc".

[0235] For example, the encryption key can be used to encrypt the network key of the first network. Furthermore, the message carrying the network key of the first network can also be integrity-protected using the security key. For another example, the authentication encryption key can be used to encrypt the network key of the first network, while also providing security for the network key of the first network.

[0236] In a possible implementation, the first key agreement algorithm used by the first node and the second node in the key agreement DHkey process can also be obtained through negotiation. The following are two ways to determine the first key agreement algorithm:

[0237] Method 1: The first node informs the second node of the key agreement algorithms it supports, and the first node selects the key agreement algorithm used to negotiate the key, that is, determines the first key agreement algorithm. Specifically, the first node sends the first node's key agreement algorithm capability to the second node, and the first node's key agreement algorithm capability is used to indicate the key agreement algorithms supported by the first node. The first node receives the indication information of the first key agreement algorithm sent by the second node. In combination with Table 4, the second node can select one (or more) of the three key agreement algorithms KE0, KE1, and KE2 that are commonly supported by the two nodes as the first key agreement algorithm.

[0238] Table 4 KDF capabilities of nodes

[0239] Optionally, the message transmitted to negotiate the key agreement algorithm can be the same message as the aforementioned message carrying other parameters, which can save signaling overhead. For example, the key agreement algorithm capability of the second node is included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

[0240] In the second method, the second node informs the first node of the key agreement algorithms it supports, and the second node selects the key agreement algorithm used to negotiate the key. Specifically, the second node sends the first node's key agreement algorithm capabilities to the first node, and the second node's key agreement algorithm capabilities are used to indicate the key agreement algorithms supported by the second node. The second node receives the indication information of the first key agreement algorithm sent by the first node. In combination with Table 4, the second node can select one (or more) of the three key agreement algorithms KE0, KE1, and KE2 that are commonly supported by the two nodes as the first key agreement algorithm.

[0241] In one possible implementation, before the first node encrypts and sends the network key to the second node, the first node may receive a request message from the second node requesting the network key of the first network. Accordingly, the first node may encrypt and send the network key to the second node in response to the request message.

[0242] Furthermore, after the first node sends the network key of the first network to the second node, the second node may send a network key configuration completion message to the first node to indicate that the key configuration is complete. Furthermore, the first node and the second node may start a wireless neighbor protocol.

[0243] In the embodiment shown in Figure 2, when a second node joins a first network, the first node, already in the first network, can send the first network's network key to the second node in an encrypted form, thereby securely distributing the network key. The second node can also use the network key to securely transmit information in the first network.

[0244] Furthermore, before encrypting and sending the key, the first node may send a topology configuration message to the second node. The topology configuration message carries information about the first network, primarily including some network attribute information. The first and second nodes can negotiate to obtain a KDF and, based on the KDF, verify that the information contained in the topology configuration message has not been tampered with, thereby confirming the security of the communication environment between the first and second nodes. In this process, the first KDF is negotiated by the first and second nodes, which can accommodate the situation where nodes with various security capabilities join the network, allowing the network to be applied to scenarios with a variety of different types of devices, thereby improving the network's inclusiveness.

[0245] The above solution mentions access layer connections. Below, we describe two signaling processes for establishing access layer connections. Alternatively, the process for establishing an access layer connection can also be referred to as an access process or an association process. Specifically, association refers to the process by which two nodes obtain a consistent communication key and establish a connection. The following uses the process of a terminal node accessing a management node as an example. The management node is either the first or second node, and the terminal node can be either the second or first node.

[0246] Please refer to Figure 3, which is a schematic diagram of an association process without a security context, including authentication and security context processes. For the sake of convenience, the messages (or information) exchanged during the association process are represented as T1-T5 below. Before this association process, there is no security context in the terminal node and the management node, no session key is negotiated, and there is no security context. When associating, the terminal node sends a message T1, which includes the terminal node ID, the first key negotiation parameter and the third fresh parameter. The management node determines the second key negotiation parameter and the fourth fresh parameter, and determines the first key based on the first key negotiation parameter and the second key negotiation parameter. Furthermore, the management node can determine the first key based on the first key (such as the key K KE), the third fresh parameter and the fourth fresh parameter determine the second key (such as the key Kgt). Optionally, the management node can derive a session key based on the second key (or the first key) for secure message protection. The management node provides the second key negotiation parameter and the fourth fresh parameter to the terminal node through message T2. Optionally, message T2 carries authentication information (i.e., the first authentication information) for verifying the key, identity, or message integrity. The terminal node obtains the first key, or the second key, in the same way. Further, the terminal node derives a session key based on the second key (or the first key) for secure message protection. In this way, the terminal node and the management node negotiate to obtain a consistent key. The terminal node can further generate a second authentication information and carry it in a message T3 to send to the management node. The management node verifies the second authentication information. If the verification is successful, the management node sends a message T4 to the terminal node to complete the association. The terminal node optionally responds with a message T5 to indicate that the association is complete.

[0247] It should be understood that during specific implementations, the association process may exchange more messages, or the messages may carry more or fewer parameters. For example, the third and fourth freshness parameters may not be included, and when obtaining the second key, the second key may be obtained based on the first key and the counter. For another example, the first authentication information or the second authentication information may not be included. For another example, message T1 may optionally carry one or more of the following: the security capabilities of the terminal node (used to indicate the security algorithms supported by the terminal node), information indicating the key agreement algorithm, etc. For another example, message T2 may also carry the length of the authentication information, the length of the session key, the ID of the second key (or the ID of the first key), and information indicating the security algorithm. For another example, message T4 may also carry one or more of the following: the temporary ID assigned by the terminal node to the management node, the validity period of the second key, the validity period of the first key, etc. If the terminal node belongs to a communication group, the management node may also carry one or more of the following: the group key of the communication group, the ID of the group key, the group security algorithm, the validity period of the group key, etc. in message T4.

[0248] The aforementioned security context refers to a set of information containing parameters related to communication security, such as one or more of the following: keys, freshness parameters, key negotiation parameters, security algorithm information, and terminal identity. Security algorithm information includes one or more of the following: security algorithm indication information and security algorithm version.

[0249] Exemplarily, a security context may include one or more of the following information: a fixed ID of a terminal node, a temporary ID of a terminal node, a shared key (for example, expressed as Kgt), validity period of the shared key, an identifier of the shared key (for example, Kgt ID), indication information of a key agreement algorithm, indication information of an encryption algorithm of a signaling plane, indication information of an integrity protection algorithm of a signaling plane, an encryption key of a signaling plane, an integrity protection key of a signaling plane, indication information of an encryption algorithm of a user plane, indication information of an integrity protection algorithm of a user plane, indication information of an authentication encryption algorithm of a user plane, an encryption key of a user plane, an integrity protection key of a user plane, an authentication encryption key of a user plane, a key deduction counter counter, COUNTERg, a global frame number (GFN), a group key (for example, expressed as GK), an identifier of a GK (GK ID), a group algorithm (Galgorithm), validity period of a group key (GK expiration), and a group global frame number (GGFN).

[0250] Please refer to Figure 4, which is a schematic diagram of an association process with a security context. For ease of distinction, the messages (or information) below are represented as T6-T8. Before the association process, the management node obtains the security context of the terminal node. The content of the association context can be found above. When associating, the terminal node sends a message T7 to the management node, carrying the identity of the terminal node (optionally a temporary identity or a fixed identity), and optionally carrying a Kgt ID. Optionally, the message T7 can be integrity protected by an integrity protection key.

[0251] The management node obtains the integrity protection key shared with the terminal node based on the terminal node's identity and checks the integrity of the association message using this integrity protection key. If the management node successfully checks the integrity of the association request message, it sends message T7 to establish an association between the management node and the terminal node. Optionally, if the management node successfully checks the integrity of the association request message, it may also assign a temporary ID to the terminal node. In this case, message T7 may carry the temporary ID assigned by the management node to the terminal node.

[0252] It is understandable that the integrity protection key can be included in the security context, and the aforementioned "checking the integrity of the associated message based on the integrity protection key" can also be replaced with "checking the integrity of the associated message based on the security context." Furthermore, the security context can include indication information and the integrity protection key of the integrity protection algorithm. The management node can check the integrity of message T6 using the integrity protection key and the specified integrity protection algorithm. Optionally, the integrity protection key here can be the integrity protection algorithm of the signaling plane.

[0253] Furthermore, the management node uses the signaling plane integrity protection algorithm and signaling plane integrity protection key Ks.int to perform integrity protection on message T7. Optionally, when signaling plane encryption protection is enabled, the management node may also use the signaling plane encryption algorithm and signaling plane encryption key Ks.enc to perform encryption protection on message T7.

[0254] The optional end node responds with message T8, indicating that the association is complete. In some scenarios, if message T7 is encrypted, the end node decrypts message T7. If message T7 is integrity-protected, the end node verifies the integrity of message T7. If the integrity verification succeeds, the association is complete, and the end node can send message T8 to the management node.

[0255] The embodiment shown in Figure 2 provides multiple possible solutions. Some of these possible designs are exemplified below in conjunction with Figures 5, 6, 7, 8, or 9. It should be understood that the logic, terminology, and other aspects of the embodiments shown in Figures 5, 6, 7, 8, or 9 can be found in the preceding text. Furthermore, in some figures of this application, information indicated by messages is schematically depicted in parentheses within the accompanying drawings, but this does not constitute a strict limitation on the message content. For example, although the topology configuration message shown in Figure 5 illustrates a security algorithm, in actual implementation, the topology configuration message may contain the identifier of the security algorithm. Hereinafter, the first node is a node already in the first network, referred to as an on-network device in some scenarios. The second node is a node that needs to join the first network, referred to as an on-network device in some scenarios. The first network can be a mesh network, but this application also applies to networks with other topology types.

[0256] In one possible design, the first node encrypts the network key using an access layer encryption mechanism when sending the network key. Please refer to Figure 5, which is a flowchart of another communication method provided by an embodiment of the present application. The communication method may include steps S502, S504, and S505, and may further include steps S501 and / or S503. Steps S501 to S502 are specifically as follows:

[0257] Step S501: A first node sends a topology configuration message. Correspondingly, a second node may receive the topology configuration message from the first node.

[0258] The topology configuration message may include information about the first network. For example, the topology configuration message may include information about the first network. Furthermore, for example, the topology configuration information may also indicate the security algorithm used by the first network. For example, the topology configuration message may include the encryption algorithm and integrity protection algorithm used by the first network. Alternatively, the topology configuration message may include the authentication encryption algorithm used by the first network.

[0259] Step S502: The first node establishes an access layer connection with the second node.

[0260] For example, the first node and the second node are connected through the process shown in FIG3 or FIG4 , and encryption may be enabled for the access layer connection between the first node and the second node.

[0261] Step S503: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message from the second node.

[0262] The key request message includes indication information indicating the network key of the first network.

[0263] Step S504: The first node sends the network key of the first network to the second node. Correspondingly, the second node receives the network key of the first network.

[0264] Specifically, the first node carries the network key of the first network in the fourth message, and the fourth message is encrypted at the access layer. Accordingly, when the second node receives the fourth message at the access layer, it can decrypt the fourth message using the key of the access layer to obtain the network key of the first network.

[0265] Optionally, before sending, the first node determines a first network that the first node joins, and determines a network key of the first network.

[0266] Step S505: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0267] In the embodiment shown in Figure 5, the first node secretly transmits the network key of the first network through the access layer encryption mechanism, thereby improving the security of the network key of the first network. The network key of the first network is used for network layer security protection, improving the security of information transmitted between nodes at the network layer.

[0268] In another possible design, the first node and the second node may negotiate to obtain a first key and derive an encryption key based on the first key. When sending a network key to the second node, the first node may use the encryption key to encrypt the network key. Correspondingly, the second node may decrypt the network key using the encryption key.

[0269] Please refer to Figure 6, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include steps S602 to S608, step S610, and step S611. It may further include step S601 and / or step S609. Steps S601 to S609 are as follows:

[0270] Step S601: The first node sends a topology configuration message, and the second node receives the topology configuration message accordingly.

[0271] Step S602: The first node establishes an access layer connection with the second node.

[0272] Optionally, the access layer connection between the first node and the second node can be encrypted, which can further improve the security of network key distribution. Alternatively, the access layer connection between the first node and the second node can be unencrypted. In this case, the first node can subsequently encrypt and send the network key using an encryption key derived from the first key.

[0273] Step S603: The first node sends the first public key to the second node. Correspondingly, the second node receives the first public key from the first node.

[0274] Specifically, the first node generates a first private key and, based on a first key agreement algorithm, generates a corresponding first public key and sends it to the second node. Optionally, the first key agreement algorithm can be selected by the first node or the second node.

[0275] Step S604: The second node sends the second public key to the first node. Correspondingly, the first node receives the second public key from the second node.

[0276] Specifically, the second node generates a second private key, and generates a corresponding second public key according to the first key agreement algorithm and sends it to the first node.

[0277] Step S605: The first node determines the first key.

[0278] Specifically, the first node determines the first key according to the first private key, the second public key, and a first key agreement algorithm.

[0279] Step S606: The second node determines the first key.

[0280] Specifically, the second node determines the first key according to the first private key, the second public key, and the first key agreement algorithm.

[0281] Step S607: The first node determines an encryption key according to the first key.

[0282] Specifically, the first node derives other keys, such as an encryption key, based on the first key. Furthermore, the first node can also derive a security key based on the first key.

[0283] Step S608: The second node determines an encryption key according to the first key.

[0284] Refer to step S607.

[0285] Step S609: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message from the second node.

[0286] Step S610: The first node sends the network key of the first network to the second node.

[0287] Specifically, the first node determines a network key NetKey of a first network that the first node joins, and encrypts the network key of the first network using an encryption key when sending the network key.

[0288] For example, the first node can encrypt the network key NetKey of the first network using the encryption key, obtain the ciphertext of NetKey and send it to the second node. Correspondingly, the second node can decrypt the ciphertext using the encryption key to obtain the network key NetKey of the first network.

[0289] It should be understood that, in a specific implementation process, encrypting the network key NetKey of the first network may also be achieved in the following manner: the NetKey is carried in the fourth message, and the first node encrypts the fourth message using the encryption key.

[0290] Step S611: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0291] In the embodiment shown in Figure 6, the first node and the second node negotiate to obtain a first key and derive an encryption key based on the first key, thereby secretly transmitting the network key of the first network and improving the privacy of the network key of the first network. The network key of the first network is used for network layer security protection, improving the security of information transmitted between nodes at the network layer.

[0292] Furthermore, the key negotiation algorithm used when negotiating the key can also be obtained through negotiation, so that the method is applicable to nodes with different key negotiation capabilities, improving the network's capacity to accommodate multiple types of nodes and enhancing network availability.

[0293] In some possible implementations, before transmitting the key of the first network, the first node may verify information shared between the first node and the second node (e.g., previously transmitted information or predefined information). If the shared information has not been tampered with, the first node then sends the network key of the first network to the second node, thereby enhancing the privacy of the network key of the first network and improving the communication security of the nodes.

[0294] Please refer to Figure 7, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in steps S701 to S716. It should be understood that the following description is only based on the order of steps S701 to S716 as an example. During the specific implementation, the timing of executing some steps may be changed. Steps S701 to S716 are as follows:

[0295] Step S701: The first node sends a topology configuration message.

[0296] Specifically, the first node may include information indicating the security algorithm used by the first network in the topology configuration message. For example, the topology configuration message includes the encryption algorithm and integrity protection algorithm used by the first network. Alternatively, the topology configuration message includes the authentication encryption algorithm used by the first network.

[0297] In some possible solutions, when a first network-entering device joins the first network through a mesh management node, the security algorithm of the first network is configured by the management node or determined through negotiation between the management node and the first network-entering device.

[0298] It is understandable that the first node sends a topology configuration message, and correspondingly, the second node can receive the topology configuration message from the first node.

[0299] Step S702: The second node determines whether it supports the security algorithm of the first network.

[0300] The security algorithm of the first network is the security algorithm indicated by the first node in the topology configuration message.

[0301] If the second node supports the security algorithm sent by the first node, the subsequent process is executed. If the second node does not support the security algorithm sent by the first node, the process ends, that is, the subsequent process is not executed.

[0302] Step S703: The first node establishes an access layer connection with the second node.

[0303] For example, the first node and the second node are connected through the process shown in FIG. 3 or FIG. 4 .

[0304] Optionally, the access layer connection between the first node and the second node can be encrypted, which can further improve the security of network key distribution. Alternatively, the access layer connection between the first node and the second node can be unencrypted. In this case, the first node can subsequently encrypt and send the network key using an encryption key derived from the first key.

[0305] Step S704: The second node sends a first message to the first node.

[0306] The first message carries the key agreement algorithm capability and the key derivation function capability, wherein the key agreement algorithm capability is used to indicate the key agreement algorithm supported by the second node, and the key derivation function capability is used to indicate the key derivation function supported by the second node.

[0307] It should be understood that the names of the messages herein are only used to distinguish different messages, and in specific implementations, the names of the messages may be designed in other ways. For example, the first message may be called a security request message, or the first message may be a handshake message or a hello message for a network layer connection.

[0308] It can be understood that the second node sends the first message to the first node, and correspondingly, the first node receives the first message from the second node.

[0309] As one possible implementation, the first node selects the key agreement algorithm and key derivation function with the highest priority based on the key agreement algorithm and key derivation function capabilities of the second node. Of course, in some solutions, the key agreement algorithm and key derivation function selected by the second node are also the key agreement algorithm and key derivation function supported by the first node itself.

[0310] Furthermore, the first node may generate a first private key and generate a first public key according to a selected key agreement algorithm. Optionally, the first node may also generate a first random number.

[0311] Step S705: The first node sends a second message to the second node.

[0312] The second message carries the first public key and is further used to indicate the key agreement algorithm and key derivation function selected by the first node. It should be understood that the name of the second message may be other designs. For example, the first message may be called a security response message, or the second message may be a handshake message or a hello message for a network layer connection.

[0313] Furthermore, when the first node generates the first random number, the first random number is carried in the second message and sent to the second node.

[0314] It can be understood that the first node sends the second message to the second node, and correspondingly, the second node can receive the second message from the first node.

[0315] Step S706: The second node determines the first key.

[0316] For example, the second node may generate a second private key, and based on the key agreement algorithm selected by the first node, calculate the first key based on the second private key and the first public key. Optionally, the first key may also be referred to as a negotiation key, DH key, etc.

[0317] Step S707: The second node determines the first verification value.

[0318] As a possible implementation, the first verification value = KDF (DH key, second message content, topology configuration message content), wherein DH key is the first key determined in step S506, and the KDF used to generate the first verification value is the KDF selected by the first node.

[0319] In addition, the second message content includes part or all of the information in the second message, or the second message content includes information processed based on part or all of the information in the second message. Exemplarily, when the second message includes a first random number, a first public key, a selected key agreement algorithm, and a selected key derivation function, the second message content = first random number || first public key || selected key agreement algorithm || selected key derivation function.

[0320] Similarly, the topology configuration message content includes part or all of the information in the topology configuration message, or the topology configuration message content includes information processed based on part or all of the information in the topology configuration message.

[0321] As another possible implementation manner, the first verification value=KDF(DH key, first random number, topology configuration message content).

[0322] Step S708: The second node sends a third message to the first node.

[0323] The third message carries the second public key and the first verification value. The second public key may be determined by the second node based on the second private key. Specifically, the second node generates the second private key and, based on a selected key agreement algorithm, generates a corresponding second public key. Furthermore, the second node generates a second random number, which is carried in the third message and sent to the second node.

[0324] It should be understood that the name of the third message may have other designs. For example, the third message may be called a security verification request message, or the third message may be a handshake message or a hello message of a network layer connection.

[0325] It is understood that the second node sends the third message to the first node, and accordingly, the first node can receive the third message from the second node. Optionally, the first node can verify the first verification value. Further, if the first node successfully verifies the first verification value, the subsequent process proceeds, such as continuing to execute step S709 and some or all of the following steps. Otherwise, the process ends.

[0326] Step S709: The first node determines the first key.

[0327] Exemplarily, the first node calculates the first key according to the first private key and the second public key by using a selected key agreement algorithm.

[0328] Step S710: The first node determines a second verification value.

[0329] As a possible implementation, the second verification value = KDF (DH key, third message content, second message content, topology configuration message content), where DH key is the first key determined in step S709, and the KDF used to generate the first verification value is the KDF selected by the first node.

[0330] In addition, the third message content includes part or all of the information in the third message, or the third message content includes information processed based on part or all of the information in the third message. Exemplarily, when the third message includes the second random number, the second public key, and the first verification value, the third message content = the second random number || the second public key || the first verification value.

[0331] Similarly, the topology configuration message content includes part or all of the information in the topology configuration message, or the topology configuration message content includes information processed based on part or all of the information in the topology configuration message.

[0332] As another possible implementation, the first verification value = KDF (DH key, second random number, topology configuration message content).

[0333] Step S711: The first node sends a fifth message to the second node.

[0334] The fifth message carries the second verification value.

[0335] Step S712: The first node determines the encryption key using the first key.

[0336] Furthermore, the first node may also derive an integrity protection key or an authentication encryption key based on the first key.

[0337] Step S713: The second node determines the encryption key using the first key.

[0338] Specifically, the first node derives an encryption key based on the first key.

[0339] Furthermore, the first node may also derive an integrity protection key or an authentication encryption key based on the first key.

[0340] Step S714: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message from the second node.

[0341] Step S715: The first node sends a network key configuration message to the second node.

[0342] The network key configuration message includes the network key of the first network. Optionally, the network key configuration message may also include the ID of the network key of the first network. Optionally, the fifth message may be a network key configuration message, or a network key configuration message encapsulated at the access layer.

[0343] Optionally, the first node determines a network key NetKey of a first network that the first node joins, and carries the NetKey in a key configuration message and sends it to the second node.

[0344] Optionally, the first node may derive an encryption key based on the aforementioned first key, and the network key configuration message may be encrypted and sent using the encryption key. Correspondingly, the second node may decrypt the ciphertext using the encryption key to obtain the network key NetKey of the first network.

[0345] Furthermore, the first node may also derive an integrity protection key based on the first key, and the network key configuration message may be integrity protected by the integrity protection key.

[0346] Optionally, the first node may derive an authentication encryption key based on the aforementioned first key, and the network key configuration message may be authenticated and encrypted using the authentication encryption key.

[0347] Furthermore, the second node may also send a sixth message to the first node, where the sixth message is used to indicate that the network key configuration is completed.

[0348] Step S716: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0349] Furthermore, the first node and the second node may start a wireless neighbor protocol.

[0350] In the embodiment shown in Figure 7, during the process of a first node joining a first network, the first node and the second node negotiate a key agreement algorithm and a key derivation function. The key agreement algorithm is used to determine the first key, which is used to securely protect information transmitted between the two nodes. The key derivation function is used to verify the information transmitted between the two nodes to ensure that it has not been tampered with. This allows the first node to distribute the network key of the first network in a relatively secure environment, improving network security. Furthermore, by negotiating various security algorithms, the network's capacity to accommodate diverse node types is enhanced, thereby improving network availability.

[0351] Please refer to Figure 8, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in steps S801 to S813. It should be understood that the following description is only based on the order of steps S801 to S813 as an example. During the specific implementation, the timing of executing some steps may be changed. Steps S801 to S813 are as follows:

[0352] Step S801: A first node sends a topology configuration message. Correspondingly, a second node may receive the topology configuration message from the first node.

[0353] Step S802: The second node determines whether it supports the security algorithm of the first network.

[0354] Step S803: The first node and the second node establish an access layer connection.

[0355] Step S804: The second node sends a first message to the first node. Correspondingly, the first node receives the first message.

[0356] The first message carries the key negotiation algorithm capability.

[0357] Step S805: The first node sends a second message to the second node. Correspondingly, the second node receives the second message.

[0358] The second message carries the first public key and is further used to indicate the key agreement algorithm selected by the first node. Optionally, the second message also carries the first random number.

[0359] Step S806: The second node determines the first key.

[0360] Step S807: The second node sends a third message to the first node. Correspondingly, the first node receives the third message.

[0361] The third message carries the second public key. Furthermore, the third message also carries a second random number.

[0362] Step S808: The first node determines the first key.

[0363] Step S809: The second node determines the encryption key using the first key.

[0364] Step S810: The first node determines the encryption key using the first key.

[0365] Step S811: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.

[0366] Step S812: The first node sends the network key of the first network to the second node.

[0367] Specifically, when sending the network key of the first network, the encryption key is used to encrypt the sending.

[0368] Step S813: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0369] In the embodiment shown in Figure 8, the first node and the second node can determine a key agreement algorithm through negotiation and, based on the key agreement algorithm, determine a first key. The first key is used to securely protect information transmitted between the two nodes. If the parameters passed between the first node and the second node during the key agreement process have not been tampered with, the second node and the first node can determine a consistent first key, allowing the second node to decrypt the ciphertext and obtain the network key of the first network. In this way, the first node can distribute the network key of the first network in a relatively secure environment, improving network security. Furthermore, by negotiating the key agreement algorithm, the network's capacity for multiple types of nodes is improved, thereby enhancing network availability.

[0370] Please refer to Figure 9, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in steps S901 to S916. It should be understood that the following description is only based on the order of steps S901 to S916 as an example. During the specific implementation, the timing of executing some steps may be changed. Steps S901 to S916 are as follows:

[0371] Step S901: A first node sends a topology configuration message. Correspondingly, a second node may receive the topology configuration message from the first node.

[0372] The topology configuration message may include information of the first network and the key negotiation algorithm capability of the first node.

[0373] Step S902: The second node determines whether it supports the security algorithm of the first network. For related description, see step S702.

[0374] Step S903: The first node establishes an access layer connection with the second node. For related descriptions, see step S703.

[0375] Step S904: The second node sends a first message to the first node. Correspondingly, the first node can receive the first message from the second node.

[0376] The first message carries the second public key, the key agreement algorithm selected by the second node, and the key agreement algorithm capability of the second node. The second public key is generated by the second node based on the selected key agreement algorithm and the second private key generated by the second node.

[0377] Optionally, the first message also carries a second random number.

[0378] Step S905: The first node sends a second message to the second node. Correspondingly, the second node can receive the second message from the first node.

[0379] The second message carries the first public key, and is also used to indicate the key derivation function selected by the first node. Furthermore, the second message also carries the first random number.

[0380] Step S906: The second node determines the first key.

[0381] Exemplarily, the second node selects a key agreement algorithm based on the first node to calculate the first key according to the second private key and the first public key.

[0382] Step S907: The first node determines the first key.

[0383] Exemplarily, the first node calculates the first key according to the first private key and the second public key by using a selected key agreement algorithm.

[0384] Step S908: The second node determines the first verification value.

[0385] As a possible implementation, the first verification value = KDF (DH key, second message content, topology configuration message content), wherein DH key is the first key determined in step S906, and the KDF used to generate the first verification value is the KDF selected by the second node.

[0386] As another possible implementation, the first verification value = KDF (DH key, first random number, topology configuration message content). Of course, in a specific implementation process, more or fewer parameters may be involved in generating the first verification value.

[0387] Step S909: the second node sends a third message to the first node.

[0388] The third message carries the first verification value. For related description, see step S508.

[0389] Step S910: The first node determines a second verification value.

[0390] As one possible implementation, the second verification value = KDF(DH key, third message content, second message content, topology configuration message content). As another possible implementation, the first verification value = KDF(DH key, second random number, topology configuration message content). Of course, in specific implementations, more or fewer parameters may be involved in generating the first verification value.

[0391] Step S911: The first node sends a fifth message to the second node. Correspondingly, the second node receives the fifth message from the first node, wherein the fifth message carries the second verification value.

[0392] Step S912: The first node determines the encryption key using the first key.

[0393] Step S913: The second node determines the encryption key using the first key.

[0394] Step S914: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.

[0395] Step S915: The first node sends the network key of the first network to the second node.

[0396] Specifically, the first node determines the network key NetKey of the first network that the first node joins, and encrypts the network key of the first network using the encryption key before sending it.

[0397] Step S916: Perform security protection on the network layer based on the network key of the first network.

[0398] For the relevant description of the embodiment shown in FIG. 9 , reference can also be made to the embodiment shown in FIG. 7 .

[0399] Please refer to Figure 10, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in steps S1001 to S1011. It should be understood that the following description is only based on the order of steps S1001 to S1011 as an example. During the specific implementation, the timing of executing some steps may be changed. Steps S1001 to S1011 are as follows:

[0400] Step S1001: A first node sends a topology configuration message. Correspondingly, a second node may receive the topology configuration message from the first node.

[0401] See the description of step S701.

[0402] Step S1002: The second node determines whether it supports the security algorithm of the first network. For related description, see step S702.

[0403] Step S1003: The first node establishes an access layer connection with the second node.

[0404] The access layer connection encryption between the first node and the second node is enabled. For related description, see step S703.

[0405] Step S1004: The second node sends a first message to the first node. Correspondingly, the first node can receive the first message from the second node.

[0406] The first message carries the KDF capability of the second node. Optionally, the first message also carries a second random number.

[0407] Step S1005: The first node sends a second message to the second node. Correspondingly, the second node can receive the second message from the first node.

[0408] The second message is also used to indicate the key derivation function selected by the first node. Furthermore, the second message also carries the first random number.

[0409] Step S1006: The second node determines the first verification value.

[0410] As a possible implementation, the first verification value = KDF(first parameter, second message content, topology configuration message content). The first parameter is a parameter predefined (e.g., before generating the first verification value), such as ZERO. The KDF used to generate the first verification value is the KDF selected by the second node.

[0411] As another possible implementation, the first verification value = KDF (first parameter, first random number, topology configuration message content). Of course, in a specific implementation process, more or fewer parameters may be involved in generating the first verification value.

[0412] Step S1007: The second node sends a third message to the first node.

[0413] The third message carries the first verification value. For related description, see step S708.

[0414] Step S1008: The first node verifies the first verification value.

[0415] Exemplarily, the first node calculates the first key according to the first private key and the second public key by using a selected key agreement algorithm.

[0416] Step S1009: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.

[0417] Step S1010: The first node sends the network key of the first network to the second node.

[0418] Specifically, the first node carries the network key of the first network in the fourth message, and the fourth message is encrypted at the access layer. Accordingly, when the second node receives the fourth message at the access layer, it can decrypt the fourth message using the key of the access layer to obtain the network key of the first network.

[0419] Step S1011: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0420] In the embodiment shown in Figure 8, the first node secretly transmits the network key of the first network through an access layer encryption mechanism. Before transmitting the key, the first node and the second node can negotiate to obtain a KDF and, based on the KDF, verify that the information contained in the topology configuration message has not been tampered with, thereby confirming that the communication environment between the first node and the second node is secure. During this process, the first node and the second node negotiate to obtain the first KDF, which can accommodate nodes with different security capabilities joining the network, allowing the network to be used in scenarios with a variety of different types of devices, thereby improving the network's inclusiveness.

[0421] Please refer to Figure 11, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in steps S1101 to S1115. It should be understood that the following description is only based on the order of steps S1101 to S1115 as an example. During the specific implementation, the timing of executing some steps may be changed. Steps S1101 to S1115 are as follows:

[0422] Step S1101: The first node sends a topology configuration message. Correspondingly, the second node can receive the topology configuration message from the first node. See the description of step S701.

[0423] Step S1102: The first node establishes an access layer connection with the second node. Encryption of the access layer connection between the first node and the second node is enabled. For related descriptions, see step S703.

[0424] Step S1103: The second node sends a first message to the first node. Correspondingly, the first node can receive the first message from the second node.

[0425] The first message carries the security capability of the second node, wherein the security capability of the second node indicates the security algorithm, key agreement algorithm, and KDF supported by the second node.

[0426] Optionally, the first message also carries a second random number.

[0427] Step S1104: The first node sends a second message to the second node. Correspondingly, the second node can receive the second message from the first node.

[0428] The second message carries the first public key, and is also used to indicate the key agreement algorithm and key derivation function selected by the first node.

[0429] Exemplarily, the first node selects the highest priority key derivation function and the highest priority key agreement algorithm based on the security algorithm capability of the networked device. The first node generates a first private key and determines a first public key based on the selected key agreement algorithm.

[0430] Furthermore, the second message is also used to indicate the security algorithm of the first network. Optionally, the second message also carries the first random number.

[0431] In a possible implementation, if the security algorithm supported by the network access device of the second node does not include the security algorithm of the first network, the first node sends a failure message to the second node, and the message carries a reason value.

[0432] Step S1105: The second node determines the first key.

[0433] For example, the second node may generate a second private key, and based on the key agreement algorithm selected by the first node, calculate the first key based on the second private key and the first public key. Optionally, the first key may also be referred to as a network key, a DH key, etc.

[0434] Step S1106: The second node determines the first verification value.

[0435] As a possible implementation, the first verification value = KDF (DH key, second message content, topology configuration message content), wherein DH key is the first key determined in step S1105, and the KDF used to generate the first verification value is the KDF selected by the first node.

[0436] As another possible implementation manner, the first verification value=KDF(DH key, first random number, topology configuration message content).

[0437] Step S1107: The second node sends a third message to the first node. Correspondingly, the first node receives the third message from the first node. The third message carries the second public key and the first verification value.

[0438] Step S1108: The first node determines the first key.

[0439] Step S1109: The first node determines a second verification value.

[0440] As a possible implementation, the second verification value = KDF (DH key, third message content, second message content, topology configuration message content), where DH key is the first key determined in step S1105, and the KDF used to generate the first verification value is the KDF selected by the first node.

[0441] As another possible implementation, the first verification value = KDF (DH key, second random number, topology configuration message content).

[0442] Step S1110: The first node sends a fifth message to the second node. Correspondingly, the second node receives the fifth message from the first node, wherein the fifth message carries the second verification value.

[0443] Step S1111: The first node determines the encryption key using the first key.

[0444] Step S1112: The second node determines the encryption key using the first key.

[0445] Step S1113: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.

[0446] Step S1114: The first node sends the network key of the first network to the second node.

[0447] Specifically, when sending the network key of the first network, the encryption key is used to encrypt the sending.

[0448] Step S1115: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0449] In the embodiment shown in Figure 11, during the process of a first node joining a first network, the first node and the second node negotiate a key agreement algorithm and a key derivation function. The key agreement algorithm is used to determine the first key, which is used to securely protect information transmitted between the two nodes. The key derivation function is used to verify the information transmitted between the two nodes to ensure that it has not been tampered with. This allows the first node to distribute the network key of the first network in a relatively secure environment, improving network security. Furthermore, by negotiating various security algorithms, the network's capacity to accommodate diverse node types is enhanced, improving network availability.

[0450] Please refer to Figure 12, which is a flow chart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in steps S1201 to S1210. It should be understood that the following description is only based on the order of steps S1201 to S1210 as an example. During the specific implementation, the timing of executing some steps may be changed. Steps S1201 to S1210 are as follows:

[0451] Step S1201: A first node sends a topology configuration message. Correspondingly, a second node may receive the topology configuration message from the first node.

[0452] See the description of step S1001.

[0453] Step S1202: The first node establishes an access layer connection with the second node.

[0454] The access layer connection encryption between the first node and the second node is enabled. For related description, see step S703.

[0455] Step S1203: The second node sends a first message to the first node. Correspondingly, the first node can receive the first message from the second node.

[0456] The first message carries the KDF capability of the second node. Optionally, the first message also carries a second random number.

[0457] Step S1204: The first node sends a second message to the second node. Correspondingly, the second node can receive the second message from the first node.

[0458] The second message is also used to indicate the key derivation function selected by the first node and the security algorithm of the first network. Furthermore, the second message also carries the first random number.

[0459] Step S1205: The second node determines the first verification value.

[0460] As a possible implementation, the first verification value = KDF(first parameter, second message content, topology configuration message content). The first parameter is a parameter predefined (e.g., before generating the first verification value), such as ZERO. The KDF used to generate the first verification value is the KDF selected by the second node.

[0461] As another possible implementation, the first verification value = KDF (first parameter, first random number, topology configuration message content). Of course, in a specific implementation process, more or fewer parameters may be involved in generating the first verification value.

[0462] Step S1206: The second node sends a third message to the first node.

[0463] The third message carries the first verification value. For related description, see step S708.

[0464] Step S1207: The first node verifies the first verification value.

[0465] Exemplarily, the first node calculates the first key according to the first private key and the second public key by using a selected key agreement algorithm.

[0466] Step S1208: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.

[0467] Step S1209: The first node sends the network key of the first network to the second node.

[0468] Specifically, the first node carries the network key of the first network in the fourth message, and the fourth message is encrypted at the access layer. Accordingly, when the second node receives the fourth message at the access layer, it can decrypt the fourth message using the key of the access layer to obtain the network key of the first network.

[0469] Step S1210: The first node and the second node perform security protection on the network layer based on the network key of the first network.

[0470] In the embodiment shown in Figure 12, the first node secretly transmits the network key of the first network through an access layer encryption mechanism. Before transmitting the key, the first node and the second node can negotiate to obtain a KDF and, based on the KDF, verify that the information contained in the topology configuration message has not been tampered with, thereby confirming that the communication environment between the first node and the second node is secure. During this process, the first node and the second node negotiate to obtain the first KDF, which can accommodate nodes with different security capabilities joining the network, allowing the network to be used in scenarios with a variety of different types of devices, thereby improving the network's inclusiveness.

[0471] The above describes in detail the method of the embodiment of the present application. The following provides an apparatus of the embodiment of the present application.

[0472] It should be understood that the division of units in the device provided in the embodiments of the present application is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the units in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, and the memory stores instructions. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory within the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all of the units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), which realizes the functions of some or all of the above units by designing the logical relationship of the components in the circuit. For another example, in another implementation, the hardware circuit can be implemented by a programmable logic device (PLD). Taking a field programmable gate array (FPGA) as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by configuring the configuration file, thereby realizing the functions of some or all of the above units. All units of the above devices can be implemented in the form of software called by the processor, or in the form of hardware circuits, or in part by the form of software called by the processor, and the rest by hardware circuits.

[0473] In an embodiment of the present application, a processor is a circuit with a signal processing capability. In one implementation, the processor may be a circuit with an instruction reading and execution capability, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which may be understood as a microprocessor), or a digital signal processor (DSP); in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit may be fixed or reconfigurable, such as a hardware circuit implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration may be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc.

[0474] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0475] In addition, the various units in the above devices can be fully or partially integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of the various units of the device. The type of the at least one processor can be different, for example, including a CPU and FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0476] Several possible arrangements are listed below.

[0477] Please refer to Figure 13, which is a structural diagram of a communication device provided in an embodiment of the present application. Optionally, the communication device 130 can be an independent device, such as a node. Alternatively, the communication device 130 can also be a device in an independent device (such as a node), such as a chip or an integrated circuit. The communication device 130 is used to implement the aforementioned communication method, such as the communication method shown in any one or more of the embodiments shown in Figures 2, 5, 6, 7, 8, 9, 10, 11, or 12. Furthermore, in some scenarios, the communication device is also used to implement the association process shown in Figure 3 or 4.

[0478] As shown in Figure 13, communication device 130 includes a communication unit 1301 and a processing unit 1302. Communication unit 1301 is configured to implement one or more operations such as sending, receiving, monitoring, transmitting, establishing a connection, and responding, and further includes other operations for implementing the communication method. Processing unit 1302 is configured to implement one or more operations such as processing, calculating, determining, generating, updating, encrypting, and decrypting, and further includes other operations for implementing the communication method.

[0479] In one possible design, the communication device 130 includes a communication unit 1301 and a processing unit 1302, and the communication device 130 is used to implement the method on the first node side in the aforementioned communication method.

[0480] In one possible implementation, the communication unit 1301 is configured to:

[0481] Sending a topology configuration message to the second node, where the topology configuration message includes information about the first network;

[0482] Negotiate with the second node to determine a first KDF, where the first KDF is a KDF supported by both the first node and the second node;

[0483] The communication unit 1301 and the processing unit 1302 are configured to verify the first information with the second node through the first KDF;

[0484] The communication unit 1301 is further configured to encrypt and send the network key of the first network to the second node if the first information is successfully verified. The network key of the first network is used to provide security protection for the first network, for example, the network key of the first network is used to provide security protection for the network layer between nodes in the first network.

[0485] Optionally, the communication device 130 is a first node or the communication device 130 is included in the first node, and the first network includes the first node.

[0486] In a possible implementation, the communication unit 1301 is further configured to send the ID of the network key of the first network to the second node.

[0487] In a possible implementation manner, the information transmitted by the first node and the second node includes information included in a topology configuration message.

[0488] In one possible implementation of the first aspect, the communication unit 1301 is further configured to receive a first verification value from the second node, and the processing unit 1302 verifies the first verification value based on at least the first KDF and information included in the topology configuration message. The first verification value is associated with at least the first KDF and information included in the topology configuration message.

[0489] Furthermore, successfully verifying the first information includes successfully verifying the first verification value. Optionally, the first verification value may be included in the third message, or carried in the third message.

[0490] In one possible implementation, the first KDF may be the KDF with the highest priority among the KDFs supported by the second node. Alternatively, the first KDF may be a KDF supported by both the first node and the second node. In this case, the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.

[0491] In a possible implementation, the communication device 130 may select a first KDF from among the KDFs supported by both the second node and the first node, and indicate the selected first KDF to the second node.

[0492] In a possible implementation, the communication unit 1301 is further configured to: receive the KDF capability of the second node from the second node, and send indication information of the first KDF to the second node, wherein the KDF of the second node can be used to indicate the KDF supported by the second node.

[0493] In some scenarios, the KDF capability of the second node and the indication information of the first KDF are also considered as the first information. In this way, the first node and the second node can verify whether this information has been tampered with, thereby improving security.

[0494] In one possible implementation, communication unit 1301 is further configured to receive a first message from a second node and send a second message to the second node. The first message includes the KDF capabilities of the second node, and the second message includes at least information indicating the first KDF. It should be understood that the first and second messages may also include other information.

[0495] In a possible implementation manner, the information transmitted by the first node and the second node includes one or more items of information included in the second message, information included in the topology configuration message, and the like.

[0496] In one possible implementation, communication unit 1301 is further configured to: receive a third message from the second node, and verify the first verification value based on the first KDF, the first key, information included in the second message, and information included in the topology configuration message. The third message includes the first verification value, which is associated with the first KDF, the first key, information included in the second message, and information included in the topology configuration message. The first key may be a key negotiated between the first node and the second node. Furthermore, successfully verifying the first message includes successfully verifying the first verification value.

[0497] In one possible implementation, communication unit 1301 is further configured to: receive a third message from the second node, and verify the first verification value based on the first KDF, the first parameter, information included in the second message, and information included in the topology configuration message. The third message includes the first verification value, and the first verification value is associated with the first KDF, the first parameter, information included in the second message, and information included in the topology configuration message. The value of the first parameter is predefined. For example, the first parameter is 128 bits of data, and further, the 128 bits are all 0s. Furthermore, successfully verifying the first information includes successfully verifying the first verification value.

[0498] In one possible implementation, communication unit 1301 is further configured to: send the KDF capabilities of the first node to the second node, where the KDF capabilities of the first node indicate the KDFs supported by the first node; and receive indication information of the first KDF from the second node. In some scenarios, the KDF capabilities of the first node, the indication information of the first KDF, etc., also constitute the first information.

[0499] In a possible implementation, the process of verifying the first information with the second node through the first KDF is protected to further enhance security.

[0500] In a possible implementation, the communication unit 1301 is further configured to: send a first random number to the second node. The random number may belong to the first information, so as to determine whether a message carrying the random number has been tampered with.

[0501] In one possible implementation, the processing unit 1302 is further configured to generate a second verification value based on the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and the first key. The communication unit 1301 is further configured to send the second verification value to the second node.

[0502] Furthermore, the communication unit 1301 is further configured to receive a second random number from the second node. Optionally, the second random number is included in the third message.

[0503] Optionally, the second verification value is carried in a fifth message sent by the first node to the second node. Furthermore, the process of receiving the third message and sending the fifth message may be subject to security protection.

[0504] In one possible implementation, the communication unit 1301 and the processing unit are further configured to: based on a first key agreement algorithm, negotiate with the second node to determine a first key. The first key (DH key) or a key derived from the first key is used to securely protect information transmitted between the first node and the second node.

[0505] In a possible implementation, the first key agreement algorithm may be determined through negotiation between the communication device 130 and the second node.

[0506] In yet another possible implementation, the communication unit 1301 is further configured to: send the key agreement algorithm capability of the first node to the second node, and receive indication information of the first key agreement algorithm sent from the second node.

[0507] Optionally, the key agreement algorithm capability of the first node is included in the topology configuration message, and the indication information of the first key agreement algorithm is included in the first message.

[0508] In yet another possible implementation, the communication unit 1301 is further configured to: receive the key agreement algorithm capability of the second node from the second node, and send indication information of the first key agreement algorithm to the second node.

[0509] Optionally, the key agreement algorithm capability of the second node is included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

[0510] In another possible implementation, the processing unit 1302 is further configured to: derive an encryption key based on the first key, and encrypt the key of the first network layer using the encryption key to obtain a ciphertext of the network key of the first network;

[0511] The communication unit 1301 is further configured to send the ciphertext of the network key of the first network to the second node.

[0512] In another possible implementation, the communication unit 1301 and the processing unit 1302 are further configured to establish an access layer connection with the second node, and access layer encryption of the first node and the second node is enabled;

[0513] The communication unit 1301 is further configured to send a fourth message to the second node, where the fourth message includes a network key of the first network, and the first message is encrypted at the access layer.

[0514] In yet another possible implementation, the communication unit 1301 is further configured to send an identifier of the security algorithm of the first network to the second node.

[0515] In another possible implementation, the communication unit 1301 is further configured to receive security capability information of the second node from the second node, and the processing unit 1302 is further configured to determine a security algorithm of the first network. Further, the communication unit 1301 is further configured to provide an identifier of the determined security algorithm of the first network to the second node.

[0516] In another possible design, the communication device 130 includes a communication unit 1301 and a processing unit 1302, and the communication device 130 is used to implement the method on the second node side in the aforementioned communication method.

[0517] In one possible embodiment, communication unit 1301 is configured to receive a topology configuration message from a first node. Communication unit 1301 and processing unit 1302 are configured to negotiate with the first node to determine a first key derivation function (KDF), where the first KDF is a KDF supported by both the first node and the second node. Processing unit 1302 is further configured to generate a first verification value based on the first KDF and the first information. Communication unit 1301 is further configured to send the first verification value to the first node and receive a network key of the first network encrypted and sent by the first node. The network key of the first network is used to provide security protection for the network layer between nodes in the first network.

[0518] In one possible implementation, the information transmitted between the first node and the second node includes information contained in a topology configuration message. Processing unit 1302 is further configured to generate a first verification value based on at least the first KDF and the information contained in the topology configuration message, and communication unit 1301 is further configured to send the first verification value to the first node. Optionally, the first verification value may be included in a third message sent to the first node.

[0519] In one possible implementation, the first KDF may be the KDF with the highest priority among the KDFs supported by the second node. Alternatively, the first KDF may be a KDF supported by both the first node and the second node. In this case, the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.

[0520] In one possible implementation, communication unit 1301 is further configured to send the second node's KDF capabilities to the first node and receive information indicating the first KDF from the first node. In some scenarios, the second node's KDF capabilities and the first KDF indication also constitute the first information. This allows the first and second nodes to verify whether this information has been tampered with, thereby improving security.

[0521] In a possible implementation, the communication device 130 may select a first KDF from among the KDFs supported by both the second node and the first node, and indicate the selected first KDF to the second node.

[0522] In a possible implementation manner, the information transmitted by the first node and the second node includes information included in the second message and / or information included in the topology configuration message.

[0523] In one possible embodiment, the processing unit 1302 is further used to generate a first verification value based on the first key information contained in the second message and the information contained in the topology configuration message, and the communication unit 1301 is further used to send a third message to the first node, and the third message includes the first verification value.

[0524] In one possible implementation, the processing unit 1302 is further configured to generate a first verification value based on the first KDF, the first key, information included in the second message, and information included in the topology configuration message, and the communication unit 1301 is further configured to send a third message to the first node, the third message including the first verification value. The first key is obtained through negotiation between the first node and the second node.

[0525] In one possible implementation, the processing unit 1302 is further configured to generate a first verification value based on the first KDF, the first parameter, information included in the second message, and information included in the topology configuration message, and the communication unit 1301 is further configured to send a third message to the first node, the third message including the first verification value. The value of the first parameter is predefined, for example, 128 bits of all 0s.

[0526] In one possible implementation, communication unit 1301 is further configured to receive a first random number from a second node. The first random number is used to generate a verification value or to derive a key. Optionally, the second random number may be included in the second message. Furthermore, the first information includes the second random number in the second message, meaning that the first random number may be used to generate the first verification value.

[0527] In one possible implementation, the communication unit 1301 is further configured to receive a fifth message from the first node, the fifth message including a second verification value, where the second verification value is associated with the first KDF and at least one of the following information: information included in the third message, information included in the first message, information included in the topology configuration message, and the first key. The processing unit 1302 is further configured to verify the first verification value based on the first KDF and the same information.

[0528] For example, the second verification value is associated with the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and the first key. The second node verifies the second verification value based on the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and the first key.

[0529] In one possible implementation, the processing unit 1302 is further configured to determine a first key according to a first key agreement algorithm. The first key or a key derived from the first key is used to securely protect information transmitted between the first node and the second node.

[0530] In a possible implementation, the communication unit 1301 and the processing unit 1302 are further configured to negotiate with the first node to determine a first key agreement algorithm, where the first key agreement algorithm is a key agreement algorithm supported by the second node.

[0531] In another possible implementation, the communication unit 1301 is further configured to receive the key agreement algorithm capabilities of the first node from the first node, and send indication information of the first key agreement algorithm to the first node. Optionally, the key agreement algorithm capabilities of the first node are included in the topology configuration message, and the indication information of the first key agreement algorithm is included in the first message.

[0532] In another possible implementation, communication unit 1301 is further configured to send the second node's key agreement algorithm capabilities to the first node, and receive indication information of the first key agreement algorithm from the first node. Optionally, the second node's key agreement algorithm capabilities are included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

[0533] In another possible implementation, the communication unit 1301 is further configured to receive a ciphertext of the network key of the first network. The processing unit 1302 is further configured to derive an encryption key based on the first key, and decrypt the ciphertext of the network key of the first network layer using the encryption key to obtain the network key of the first network.

[0534] In another possible implementation, communication unit 1301 and processing unit 1302 are further configured to establish an access-layer connection with the first node, where encryption is enabled at the access layer. Communication unit 1301 is further configured to receive a fourth message, where the fourth message includes the network key of the first network and is encrypted at the access layer. Processing unit 1302 is further configured to decrypt the fourth message at the access layer to obtain the network key of the first network.

[0535] In yet another possible implementation, the communication unit 1301 is further configured to receive an identifier of a security algorithm of the first network from the first node.

[0536] In yet another possible implementation, the communication unit 1301 is further configured to send security capability information of the second node to the first node.

[0537] In yet another possible implementation, the communication unit 1301 is further configured to receive a second message from the first node, where the second message indicates that the second node fails to join the first network.

[0538] Please refer to Figure 14, which is a schematic diagram of the structure of another communication device provided in an embodiment of the present application. The communication device 140 can be an independent device, such as a node, or a device included in an independent device, such as a chip, a software module, or an integrated circuit. The communication device 140 may include at least one processor 1401 and a communication interface 1402. Optionally, it may also include at least one memory 1403. Further optionally, it may also include a connection line 1404, wherein the processor 1401, the communication interface 1402 and / or the memory 1403 are connected via the connection line 1404, and / or communicate with each other via the connection line 1404 to transmit control signals and / or data signals.

[0539] in:

[0540] The processor 1401 is a module that performs arithmetic operations and / or logical operations, and may specifically include one or more of the following modules: a filter, a modem, a power amplifier, a low noise amplifier (LNA), a baseband processor, a radio frequency processor, a radio frequency circuit, a central processing unit (CPU), an application processor (AP), a microcontroller unit (MCU), an electronic control unit (ECU), a graphics processing unit (GPU), a microprocessor unit (MPU), an application specific integrated circuit (ASIC), an image signal processor (ISP), a digital signal processor (DSP), a field programmable gate array (FPGA), a complex programmable logic device (CPLD), or a coprocessor, etc.

[0541] The communication interface 1402 may be used to provide information input or output for the at least one processor, or to receive externally transmitted signals and / or send externally transmitted signals.

[0542] For example, communication interface 1402 may include interface circuitry.

[0543] For example, the communication interface 1402 may include a wired link interface such as an Ethernet cable, or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, and other short-range wireless communication technologies, etc.).

[0544] Optionally, the communication interface 1402 may further include a radio frequency transmitter, an antenna, etc. When the communication interface 1402 includes an antenna, the number of antennas may be one or more.

[0545] As a possible design, if the communication device 140 is a standalone device, the communication interface 1402 may include a receiver and a transmitter. The receiver and the transmitter may be the same component or different components. When the receiver and the transmitter are the same component, the component may be referred to as a transceiver.

[0546] As another possible design, if the communication device 140 is a chip or a circuit, the communication interface 1402 may include an input interface and an output interface. The input interface and the output interface may be the same interface, or may be different interfaces.

[0547] Optionally, the functions of the communication interface 1402 may be implemented by a transceiver circuit or a dedicated transceiver chip.

[0548] Memory 1403 is used to provide storage space for storing data such as the operating system and computer programs. Memory 1403 can be one or a combination of random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).

[0549] The functions and actions of the modules or units in the communication device 140 listed above are merely exemplary.

[0550] Each functional unit in the communication device 140 can be used to implement the aforementioned communication method, such as the communication method shown in Figure 2, Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, or Figure 12.

[0551] Optionally, processor 1401 may be a processor specifically used to execute the aforementioned method (for convenience of distinction, referred to as a dedicated processor), or a processor that executes the aforementioned method by calling a computer program (for convenience of distinction, referred to as a dedicated processor). Optionally, at least one processor may include both a dedicated processor and a general-purpose processor.

[0552] Optionally, in the case where the communication device 140 includes at least one memory 1403 , if the processor 1401 implements the aforementioned communication method by calling a computer program, the computer program may be stored in the memory 1403 .

[0553] An embodiment of the present application further provides a chip comprising a logic circuit and a communication interface. The communication interface is configured to receive or transmit signals, and the logic circuit is configured to receive or transmit signals via the communication interface. The chip is configured to implement the aforementioned communication methods, such as those shown in Figures 2, 5, 6, 7, 8, 9, 10, 11, or 12.

[0554] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on at least one processor (or communication device), the aforementioned communication method is implemented, such as the communication method shown in Figures 2, 5, 6, 7, 8, 9, 10, 11, or 12.

[0555] An embodiment of the present application also provides a computer program product, which includes computer instructions, and the computer instructions are used to implement the aforementioned communication method, such as the communication method shown in Figure 2, Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, or Figure 12.

[0556] An embodiment of the present application further provides a terminal, which includes the aforementioned communication device 130 and / or communication device 140.

[0557] As a possible implementation, the terminal includes a terminal node, wherein the terminal can be an intelligent terminal or transportation tool such as a vehicle, a drone, or a robot.

[0558] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0559] In the embodiments of this application, "at least one" refers to one or more, and "more" refers to two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items.

[0560] For example, at least one of a, b, or c can represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, and c can be single or plural. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, A and / or B can represent: A alone, A and B together, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0561] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" in the embodiments of this application are used to distinguish multiple objects and are not used to define the order, timing, priority, or importance of multiple objects. For example, the terms "first node" and "second node" are merely used to facilitate the description of new parameters in different implementations and do not indicate differences in their execution operations, importance, structure, etc.

[0562] In addition, in this application, a message can also be regarded as a type of information, and the name of the message can be replaced arbitrarily. For example, a topology configuration message can also be called a topology configuration service data information. The names of other messages, information, etc. can also have other designs, which will not be explained here one by one.

[0563] In the above embodiments, the term "when" can be interpreted to mean "if...", "after...", "in response to determining...", or "in response to detecting...", depending on the context. The above are merely optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the concepts and principles of the present application shall be included in the scope of protection of the present application.

[0564] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

Claims

1. A communication method, characterized in that: Applied to the first node, the method comprises: Sending a topology configuration message to the second node, wherein the topology configuration message includes information of the first network; Negotiate with the second node to determine a first key derivation function KDF, where the first KDF is a KDF supported by the second node; Verify first information with the second node through the first KDF, where the first information is information transmitted by the first node and the second node; When the first information is verified successfully, the network key of the first network is encrypted and sent to the second node.

2. The method according to claim 1, characterized in that The information transmitted by the first node and the second node includes the information included in the topology configuration message; The verifying the first information with the second node through the first KDF includes: receiving a third message from the second node, the third message comprising a first verification value, the first verification value being associated with at least the first KDF and information included in the topology configuration message; Verifying the first verification value at least according to the first KDF and information included in the topology configuration message; The successful verification of the first information includes: successful verification of the first verification value.

3. The method according to claim 1, characterized in that The negotiating with the second node to determine the first KDF includes: receiving a first message from the second node, where the first message includes a KDF capability of the second node, where the KDF capability of the second node is used to indicate a KDF supported by the second node; Send a second message to the second node, where the second message includes at least indication information of the first KDF.

4. The method according to claim 3, characterized in that The information transmitted by the first node and the second node includes the information included in the second message and / or the information included in the topology configuration message.

5. The method according to claim 4, characterized in that The verifying the first information with the second node through the first KDF includes: receiving a third message from the second node, the third message including a first verification value, the first verification value being associated with the first KDF, a first key, information included in the second message, and information included in the topology configuration message, the first key being obtained by negotiation between the first node and the second node; Verify the first verification value according to the first KDF, the first key, information included in the second message, and information included in the topology configuration message; The successful verification of the first information includes: successful verification of the first verification value.

6. The method according to claim 4, characterized in that The verifying the first information with the second node through the first KDF includes: receiving a third message from the second node, the third message comprising a first verification value, the first verification value being associated with the first KDF, a first parameter, information included in the second message, and information included in the topology configuration message, and the value of the first parameter being predefined; Verify the first verification value according to the first KDF, the first parameter, information included in the second message, and information included in the topology configuration message; The successful verification of the first information includes: successful verification of the first verification value.

7. The method according to any one of claims 3 to 6, characterized in that: The second message also includes a first random number.

8. The method according to claim 5 or 6, characterized in that: The method further comprises: Generate a second verification value according to the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and the first key; The second verification value is sent to the second node.

9. The method according to any one of claims 3 to 7, characterized in that: The method further comprises: Negotiate with the second node to determine a first key agreement algorithm, where the first key agreement algorithm is a key agreement algorithm supported by the second node; A first key is determined according to the first key agreement algorithm, and the first key or a key derived from the first key is used to securely protect information transmitted between the first node and the second node.

10. The method according to claim 9, characterized in that The negotiating with the second node to determine a first key agreement algorithm includes: Sending the key agreement algorithm capability of the first node to the second node, where the key agreement algorithm capability of the first node is used to indicate the key agreement algorithm supported by the first node; Receive indication information of a first key agreement algorithm sent by the second node.

11. The method according to claim 10, characterized in that The key agreement algorithm capability of the first node is included in the topology configuration message, and the indication information of the first key agreement algorithm is included in the first message.

12. The method according to claim 9, characterized in that The negotiating with the second node to determine a first key agreement algorithm includes: receiving a key agreement algorithm capability of the second node from the second node, where the key agreement algorithm capability of the second node includes a key agreement algorithm supported by the second node; Send indication information of the first key agreement algorithm to the second node.

13. The method according to claim 12, characterized in that The key agreement algorithm capability of the second node is included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

14. The method according to any one of claims 9 to 13, characterized in that: The step of encrypting and sending the network key of the first network to the second node comprises: deriving an encryption key according to the first key; Encrypting the key of the first network layer by using the encryption key to obtain a ciphertext of the network key of the first network; The ciphertext of the network key of the first network is sent to the second node.

15. The method according to any one of claims 1 to 14, characterized in that: Before encrypting and sending the network key of the first network to the second node, the method further includes: establishing an access layer connection with the second node, with encryption of the access layer connection turned on; The encrypting and sending the network key of the first network to the second node includes: sending a fourth message to the second node, the fourth message includes the network key of the first network, and the fourth message is encrypted at the access layer.

16. The method according to any one of claims 1 to 15, characterized in that: The method further comprises: The information of the first network includes an identifier of a security algorithm of the first network, The security algorithm includes an encryption algorithm and / or an integrity protection algorithm, or the security algorithm includes an authenticated encryption algorithm.

17. The method according to claim 16, characterized in that The session security algorithm of the first network is pre-configured in the first node; Alternatively, before sending the topology configuration message to the second node, the method further includes: receiving security capability information of the second node from the second node, where the security capability information of the second node indicates a security algorithm supported by the second node; A security algorithm of the first network is determined, where the security algorithm of the first network belongs to a session security algorithm supported by the second node.

18. The method according to claim 17, characterized in that The first node is a management node, and before the second node joins the first network, the first node is the only node in the first network.

19. A communication method, characterized in that: Applied to the second node, the method comprises: receiving a topology configuration message from a first node, wherein the topology configuration message includes information of a first network; Negotiate with the first node to determine a first key derivation function KDF, where the first KDF is a KDF supported by the second node; generating a first verification value based on the first KDF and first information, where the first information includes information transmitted by the first node and the second node; Sending the first verification value to the first node; Receive the network key of the first network sent by the first node in encrypted form.

20. The method according to claim 19, characterized in that The information transmitted by the first node and the second node includes the information included in the topology configuration message.

21. The method according to claim 19, characterized in that The negotiating with the second node to determine the first KDF includes: Sending a first message to the first node, where the first message includes the KDF capability of the second node, where the KDF capability of the second node indicates a KDF supported by the second node; A second message is received from the first node, where the second message includes indication information of the first KDF.

22. The method according to claim 21, characterized in that The information transmitted by the first node and the second node includes the information included in the second message and / or the information included in the topology configuration message.

23. The method according to claim 22, characterized in that The generating a first verification value based on the first KDF and the first information includes: Generate the first verification value according to the first KDF, the first key, the information included in the second message, and the information included in the topology configuration message, where the first key is obtained through negotiation between the first node and the second node; The sending the first verification value to the first node includes: A third message is sent to the first node, where the third message includes the first verification value.

24. The method according to claim 22, characterized in that The generating a first verification value based on the first KDF and the first information includes: Generate the first verification value according to the first KDF, the first parameter, the information included in the second message, and the information included in the topology configuration message, where the first key is obtained through negotiation between the first node and the second node, and the value of the first parameter is predefined; The sending the first verification value to the first node includes: A third message is sent to the first node, where the third message includes the first verification value.

25. The method according to any one of claims 21 to 24, characterized in that: The second message also includes a first random number.

26. The method according to claim 23 or 24, characterized in that The method further comprises: receiving a second verification value from the first node, the second verification value being associated with the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and a first key; The second verification value is verified according to the first KDF, information included in the third message, information included in the first message, information included in the topology configuration message, and a first key.

27. The method according to any one of claims 21 to 26, characterized in that: The method further comprises: Negotiate with the first node to determine a first key agreement algorithm, where the first key agreement algorithm is a key agreement algorithm supported by the second node; A first key is determined according to the first key agreement algorithm, and the first key or a key derived from the first key is used to securely protect information transmitted between the first node and the second node.

28. The method according to claim 27, characterized in that The negotiating with the first node to determine a first key agreement algorithm includes: receiving a key negotiation algorithm capability of the first node from the first node, wherein the key negotiation algorithm capability of the first node includes a key agreement algorithm supported by the first node; Send indication information of a first key agreement algorithm to the first node, where the first key agreement algorithm is a key agreement algorithm supported by the second node.

29. The method according to claim 28, characterized in that The key agreement algorithm capability of the first node is included in the topology configuration message, and the indication information of the first key agreement algorithm is included in the first message.

30. The method according to claim 27, characterized in that The negotiating with the first node to determine a first key agreement algorithm includes: Sending the key agreement algorithm capability of the second node to the first node, where the key agreement algorithm capability of the second node includes the key agreement algorithm supported by the second node; Indication information of a first key agreement algorithm is received from the first node, where the first key agreement algorithm is a key agreement algorithm supported by the second node.

31. The method according to claim 30, characterized in that The key agreement algorithm capability of the second node is included in the first message, and the indication information of the first key agreement algorithm is included in the second message.

32. The method according to any one of claims 27 to 31, characterized in that: The receiving the network key of the first network sent encrypted by the first node includes: receiving a ciphertext of the network key of the first network; The method further comprises: deriving an encryption key according to the first key; The ciphertext of the network key of the first network layer is decrypted by using the encryption key to obtain the network key of the first network.

33. The method according to any one of claims 19 to 32, characterized in that: The method further comprises: Establishing an access layer connection with the first node, with encryption of the access layer connection enabled; The receiving the network key of the first network sent encrypted by the first node includes: receiving a fourth message, the fourth message including a network key of the first network, the fourth message being encrypted at the access layer; The fourth message is decrypted at the access layer to obtain a network key of the first network.

34. The method according to any one of claims 19 to 33, characterized in that: The method further comprises: The information of the first network includes an identifier of a security algorithm of the first network, The security algorithm includes an encryption algorithm and / or an integrity protection algorithm, or the security algorithm includes an authenticated encryption algorithm.

35. The method according to any one of claims 19 to 34, characterized in that: The method further comprises: Security capability information of the second node is sent to the first node, where the security capability information of the second node indicates a security algorithm supported by the second node.

36. A communication device, characterized in that: The communication device comprises a communication unit and a processing unit, and the communication device is used to implement the method according to any one of claims 1 to 18.

37. A communication device, characterized in that: The communication device comprises a communication unit and a processing unit, and the communication device is used to implement the method described in any one of claims 19-35.

38. A communication device, characterized in that: The communication device includes a processor and a communication interface; When the processor calls the computer program or instruction in the memory, the method according to any one of claims 1 to 18 is executed, or the method according to any one of claims 19 to 35 is executed.

39. A chip, characterized in that: The chip includes a processor and a communication interface; The processor is used to implement the method according to any one of claims 1 to 18, or to implement the method according to any one of claims 19 to 35. Law.

40. A communication system, characterized in that: The communication system comprises a first node and a second node, The first node comprises the communication device as claimed in claim 36; The second node comprises the communication device of claim 37.

41. A terminal, characterized in that: The terminal includes the communication device as claimed in claim 36, or includes the communication device as claimed in claim 37, or includes the communication device as claimed in claim 38, or includes the chip as claimed in claim 39, or includes the communication system as claimed in claim 40.

42. A computer-readable storage medium, characterized in that: The computer readable storage medium is used to store instructions or computer programs; When the instructions or the computer program are executed, the method according to any one of claims 1 to 18 is implemented, or the method according to any one of claims 19 to 35 is implemented.

Citation Information

Patent Citations

  • Method, system and network node for consulting cipher key derivative function

    CN101645877A

  • Bluetooth node pairing method and related device

    CN112640506A

  • Communication method and device

    CN113455032A

  • Key negotiation method and device, equipment and storage medium

    CN116208323A

  • Key derivation algorithm negotiation method and apparatus

    US20200221297A1