WO2025059942A1 - Communication method, communication apparatus and terminal - Google Patents
Communication method, communication apparatus and terminal Download PDFInfo
- Publication number
- WO2025059942A1 WO2025059942A1 PCT/CN2023/120189 CN2023120189W WO2025059942A1 WO 2025059942 A1 WO2025059942 A1 WO 2025059942A1 CN 2023120189 W CN2023120189 W CN 2023120189W WO 2025059942 A1 WO2025059942 A1 WO 2025059942A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- key
- network
- message
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/03—Protecting confidentiality, e.g. by encryption
Definitions
- 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.
- Typical network topology types include star, tree, and mesh networks.
- in-network nodes the nodes that are already in the network
- access nodes the nodes that need to join the network
- 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 connected nodes, so that the newly connected nodes can obtain the securely protected information transmitted in the network.
- 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 access nodes.
- an embodiment of the present application provides a communication method, the method comprising:
- the first node sends a topology configuration message to the second node, and the topology configuration message includes information of the first network.
- the first node negotiates with the second node to determine a first key derivation function (KDF), and the first KDF belongs to a KDF supported by the second node.
- KDF key derivation function
- the first node verifies the first information with the second node through the first KDF, and encrypts and sends the network key of the first network to the second node if the verification of the first information is successful.
- the network key of the first network is used to securely protect messages transmitted in the first network.
- the network key of the first network is used to securely protect network layer messages transmitted between nodes in the network, and security protection includes encryption, integrity protection, authenticated encryption, etc.
- security protection includes encryption, integrity protection, authenticated encryption, etc.
- the network key of the first network is used to derive a session key, and the security key is then used for session security protection.
- the first network includes the first node.
- the first node may obtain information about the first network.
- 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 (identify, 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 authentication encryption algorithm, and the like.
- the first node already in the first network can send a topology configuration message to it.
- the information of the first network carried in the topology configuration message mainly includes some attribute information of the network.
- some secret information of the first network such as the network key
- the first node does not directly carry it in the topology configuration message, but needs to send it to the second node in an encrypted manner.
- the first node and the second node need to perform information verification (taking verification of the first information as an example), that is, verify 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 by the first node and the second node, such as information included in the topology configuration message and/or one or more of the information mentioned below.
- the first information may also include parameters and keys predetermined between the first node and the second node.
- any node when verifying information, any node needs to generate a verification value first and send it to the other party for verification.
- the generation of the verification value depends on the security algorithm. Since there are many different nodes in the network, the security capabilities of the nodes joining the network may be different.
- the first node and the second node can negotiate to obtain the first KDF, and verify the first information through the first KDF. In this way, it can adapt to the situation where nodes with different security capabilities join the network, so that the network can be applied to scenarios with many different types of devices, improving the network's packet loss. Capacitance.
- the message sent by the first node and the message received by the first node can be transmitted by means of wireless signals.
- the connection mode of the first node and the second node can be a wireless connection. Since wireless connections are vulnerable to attacks by attackers, the solution provided by the embodiment of the present application can significantly improve the security of communication in the case of wireless transmission.
- the method further includes: sending an ID of a network key of the first network to the second node.
- the network key of the first network may be a number, a string, etc.
- the ID of the network key of the first network may be derived based on the network key of the first network.
- 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.
- 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.
- the first information may include all the information in the topology configuration message, or include the entire topology configuration message.
- verifying the first information with the second node through the first KDF includes: receiving a first verification value from the second node, and verifying the first verification value at least according to the first KDF and the information included in the topology configuration message.
- the first verification value is at least associated with the information included in the first KDF and the topology configuration message.
- verifying the first information successfully includes: verifying the first verification value successfully.
- the first verification value can be included in a third message, or referred to as being carried in a third message.
- the second node can generate a verification value based on at least the first KDF and the information contained in the topology configuration message, and the first node can verify the verification value based on the first KDF and the information contained in the same topology configuration message. If the verification is successful, it means 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, that is, it has not been tampered with. In this way, it can be determined that the information received by the second node is accurate, and it shows that the communication environment between the two is relatively safe, which improves the communication security.
- the first KDF may be the KDF with the highest priority among the KDFs supported by the second node.
- the first KDF may be a KDF supported by both the first node and the second node.
- the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.
- the first node can 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 work of selecting the KDF, which can concentrate the amount of calculation on the first node side. It is suitable for scenarios where the first node has stronger computing power and can improve the speed of network access.
- 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 management node by accessing the management node. Therefore, compared with the networked node, the networked node usually has stronger communication capabilities or computing capabilities. Therefore, the networked node is responsible for the calculation work during the selection, which can improve the speed of selecting the KDF and shorten the delay of the network access process.
- KDF is selected by the first node, and nodes in the network can select KDF based on consistent priorities, which is conducive to improving the uniformity of KDF standards for node selection in the network.
- negotiating with the second node to determine the first KDF includes: receiving the KDF capability of the second node from the second node, and sending indication information of the first KDF to the second node, wherein the KDF capability of the second node is used to indicate the KDF supported by the second node.
- the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
- 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 capability of the second node, and the second message includes at least indication information of the first KDF. It should be understood that the first message and the second message may also include other information.
- the information transmitted by the first node and the second node includes one or more of information included in the second message, information included in the topology configuration message, etc.
- the information included in the second message here may be part of the information in the second message, or may be all of the information (or the entire second message).
- 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 according to the first KDF, the first key, 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 key, the information included in the second message, and the information included in the topology configuration message, and the first key can be a key obtained by negotiation between the first node and the second node.
- successfully verifying the first information includes: successfully verifying the first verification value.
- the first information can be understood as the information included in the second message and the information included in the topology configuration message.
- 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.
- 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 according to 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.
- the first parameter is 128 bits of data, and further, the 128 bits are all 0.
- successfully verifying the first information includes: successfully verifying the first verification value.
- the first information is the information included in the second message and the information included in the topology configuration message.
- the first information is the first parameter, the information included in the second message and the information included in the topology configuration message.
- the method further includes: sending the KDF capability of the first node to the second node, the KDF capability of the first node indicating the KDF supported by the first node; and receiving indication information of the first KDF from the second node.
- the KDF capability of the first node, the indication information of the first KDF, etc. also belong to the first information.
- the process of verifying the first information by using the first KDF and the second node is security protected in order to further improve security.
- the first verification value is encrypted during transmission, for example, the message carrying the first verification value is encrypted at the access layer, and in another example, the first verification value can be encrypted by a key to form a ciphertext, and the second node can send the ciphertext of the first verification value.
- the parameters involved in generating the first verification value include a key, and further, the key involved in generating the first verification value can be obtained through negotiation between the first node and the second node, or a shared key pre-configured in the first node and the second node.
- 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 is tampered with.
- the first random number may be included in the second message, that is, the aforementioned second message includes the first random number.
- 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.
- the method further includes receiving a second random number from the second node.
- the second random number is included in the third message.
- the second verification value is carried in a fifth message sent by the first node to the second node.
- the process of receiving the third message and sending the fifth message may be subject to security protection.
- the method further includes:
- the first key is determined through 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.
- 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.
- 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, so as to adapt to the scenario where nodes with different key agreement capabilities join the first network.
- the first key agreement algorithm also belongs to the key agreement algorithms supported by the first node.
- 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.
- An exemplary process of obtaining a first key through negotiation 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 private key of the first node and a public key determined by a first key negotiation algorithm, and provides the first public key to the second node.
- the second node determines a second public key based on the private key of the second node and a public key determined by the first key negotiation algorithm, and provides the second public key to the first node.
- the first node determines the first key based on the private key of the first node and the second public key
- the second node determines the first key 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 first keys determined by the two are consistent.
- 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.
- the first key agreement algorithm may be determined by negotiation between the first node and the second node. That is, the first node and the second node may negotiate to determine the first key agreement algorithm to facilitate key negotiation later.
- the first key agreement algorithm may also be configured by the first node, for example, an identifier of the first key agreement algorithm may be carried in a key configuration message, for example, the first key agreement algorithm is a key agreement algorithm used by the first network.
- 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; receiving indication information of the first key agreement algorithm sent from the second node.
- 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.
- 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.
- 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.
- encrypting and sending a network key of the first network to the second node includes:
- the ciphertext of the network key of the first network is sent to the second node.
- this implementation can be performed when the access layer of the first node and the second node is not encrypted.
- the first node and the second node establish an access layer connection, and when the access layer connection is not encrypted, 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, and optionally, the key agreement algorithm is determined before determining the first key.
- the first node may not need to negotiate the KDF or verify the first information, and thus directly send the network key of the first network through the encrypted access layer.
- 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.
- the second node establishes an access layer connection with the first node before joining the first network. Since the access layer encrypts the message, the first node can securely transmit the network key of the first network through the encryption mechanism of the access layer. Exemplarily, the first node can encrypt the fourth message in the access layer established by the first node.
- the fourth message further includes an ID of a network key of the first network.
- the information of the security algorithm of the first network may not be carried in the topology configuration message.
- the information of the security algorithm of the first network may also be carried in the second message.
- the security algorithm of the first network is pre-configured in the first node, for example, configured in the first node by a management node or a control node.
- the security algorithm of the first network is obtained through negotiation between the first node and the second node.
- the aforementioned communication method also 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 algorithms supported by the second node and the first node.
- the first node may provide the identifier of the determined security algorithm of the first network to the second node. This example is illustrated by taking the case where the first node selects the first key negotiation algorithm as an example.
- the second node may also select the security algorithm of the first network based on the security capability information of the first node.
- the above implementation can be implemented when a new node is first added to the first network.
- 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 of the first network.
- 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 performs the process of joining the first network, the first node and the second node negotiate the session security key of the first network.
- the method is applied when the second node supports the security algorithm of the first network. Further, 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 capability of the second node.
- the first node may receive security capability information from the second node, and the security capability information of the second node indicates the security algorithm supported by the second node.
- the security capability information of the second node indicates the security algorithm supported by the second node.
- a second message may be sent to the second node, and the second message indicates that joining the first network failed.
- the process of joining the second node to the first network may be terminated, for example, messages related to joining the first network may not be transmitted (such as sending and/or receiving) with the second node.
- 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 step of encrypting and sending the network key of the first network to the second node is executed, that is, the step of encrypting and sending the network key of the first network to the second node is executed when the second node supports the security algorithm of the first network.
- an embodiment of the present application provides a communication method, including:
- the second node receives a topology configuration message from the first node, and the topology configuration message includes information about the first network.
- the second node negotiates with the first node to determine a first key derivation function KDF, generates a first verification value based on the first KDF and the first information, and sends the first verification value to the first node, wherein the first KDF is a KDF commonly supported by the second node, and the first information includes information transmitted by the first node and the second node.
- the second node receives the network key of the first network encrypted and sent by the first node.
- the network key of the first network is used to perform security protection on the network layer between nodes in the first network.
- the method may be implemented by a hardware module or a software module of the second node.
- the information transmitted by the first node and the second node includes information included in a topology configuration message.
- the first KDF may be the KDF with the highest priority among the KDFs supported by the second node.
- the first KDF may be a KDF supported by both the first node and the second node.
- the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.
- determining the first KDF through negotiation with the second node includes:
- the KDF capability of the second node Send the KDF capability of the second node to the first node, and receive the indication information of the first KDF from the first node.
- the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
- the second 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 second node receives the KDF capability of the first node from the first node and sends indication information of the first KDF to the first node.
- the KDF capability of the first node indicates the KDF supported by the first node.
- the first node provides its KDF capability to the second node.
- the subsequent process related to "joining the first network” may not be performed, thereby saving signaling overhead and computing consumption.
- the first node usually does not actively indicate the joining failure (or termination) to the first node.
- 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.
- 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: using a first key to generate the first verification value based on information contained in the second message and information contained in the topology configuration message, and sending a third message to the first node, the third message containing the first verification value.
- generating a first verification value based on the first KDF and the first information includes:
- Sending a 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.
- generating a first verification value based on the first KDF and the first information includes:
- 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.
- the value of the first parameter is predefined, for example, 128 bits of all 0s.
- 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.
- the second random number may be included in the second message.
- 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.
- the method further includes:
- 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.
- 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 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 may be carried in a message and sent, for example, carried in a fifth message and sent.
- the method further includes:
- a first key is determined.
- 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.
- the method further includes:
- 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.
- negotiating with the first node to determine the first key agreement algorithm includes:
- the key agreement algorithm capability of the first node including a key agreement algorithm supported by the first node
- 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.
- 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.
- negotiating with the first node to determine the first key agreement algorithm includes:
- 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.
- 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.
- receiving the network key of the first network encrypted and sent by the first node includes: receiving a ciphertext of the network key of the first network;
- the method also includes:
- 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.
- the method further includes:
- Receiving a network key of the first network encrypted and sent by the first node comprising:
- 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.
- 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
- the second node may decrypt the fourth message at its own access layer to obtain a network key of the first network
- the method further includes:
- 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.
- the network key of the first network supports the security algorithm of the first network at the second node. Sent in case;
- the method further includes: receiving a second message from the first node, the second message indicating that the second node fails to join the first network.
- an embodiment of the present application provides a communication device, the communication device comprising a communication unit and a processing unit.
- the communication device is used to implement any method of the first aspect; or to implement any method of the second aspect.
- an embodiment of the present application provides a communication device, the communication device comprising a processor.
- the processor calls a computer program or instruction in a memory, any method of the first aspect is implemented, or any method of the second aspect is implemented.
- 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;
- the interface is used to input data to be processed, and the logic circuit processes the data to be processed according to any method of the first aspect or any method of the second aspect to obtain processed data.
- the interface is also used to output the processed data.
- 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.
- an embodiment of the present application provides a computer program product, and when the instruction or computer program is executed, it implements any method of the first aspect, or implements any method of the second aspect.
- an embodiment of the present application provides a terminal, which includes the communication device of any one of aspects 3 to 5. Further, the terminal can be an intelligent terminal or a transportation tool such as a vehicle, a drone, or a robot.
- an embodiment of the present application provides a communication system, the communication system comprising a first node and a second node, wherein the first node is used to implement any method of the first aspect; and the second node is used to implement any method of the second aspect.
- FIG1 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application.
- FIG2 is a flow chart of a communication method provided in an embodiment of the present application.
- FIG3 is a schematic diagram of an association process without a security context
- FIG4 is a schematic diagram of an association process with a security context
- FIG5 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG6 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG7 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG8 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG9 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG10 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG11 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG12 is a flow chart of another communication method provided in an embodiment of the present application.
- FIG13 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application.
- FIG14 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application.
- a node is a device with communication capabilities, including but not limited to one or more of user equipment, network equipment, industrial equipment, etc.
- user devices include handheld terminals, wearable terminals, transportation tools, vehicle-mounted 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.
- Transportation tools 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.), etc.
- Vehicle-mounted devices include but are not limited to domain controllers (DC), screens, microphones, speakers, electronic keys, keyless entry, start system controllers, battery management systems (BMS), battery packs, or batteries, 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 equipment or 4D theater cabins, etc.
- VR virtual reality
- MR mixed reality
- Network equipment includes but is not limited to routers, switches, or base stations, etc.
- Industrial equipment such as industrial robots or robotic arms, etc.
- nodes in the embodiments of the present application can be applied to various scenarios such as smart cars, smart homes, smart terminals, smart manufacturing, or smart exhibition halls.
- devices with similar communication capabilities may not be called nodes, but for the convenience of description, in the embodiments of the present application, devices with communication capabilities are collectively referred to as nodes.
- the communication method, communication device, communication system or node of the embodiments of the present application are applicable to a variety of networks, for example, a network including a wired communication network, a wireless communication network, or a combination of wired communication and wireless communication.
- the wireless communication network includes 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 system, etc., or, it can also be a long-distance connection technology including communication technology based on Long Term Evolution (Long Term Evolution), fifth-generation mobile communication technology (5th generation mobile networks or 5th generation wireless systems, 5th-Generation, referred to as 5G or 5G technology), global system for mobile communications (global System for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), universal mobile telecommunications system (universal mobile telecommunications system, UMTS) and other wireless access type technologies.
- SparkLink or NearLink
- 802.11b/g Bluetooth
- Zigbee radio frequency identification
- RFID ultra-wideband
- wireless short-range communication system etc.
- it can also be a long-distance connection technology including communication technology based on Long
- 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.
- CAN controller area network
- LIN local interconnect network bus
- CAN FD CAN flexible data rate
- vehicle-mounted Ethernet 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.
- FIG. 1 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 .
- 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 through short-range wireless communication technology (described below).
- the first node 101 and the second node 102 can establish a connection (as shown in Figure 1, the two are connected with a solid line), and the communication connection here includes a direct connection, a connection through an intermediate node (such as a control node), etc.
- the connection between any two nodes can be wired, wireless, or a combination.
- the connection may include a connection between peer entities of some layers in the node, such as an access layer connection.
- the first node 101 belongs to the first network 103.
- 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.
- a message of a node can be transmitted to another node in the network.
- the security protection parameter includes 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.
- the security protection parameter includes the network key of the first network
- a new node e.g., a second node
- 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.
- the first node can configure the network key of the first network for the second node.
- the first node can send the security protection parameters (such as keys, 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.
- the security protection parameter as a network key
- 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.
- 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.
- the first node 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.
- a verification value needs to be generated first when verifying information, and 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, the present application can obtain the algorithm used for verification through negotiation between the first node and the second node, so that it can adapt to the situation where nodes with different security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the inclusiveness of the network.
- FIG. 2 is a flow chart of a communication method provided by an embodiment of the present application.
- the method can be implemented based on the communication system shown in FIG. 1.
- the communication method shown in FIG. 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 made in the order of S201 to S204, and it is not intended to limit the description to be carried out in the above order. Execution. The present application embodiment does not limit the execution order, execution time, execution times, etc. of the above one or more steps. Steps S201 to S204 are as follows:
- Step S201 a first node sends a topology configuration message to a second node.
- the second node may receive a topology configuration message from the first node.
- the first network includes the first node.
- the first node may obtain information about the first network.
- the topology configuration message includes information of the first network.
- the information of the first network may include one or more of an identifier of the security algorithm of the first network, an identifier (identify, 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 authentication encryption algorithm, etc.
- the first network includes a first node, or the first node can obtain information of the first network.
- the information of the security algorithm of the first network may not be carried in the topology configuration message.
- the information of the security algorithm of the first network may also be carried in the second message below, the network key configuration message, etc.
- the identifier of the security algorithm 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.
- the security algorithm includes a first encryption algorithm and/or a first integrity protection algorithm.
- the security algorithm includes a first authentication encryption algorithm.
- 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 a possible security algorithm.
- the encryption algorithm may include 4 types, each of which corresponds to a 4-bit data.
- the names of the algorithms 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" has a corresponding value of 0000, and the rest of the cases are shown in Table 1.
- ENC0 the names of the algorithms
- ENC1, ENC2, and ENC adaptive design may be performed according to the supported algorithms during the specific implementation process
- the algorithm named "ENC0" has a corresponding value of 0000, and the rest of the cases are shown in Table 1.
- Table 1 as an example, when the value of the first field is 0000, 0000 can be regarded as the identifier of the security
- the first field may include multiple fields, for example, field 1 and field 2.
- Field 1 is used to indicate an encryption algorithm
- field 2 is used to indicate an integrity protection algorithm.
- the security algorithm of the first network includes an encryption algorithm with an algorithm name of "ENC0" and an integrity protection algorithm with an algorithm name of "INT1".
- the security algorithm of the first network includes an authentication encryption algorithm with the algorithm name "AUTH1".
- the identifier of the security algorithm of the first network may be included in the topology configuration message.
- the present application is also applicable to the case where the identifier is sent through other messages.
- the security algorithm of the first network is pre-configured in the first node, for example, configured in the first node by a management node or a control node.
- the first network may be created by a 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 access device.
- the management node may be the first node.
- the first node applying to join the first network may be the second node herein.
- the security algorithm of the first network is obtained through negotiation between the first node and the second node.
- the aforementioned communication method also 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.
- 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 negotiation algorithm as an example.
- the second node may also select the security algorithm of the first network based on the security capability information of the first node.
- the above 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.
- 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 of the first network.
- 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).
- the first node and the second node negotiate the session security key of the first network.
- the method shown in Figure 2 can be implemented when the second node supports the security algorithm of the first network.
- 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 capability of the second node.
- the second node if the second node does not support the security algorithm of the first network, the second node can choose to end the process of joining the first network, or not to join the first network. Further, the first node can also be indicated to the first node that joining the first network failed, such as sending an indication code of 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 check 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 checks whether it supports the security algorithm of the first network.
- the current process of joining the first network is terminated, for example, a message related to joining the first network can be transmitted (such as sending and/or receiving) with the first node.
- a message related to joining the first network can be transmitted (such as sending and/or receiving) with the first node.
- the second node can determine whether it supports the security algorithm of the first network after receiving the topology configuration message. If supported, then continue to execute some or all of the subsequent steps S202-step S204, otherwise the process can be terminated, that is, some or all of the steps in step S202-step S204 are not executed.
- the first node may receive security capability information from the second node, and the security capability information of the second node indicates the security algorithm supported by the second node.
- the security capability information of the second node indicates the security algorithm supported by the second node.
- a second message may be sent to the second node, and the second message indicates that joining the first network failed.
- the process of joining the second node to the first network may be terminated, for example, messages related to joining the first network may not be transmitted (such as sending and/or receiving) with the second node.
- 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.
- the topology configuration message may not be sent by the first node to the second node in a point-to-point manner.
- the first node may send the topology configuration message by broadcast or multicast, and when the second node is within the range that can receive the topology configuration message, the topology configuration message can be regarded as sent to the second node.
- Step S202 The first node and the second node negotiate to determine a first KDF.
- KDF can derive another piece of information based on one piece of information.
- KDF can receive a key (or other weak key material) as input and output secure key material through a special function.
- KDF usually adds parameters as encryption factors, which are called salts.
- KDF can be implemented through hash functions, such as SHA1, SHA256, SHA512 and other functions.
- 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.
- KDF may include 4 types, and the 4 types of KDF are exemplarily called KDF0, KDF1, KDF2 and KDF3, and their corresponding values may be shown in Table 2.
- the first KDF is a KDF supported by the second node.
- the first node may select a first KDF from the KDFs supported by the second node and indicate the selected first KDF to the second node. For example, the first node receives the KDF capability of the second node from the second node, and the KDF capability of the second node indicates the KDF supported by the second node. After the first node determines the first KDF, it sends the indication information of the first KDF to the second node.
- the KDF capability information of the second node may indicate that the second node supports three KDFs, namely KDF0, KDF1, and KDF2.
- the KDF capability information of the second node includes "KDF0, KDF1, KDF2", or includes "0000, 0001, 0010".
- the first node may select one (or more) of KDF0, KDF1, and KDF2 supported by the second node as the KDF used for subsequent verification, i.e., the first KDF.
- the names, identifiers, and numbers of KDFs here are only examples.
- the first node may select the KDF with the highest priority from the KDFs supported by the second node as the first KDF.
- the first KDF may also be a KDF supported by the first node. Since the information needs to be verified by KDF later, the first node also needs to support the KDF to verify the first information or generate a verification value of the first information.
- the first KDF is the KDF with the highest priority among the KDFs supported by both the first node and the second node.
- the first node supports four KDFs, namely KDF0, KDF1, KDF2, and KDF3.
- the first node can select one (or more) from KDF0, KDF1, and KDF2 supported by the first node and the second node as the KDF used for subsequent verification, namely the first KDF.
- the KDF capability of the second node is carried in the message sent by the second node to the first node, so as to facilitate the distinction of the message called the first message.
- the indication information of the first KDF is carried in the message sent by the first node to the second node, so as to facilitate the distinction of the message called the second message.
- the first message and the second message are messages at the network layer, and the first message and the second message can be encapsulated in the next layer entity when transmitted.
- the first message and the second message can be information transmitted by the first node and the second node when establishing a network layer connection.
- 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.
- 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.
- the first node can indicate to the second node that it supports four KDFs, namely KDF0, KDF1, KDF2 and KDF3, and 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, namely the first KDF.
- the selected KDF can also be supported by the second node.
- the second node can select the KDF with the highest priority as the first KDF from the KDFs supported by both the first node and the second node.
- the first node or the second node may end the process, for example, not execute subsequent processes, discard received messages, disconnect the link, etc.
- Step S203 The first node and the second node verify the first information through the first KDF.
- the first information may include information transmitted by the first node and the second node, such as information contained in a topology configuration message and/or one or more information mentioned in this article that is transmitted before performing the verification action.
- the first information may include all the information in the transmitted message, or may only include part of the information in the transmitted message.
- the topology configuration message may contain multiple pieces of information.
- 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.
- all the messages in the topology configuration message may be verified during verification, or it may be called verifying the information contained in the entire topology configuration message.
- the first information may also include parameters and keys predetermined between the first node and the second node.
- the first information may include one or more of the first key, an encryption key derived based on the first key, an authentication encryption key derived based on the first key, an integrity protection key derived based on the first key, or the first parameter.
- the first node or the second node continues to execute the addition of the second node to the first network.
- the first node or the second node may interrupt or end the process of adding the second node to the first network, for example, not executing step S204.
- 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.
- 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.
- the session security key i.e., one or more of the encryption key, the integrity key, and the authentication encryption key
- 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 also be fixed or may change.
- the first key is a key pre-shared by the first node and the second node, such as a negotiated key, or a pre-set key, or a key derived from 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 negotiation algorithm (optional), a selected KDF (regarded as indication information of the first KDF), etc.
- 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. Further, 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 whether the first test value is the same as the first verification value. If they are the same, it indicates that the verification of the first verification value is successful, otherwise it indicates that the verification fails.
- first verification value KDF (DH key, second message content, topology configuration message content).
- KDF is the KDF determined by negotiation between 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)
- the second message content first random number
- topology configuration message content encryption algorithm
- " represents information connection or splicing. For example, if the first random number is 0x111111111 and the first public key is 0x00000000, then the first random number
- the second node can generate a 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, and send the first verification value to the first node. Further, the first node can verify the first verification value based on the same parameters and the first KDF.
- first verification value KDF (ZERO, second message content, topology configuration message content).
- KDF is the KDF determined by negotiation between the first node and the second node
- ZERO represents N bits of 0, for example, 128 bits of all
- the second message content the selected key derivation function
- the topology configuration message content encryption algorithm
- the parameters involved in generating the first verification value may be more or fewer.
- the content of the second message can be obtained by splicing only part of the information in the second message.
- the aforementioned first public key, the selected key negotiation algorithm, etc. refer to information in the key negotiation scenario.
- the first node and the second node do not negotiate a key, then the first public key, the selected key negotiation algorithm and other parameters do not participate in generating the first verification value.
- first verification value KDF (DH key, second message content).
- KDF may also receive an algorithm indication to indicate which function is used internally.
- representation method for example, KDF() is used to represent the KDF algorithm
- the first verification value is carried in a third message sent by the second node to the first node. Further, the third message is later than the first message.
- the first random number may be carried in a message sent by the first node to the second node, such as the second message, which is earlier than the third message.
- 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 is verified by the second node.
- the second verification value is related to the first KDF, and one or more of the following information: the first parameter, the first key, the information included in the first message, the information included in the second message, the information included in the third message, and the information included in the topology configuration message.
- the first message may include one or more of KDF capability, key agreement algorithm capability, etc.
- the third message may include one or more of the second public key, the second random number, the first verification value, etc.
- 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 whether the second test value 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.
- KDF is the KDF determined by negotiation between the first node and the second node
- DH key represents a key predetermined between the first node and the second node (regarded as the first key)
- the third message content second random number
- the first message content key negotiation algorithm capability
- topology configuration message content encryption algorithm
- the first node can generate a second verification value based on the first KDF, the first parameter, 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. Further, the second node can verify the first verification value based on the same parameters and the first KDF.
- KDF is the KDF determined by negotiation between the first node and the second node
- ZERO represents N bits of 0, for example, 128 bits of all 0,
- the third message content the second random number
- the first verification value, the first message content the key negotiation algorithm capability
- the key derivation function capability, and the topology configuration message content the encryption algorithm
- the parameters involved in generating the second verification value may be more or less.
- the process in which the first node and the second node verify the first information through the first KDF is securely protected in order to further improve security.
- the aforementioned first verification value and/or second verification value can be securely protected.
- the first verification value is encrypted during transmission, for example, the message carrying the first verification value is encrypted at the access layer, and in another example, the first verification value (or the message carrying the first verification value) can be encrypted by a key to form a ciphertext, and the second node can send the first ciphertext.
- the parameters involved in generating the first verification value include a key, so that the first verification value is not easily cracked.
- Step S204 The first node encrypts and sends the network key of the first network to the second node.
- the second node receives the network key of the first network from the first node.
- encrypting the network key NetKey of the first network may also be implemented in the following manner: NetKey is carried in a message, and the first node encrypts the entire message using the encryption key.
- the network key of the first network is used to securely protect messages between nodes in the first network, for example, for one or more of encryption, integrity, or authenticated encryption. This includes being directly used for encryption, integrity, or authenticated encryption, etc., or first deriving an encryption key, integrity key, or authenticated encryption key based on the network key of the first network, and then using these derived keys to securely protect the message.
- Kenc KDF (NetKey, algorithm identifier, "enc”)
- NetKey is the network key of the first network
- algorithm identifier is used to indicate the KDF algorithm used for derivation
- enc can be regarded as the salt of KDF, which is related to the encryption key, so that the opposite device can also derive a consistent encryption key based on the same salt.
- the first node may also send the ID of the network key of the first network to the second node.
- the network key of the first network may be a number, a string, etc.
- the ID of the network key of the first network may be derived based on the network key of the first network.
- 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.
- the first node and the second node may perform security protection on the network layer of the first node and the second node through the network key of the first network.
- Implementation method 1 When the access layer encrypts the message, the first node encrypts and sends the network key of the first network through the encryption mechanism of the access layer. Specifically, the first node sends a fourth message to the second node, and the fourth message includes 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 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. Correspondingly, 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.
- the first node and the second node may encrypt the network key of the first network by using a key shared in advance (for example, before transmitting the key) to obtain a ciphertext.
- the first node sends the ciphertext of the network key of the first network to the second node.
- the second node may obtain the ciphertext and decrypt the ciphertext based on the shared key to obtain the network key of the first network.
- the above two encrypted transmission methods are only examples, and other methods that can encrypt and send the network key of the first network may be included in the specific implementation process.
- the above two methods can also be combined without being mutually exclusive.
- the network key of the first network is encrypted by the key to obtain a ciphertext, thereby realizing encrypted transmission of the network key of the first network.
- a key is exchanged based on a key negotiation algorithm, and the network key of the first network is encrypted based on the key (directly or indirectly).
- the access layer connection is enabled, the network key of the first network is encrypted and sent through the encryption mechanism of the access layer.
- the shared key may be a key obtained by negotiation between the first node and the second node, or the shared key may be a key derived based on the key obtained by negotiation between the first node and the second node.
- the following first introduces the process of the first node and the second node negotiating to obtain a key.
- the first node can negotiate with the second node to determine the first key based on the first key negotiation algorithm.
- the first key is used to securely protect information transmitted between the first node and the second node.
- the first key can be directly used to encrypt information during the communication process.
- the first key can be used to derive other keys, and the derived keys can be used to encrypt information during the communication process.
- 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.
- the DHkey determined by the two are consistent.
- 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.
- 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.
- DHkey is used to derive other keys, including but not limited to encryption keys, integrity protection keys, integrity protection keys, etc.
- encryption key KDF (DHkey, algorithm identifier, encryption key identifier), wherein the algorithm identifier is used to indicate which algorithm is used in 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”.
- 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”.
- the encryption key can be used to encrypt the network key of the first network.
- the message carrying the network key of the first network can also be integrity protected by the security key.
- the authentication encryption key can be used to encrypt the network key of the first network and simultaneously protect the network key of the first network.
- the first key agreement algorithm used by the first node and the second node in the key agreement DHkey process may also be obtained through negotiation. Two methods for determining the first key agreement algorithm are listed below:
- Method 1 The first node informs the second node of the key negotiation algorithm it supports, and the first node selects the key used for negotiating the key.
- Negotiation algorithm that is, determining the first key negotiation algorithm.
- the first node sends the key negotiation algorithm capability of the first node to the second node, and the key negotiation algorithm capability of the first node is used to indicate the key negotiation algorithm supported by the first node.
- the first node receives the indication information of the first key negotiation algorithm sent by the second node.
- the second node can select one (or more) from the three key negotiation algorithms KE0, KE1, and KE2 that are commonly supported by both nodes as the first key negotiation algorithm.
- the message transmitted for negotiating the key negotiation algorithm may be the same message as the message carrying other parameters, which can save signaling overhead.
- the key negotiation algorithm capability of the second node is included in the first message, and the indication information of the first key negotiation algorithm is included in the second message.
- Method 2 The second node informs the first node of the key negotiation algorithms it supports, and the second node selects the key negotiation algorithm used to negotiate the key. Specifically, the second node sends the first node's key negotiation algorithm capability to the first node, and the second node's key negotiation algorithm capability is used to indicate the key negotiation algorithms supported by the second node. The second node receives the indication information of the first key negotiation algorithm sent by the first node. Combined with Table 4, the second node can select one (or more) of the three key negotiation algorithms KE0, KE1, and KE2 that are commonly supported by both nodes as the first key negotiation algorithm.
- the first node may receive a request message from the second node, the request message being used to indicate a request for 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.
- the second node may send a network key configuration completion message to the first node to indicate that the key configuration is complete. Further, the first node and the second node may start a wireless neighbor protocol.
- the first node already in the first network can send the network key of the first network to the second node in an encrypted form, so that the network key is securely distributed.
- the second node can also use the network key to securely transmit information in the first network.
- the first node may send a topology configuration message to the second node.
- the information of the first network carried in the topology configuration message mainly includes some attribute information of the network.
- the first node and the second node can negotiate to obtain the KDF, and verify based on the KDF that the information contained in the topology configuration message has not been tampered with, thereby determining that the communication environment of the first node and the second node is secure.
- the first node and the second node negotiate to obtain the first KDF, which can adapt to the situation where nodes with various security capabilities join the network, so that the network can be applied to scenarios with various types of devices, thereby improving the inclusiveness of the network.
- access layer connection Two signaling processes for establishing access layer connection are introduced below.
- the process of establishing access layer connection can also be called access process or association process.
- association refers to the process in which two nodes obtain consistent communication keys and establish a connection.
- the following is an introduction to the process of terminal node accessing the management node as an example, where the management node is the first node or the second node, and correspondingly, the terminal node can be the second node or the first node.
- FIG 3 is a schematic diagram of an association process without a security context, including authentication and security context processes.
- the messages (or information) exchanged during the association process are represented as T1-T5.
- T1-T5 the messages (or information) exchanged during the association process are represented as T1-T5.
- 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.
- the management node can determine the second key (such as the key K KE ), the third fresh parameter, and the fourth fresh parameter.
- the management node can derive a session key based on the second key (or the first key) for security protection of the message.
- the management node provides the second key negotiation parameter and the fourth fresh parameter to the terminal node through a message T2, and the optional 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 manner.
- the terminal node also derives a session key based on the second key (or the first key) to protect the subsequent messages.
- the terminal node and the management node negotiate to obtain a consistent key.
- the terminal node can further generate a second authentication information and send it to the management node in a message T3.
- 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 optional terminal node responds with a message T5, indicating that the association is complete.
- the association process may exchange more messages, or the message may carry more or fewer parameters.
- the third fresh parameter and the fourth fresh parameter may not be carried, and the second key may be obtained according to the first key and the counter when the second key is obtained.
- the first authentication information or the second authentication information may not be carried.
- the message T1 may optionally carry one or more of the security capabilities of the terminal node (used to indicate the security algorithm supported by the terminal node), the indication information of the key negotiation algorithm, etc.
- the 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 the indication information of the security algorithm.
- the message T4 may also carry one or more of 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.
- the management node may also carry one or more of 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 the message T4.
- the aforementioned security context refers to a set of information including parameters related to communication security, such as one or more of a key, a freshness parameter, a key negotiation parameter, information about a security algorithm, an identity of a terminal, etc.
- the information about a security algorithm includes one or more of indication information of a security algorithm, a version of a security algorithm, etc.
- 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), a 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 GK (GK ID), a group algorithm (G
- FIG 4 is a schematic diagram of an association process with a security context.
- the messages (or information) are represented as T6-T8 below.
- the management node obtains the security context of the terminal node. The content of the association context can be found above.
- 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.
- the message T7 can be integrity protected by an integrity protection key.
- the management node obtains the shared integrity protection key with the terminal node according to the identity of the terminal node, and checks the integrity of the association message according to the integrity protection key. If the management node successfully checks the integrity of the association request message, it sends message T7, and an association is established between the management node and the terminal node. Optionally, if the management node successfully checks the integrity of the association request message, the management node can also assign a temporary ID to the terminal node. In this case, the temporary ID assigned by the management node to the terminal node can be carried in message T7.
- the integrity protection key may be included in the security context, and the aforementioned "checking the integrity of the associated message according to the integrity protection key” may also be replaced by "checking the integrity of the associated message according to the security context".
- the security context may include indication information of the integrity protection algorithm and the integrity protection key, and the management node may check the integrity of the message T6 by using the integrity protection key and the specified integrity protection algorithm.
- the integrity protection key here may be the integrity protection algorithm of the signaling plane.
- the management node uses the integrity protection algorithm of the signaling plane and the signaling plane integrity protection key Ks.int to perform integrity protection on message T7.
- the management node may also use the encryption algorithm of the signaling plane and the encryption key Ks.enc of the signaling plane to perform encryption protection on message T7.
- the optional terminal node responds with message T8, indicating that the association is complete.
- message T7 is encrypted
- the terminal node decrypts message T7.
- message T7 is integrity protected
- the terminal node verifies the integrity of message T7. If the integrity verification passes, the association is complete and the terminal node can send message T8 to the management node.
- FIG. 2 provides a variety of possible solutions.
- the following is an exemplary description of some of the possible designs in conjunction with FIG. 5, FIG. 6, FIG. 7, FIG. 8, or FIG. 9.
- the logic, terminology, etc. in the embodiments shown in FIG. 5, FIG. 6, FIG. 7, FIG. 8, or FIG. 9 can refer to the above.
- the information indicated by the message is schematically described in the accompanying drawings by brackets, but this does not represent a strict limitation on the content of the message.
- the first node is a node that is already in the first network, and is referred to as an in-network device in some schemes.
- the second node is a node that needs to join the first network, and is referred to as a networked device in some scenarios.
- the first network can be a mesh network.
- the present application is also applicable to the case where the first network is a network of other topology types.
- the first node implements encryption of the network key through an encryption mechanism of the access layer when sending the network key.
- the communication method may include step S502, step S504 and step S505, and may further include step S501 and/or step S503. Steps S501 to S502 are as follows:
- Step S501 The first node sends a topology configuration message.
- the second node may receive the topology configuration message from the first node.
- the topology configuration message may include information of the first network.
- the topology configuration message may include information of the first network.
- the topology configuration information may also be used to indicate a security algorithm used by the first network.
- the topology configuration message includes an encryption algorithm and an integrity protection algorithm used by the first network.
- the topology configuration message includes an authentication encryption algorithm used by the first network.
- Step S502 The first node establishes an access layer connection with the second node.
- first node and the second node are connected through the process shown in FIG. 3 or FIG. 4 , and encryption may be enabled for the access layer connection between the first node and the second node.
- Step S503 The second node sends a key request message to the first node.
- the first node receives the key request message from the second node.
- the key request message includes indication information indicating the network key of the first network.
- Step S504 The first node sends the network key of the first network to the second node.
- the second node receives the network key of the first network.
- 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.
- the first node determines a first network that the first node joins, and determines a network key of the first network.
- 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.
- 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 security protection of the network layer, thereby improving the security of information transmitted between nodes at the network layer.
- the first node and the second node may negotiate to obtain a first key, and derive an encryption key based on the first key.
- the first node may use the encryption key to encrypt the network key.
- the second node may decrypt the network key using the encryption key.
- FIG. 6 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 S509 are as follows:
- Step S601 The first node sends a topology configuration message, and correspondingly, the second node receives the topology configuration message.
- Step S602 The first node establishes an access layer connection with the second node.
- the access layer connection between the first node and the second node may be encrypted, which can further improve the security of network key distribution.
- the access layer connection between the first node and the second node is not encrypted, in which case the first node can subsequently encrypt and send the network key using an encryption key derived from the first key.
- Step S603 The first node sends the first public key to the second node.
- the second node receives the first public key from the first node.
- the first node generates a first private key, and generates a corresponding first public key according to a first key agreement algorithm and sends it to the second node.
- the first key agreement algorithm may be selected by the first node or the second node.
- Step S604 The second node sends the second public key to the first node.
- the first node receives the second public key from the second node.
- 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.
- Step S605 The first node determines the first key.
- the first node determines the first key according to the first private key, the second public key, and a first key negotiation algorithm.
- Step S606 The second node determines the first key.
- the second node determines the first key according to the first private key, the second public key, and the first key negotiation algorithm.
- Step S607 The first node determines an encryption key according to the first key.
- the first node derives other keys, such as an encryption key, based on the first key. Furthermore, the first node may also derive a security key based on the first key.
- Step S608 The second node determines an encryption key according to the first key.
- Step S609 The second node sends a key request message to the first node.
- the first node receives the key request message from the second node. information.
- Step S610 The first node sends the network key of the first network to the second node.
- the first node determines a network key NetKey of a first network that the first node joins, and when sending the network key of the first network, encrypts and sends it using an encryption key.
- the first node can encrypt the network key NetKey of the first network with the encryption key, obtain the ciphertext of NetKey and send it to the second node.
- the second node can decrypt the ciphertext with the encryption key to obtain the network key NetKey of the first network.
- encrypting the network key NetKey of the first network may also be achieved in the following manner: NetKey is carried in the fourth message, and the first node encrypts the fourth message using the encryption key.
- 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.
- the first node and the second node negotiate to obtain the first key, and derive the encryption key based on the first key, thereby secretly transmitting the network key of the first network, thereby improving the privacy of the network key of the first network.
- the network key of the first network is used for security protection of the network layer, thereby improving the information security of the network layer transmission between nodes.
- 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.
- the first node may verify the information shared by 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 to enhance the privacy of the network key of the first network and enhance the communication security of the nodes.
- the information shared by 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 to enhance the privacy of the network key of the first network and enhance the communication security of the nodes.
- Step 7 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 step S701-step S716. It should be understood that the following is only described exemplarily by taking the step sequence of S701-S716 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S701-step S716 are as follows:
- Step S701 The first node sends a topology configuration message.
- the first node may carry information indicating the security algorithm used by the first network in the topology configuration message.
- the topology configuration message includes the encryption algorithm and integrity protection algorithm used by the first network.
- the topology configuration message includes the authentication encryption algorithm used by the first network.
- a 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.
- the first node sends a topology configuration message
- the second node can receive the topology configuration message from the first node.
- Step S702 The second node determines whether it supports the security algorithm of the first network.
- the security algorithm of the first network is the security algorithm indicated by the first node in the topology configuration message.
- 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.
- Step S703 The first node establishes an access layer connection with the second node.
- the first node and the second node are connected through the process shown in FIG. 3 or FIG. 4 .
- the access layer connection between the first node and the second node may be encrypted, which can further improve the security of network key distribution.
- the access layer connection between the first node and the second node is not encrypted, in which case the first node can subsequently encrypt and send the network key using an encryption key derived from the first key.
- Step S704 the second node sends a first message to the first node.
- 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.
- the names of the messages in this article are only used to distinguish different messages, and in the specific implementation process, the names of the messages may have other designs.
- the first message may be called a security request message, or the first message may be a handshake message or a hello message of a network layer connection.
- the second node sends the first message to the first node, and correspondingly, the first node receives the first message from the second node.
- the first node selects the key agreement algorithm and key derivation function with the highest priority according to the key agreement algorithm capability and key derivation function capability of the second node.
- 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.
- the first node may generate a first private key, and generate a first public key according to a selected key agreement algorithm.
- the first node may also generate a first random number.
- Step S705 The first node sends a second message to the second node.
- the second message carries the first public key, and the second message is also used to indicate the key agreement algorithm selected by the first node and the key derivation function selected by the first node.
- the name of the second message can have other designs, for example, the first message can be called a security response message, or the second message can be a handshake message or a hello message of a network layer connection.
- the first random number is carried in the second message and sent to the second node.
- 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.
- Step S706 The second node determines the first key.
- the second node may generate a second private key, and based on the key negotiation algorithm selected by the first node, calculate the first key according to the second private key and the first public key.
- the first key may also be referred to as a negotiation key, DH key, etc.
- Step S707 The second node determines the first verification value.
- the first verification value KDF (DH key, second message content, topology configuration message content).
- DH key is the first key determined in step S506
- the KDF used to generate the first verification value is the KDF selected by the first node.
- 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.
- 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
- 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.
- the first verification value KDF (DH key, first random number, topology configuration message content).
- the third message carries the second public key and the first verification value.
- the second public key may be determined by the second node according to the second private key. Specifically, the second node generates the second private key and generates the corresponding second public key according to the selected key agreement algorithm. Furthermore, the second node also generates a second random number, which is carried in the third message and sent to the second node.
- 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.
- 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.
- the first node can verify the first verification value. Further, if the first node successfully verifies the first verification value, a subsequent process is performed, such as continuing to execute step S709 and some or all of the subsequent steps, otherwise the process ends.
- Step S709 The first node determines the first key.
- 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.
- Step S710 The first node determines a second verification value.
- the second verification value KDF (DH key, third message content, second message content, topology configuration message content).
- DH key is the first key determined in step S709
- the KDF used to generate the first verification value is the KDF selected by the first node.
- 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.
- 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 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.
- the first verification value KDF (DH key, second random number, topology configuration message content).
- Step S711 the first node sends a fifth message to the second node.
- the fifth message carries the second verification value.
- Step S712 The first node determines the encryption key using the first key.
- the first node may also derive an integrity protection key or an authentication encryption key based on the first key.
- Step S713 The second node determines the encryption key through the first key.
- the first node derives an encryption key based on the first key.
- the first node may also derive an integrity protection key or an authentication encryption key based on the first key.
- Step S714 The second node sends a key request message to the first node.
- the first node receives the key request message from the second node.
- Step S715 The first node sends a network key configuration message to the second node.
- the network key configuration message includes the network key of the first network.
- the network key configuration message may also include the network key of the first network.
- the fifth message may be a network key configuration message, or a network key configuration message encapsulated at the access layer.
- the first node determines a network key NetKey of a first network joined by the first node, carries the NetKey in a key configuration message and sends it to the second node.
- 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.
- the second node may decrypt the ciphertext using the encryption key to obtain the network key NetKey of the first network.
- 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.
- 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.
- 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.
- 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.
- first node and the second node may start a wireless neighbor protocol.
- the first node negotiates with the second node on a key negotiation algorithm and a key derivation function.
- the key negotiation algorithm is used to determine the first key
- the first key is used to securely protect the information transmitted between the two.
- the key derivation function is used to verify the information transmitted by the two to ensure that the transmitted information is not tampered with.
- the first node can distribute the network key of the first network in a relatively safe environment, thereby improving network security.
- the network's capacity to accommodate various types of nodes is improved, thereby improving network availability.
- Step 8 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 step S801-step S813. It should be understood that the following is only described exemplarily by taking the step sequence of S801-S813 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S801-step S813 are as follows:
- Step S801 The first node sends a topology configuration message.
- the second node may receive the topology configuration message from the first node.
- Step S802 The second node determines whether it supports the security algorithm of the first network.
- Step S803 The first node and the second node establish an access layer connection.
- Step S804 the second node sends a first message to the first node.
- the first node receives the first message.
- the first message carries the key negotiation algorithm capability.
- Step S805 The first node sends a second message to the second node.
- the second node receives the second message.
- the second message carries the first public key, and the second message is also used to indicate the key agreement algorithm selected by the first node.
- the second message also carries the first random number.
- Step S806 The second node determines the first key.
- Step S807 The second node sends a third message to the first node.
- the first node receives the third message.
- the third message carries the second public key. Furthermore, the third message also carries the second random number.
- Step S808 The first node determines the first key.
- Step S809 The second node determines the encryption key using the first key.
- Step S810 The first node determines the encryption key through the first key.
- Step S811 The second node sends a key request message to the first node.
- the first node receives the key request message.
- Step S812 The first node sends the network key of the first network to the second node.
- the encryption key is used to encrypt and send it.
- 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.
- the first node and the second node can determine the key negotiation algorithm through negotiation, and determine the first key based on the key negotiation algorithm, and the first key is used to securely protect the information transmitted between the two nodes. If the parameters transmitted by the first node and the second node during the key negotiation process have not been tampered with, the second node and the first node can determine a consistent first key, so that the second node can decrypt the ciphertext to 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 safe environment, thereby improving network security. Moreover, by negotiating the key negotiation algorithm, the network's capacity to accommodate various types of nodes is improved, and the network availability is improved.
- FIG. 9 is a flowchart of another communication method provided in an embodiment of the present application.
- the communication method may include some or all of the steps in step S901 to step S916. It should be understood that the following description is only based on the sequence of steps S901 to S916. During the implementation process, the timing of executing some steps can be changed. Steps S901 to S916 are as follows:
- Step S901 The first node sends a topology configuration message.
- the second node may receive the topology configuration message from the first node.
- the topology configuration message may include information of the first network and the key negotiation algorithm capability of the first node.
- Step S902 The second node determines whether it supports the security algorithm of the first network. For related description, see step S702.
- Step S903 The first node establishes an access layer connection with the second node. For related description, see step S703.
- Step S904 the second node sends a first message to the first node.
- the first node can receive the first message from the second node.
- 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 itself.
- the first message also carries a second random number.
- Step S905 The first node sends a second message to the second node.
- the second node can receive the second message from the first node.
- 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.
- Step S906 The second node determines the first key.
- 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.
- Step S907 The first node determines the first key.
- 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.
- Step S908 The second node determines the first verification value.
- the first verification value KDF (DH key, second message content, topology configuration message content).
- DH key is the first key determined in step S906
- the KDF used to generate the first verification value is the KDF selected by the second node.
- the first verification value KDF (DH key, first random number, topology configuration message content).
- KDF DH key, first random number, topology configuration message content
- Step S909 the second node sends a third message to the first node.
- the third message carries the first verification value. For related description, see step S508.
- Step S910 The first node determines a second verification value.
- the second verification value KDF (DH key, third message content, second message content, topology configuration message content).
- the first verification value KDF (DH key, second random number, topology configuration message content).
- Step S911 The first node sends a fifth message to the second node.
- the second node receives the fifth message from the first node.
- the fifth message carries the second verification value.
- Step S912 The first node determines the encryption key using the first key.
- Step S913 The second node determines the encryption key through the first key.
- Step S914 the second node sends a key request message to the first node.
- the first node receives the key request message.
- Step S915 The first node sends the network key of the first network to the second node.
- 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 before sending it.
- Step S916 Perform security protection on the network layer based on the network key of the first network.
- Step 10 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 step S1001-step S1011. It should be understood that the following is only described exemplarily by taking the step sequence of S1001-S1011 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S1001-step S1011 are as follows:
- Step S1001 A first node sends a topology configuration message.
- a second node may receive the topology configuration message from the first node.
- Step S1002 The second node determines whether it supports the security algorithm of the first network. For related description, see step S702.
- Step S1003 The first node establishes an access layer connection with the second node.
- the access layer connection encryption between the first node and the second node is turned on. For related description, see step S703.
- Step S1004 the second node sends a first message to the first node.
- the first node can receive the first message from the second node.
- the first message carries the KDF capability of the second node.
- the first message also carries a second random number.
- Step S1005 The first node sends a second message to the second node.
- the second node can receive the second message from the first node.
- 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.
- Step S1006 The second node determines the first verification value.
- the first verification value KDF (first parameter, second message content, topology configuration message content).
- the first parameter is a parameter defined in advance (for example, before generating the first verification value), for example, ZERO.
- the KDF used to generate the first verification value is the KDF selected by the second node.
- the first verification value KDF (first parameter, first random number, topology configuration message content).
- KDF first parameter, first random number, topology configuration message content
- Step S1007 the second node sends a third message to the first node.
- the third message carries the first verification value. For related description, see step S708.
- Step S1008 The first node verifies the first verification value.
- 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.
- Step S1009 the second node sends a key request message to the first node.
- the first node receives the key request message.
- Step S1010 The first node sends the network key of the first network to the second node.
- 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.
- 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.
- the first node secretly transmits the network key of the first network through the access layer encryption mechanism.
- the first node and the second node can negotiate to obtain the KDF, and verify based on the KDF that the information contained in the topology configuration message has not been tampered with, thereby determining that the communication environment of the first node and the second node is secure.
- the first node and the second node negotiate to obtain the first KDF, so that it can adapt to the situation where nodes with multiple different security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the inclusiveness of the network.
- Step 11 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 step S1101-step S1115. It should be understood that the following is only described exemplarily by taking the step sequence of S1101-S1115 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S1101-step S1115 are as follows:
- Step S1101 The first node sends a topology configuration message.
- the second node can receive the topology configuration message from the first node. See the description of step S701.
- Step S1102 The first node establishes an access layer connection with the second node.
- the access layer connection encryption between the first node and the second node is enabled. For related description, see step S703.
- Step S1103 The second node sends a first message to the first node.
- the first node can receive the first message from the second node.
- 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.
- the first message also carries a second random number.
- Step S1104 the first node sends a second message to the second node.
- the second node can receive the second message from the first node.
- 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.
- the first node selects the key derivation function with the highest priority and the key agreement algorithm with the highest priority according to the security algorithm capability of the networked device.
- the first node generates a first private key and determines a first public key according to the selected key agreement algorithm.
- the second message is also used to indicate a security algorithm of the first network.
- the second message also carries a first random number.
- the first node 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 carries a reason value.
- Step S1105 The second node determines the first key.
- 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 according to the second private key and the first public key.
- the first key may also be referred to as a network key, a DH key, etc.
- Step S1106 The second node determines the first verification value.
- the first verification value KDF (DH key, second message content, topology configuration message content).
- 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.
- the first verification value KDF (DH key, first random number, topology configuration message content).
- Step S1107 The second node sends a third message to the first node.
- the first node receives the third message from the first node.
- the third message carries the second public key and the first verification value.
- Step S1108 The first node determines the first key.
- Step S1109 The first node determines a second verification value.
- the second verification value KDF (DH key, third message content, second message content, topology configuration message content).
- DH key is the first key determined in step S1105
- the KDF used to generate the first verification value is the KDF selected by the first node.
- the first verification value KDF (DH key, second random number, topology configuration message content).
- Step S1110 The first node sends a fifth message to the second node.
- the second node receives the fifth message from the first node.
- the fifth message carries the second verification value.
- Step S1111 The first node determines the encryption key through the first key.
- Step S1112 The second node determines the encryption key through the first key.
- Step S1113 The second node sends a key request message to the first node.
- the first node receives the key request message.
- Step S1114 the first node sends the network key of the first network to the second node.
- the encryption key is used to encrypt and send it.
- 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.
- the first node negotiates with the second node on a key negotiation algorithm and a key derivation function.
- the key negotiation algorithm is used to determine the first key
- the first key is used to securely protect the information transmitted between the two.
- the key derivation function is used to verify the information transmitted by the two to ensure that the transmitted information is not tampered with.
- the first node can distribute the network key of the first network in a relatively safe environment, thereby improving network security.
- the network's capacity to accommodate various types of nodes is improved, thereby improving network availability.
- Step 12 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 step S1201-step S1210. It should be understood that the following is only described exemplarily by taking the step sequence of S1201-S1210 as an example. During the specific implementation process, the timing of executing some steps may be changed. Steps S1201-step S1210 are as follows:
- Step S1201 The first node sends a topology configuration message.
- the second node may receive the topology configuration message from the first node.
- Step S1202 The first node establishes an access layer connection with the second node.
- the access layer connection encryption between the first node and the second node is turned on. For related description, see step S703.
- Step S1203 The second node sends a first message to the first node.
- the first node can receive the first message from the second node.
- the first message carries the KDF capability of the second node.
- the first message also carries a second random number.
- Step S1204 the first node sends a second message to the second node.
- the second node can receive the second message from the first node.
- 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.
- Step S1205 The second node determines the first verification value.
- the first verification value KDF (first parameter, second message content, topology configuration message content).
- the first parameter is a parameter defined in advance (for example, before generating the first verification value), for example, ZERO.
- the KDF used to generate the first verification value is the KDF selected by the second node.
- the first verification value KDF (first parameter, first random number, topology configuration message content).
- KDF first parameter, first random number, topology configuration message content
- Step S1206 the second node sends a third message to the first node.
- the third message carries the first verification value. For related description, see step S708.
- Step S1207 The first node verifies the first verification value.
- 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.
- Step S1208 The second node sends a key request message to the first node.
- the first node receives the key request message.
- Step S1209 The first node sends the network key of the first network to the second node.
- 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.
- the first node secretly transmits the network key of the first network through the access layer encryption mechanism.
- the first node and the second node can negotiate to obtain the KDF, and verify based on the KDF that the information contained in the topology configuration message has not been tampered with, thereby determining that the communication environment of the first node and the second node is secure.
- the first node and the second node negotiate to obtain the first KDF, so that it can adapt to the situation where nodes with multiple different security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the inclusiveness of the network.
- the division of units in the device is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated.
- 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 instructions are stored in the memory.
- the processor calls the instructions stored in the memory to implement any of the above methods or to implement 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 inside the device or a memory outside the device.
- CPU central processing unit
- microprocessor a microprocessor
- the units in the device may be implemented in the form of hardware circuits, and the functions of some or all of the units may be implemented by designing the hardware circuits, and the hardware circuits may be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above units may be implemented by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit may be implemented by a programmable logic device (PLD), and a field programmable gate array (FPGA) may be used as an example, which may include a large number of logic gate circuits, and the connection relationship between the logic gate circuits may be configured by a configuration file, so as to implement the functions of some or all of the above units. All units of the above devices may be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.
- ASIC application-specific integrated circuit
- FPGA field programm
- the processor is a circuit with the ability to process signals.
- the processor can be a circuit with the ability to read and run instructions, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a microprocessor), or a digital signal processor (DSP); in another implementation, the processor can realize certain functions through the logical relationship of the hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as the processor is a hardware circuit implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as an FPGA.
- ASIC application-specific integrated circuit
- PLD programmable logic device
- the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units.
- 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.
- NPU neural network processing unit
- TPU tensor processing unit
- DPU deep learning processing unit
- 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.
- processors or processing circuits
- the units in the above device can be integrated together in whole or in part, 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).
- SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device.
- the type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
- the communication device 130 can be an independent device, such as a node.
- 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.
- the communication device is also used to implement the association process shown in Figure 3 or 4.
- the communication device 130 includes a communication unit 1301 and a processing unit 1302.
- the communication unit 1301 is used 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.
- the processing unit 1302 is used 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.
- 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.
- the communication unit 1301 is used to:
- topology configuration message Sending a topology configuration message to the second node, where the topology configuration message includes information about the first network
- the communication unit 1301 and the processing unit 1302 are used to verify the first information with the second node through the first KDF;
- the communication unit 1301 is also used to encrypt and send the network key of the first network to the second node when the first information is successfully verified.
- the network key of the first network is used to perform security protection on the first network, for example, the network key of the first network is used to perform security protection on the network layer between nodes in the first network.
- 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.
- the communication unit 1301 is further configured to send the ID of the network key of the first network to the second node.
- the information transmitted by the first node and the second node includes information included in a topology configuration message.
- 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 at least according to the first KDF and the information included in the topology configuration message.
- the first verification value is at least associated with the information included in the first KDF and the topology configuration message.
- successfully verifying the first information includes: successfully verifying the first verification value.
- the first verification value may be included in the third message, or referred to as being carried in the third message.
- the first KDF may be the KDF with the highest priority among the KDFs supported by the second node.
- the first KDF may be the KDF supported by both the first node and the second node.
- the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.
- the communication device 130 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 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.
- the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
- the communication unit 1301 is further used to: receive a first message from the second node, and send a second message to the second node.
- the first message includes the KDF capability of the second node
- the second message includes at least the indication information of the first KDF. It should be understood that the first message and the second message may also include other information.
- the information transmitted by the first node and the second node includes one or more of the information included in the second message, the information included in the topology configuration message, and the like.
- the communication unit 1301 is further used to: receive a third message from the second node, and verify the first verification value according to the first KDF, the first key, the information contained in the second message, and the information contained 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 key, the information contained in the second message, and the information contained in the topology configuration message.
- the first key can be a key obtained by negotiation between the first node and the second node. Further, verifying the first information successfully includes: verifying the first verification value successfully.
- the communication unit 1301 is also used to: receive a third message from the second node, and verify the first verification value according to the first KDF, the first parameter, the information contained in the second message, and the information contained 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, the information contained in the second message, and the information contained in the topology configuration message, and the value of the first parameter is predefined.
- the first parameter is 128 bits of data, and further, the 128 bits are all 0.
- the successful verification of the first information includes: the successful verification of the first verification value.
- the communication unit 1301 is further used to: send the KDF capability of the first node to the second node, where the KDF capability of the first node indicates the KDF supported by the first node; and receive indication information of the first KDF from the second node.
- the KDF capability of the first node, the indication information of the first KDF, etc. also belong to the first information.
- the process of verifying the first information through the first KDF and the second node is protected to further improve security.
- 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 is tampered with.
- the processing unit 1302 is further configured to: 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 communication unit 1301 is further configured to: send the second verification value to the second node.
- the communication unit 1301 is further configured to receive a second random number from the second node.
- the second random number is included in the third message.
- the second verification value is carried in a fifth message sent by the first node to the second node.
- the process of receiving the third message and sending the fifth message may be subject to security protection.
- the communication unit 1301 and the processing unit are further used to: based on the first key agreement algorithm, negotiate with the second node to determine the 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.
- the first key agreement algorithm may be determined through negotiation between the communication device 130 and the second node.
- 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.
- 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.
- 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.
- 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.
- the processing unit 1302 is further configured to: derive an encryption key according to the first key, and encrypt 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 communication unit 1301 is further configured to send the ciphertext of the network key of the first network to the second node.
- 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;
- 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.
- the communication unit 1301 is further configured to send an identifier of a security algorithm of the first network to the second node.
- 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.
- 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.
- the communication unit 1301 is used to receive a topology configuration message from the first node.
- the communication unit 1301 and the processing unit 1302 are used 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.
- the processing unit 1302 is also used to generate a first verification value based on the first KDF and the first information.
- the communication unit 1301 is also used to: send the first verification value to the first node, and receive the network key of the first network encrypted and sent by the first node.
- the network key of the first network is used to perform security protection on the network layer between nodes in the first network.
- the information transmitted by the first node and the second node includes information included in the topology configuration message.
- the processing unit 1302 is further configured to generate a first verification value based on at least the first KDF and the information included in the topology configuration message, and the communication unit 1301 is further configured to send the first verification value to the first node.
- the first verification value may be carried in a third message and sent to the first node.
- the first KDF may be the KDF with the highest priority among the KDFs supported by the second node.
- the first KDF may be the KDF supported by both the first node and the second node.
- the first KDF may be the KDF with the highest priority among the KDFs supported by both the first node and the second node.
- the communication device 130 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 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.
- the processing unit 1302 is further used to generate a first verification value based on the first key information included in the second message and the information included 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.
- the processing unit 1302 is further configured to generate 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, 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 are all 0.
- the communication unit 1301 is further used to receive a first random number from the second node, and the first random number is used to participate in generating a verification value, or to derive a key, etc.
- the second random number may be included in the second message.
- 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.
- the communication unit 1301 is further configured to receive a fifth message from the first node, the fifth message including a second verification value, wherein 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.
- 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 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 communication unit 1301 and the processing unit 1302 are further configured to negotiate with the first node to determine a first key negotiation algorithm, where the first key negotiation algorithm is a key negotiation algorithm supported by the second node.
- the communication unit 1301 is further configured to send the key agreement algorithm capability of the second node to the first node, and receive indication information of the first key agreement algorithm from the first node.
- the key agreement algorithm capability of the second node is included in the first message
- the indication information of the first key agreement algorithm is included in the second message.
- the communication unit 1301 is further configured to receive the ciphertext of the network key of the first network.
- the processing unit 1302 is further configured to derive an encryption key according to the first key, and decrypt the ciphertext of the network key of the first network layer by using the encryption key to obtain the network key of the first network.
- the communication unit 1301 and the processing unit 1302 are further used to establish an access layer connection with the first node, and the access layer encryption is turned on.
- the communication unit 1301 is also used to receive a fourth message, the fourth message includes a network key of the first network, and the fourth message is encrypted at the access layer.
- the processing unit 1302 is also used to decrypt the fourth message at the access layer to obtain the network key of the first network.
- the communication unit 1301 is further configured to receive an identifier of a security algorithm of the first network from the first node.
- the communication unit 1301 is further configured to send security capability information of the second node to the first node.
- the communication device 140 can be an independent device, such as a node, or a device contained 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.
- at least one memory 1403 may also be included.
- a connection line 1404 may also be included, 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.
- Processor 1401 is a module that performs arithmetic operations and/or logical operations, and may specifically include one or more of the following modules: filter, modem, power amplifier, low noise amplifier (LNA), baseband processor, radio frequency processor, radio frequency circuit, central processing unit (CPU), application processor (AP), microcontroller unit (MCU), electronic control unit (ECU), graphics processor (GPU), microprocessor (MPU), application specific integrated circuit (ASIC), image signal processor (ISP), digital signal processor (DSP), field programmable gate array (FPGA), complex programmable logic device (CPLD), or coprocessor, etc.
- modules filter, modem, power amplifier, low noise amplifier (LNA), baseband processor, radio frequency processor, radio frequency circuit, central processing unit (CPU), application processor (AP), microcontroller unit (MCU), electronic control unit (ECU), graphics processor (GPU), microprocessor (MPU), application specific integrated circuit (ASIC), image signal processor (ISP), digital signal processor (DSP), field programmable gate array (FPGA),
- the communication interface 1402 may be used to provide information input or output for the at least one processor, or to receive externally sent signals and/or send externally sent signals.
- communication interface 1402 may include interface circuitry.
- the communication interface 1402 may include a wired link interface such as an Ethernet cable, or may be a wireless link (Wi-Fi, Bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, and other short-range wireless communication technologies, etc.) interface.
- a wired link interface such as an Ethernet cable
- a wireless link Wi-Fi, Bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, and other short-range wireless communication technologies, etc.
- the communication interface 1402 may include a receiver and a transmitter.
- the receiver and the transmitter may be the same component or different components.
- the component may be referred to as a transceiver.
- the communication interface 1402 may include an input interface and an output interface, and the input interface and the output interface may be the same interface, or may be different interfaces.
- the functions of the communication interface 1402 may be implemented by a transceiver circuit or a dedicated transceiver chip.
- the memory 1403 is used to provide a storage space in which data such as an operating system and a computer program can be stored.
- the memory 1403 can be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), etc., or a combination of multiple thereof.
- 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.
- the processor 1401 may be a processor specifically used to execute the aforementioned method (for convenience of distinction, referred to as a dedicated processor), or may be a processor that executes the aforementioned method by calling a computer program (for convenience of distinction, referred to as a dedicated processor).
- the at least one processor may include both a dedicated processor and a general-purpose processor.
- 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 .
- the embodiment of the present application also provides a chip, which includes a logic circuit and a communication interface.
- the communication interface is used to receive a signal or send a signal; the logic circuit is used to receive a signal or send a signal through the communication interface.
- the chip is 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.
- An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored.
- 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.
- the terminal includes a terminal node, wherein the terminal may be an intelligent terminal or a means of transportation such as a vehicle, a drone, or a robot.
- 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.
- At least one of a, b, or c can be represented by: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple.
- "And/or” describes the association relationship of the associated objects, indicating that there can be three relationships.
- a and/or B can be represented by: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
- the character "/" generally indicates that the associated objects are in an "or" relationship.
- first and second used in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects.
- first node and the second node are only for the convenience of describing fresh parameters in different implementations, and do not indicate differences in their execution operations, importance, structure, etc.
- a message can also be regarded as a type of information, and the name of the message can be replaced arbitrarily.
- 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 described one by one here.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本申请涉及通信技术领域,尤其涉及短距通信技术领域,例如智能汽车、智能家居、智能终端和智能制造等场景中的通信等。具体涉及一种通信方法、通信装置及终端。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.
随着通信技术的不断发展,智能家居、智能座舱、智能驾驶、智能制造、智能运输等智能应用场景应运而生。进入移动互联网时代,通信的工具和传统的计算机,尤其是台式工作站、服务器相比,使用更便利。With the continuous development of communication technology, smart application scenarios such as smart home, smart cockpit, smart driving, smart manufacturing, and smart transportation have emerged. In the era of mobile Internet, communication tools are more convenient to use than traditional computers, especially desktop workstations and servers.
无线短距通信系统为了便利性,具有漫游的需求。很多场景需要使用多跳组网,如无线BMS网络、智能家居网络、智能制造低功耗网络等。典型的网络拓扑类型包括星型、树型、mesh网络等。当一个节点需要加入新的网络时,已经在网络中的节点(简称为在网节点)可以需要网络的信息发送给需加入该网络的节点(简称为入网节点)。但是,随着网络的安全性能的提升,网络中传输的信息需要经过安全保护,而进行安全保护时使用的参数(例如密钥)也需要提供给新入网的节点,从而使得新入网的节点能够获取在网络中传输的、经过安全保护的信息。For the convenience of wireless short-range communication systems, there is a need for roaming. Many scenarios require the use of multi-hop networking, such as wireless BMS networks, smart home networks, and smart manufacturing low-power networks. Typical network topology types include star, tree, and mesh networks. When a node needs to join a new network, the nodes that are 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 access 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 connected nodes, so that the newly connected nodes can obtain the securely protected information transmitted in the network.
对于包含无线通信方式的网络,密钥通常不能直接通过无线信号传输。因此,如何在向入网节点提供网络的密钥的过程中保障通信安全是本领域技术人员正在研究的热点问题。For networks that include wireless communication, keys cannot usually be transmitted directly via wireless signals. Therefore, how to ensure communication security in the process of providing network keys to networked nodes is a hot topic being studied by those skilled in the art.
发明内容Summary of the invention
本申请实施例提供了一种通信方法、通信装置及终端,能够在向入网节点提供网络的密钥的过程中提高通信安全性,提升网络的可用性。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 access nodes.
第一方面,本申请实施例提供一种通信方法,该方法包括:In a first aspect, an embodiment of the present application provides a communication method, the method comprising:
第一节点向第二节点发送拓扑配置消息,拓扑配置消息包含第一网络的信息。第一节点与第二节点协商确定第一密钥派生函数(key derivation functions,KDF),第一KDF属于第二节点支持的KDF。第一节点通过第一KDF与第二节点校验第一信息,并在校验第一信息成功的情况下向第二节点加密发送第一网络的网络密钥。The first node sends a topology configuration message to the second node, and the topology configuration message includes information of the first network. The first node negotiates with the second node to determine a first key derivation function (KDF), and the first KDF belongs to a KDF supported by the second node. The first node verifies the first information with the second node through the first KDF, and encrypts and sends the network key of the first network to the second node if the verification of the first information is successful.
一些方案中,第一网络的网络密钥用于对第一网络中传输的消息进行安全保护。例如,第一网络的网络密钥用于对网络内的节点之间传输的网络层消息进行安全保护,安全保护包含加密、完保、认证加密等。或者,第一网络的网络密钥用于派生得到会话密钥,安全密钥再用于会话安全保护。In some solutions, the network key of the first network is used to securely protect messages transmitted in the first network. For example, the network key of the first network is used to securely protect network layer messages transmitted between nodes in the network, and security protection includes encryption, integrity protection, authenticated encryption, etc. Alternatively, the network key of the first network is used to derive a session key, and the security key is then used for session security protection.
可选的,第一网络包含该第一节点。或者,第一节点可以获取第一网络的信息。可选的,该方法可以通过第一节点的硬件模块或者软件模块实现。其中,第一网络的信息可以包含第一网络的安全算法的标识、第一网络的身份标识(identify,ID)、第一网络的拓扑类型、第一网络的网络优先级、或第一网络的地址分配方式等中的一项或者多项,其中,安全算法可以包含加密算法、完整性保护算法、认证加密算法等中的一项或者多项。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 (identify, 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 authentication encryption algorithm, and the like.
本申请实施例中,第二节点在加入第一网络的过程中,已经在第一网络中的第一节点可以向其发送拓扑配置消息,拓扑配置消息中携带第一网络的信息主要包含了网络的一些属性信息。而对于第一网络的一些秘密信息,例如网络密钥,第一节点则不直接携带在拓扑配置消息中,而是需要以加密发送的方式发送给第二节点。In the embodiment of the present application, when the second node joins the first network, the first node already in the first network can send a topology configuration message to it. The information of the first network carried in the topology configuration message mainly includes some attribute information of the network. As for some secret information of the first network, such as the network key, the first node does not directly carry it in the topology configuration message, but needs to send it to the second node in an encrypted manner.
进一步的,在加密发送第一网络的网络密钥之前,第一节点和第二节点需要进行信息校验(以校验第一信息为例),也即验证第一节点和第二节点之间共享的第一信息是否受到篡改。其中,第一信息例如可以包含第一节点和第二节点传输过的信息,例如拓扑配置消息包含的信息和/或下文中提到的一种或者多种信息。进一步的,第一信息还可以包含第一节点和第二节点之间预先确定的参数、密钥等。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, verify 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 by the first node and the second node, such as information included in the 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.
具体的,在校验信息时,任一节点之间需要先产生验证值并发送给对方进行校验。验证值的产生依赖于安全算法。由于网络中的节点多种多样,加入网络的节点的其安全能力可能各不相同。而本申请可以由第一节点和第二节点协商得到第一KDF,并通过第一KDF对第一信息进行校验。如此可以适应多种不同安全能力的节点加入网络的情况,使得网络中可以应用于具有多种不同种类设备的场景下,提升网络的包 容性。Specifically, when verifying information, any node needs to generate a verification value first and send it to the other party for verification. The generation of the verification value depends on the security algorithm. Since there are many different nodes in the network, the security capabilities of the nodes joining the network may be different. In this application, the first node and the second node can negotiate to obtain the first KDF, and verify the first information through the first KDF. In this way, it can adapt to the situation where nodes with different security capabilities join the network, so that the network can be applied to scenarios with many different types of devices, improving the network's packet loss. Capacitance.
本申请中,第一节点发送的消息以及接收的消息可以通过无线信号的方式被传递。在第一节点和第二节点连接时,第一节点和第二节点的连接方式可以为无线连接。由于无线连接容易遭到攻击者攻击,而本申请实施例提供的方案可以显著提升无线传输情况下通信的安全性。In the present application, the message sent by the first node and the message received by the first node can be transmitted by means of wireless signals. When the first node and the second node are connected, the connection mode of the first node and the second node can be a wireless connection. Since wireless connections are vulnerable to attacks by attackers, the solution provided by the embodiment of the present application can significantly improve the security of communication in the case of wireless transmission.
在第一方面的一种可能的实施方式中,方法还包括:向第二节点发送第一网络的网络密钥的ID。可选的,第一网络的网络密钥可以为编号、字符串等。或者可选的,第一网络的网络密钥的ID可以为基于第一网络的网络密钥推演得到的。In a 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.
一些方案中,第一网络的网络密钥的ID和第一网络的网络密钥可以携带在同一条消息中。In some schemes, 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.
在第一方面的一种可能的实施方式中,第一节点和第二节点传输过的信息包含拓扑配置消息包含的信息。也即,第一信息包含拓扑配置消息包含的信息。In a possible implementation manner 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.
可选的,拓扑配置消息里面可能包含多项信息,此时,第一信息可以包含拓扑配置消息中的部分信息。或者可选的,第一信息可以包含拓扑配置消息中的全部信息,或,包含整条拓扑配置消息。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 include the entire topology configuration message.
在第一方面的一种可能的实施方式中,通过第一KDF,与第二节点校验第一信息,包含:接收来自第二节点的第一验证值,至少根据第一KDF和拓扑配置消息包含的信息校验第一验证值。其中,第一验证值至少与第一KDF和拓扑配置消息包含的信息相关联。进一步的,校验第一信息成功包含:校验第一验证值成功。可选的,第一验证值可以包含于第三消息中,或称为携带于第三消息。In a possible implementation of the first aspect, verifying the first information with the second node through the first KDF includes: receiving a first verification value from the second node, and verifying the first verification value at least according to the first KDF and the information included in the topology configuration message. The first verification value is at least associated with the information included in the first KDF and the topology configuration message. Further, verifying the first information successfully includes: verifying the first verification value successfully. Optionally, the first verification value can be included in a third message, or referred to as being carried in a third message.
上述实施方式中,第二节点可以至少基于第一KDF和拓扑配置消息包含的信息生成验证值,而第一节点可以基于第一KDF和相同的拓扑配置消息包含的信息对该验证值进行校验,若校验成功则说明第二节点接收的拓扑配置消息包含的信息与第一节点向其发送的该信息是一致的,即未经过篡改。如此可以确定第二节点接收的信息是准确的,且说明了二者之间的通信环境相对安全,提升了通信安全性。In the above implementation, the second node can generate a verification value based on at least the first KDF and the information contained in the topology configuration message, and the first node can verify the verification value based on the first KDF and the information contained in the same topology configuration message. If the verification is successful, it means 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, that is, it has not been tampered with. In this way, it can be determined that the information received by the second node is accurate, and it shows that the communication environment between the two is relatively safe, which improves the communication security.
在第一方面的一种可能的实施方式中,第一KDF可以是第二节点支持的KDF中优先级最高的KDF。可选的,第一KDF可以是第一节点和第二节点共同支持的KDF,此时,第一KDF可以为第一节点和第二节点均支持的KDF,优先级最高的KDF。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. Optionally, 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.
在第一方面的又一种可能的实施方式中,第一节点可以在第二节点和第一节点都支持的KDF中,选择第一KDF并向第二节点指示其选定的第一KDF。由第一节点承担选定KDF的工作,可以将计算量集中在第一节点一侧,适用于第一节点具有更强的计算能力的场景,可以提升入网的速度。例如,部分无线系统中,管理节点会创建网络并连接其他管理节点形成网络,而终端节点通过接入管理节点而加入某一管理节点创建的网络,因此相对于入网节点来说,在网节点通常具有更强的通信能力或者计算能力,因此由在网节点承担选择时的计算工作,可以提升选择KDF时的速度,缩短入网过程的时延。In another possible implementation of the first aspect, the first node can 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 work of selecting the KDF, which can concentrate the amount of calculation on the first node side. It is suitable for scenarios where the first node has stronger computing power and can improve 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 management node by accessing the management node. Therefore, compared with the networked node, the networked node usually has stronger communication capabilities or computing capabilities. Therefore, the networked node is responsible for the calculation work during the selection, which can improve the speed of selecting the KDF and shorten the delay of the network access process.
另外,在基于优先级选择KDF的情况下,通过第一节点来选择KDF,在网节点可以基于一致的优先级来选择KDF,从而有利于提升网络中节点选择的KDF标准统一。In addition, in the case of selecting KDF based on priority, KDF is selected by the first node, and nodes in the network can select KDF based on consistent priorities, which is conducive to improving the uniformity of KDF standards for node selection in the network.
在第一方面的又一种可能的实施方式中,与第二节点协商确定第一KDF包括:接收来自第二节点的第二节点的KDF能力,向第二节点发送第一KDF的指示信息。其中,第二节点的KDF能力用于指示第二节点支持的KDF。In another possible implementation of the first aspect, negotiating with the second node to determine the first KDF includes: receiving the KDF capability of the second node from the second node, and sending indication information of the first KDF to the second node, wherein the KDF capability of the second node is used to indicate the KDF supported by the second node.
一些场景中,第二节点的KDF能力、第一KDF的指示信息等也属于第一信息。如此,第一节点和第二节点可以校验这些信息是否受到篡改,提升安全性。In some scenarios, the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
在第一方面的又一种可能的实施方式中,与第二节点协商确定第一KDF包括:接收来自第二节点的第一消息,向第二节点发送第二消息。其中,第一消息包含第二节点的KDF能力,第二消息至少包含第一KDF的指示信息。应理解,第一消息、第二消息还可能包含其他信息。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 capability of the second node, and the second message includes at least indication information of the first KDF. It should be understood that the first message and the second message may also include other information.
在第一方面的又一种可能的实施方式中,第一节点和第二节点传输过的信息包含第二消息包含的信息、拓扑配置消息包含的信息等中的一项或者多项。类似的,在第二消息包含多项信息的过程中,此处的第二消息包含的信息可以为第二消息中的部分信息,也可以为全部信息(或称整条第二消息)。In another possible implementation of the first aspect, the information transmitted by the first node and the second node includes one or more of information included in the second message, information included in the topology configuration message, etc. Similarly, in the process in which the second message includes multiple pieces of information, the information included in the second message here may be part of the information in the second message, or may be all of the information (or the entire second message).
在第一方面的又一种可能的实施方式中,通过第一KDF与第二节点校验第一信息包括:接收来自第二节点的第三消息,第三消息包含第一验证值,根据第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息校验第一验证值。其中,第一验证值与第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息相关联,第一密钥可以为第一节点和第二节点协商得到的密钥。进一步的,校验第一信息成功包含:校验第一验证值成功。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 according to the first KDF, the first key, 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 key, the information included in the second message, and the information included in the topology configuration message, and the first key can be a key obtained by negotiation between the first node and the second node. Furthermore, successfully verifying the first information includes: successfully verifying the first verification value.
这种实施方式中,第一信息可以理解为第二消息包含的信息和拓扑配置消息包含的信息。或者为,第一信息可以理解为第一密钥、第二消息包含的信息和拓扑配置消息包含的信息。 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.
在第一方面的又一种可能的实施方式中,通过第一KDF与第二节点校验第一信息,包括:接收来自第二节点的第三消息,第三消息包含第一验证值,根据第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息校验第一验证值。其中,第一验证值与第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息相关联,第一参数的值为预先定义的。例如,第一参数为128比特的数据,进一步的该128比特为全0。进一步的,校验第一信息成功包含:校验第一验证值成功。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 according to 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 0. Further, successfully verifying the first information includes: successfully verifying the first verification value.
这种实施方式中,第一信息为第二消息包含的信息和拓扑配置消息包含的信息。或者为,第一信息为第一参数、第二消息包含的信息和拓扑配置消息包含的信息。In this implementation manner, 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.
在第一方面的又一种可能的实施方式中,方法还包括:向第二节点发送第一节点的KDF能力,第一节点的KDF能力指示第一节点支持的KDF;接收来自第二节点的第一KDF的指示信息。一些场景中,第一节点的KDF能力、第一KDF的指示信息等也属于第一信息。In another possible implementation of the first aspect, the method further includes: sending the KDF capability of the first node to the second node, the KDF capability of the first node indicating the KDF supported by the first node; and receiving indication information of the first KDF from the second node. In some scenarios, the KDF capability of the first node, the indication information of the first KDF, etc. also belong to the first information.
在第一方面的又一种可能的实施方式中,通过第一KDF与第二节点校验第一信息的过程经过安全保护,以期进一步提升安全性。In another possible implementation of the first aspect, the process of verifying the first information by using the first KDF and the second node is security protected in order to further improve security.
以通过校验第一验证值的方式来校验第一信息为例,一种示例中,第一验证值在传输的过程中经过加密,例如携带第一验证值的消息在接入层被加密,再如,第一验证值可以被密钥加密形成密文,第二节点可以发送第一验证值的密文。又一种示例中,参与生成第一验证值的参数包含密钥,进一步的,参与生成第一验证值的密钥可以是第一节点和第二节点之间协商得到的,或者第一节点和第二节点中预先配置的共享密钥。Taking verifying the first information by verifying 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 in another example, the first verification value can be encrypted by a key to form a 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, and further, the key involved in generating the first verification value can be obtained through negotiation between the first node and the second node, or a shared key pre-configured in the first node and the second node.
在第一方面的又一种可能的实施方式中,方法还包括:向第二节点发送第一随机数。该随机数可以属于第一信息,从而确定携带该随机数的消息是否受到篡改。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 is tampered with.
可选的,第一随机数可以包含于第二消息,也即,前述的第二消息中包含该第一随机数。Optionally, the first random number may be included in the second message, that is, the aforementioned second message includes the first random number.
在第一方面的又一种可能的实施方式中,方法还包括:根据第一KDF、第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥生成第二验证值;向第二节点发送第二验证值。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.
进一步的,方法还包括接收来自第二节点的第二随机数。可选的,第二随机数包含于第三消息。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.
可选的,第二验证值携带于第一节点发送第二节点的第五消息中。进一步的,该接收第三消息、发送第五消息的过程可以经过安全保护。Optionally, the second verification value is carried in a fifth message sent by the first node to the second node. Further, the process of receiving the third message and sending the fifth message may be subject to security protection.
在第一方面的又一种可能的实施方式中,方法还包括:In another possible implementation manner of the first aspect, the method further includes:
基于第一密钥协商算法,与第二节点协商确定第一密钥。其中,所述第一密钥(DH key)或经由所述第一密钥派生的密钥用于对所述第一节点和所述第二节点之间传输的信息进行安全保护。换句话说,第一密钥可以直接用于通信过程中的信息加密,或者可选的,第一密钥可以用于派生得到其他密钥,其派生得到密钥可以用于通信过程中的信息加密。这种实施方式中,第一密钥协商算法属于第二节点支持的算法,进一步还可以是第二节点支持的密钥协商算法中优先级最高的密钥协商算法,如此可以适应具有不同密钥协商能力的节点加入第一网络的场景。Based on the first key agreement algorithm, the first key is determined through 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 implementation, 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, so as to adapt to the scenario where nodes with different key agreement capabilities join the first network.
可选的,第一密钥协商算法也属于第一节点支持的密钥协商算法,换句话说,第一密钥协商算法为第一节点和第二节点共同支持的、优先级最高的密钥协商算法。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.
一种示例性的协商得到第一密钥的过程如下:第一节点和第二节点确定各自的私钥,第一节点基于第一节点的私钥和通过第一密钥协商算法确定出的公钥确定第一公钥,并将第一公钥提供给第二节点。第二节点基于第二节点的私钥和通过第一密钥协商算法确定出的公钥确定第二公钥,并将第二公钥提供给第一节点。第一节点根据第一节点的私钥和第二公钥确定第一密钥,而第二节点基于第二节点的私钥和第一公钥确定第一密钥,在交换的公钥未经过篡改的情况下,两者确定出的第一密钥是一致的。An exemplary process of obtaining a first key through negotiation 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 private key of the first node and a public key determined by a first key negotiation algorithm, and provides the first public key to the second node. The second node determines a second public key based on the private key of the second node and a public key determined by the first key negotiation algorithm, and provides the second public key to the first node. The first node determines the first key based on the private key of the first node and the second public key, and the second node determines the first key 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 first keys determined by the two are consistent.
可选的,第一公钥可以携带于消息第二消息中,第二公钥可以携带于消息第一消息或第三消息中。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.
在第一方面的又一种可能的实施方式中,第一密钥协商算法可以是第一节点和第二节点协商确定的。也即,第一节点和第二节点可以协商确定第一密钥协商算法,以便于后期进行密钥协商。或者,第一密钥协商算法也可以由第一节点配置,例如第一密钥协商算法的标识可以在密钥配置消息中携带,例如为第一密钥协商算法为第一网络所使用的密钥协商算法。In another possible implementation of the first aspect, the first key agreement algorithm may be determined by negotiation between the first node and the second node. That is, the first node and the second node may negotiate to determine the first key agreement algorithm to facilitate key negotiation later. Alternatively, the first key agreement algorithm may also be configured by the first node, for example, an identifier of the first key agreement algorithm may be carried in a key configuration message, for example, the first key agreement algorithm is a key agreement algorithm used by the first network.
作为一种确定密钥协商算法的实现,前述通信方法还包括:向第二节点发送第一节点的密钥协商算法能力,第一节点的密钥协商算法能力用于指示第一节点支持的密钥协商算法;接收来自第二节点发送的第一密钥协商算法的指示信息。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; receiving indication information of the first key agreement algorithm sent from the second node.
可选的,第一节点的密钥协商算法能力包含于拓扑配置消息,第一密钥协商算法的指示信息包含于第一消息。 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.
作为又一种确定密钥协商算法的实现,前述通信方法还包括:接收来自第二节点的第二节点的密钥协商算法能力,第二节点的密钥协商算法能力包含第二节点支持的密钥协商算法;向第二节点发送第一密钥协商算法的指示信息。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.
可选的,第二节点的密钥协商算法能力包含于第一消息,第一密钥协商算法的指示信息包含于第二消息。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.
在第一方面的又一种可能的实施方式中,向第二节点加密发送第一网络的网络密钥,包括:In yet another possible implementation of the first aspect, encrypting and sending a network key of the first network to the second node includes:
根据第一密钥派生得到加密密钥;deriving an encryption key based on 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.
这种实施方式中,第一节点和第二节点协商得到了密钥,基于该密钥可以实现对第一网络的网络密钥的安全传输。In this implementation manner, 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.
可选的,该实施方式可以在第一节点和第二节点的接入层未开始加密的情况下执行。例如,第一节点和第二节点建立接入层连接,在接入层连接未开启加密的情况下,第一节点与第二节点基于第一密钥协商算法协商得到第一密钥以用于对网络密钥进行加密,可选在确定第一密钥之前还进行密钥协商算法的确定。Optionally, this implementation can be performed when the access layer of the first node and the second node is not encrypted. For example, the first node and the second node establish an access layer connection, and when the access layer connection is not encrypted, 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, and optionally, the key agreement algorithm is determined before determining the first key.
在第一方面的又一种可能的实施方式中,在向第二节点加密发送第一网络的网络密钥之前,方法还包括:与第二节点建立接入层连接。进一步的,在第一节点和第二节点之间的接入层连接未开启加密的情况下,第一节点和第二节点实现第一方面的方法。例如,在接入层连接未开启的情况下,第一节点与所述第二节点协商确定第一密钥派生函数KDF。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. Further, 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 negotiates with the second node to determine a first key derivation function KDF.
可选的,在接入层连接的加密开启的情况下,第一节点可以无需协商KDF、无需校验第一信息,从而直接通过经过加密的接入层发送第一网络的网络密钥。Optionally, when encryption of the access layer connection is enabled, the first node may not need to negotiate the KDF or verify the first information, and thus directly send the network key of the first network through the encrypted access layer.
在第一方面的又一种可能的实施方式中,第一节点和第二节点的接入层连接的加密开启,方法还包括:向第二节点发送第四消息,该第四消息包含第一网络的网络密钥,第四消息在接入层被加密。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.
这种实施方式中,第二节点在加入第一网络之前,先与第一节点建立了接入层连接。由于在接入层对消息进行了加密的情况下,第一节点可以通过接入层的加密机制来对第一网络的网络密钥进行安全传输。示例性的,第一节点可以在第一节点所建立的接入层中加密该第四消息。In this implementation, the second node establishes an access layer connection with the first node before joining the first network. Since the access layer encrypts the message, the first node can securely transmit the network key of the first network through the encryption mechanism of the access layer. Exemplarily, the first node can encrypt the fourth message in the access layer established by the first node.
可选的,第四消息还包含第一网络的网络密钥的ID。Optionally, the fourth message further includes an ID of a network key of the first network.
在第一方面的又一种可能的实施方式中,第一网络的安全算法的信息也可以不携带于拓扑配置消息中。例如,第一网络的安全算法的信息还可以携带于第二消息等。In another possible implementation of the first aspect, the information of the security algorithm of the first network may not be carried in the topology configuration message. For example, the information of the security algorithm of the first network may also be carried in the second message.
在第一方面的又一种可能的实施方式中,第一网络的安全算法为预先在第一节点中配置的。例如,由管理节点或控制节点在第一节点中配置的。In another possible implementation manner of the first aspect, the security algorithm of the first network is pre-configured in the first node, for example, configured in the first node by a management node or a control node.
在第一方面的又一种可能的实施方式中,第一网络的安全算法为第一节点和第二节点协商得到的。示例性的,前述的通信方法还包括:接收来自第二节点的第二节点的安全能力信息,第二节点的安全能力信息指示第二节点支持的安全算法;确定第一网络的安全算法,第一网络的安全算法属于第二节点和第一节点支持的安全算法。进一步的,第一节点可以将确定的第一网络的安全算法的标识提供给第二节点。这个示例是以第一节点选定第一密钥协商算法的情况为例进行说明,一些场景中,也可以是由第二节点根据第一节点的安全能力信息选定第一网络的安全算法。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 also 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 algorithms supported by the second node and the first node. Further, the first node may provide the identifier of the determined security algorithm of the first network to the second node. This example is illustrated by taking the case where the first node selects the first key negotiation 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.
进一步的,上述实施方式可以在第一网络初次加入新节点的情况下实施。例如,在第二节点加入第一网络之前第一节点为第一网络中的唯一节点的情况下,第一节点和第二节点进行第一网络的会话安全密钥的协商。再如,第一节点为管理节点,管理节点可以创建第一网络(此时第一节点为第一网络中的唯一节点),这种情况下,当第一个第二节点进行加入第一网络的流程时,第一节点和第二节点进行第一网络的会话安全密钥的协商。Furthermore, the above implementation 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 of the first network. For another example, the first node is a management node, and 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 performs the process of joining the first network, the first node and the second node negotiate the session security key of the first network.
在第一方面的又一种可能的实施方式中,方法应用于第二节点支持第一网络的安全算法的情况下。进一步的,第一节点或第二节点可以根据第一网络中使用的安全算法的标识和第二节点的安全能力确定第二节点是否支持第一网络的安全算法。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 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 capability of the second node.
对于第二节点来说,若第二节点不支持第一网络的安全算法,则第二节点可以选择结束加入第一网络的流程,或者不加入该第一网络。进一步的,还可以向第二节点指示加入第一网络失败,例如发送失败原因的指示代码等。若第二节点支持第一网络的安全算法,则第二节点继续加入第一网络的流程。For the second node, if the second node does not support the security algorithm of the first network, the second node may choose to end 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 an indication code of 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 check 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 checks whether it supports the security algorithm of the first network. If the second node finds that it does not support the security algorithm, the current operation is terminated. The process of joining the first network may include, for example, transmitting (eg, sending and/or receiving) a message related to joining the first network with the first node.
对于第一节点来说,第一节点可以接收来自第二节点的安全能力信息,第二节点的安全能力信息指示第二节点支持的安全算法。在第二节点不支持第一网络的安全算法的情况下,可以向第二节点发送第二消息,第二消息指示加入第一网络失败。进一步的,可以结束将第二节点加入第一网络的流程,例如可以不与第二节点传输(如发送和/或接收)与加入第一网络相关的消息等。For the first node, the first node may receive security capability information from the second node, and the security capability information of the second node indicates the security algorithm supported by the second node. In the case where the second node does not support the security algorithm of the first network, a second message may be sent to the second node, and the second message indicates that joining the first network failed. Further, the process of joining the second node to the first network may be terminated, for example, messages related to joining the first network may not be transmitted (such as sending and/or receiving) with the second node.
相反的,在第二节点支持第一网络的安全算法的情况下,则第一节点继续执行将第二节点加入第一网络的流程。例如,在第二支持第一网络的安全算法的情况下,执行向第二节点加密发送第一网络的网络密钥这一步骤,也即,向第二节点加密发送第一网络的网络密钥这一步骤在第二节点支持第一网络的安全算法的情况下被执行。On the contrary, 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 step of encrypting and sending the network key of the first network to the second node is executed, that is, the step of encrypting and sending the network key of the first network to the second node is executed when the second node supports the security algorithm of the first network.
第二方面,本申请实施例提供一种通信方法,包括:In a second aspect, an embodiment of the present application provides a communication method, including:
第二节点接收来自第一节点的拓扑配置消息,拓扑配置消息包含第一网络的信息。第二节点与第一节点协商确定第一密钥派生函数KDF,基于所述第一KDF和第一信息生成第一验证值并向第一节点发送第一验证值,其中,第一KDF属于第二节点共同支持的KDF,第一信息包含第一节点和第二节点传输过的信息。第二节点接收第一节点加密发送的第一网络的网络密钥。其中,第一网络的网络密钥用于对第一网络中的节点之间的网络层进行安全保护。The second node receives a topology configuration message from the first node, and the topology configuration message includes information about the first network. The second node negotiates with the first node to determine a first key derivation function KDF, generates a first verification value based on the first KDF and the first information, and sends the first verification value to the first node, wherein the first KDF is a KDF commonly supported by the second node, and the first information includes information transmitted by the first node and the second node. The second node receives the network key of the first network encrypted and sent by the first node. The network key of the first network is used to perform security protection on the network layer between nodes in the first network.
可选的,该方法可以通过第二节点的硬件模块或者软件模块实现。Optionally, the method may be implemented by a hardware module or a software module of the second node.
在第二方面的一种可能的实施方式中,第一节点和第二节点传输过的信息包含拓扑配置消息包含的信息。In a possible implementation manner of the second aspect, the information transmitted by the first node and the second node includes information included in a topology configuration message.
在第二方面的一种可能的实施方式中,第一KDF可以是第二节点支持的KDF中优先级最高的KDF。可选的,第一KDF可以是第一节点和第二节点共同支持的KDF,此时,第一KDF可以为第一节点和第二节点均支持的KDF,优先级最高的KDF。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. Optionally, 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.
在第二方面的一种可能的实施方式中,与第二节点协商确定第一KDF,包括:In a possible implementation of the second aspect, determining the first KDF through negotiation with the second node includes:
向第一节点发送第二节点的KDF能力,接收来自第一节点的第一KDF的指示信息。一些场景中,第二节点的KDF能力、第一KDF的指示信息等也属于第一信息。如此,第一节点和第二节点可以校验这些信息是否受到篡改,提升安全性。Send the KDF capability of the second node to the first node, and receive the indication information of the first KDF from the first node. In some scenarios, the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
在第二方面的又一种可能的实施方式中,第二节点可以在第二节点和第一节点都支持的KDF中,选择第一KDF并向第二节点指示其选定的第一KDF。示例性的,第二节点接收来自第一节点的第一节点的KDF能力,向第一节点发送第一KDF的指示信息。其中,第一节点的KDF能力指示第一节点支持的KDF。In another possible implementation of the second aspect, the second 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. Exemplarily, the second node receives the KDF capability of the first node from the first node and sends indication information of the first KDF to the first node. The KDF capability of the first node indicates the KDF supported by the first node.
其中,第一节点的KDF能力可以携带在拓扑配置消息中,第一KDF的指示信息可以携带在第一消息或第三消息中。或者,第一节点的KDF能力可以携带在第二消息中,第一KDF的指示信息可以携带在第三消息。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.
一些场景中,第一节点的KDF能力可以在于入网设备建立连接之前就通过广播或者组播发送,从而使得第二节点在扫描到第一节点时(即接收到广播或组播消息后)就获取第一节点的KDF能力,从而在向第一节点发起连接时即携带指定的第一KDF,减少信令开销。In some scenarios, the KDF capability of the first node can be sent via broadcast or multicast before the network-accessing device establishes a connection, so that the second node obtains the KDF capability of the first node when scanning the first node (i.e. after receiving the broadcast or multicast message), and thus carries the specified first KDF when initiating a connection to the first node, thereby reducing signaling overhead.
而一些场景中,第一节点将其KDF能力提供给第二节点,在第二节点不支持第一节点所支持的任意一种KDF时,可以不再进行后续的与“加入第一网络的”相关的流程,从而节省信令开销和计算消耗。而且,由第二节点结束“加入第一网络的”的流程时,第一节点通常可以不向第一节点主动指示加入失败(或者终端)。In some scenarios, the first node provides its KDF capability to the second node. When the second node does not support any KDF supported by the first node, the subsequent process related to "joining the first network" may not be performed, thereby saving signaling overhead and computing consumption. Moreover, when the second node ends the process of "joining the first network", the first node usually does not actively indicate the joining failure (or termination) to the first node.
在第二方面的又一种可能的实施方式中,第一节点和第二节点传输过的信息包含第二消息包含的信息和/或拓扑配置消息包含的信息。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.
在第二方面的又一种可能的实施方式中,至少根据第一KDF、第二消息包含的信息和拓扑配置消息包含的信息,生成第一验证值,包括:根据第二消息包含的信息和拓扑配置消息包含的信息第一密钥成生成第一验证值,向第一节点发送第三消息,第三消息包含第一验证值。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: using a first key to generate the first verification value based on information contained in the second message and information contained in the topology configuration message, and sending a third message to the first node, the third message containing the first verification value.
在第二方面的又一种可能的实施方式中,基于第一KDF和第一信息生成第一验证值,包括:In another possible implementation of the second aspect, generating a first verification value based on the first KDF and the first information includes:
根据第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息生成第一验证值,第一密钥为第一节点和第二节点协商得到;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;
向第一节点发送第一验证值,包括:向第一节点发送第三消息,第三消息包含第一验证值。Sending a 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.
在第二方面的又一种可能的实施方式中,基于第一KDF和第一信息生成第一验证值,包括: In another possible implementation of the second aspect, generating a first verification value based on the first KDF and the first information includes:
根据第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息生成第一验证值,所述第一密钥为第一节点和第二节点协商得到,第一参数的值为预先定义的;Generate 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;
向第一节点发送所述第一验证值,包括:向第一节点发送第三消息,第三消息包含第一验证值。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.
其中,第一参数的值为预先定义的,例如128比特全0。The value of the first parameter is predefined, for example, 128 bits of all 0s.
在第二方面的又一种可能的实施方式中,方法还包括:接收来自第二节点的第一随机数,第一随机数用于参与生成验证值,或者用于派生得到密钥等。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.
可选的,第二随机数可以包含于第二消息。进一步的,第一信息包含第二消息中的第二随机数,也即,第一随机数可以参与生成第一验证值。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.
在第二方面的又一种可能的实施方式中,方法还包括:In yet another possible implementation manner of the second aspect, the method further includes:
接收来自第一节点的第二验证值,其中,第二验证值与第一KDF和以下信息中的至少一项相关联:第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥;基于第一KDF和相同的信息,校验第一验证值。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.
例如,第二验证值与第一KDF、第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥相关联。第二节点根据第一KDF、第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥校验第二验证值。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 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.
可选的,第二验证值可以携带在消息中被发送,例如携带在第五消息中被发送。Optionally, the second verification value may be carried in a message and sent, for example, carried in a fifth message and sent.
在第二方面的又一种可能的实施方式中,方法还包括:In yet another possible implementation manner of the second aspect, the method further includes:
根据第一密钥协商算法,确定第一密钥。该第一密钥或经由第一密钥派生的密钥用于对第一节点和第二节点之间传输的信息进行安全保护。According to the first key agreement algorithm, a first key is determined. 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.
在第二方面的又一种可能的实施方式中,方法还包括:In yet another possible implementation manner of the second aspect, the method further includes:
与第一节点协商确定第一密钥协商算法,第一密钥协商算法属于第二节点支持的密钥协商算法。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.
在第二方面的又一种可能的实施方式中,与第一节点协商确定第一密钥协商算法,包括:In yet another possible implementation of the second aspect, negotiating with the first node to determine the first key agreement algorithm includes:
接收来自第一节点的第一节点的密钥协商算法能力,第一节点的密钥协商算法能力包含第一节点支持的密钥协商算法;receiving a key agreement algorithm capability of the first node from the first node, the key agreement algorithm capability of the first node including a key agreement algorithm supported by the first node;
向第一节点发送第一密钥协商算法的指示信息,第一密钥协商算法属于第二节点支持的密钥协商算法。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.
可选的,第一节点的密钥协商算法能力包含于拓扑配置消息,第一密钥协商算法的指示信息包含于第一消息。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.
在第二方面的又一种可能的实施方式中,与第一节点协商确定第一密钥协商算法,包括:In yet another possible implementation of the second aspect, negotiating with the first node to determine the 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.
可选的,第二节点的密钥协商算法能力包含于第一消息,第一密钥协商算法的指示信息包含于第二消息。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.
在第二方面的又一种可能的实施方式中,接收第一节点加密发送的第一网络的网络密钥,包括:接收第一网络的网络密钥的密文;In another possible implementation of the second aspect, receiving the network key of the first network encrypted and sent by the first node includes: receiving a ciphertext of the network key of the first network;
方法还包括:The method also includes:
根据第一密钥派生得到加密密钥;deriving an encryption key based on 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.
在第二方面的又一种可能的实施方式中,方法还包括:In yet another possible implementation manner of the second aspect, the method further includes:
与第一节点建立接入层连接,该接入层加密开启;Establishing an access layer connection with the first node, wherein encryption of the access layer is enabled;
接收第一节点加密发送的第一网络的网络密钥,包括:Receiving a network key of the first network encrypted and sent by the first node, comprising:
接收第四消息,第四消息包含第一网络的网络密钥,第四消息在接入层被加密;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.
可选的,第一节点和第二节点均包含接入层,该第四消息可以在第一节点的接入层被加密,而第二节点则可以在自身的接入层解密该第四消息,得到第一网络的网络密钥。Optionally, both the first node and the second node include an access layer, and the fourth message may be encrypted at the access layer of the first node, while the second node may decrypt the fourth message at its own access layer to obtain a network key of the first network.
在第二方面的又一种可能的实施方式中,方法还包括:In yet another possible implementation manner of the second aspect, the method further includes:
向第一节点发送第二节点的安全能力信息,第二节点的安全能力信息指示第二节点支持的安全算法。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.
在第二方面的又一种可能的实施方式中,第一网络的网络密钥在第二节点支持第一网络的安全算法的 情况下被发送;In another possible implementation manner of the second aspect, the network key of the first network supports the security algorithm of the first network at the second node. Sent in case;
方法还包括:接收来自第一节点的第二消息,第二消息指示第二节点加入第一网络失败。The method further includes: receiving a second message from the first node, the second message indicating that the second node fails to join the first network.
第三方面,本申请实施例提供一种通信装置,该通信装置包含通信单元和处理单元。该通信装置用于实现第一方面任一项的方法;或者用于实现第二方面任一项的方法。In a third aspect, an embodiment of the present application provides a communication device, the communication device comprising a communication unit and a processing unit. The communication device is used to implement any method of the first aspect; or to implement any method of the second aspect.
第四方面,本申请实施例提供一种通信装置,该通信装置包含处理器。当处理器调用存储器中的计算机程序或指令时,实现第一方面任一项的方法,或者实现第二方面任一项的方法。In a fourth aspect, an embodiment of the present application provides a communication device, the communication device comprising a processor. When the processor calls a computer program or instruction in a memory, any method of the first aspect is implemented, or any method of the second aspect is implemented.
第五方面,本申请实施例提供一种通信装置,包括逻辑电路和接口,逻辑电路和接口耦合;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;
接口用于输入待处理的数据,逻辑电路按照第一方面任一项或第二方面任一项的方法对待处理的数据进行处理,获得处理后的数据。该接口还用于输出处理后的数据。The interface is used to input data to be processed, and the logic circuit processes the data to be processed according to any method of the first aspect or any method of the second aspect to obtain processed data. The interface is also used to output the processed data.
第六方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质用于存储指令或计算机程序;当指令或计算机程序被执行时,实现第一方面任一项的方法,或者实现第二方面任一项的方法。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.
第七方面,本申请实施例提供一种计算机程序产品,指令或计算机程序被执行时,实现第一方面任一项的方法,或者实现第二方面任一项的方法。In the seventh aspect, an embodiment of the present application provides a computer program product, and when the instruction or computer program is executed, it implements any method of the first aspect, or implements any method of the second aspect.
第八方面,本申请实施例提供一种终端,该终端包含第三方面至第五方面任一项的通信装置。进一步的,该终端可以为车辆、无人机、或机器人等智能终端或运输工具。In an eighth aspect, an embodiment of the present application provides a terminal, which includes the communication device of any one of aspects 3 to 5. Further, the terminal can be an intelligent terminal or a transportation tool such as a vehicle, a drone, or a robot.
第九方面,本申请实施例提供一种通信系统,该通信系统包含第一节点和第二节点。其中,第一节点用于实现第一方面任一项的方法;第二节点用于实现第二方面任一项的方法。In a ninth aspect, an embodiment of the present application provides a communication system, the communication system comprising a first node and a second node, wherein the first node is used to implement any method of the first aspect; and the second node is used to implement any method of the second aspect.
下面将对实施例描述中所需要使用的附图作简单地介绍。The following is a brief introduction to the drawings required for describing the embodiments.
图1是本申请实施例提供的一种通信系统的架构示意图;FIG1 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application;
图2是本申请实施例提供的一种通信方法的流程示意图;FIG2 is a flow chart of a communication method provided in an embodiment of the present application;
图3是一种无安全上下文的关联流程的示意图;FIG3 is a schematic diagram of an association process without a security context;
图4是一种有安全上下文的关联流程的示意图;FIG4 is a schematic diagram of an association process with a security context;
图5是本申请实施例提供的又一种通信方法的流程示意图;FIG5 is a flow chart of another communication method provided in an embodiment of the present application;
图6是本申请实施例提供的又一种通信方法的流程示意图;FIG6 is a flow chart of another communication method provided in an embodiment of the present application;
图7是本申请实施例提供的又一种通信方法的流程示意图;FIG7 is a flow chart of another communication method provided in an embodiment of the present application;
图8是本申请实施例提供的又一种通信方法的流程示意图;FIG8 is a flow chart of another communication method provided in an embodiment of the present application;
图9是本申请实施例提供的又一种通信方法的流程示意图;FIG9 is a flow chart of another communication method provided in an embodiment of the present application;
图10是本申请实施例提供的又一种通信方法的流程示意图;FIG10 is a flow chart of another communication method provided in an embodiment of the present application;
图11是本申请实施例提供的又一种通信方法的流程示意图;FIG11 is a flow chart of another communication method provided in an embodiment of the present application;
图12是本申请实施例提供的又一种通信方法的流程示意图;FIG12 is a flow chart of another communication method provided in an embodiment of the present application;
图13是本申请实施例提供的又一种通信装置的结构示意图;FIG13 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application;
图14是本申请实施例提供的又一种通信装置的结构示意图。FIG14 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application.
下面结合附图对本申请实施例进行详细介绍。The embodiments of the present application are described in detail below with reference to the accompanying drawings.
下面先对节点进行介绍。节点是具有通信能力的设备,包含但不限于是用户设备、网络设备、工业设备等中的一项或者多项。其中,用户设备包含手持终端、可穿戴终端、交通工具、车载设备、感知设备、智能家居设备、或休闲娱乐设备等,手持终端包含但不限于是手机、平板、或笔记本电脑等,可穿戴设备包含但不限于是耳机、智能手环、智能手表、或智能眼镜等,交通工具包含但不限于是车辆、舰船、飞行器、轨道交通(如地铁、高铁等)、或物流机器人(如自动引导车(automated guided vehicle,AGV)等)等,车载设备包含但不限于是域控制器(domain controller,DC)、屏幕、麦克风、音响、电子钥匙、无钥匙进入、启动系统控制器、电池管理系统(battery management system,BMS)、电池包、或电芯等,感知设备包含但不限于是相机、雷达、激光雷达、光照传感器、温度传感器、或湿度传感器等,智能家居设备包含但不限于是投影仪、智能电视、智能冰箱、智能家庭网关、或安防设备等。休闲娱乐设备例如虚拟现实(virtual reality,VR)设备、混合现实(Mixed Reality,MR)设备、按摩椅、家庭影院、游戏操控设备或4D影院座舱等。 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, industrial equipment, etc. Among them, user devices include handheld terminals, wearable terminals, transportation tools, vehicle-mounted 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. Transportation tools 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.), etc. Vehicle-mounted devices include but are not limited to domain controllers (DC), screens, microphones, speakers, electronic keys, keyless entry, start system controllers, battery management systems (BMS), battery packs, or batteries, 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 equipment or 4D theater cabins, etc.
网络设备包含但不限于是路由器、交换机、或基站等。工业设备例如工业机器人、或机械臂等。Network equipment includes but is not limited to routers, switches, or base stations, etc. Industrial equipment such as industrial robots or robotic arms, etc.
本申请实施例中的节点可以应用于智能汽车、智能家居、智能终端、智能制造、或智能展厅等各个场景中。在某些应用场景、或某些网络类型中,具备类似通信能力的设备可能不称为节点,但是为了方便描述,本申请实施例中将具有通信能力的设备统称为节点。The nodes in the embodiments of the present 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 some network types, devices with similar communication capabilities may not be called nodes, but for the convenience of description, in the embodiments of the present application, devices with communication capabilities are collectively referred to as nodes.
应理解,本申请实施例的通信方法、通信装置、通信系统或节点等,适用于多种网络,例如适用于包括有线通信网络、无线通信网络、或者有线通信和无线通信组合的网络等。例如,无线通信网络包含通过如下通信技术连接的网络:星闪(SparkLink,或NearLink)802.11b/g、蓝牙(blue tooth)、紫蜂(Zigbee)、无线射频识别技术(radio frequency identification,RFID)、超宽带(ultra-wideband,UWB)技术、或无线短距通信系统等,或者,还可以为远距离连接技术包括基于长期演进(Long Term Evolution,长期演进)的通信技术、第五代移动通信技术(5th generation mobile networks或5th generation wireless systems、5th-Generation,简称5G或5G技术)、全球移动通信系统(global System for mobile communications,GSM)、通用分组无线业务(general packet radio Service,GPRS)、通用移动通信系统(universal mobile telecommunications system,UMTS)等无线接入类型技术。再如,有线通信网络包含通过如下通信技术连接的网络:光纤连接技术、车载有线通信技术、控制器局域网(Controller Area Network,CAN)、局域互联网络总线(Local Interconnect Network,LIN)、CAN灵活数据速率(CAN Flexible Data-Rate,CAN FD)、或车载以太网等中的一项或者多项。It should be understood that the communication method, communication device, communication system or node of the embodiments of the present application are applicable to a variety of networks, for example, a network including a wired communication network, a wireless communication network, or a combination of wired communication and wireless communication. For example, the wireless communication network includes 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 system, etc., or, it can also be a long-distance connection technology including communication technology based on Long Term Evolution (Long Term Evolution), fifth-generation mobile communication technology (5th generation mobile networks or 5th generation wireless systems, 5th-Generation, referred to as 5G or 5G technology), global system for mobile communications (global System for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), universal mobile telecommunications system (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.
请参见图1,图1是本申请实施例提供的一种通信系统的架构示意图,该通信系统10可以包含第一节点101和第二节点102。Please refer to FIG. 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 .
第一节点101和第二节点102均具有通信能力,这里的通信能力可以包含无线通信能力,例如通过短距无线通信技术连接(下文中进行介绍)。另外,第一节点101和第二节点102可以建立连接(如图1将二者以实线连接),这里的通信连接包含直接连接、通过中间节点(例如控制节点)连接等。图1所示的方案中,任意两个节点之间的连接可以为有线的、无线的、或者是组合的。应理解,由于网络模型包含多层,这里的连接可以包含节点中部分层的对等实体之间的连接,例如接入层连接。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 through short-range wireless communication technology (described below). In addition, the first node 101 and the second node 102 can establish a connection (as shown in Figure 1, the two are connected with 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 Figure 1, the connection between any two nodes can be wired, wireless, or a combination. 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.
第一节点101属于第一网络103。当然,第一网络103在第一节点101之外也可能包含其他节点。多个节点所形成的拓扑类型可以属于星型、树型或网状(mesh)等拓扑类型,也即,第一网络的拓扑类型可以包含以下类型中的一种:星型、树型或mesh等。在第一网络中,一个节点的消息可以在网络中传输给另一节点。为了保证安全,一些场景中,随着网络的安全性能的提升,网络中传输的信息需要经过安全保护。以安全保护参数包含第一网络的网络密钥为例,第一网络中的节点可以被配置第一网络的网络密钥,第一网络中的节点基于该网络密钥可以加密和解密传输的消息。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 of a 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 is improved, the information transmitted in the network needs to be protected. Taking the example that the security protection parameter includes 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.
继续以安全保护参数包含第一网络的网络密钥为例,而在新的节点(例如第二节点)加入第一网络的过程中,第一网络的网络密钥需要被发送给第二节点,以使得第二节点能够获取第一网络中被网络密钥加密的信息。例如,第一节点可以为第二节点配置第一网络的网络密钥。Continuing with the example that the security protection parameter includes the network key of the 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.
在本申请实施例中,第一节点可以将第一网络的安全保护参数(例如密钥等)通过安全的方式发送给第二节点,使得第二节点可以安全地获取第一网络的安全保护参数,提升网络的可用性。以安全保护参数为网络密钥为例,第一节点可以与第二节点协商得到第一密钥,通过第一密钥加密网络密钥形成密文,将网络密钥通过密文的形式传输。或者,第一节点和第二节点建立接入层连接,在接入层的数据传输开启了加密传输的情况下,携带网络密钥的消息可以在接入层被加密后被发送给第二节点。In an embodiment of the present application, the first node can send the security protection parameters (such as keys, 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.
进一步的,第一节点在加密发送第一网络的网络密钥之前,第一节点还需要对第二节点接收的信息进行校验,也就是验证第二节点所接收的信息是否经过篡改,从而确保二者传输的信息准确且未受到攻击。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.
一些方案中,校验信息时需要先产生验证值,验证值的产生依赖于安全算法。由于网络中的节点多种多样,加入网络的节点的其安全能力可能各不相同。而本申请可以由第一节点和第二节点协商得到校验所使用的算法,如此可以适应多种不同安全能力的节点加入网络的情况,使得网络中可以应用于具有多种不同种类设备的场景下,提升网络的包容性。In some schemes, a verification value needs to be generated first when verifying information, and 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, the present application can obtain the algorithm used for verification through negotiation between the first node and the second node, so that it can adapt to the situation where nodes with different security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the inclusiveness of the network.
下面示例性地对本申请实施例提供的方法进行介绍。The method provided in the embodiments of the present application is introduced exemplarily below.
请参见图2,图2是本申请实施例提供的一种通信方法的流程示意图。可选的,该方法可以基于图1所示的通信系统来实现。如图2所示的通信方法可以包括步骤S201至步骤S204中的一个或多个步骤。应理解,此处为了方便描述,故通过S201至S204这一顺序进行描述,并不旨在限定一定通过上述顺序进行 执行。本申请实施例对于上述一个或多个步骤的执行的先后顺序、执行的时间、执行的次数等不做限定。S201至步骤S204具体如下:Please refer to FIG. 2, which is a flow chart of a communication method provided by an embodiment of the present application. Optionally, the method can be implemented based on the communication system shown in FIG. 1. The communication method shown in FIG. 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 made in the order of S201 to S204, and it is not intended to limit the description to be carried out in the above order. Execution. The present application embodiment does not limit the execution order, execution time, execution times, etc. of the above one or more steps. Steps S201 to S204 are as follows:
步骤S201:第一节点向第二节点发送拓扑配置消息。Step S201: a first node sends a topology configuration message to a second node.
相应的,第二节点可以接收来自第一节点的拓扑配置消息。可选的,第一网络包含该第一节点。或者,第一节点可以获取第一网络的信息。Correspondingly, the second node may receive a 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.
其中,拓扑配置消息包含第一网络的信息。第一网络的信息可以包含第一网络的安全算法的标识、第一网络的身份标识(identify,ID)、第一网络的拓扑类型、第一网络的网络优先级、或第一网络的地址分配方式等中的一项或者多项,其中,安全算法可以包含加密算法、完整性保护算法、认证加密算法等中的一项或者多项。可选的,第一网络包含第一节点,或者,第一节点可以获取第一网络的信息。一些方案中,第一网络的安全算法的信息也可以不携带于拓扑配置消息中,例如,第一网络的安全算法的信息还可以携带于下文中第二消息、网络密钥配置消息等。Among them, the topology configuration message includes information of the first network. The information of the first network may include one or more of an identifier of the security algorithm of the first network, an identifier (identify, 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 authentication encryption algorithm, etc. Optionally, the first network includes a first node, or the first node can obtain information of the first network. In some schemes, the information of the security algorithm of the first network may not be carried in the topology configuration message. For example, the information of the security algorithm of the first network may also be carried in the second message below, the network key configuration message, etc.
在一些可能的实施方式中,安全算法的标识指示第一网络所使用的安全算法,其标识包含但不限于是算法名称、编号、字段值等。示例性的,安全算法包含第一加密算法和/或第一完整性保护算法。或者示例性的,安全算法包含第一认证加密算法。In some possible implementations, the identifier of the security algorithm 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. Or exemplary, the security algorithm includes a first authentication encryption algorithm.
在一种可能的实施方式中,第二节点可以向第一节点发送消息,消息中包含第一字段,第一字段的取值可以用于指示第一网络的安全算法。表1提供了一种可能的安全算法的信息表。其中,加密算法可以包含4种,每一种算法对应了一段4比特的数据。示例性的,算法的名称可以示例性称为ENC0、ENC1、ENC2和ENC(具体实施过程中可以根据支持的算法进行适应性设计),而算法名称为“ENC0”的算法,对应的值为0000,其余情况参见表1。以表1为例,当第一字段的取值为0000时,0000可以看作第一网络的安全算法的标识,通过该取值可以指示第一网络所使用的安全算法包含算法名称为“ENC0”的加密算法。In a 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 a possible security algorithm. Among them, the encryption algorithm may include 4 types, each of which corresponds to a 4-bit data. Exemplarily, the names of the algorithms 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" has a corresponding value of 0000, and the rest of the cases are shown in 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, and this value can indicate that the security algorithm used by the first network includes an encryption algorithm named "ENC0".
类似的,第一字段可以包含多个字段,例如称为字段1和字段2。字段1用于指示加密算法,字段2用于指示完整性保护算法。示例性的,当字段1的取值为000,字段2的取值为010时,指示第一网络的安全算法包含算法名称为“ENC0”的加密算法和算法名称为“INT1”的完整性保护算法。Similarly, the first field may include multiple fields, for example, field 1 and field 2. Field 1 is used to indicate an encryption algorithm, and field 2 is used to indicate an integrity protection algorithm. Exemplarily, when the value of field 1 is 000 and the value of field 2 is 010, it indicates that the security algorithm of the first network includes an encryption algorithm with an algorithm name of "ENC0" and an integrity protection algorithm with an algorithm name of "INT1".
同理,当第一字段取值为1000时,指示第一网络的安全算法包含算法名称为“AUTH1”的认证加密算法。Similarly, when the value of the first field is 1000, it indicates that the security algorithm of the first network includes an authentication encryption algorithm with the algorithm name "AUTH1".
表1安全算法信息表
Table 1 Security algorithm information table
应理解,本申请所示出的算法的信息表中,算法的名称、算法对应值、每种算法包含的算法的数量仅为示例。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.
可选的,该第一网络的安全算法的标识可以包含于拓扑配置消息。当然,对于该标识通过其他消息发送的情况本申请也同样适用。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.
在一些可能的实施方式中,第一网络的安全算法为预先在第一节点中配置的。例如,由管理节点或控制节点在第一节点中配置的。In some possible implementations, the security algorithm of the first network is pre-configured in the first node, for example, configured in the first node by a management node or a control node.
在一些可能的实施方式中,第一网络可以是管理节点创建的。第一个申请加入第一网络的节点通过该管理节点加入第一网络时,第一网络的安全算法可以由管理节点配置,或者通过管理节点和第一个入网设备协商确定。可选的,管理节点可以为第一节点。第一个申请加入第一网络的节点可以为此处的第二节点。 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 access device. Optionally, the management node may be the first node. The first node applying to join the first network may be the second node herein.
作为一种实现的举例,第一网络的安全算法为第一节点和第二节点协商得到的。示例性的,前述的通信方法还包括:接收来自所述第二节点的所述第二节点的安全能力信息,所述第二节点的安全能力信息指示所述第二节点支持的安全算法;确定第一网络的安全算法,第一网络的安全算法属于第二节点和所述第一节点支持的安全算法。进一步的,第一节点可以将确定的第一网络的安全算法的标识提供给第二节点。这个示例是以第一节点选定第一密钥协商算法的情况为例进行说明,一些场景中,也可以是由第二节点根据第一节点的安全能力信息选定第一网络的安全算法。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 also 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 negotiation 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.
进一步的,上述由第一节点和第二节点协商确定第一网络的安全算法的实施方式,可以在第一网络初次加入新节点的情况下实施。例如,在第二节点加入所述第一网络之前第一节点为第一网络中的唯一节点的情况下,第一节点和第二节点进行第一网络的会话安全密钥的协商。再如,第一节点为管理节点,管理节点可以创建第一网络(此时第一节点为第一网络中的唯一节点),这种情况下,当第一个第二节点进行加入第一网络的流程时,第一节点和第二节点进行第一网络的会话安全密钥的协商。Furthermore, the above 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 of the first network. For another example, the first node is a management node, and 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 performs the process of joining the first network, the first node and the second node negotiate the session security key of the first network.
在一种可能的实施方式中,图2所示的方法可以在第二节点支持第一网络的安全算法的情况下实现。一些方案中,第一节点或第二节点可以根据第一网络中使用的安全算法的标识和第二节点的安全能力确定第二节点是否支持第一网络的安全算法。In a possible implementation, the method shown in Figure 2 can be implemented when the second node supports the security algorithm of the first network. In some schemes, 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 capability of the second node.
对于第二节点来说,若第二节点不支持第一网络的安全算法,则第二节点可以选择结束加入第一网络的流程,或者不加入该第一网络。进一步的,还可以向第一节点指示加入第一网络失败,例如发送失败原因的指示代码等。若第二节点支持第一网络的安全算法,则第二节点继续加入第一网络的流程。需要说明的是,第二节点可能在任一阶段检验是否支持第一网络的安全算法。例如,第二节点在接收到第一网络的安全算法的标识后,检验自身是否支持第一网络的安全算法。若检验为不支持,则结束当前的加入第一网络的流程,例如可以与第一节点传输(如发送和/或接收)与加入第一网络相关的消息。例如,若拓扑配置消息中包含了第一网络的安全算法的标识,第二节点接收拓扑配置消息后,可以确定自身是否支持第一网络的安全算法。在支持时,则继续执行后续的步骤S202-步骤S204中的部分或者全部步骤,否则可以结束流程,即不在执行步骤S202-步骤S204中的部分或者全部步骤。For the second node, if the second node does not support the security algorithm of the first network, the second node can choose to end the process of joining the first network, or not to join the first network. Further, the first node can also be indicated to the first node that joining the first network failed, such as sending an indication code of 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 check 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 checks whether it supports the security algorithm of the first network. If the test is not supported, the current process of joining the first network is terminated, for example, a message related to joining the first network can be transmitted (such as sending and/or receiving) with the first node. For example, if the topology configuration message contains the identifier of the security algorithm of the first network, the second node can determine whether it supports the security algorithm of the first network after receiving the topology configuration message. If supported, then continue to execute some or all of the subsequent steps S202-step S204, otherwise the process can be terminated, that is, some or all of the steps in step S202-step S204 are not executed.
对于第一节点来说,第一节点可以接收来自第二节点的安全能力信息,第二节点的安全能力信息指示所述第二节点支持的安全算法。在第二节点不支持所述第一网络的安全算法的情况下,可以向第二节点发送第二消息,第二消息指示加入第一网络失败。进一步的,可以结束将第二节点加入第一网络的流程,例如可以不与第二节点传输(如发送和/或接收)与加入第一网络相关的消息等。For the first node, the first node may receive security capability information from the second node, and the security capability information of the second node indicates the security algorithm supported by the second node. In the case where the second node does not support the security algorithm of the first network, a second message may be sent to the second node, and the second message indicates that joining the first network failed. Further, the process of joining the second node to the first network may be terminated, for example, messages related to joining the first network may not be transmitted (such as sending and/or receiving) with the second node.
相反的,在第二节点支持第一网络的安全算法的情况下,则第一节点继续执行将第二节点加入第一网络的流程。例如,在第二支持第一网络的安全算法的情况下,执行步骤后续步骤,这里的后续步骤包含步骤S204,也即,步骤S204在第二节点支持第一网络的安全算法的情况下被执行。On the contrary, 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.
需要说明的是,步骤S201中,拓扑配置消息可能不是第一节点通过点对点的形式针对性地向第二节点发送的。在一些方案中,第一节点可以通过广播或者组播的方式发送拓扑配置消息,当第二节点属于可以接收到拓扑配置消息的范围内时,该拓扑配置消息均可以看作向第二节点发送的。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 schemes, the first node may send the topology configuration message by broadcast or multicast, and when the second node is within the range that can receive the topology configuration message, the topology configuration message can be regarded as sent to the second node.
步骤S202:第一节点与第二节点协商确定第一KDF。Step S202: The first node and the second node negotiate to determine a first KDF.
其中,KDF能够基于一段信息,派生得到另一段信息。一些方案中,KDF可以接收一个密钥(或其他弱密钥材料)作为输入,通过一个特殊函数输出安全密钥材料。在派生时,KDF通常会加入参数作为加密因子,这个加密因子被称为盐(Salt)。一些方案中,KDF可以通过哈希函数实现,哈希函数例如SHA1、SHA256、SHA512等函数。另一些方案中,KDF可以包含如下几种算法中的一种或者多种:crypt(或者其变体的函数)、基于密码的密钥派生函数(password-based key derivation function,PBKDF)、Bcrypt(Blowfish crypt)、Scrypt、Argon2算法等。Among them, KDF can derive another piece of information based on one piece of information. In some schemes, KDF can receive a key (or other weak key material) as input and output secure key material through a special function. When deriving, KDF usually adds parameters as encryption factors, which are called salts. In some schemes, KDF can be implemented through hash functions, such as SHA1, SHA256, SHA512 and other functions. 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.
请参见表2,表2是本申请实施例提供的一种KDF的信息图。其中,KDF示例性可以包含4种,4种KDF分别示例性地称为KDF0、KDF1、KDF2和KDF3,其对应的值可以如表2所示。Please refer to Table 2, which is an information diagram of a KDF provided in an embodiment of the present application. Among them, KDF may include 4 types, and the 4 types of KDF are exemplarily called KDF0, KDF1, KDF2 and KDF3, and their corresponding values may be shown in Table 2.
表2KDF信息表
Table 2 KDF information table
具体的,第一KDF为第二节点支持的KDF。下面示例性地介绍几种确定第一KDF的方式:Specifically, the first KDF is a KDF supported by the second node. The following are several exemplary methods for determining the first KDF:
方式一,第一节点可以在第二节点支持的KDF中,选择第一KDF并向第二节点指示其选定的第一KDF。例如,第一节点接收来自第二节点的第二节点的KDF能力,第二节点的KDF能力指示第二节点支持的KDF。第一节点确定第一KDF后,向第二节点发送第一KDF的指示信息。Method 1: The first node may select a first KDF from the KDFs supported by the second node and indicate the selected first KDF to the second node. For example, the first node receives the KDF capability of the second node from the second node, and the KDF capability of the second node indicates the KDF supported by the second node. After the first node determines the first KDF, it sends the indication information of the first KDF to the second node.
请参见表3,第二节点的KDF能力信息可以指示第二节点支持KDF0、KDF1、KDF2这3项KDF,例如第二节点的KDF能力信息包含“KDF0、KDF1、KDF2”,或者包含“0000、0001、0010”。第一节点可以从第二节点支持的KDF0、KDF1、KDF2中选择一项(或多项)作为后续校验所使用的KDF,即第一KDF。当然,此处的名称、标识、KDF的数量仅为实例。可选的,第一节点可以从第二节点支持的KDF中选择优先级最高的KDF作为第一KDF。Please refer to Table 3. The KDF capability information of the second node may indicate that the second node supports three KDFs, namely KDF0, KDF1, and KDF2. For example, the KDF capability information of the second node includes "KDF0, KDF1, KDF2", or includes "0000, 0001, 0010". The first node may select one (or more) of KDF0, KDF1, and KDF2 supported by the second node as the KDF used for subsequent verification, i.e., the first KDF. Of course, the names, identifiers, and numbers 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.
表3节点的KDF能力
Table 3 KDF capabilities of nodes
进一步的,第一KDF也可以为第一节点支持的KDF,由于后续需要通过KDF进行信息校验,因此第一节点也需要支持该KDF从而校验第一信息或者生成第一信息的验证值。示例性的,第一KDF为第一节点和第二节点都支持的KDF中优先级最高的KDF。Furthermore, the first KDF may also be a KDF supported by the first node. Since the information needs to be verified by KDF later, the first node also needs to support the KDF to verify the first information or generate a verification value of 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.
继续参见表3,第一节点支持KDF0、KDF1、KDF2、KDF3这4项KDF,第一节点可以从第一节点和第二节点共同支持的KDF0、KDF1、KDF2中选择一项(或多项)作为后续校验所使用的KDF,即第一KDF。Continuing to refer to Table 3, the first node supports four KDFs, namely KDF0, KDF1, KDF2, and KDF3. The first node can select one (or more) from KDF0, KDF1, and KDF2 supported by the first node and the second node as the KDF used for subsequent verification, namely the first KDF.
在一种可能的实施方式中,第二节点的KDF能力携带于第二节点向第一节点发送的消息中,便于区分称为消息第一消息。而第一KDF的指示信息携带于第一节点向第二节点发送的消息中,便于区分称为第二消息。进一步的,第一消息和第二消息属于在网络层的消息,该第一消息和第二消息在传输时可以在下一层实体再进行封装。示例性的,第一消息和第二消息可以是第一节点和第二节点在建立网络层连接时传输的信息。In a possible implementation, the KDF capability of the second node is carried in the message sent by the second node to the first node, so as to facilitate the distinction of the message called the first message. The indication information of the first KDF is carried in the message sent by the first node to the second node, so as to facilitate the distinction of the message called the second message. Furthermore, the first message and the second message are messages at the network layer, and the first message and the second message can be encapsulated in the next layer entity when transmitted. Exemplarily, the first message and the second message can be information transmitted by the first node and the second node when establishing a network layer connection.
方式二,第二节点可以在第二节点和第一节点都支持的KDF中,选择第一KDF并向第二节点指示其选定的第一KDF。例如,第二节点接收来自第一节点的第一节点的KDF能力,向第一节点的KDF能力指示第一节点支持的KDF。结合表3,第一节点可以向第二节点指示自身支持KDF0、KDF1、KDF2和KDF3这4项KDF,第二节点可以从第一节点支持的KDF0、KDF1、KDF2中选择一项(或多项)作为后续校验所使用的KDF,即第一KDF。进一步的,选择出的KDF也可以是第二节点支持的。可选的,第二节点可以从第一节点和第二节点共同支持的KDF中选择优先级最高的KDF作为第一KDF。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 combination with Table 3, the first node can indicate to the second node that it supports four KDFs, namely KDF0, KDF1, KDF2 and KDF3, and 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, namely 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 as the first KDF from the KDFs supported by both the first node and the second node.
一些场景中,若第一节点和第二节点没有共同支持的KDF,则第一节点或者第二节点可以结束流程,例如不再执行后续流程,丢弃已收到的消息、断开链接等。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 end the process, for example, not execute subsequent processes, discard received messages, disconnect the link, etc.
步骤S203:第一节点与第二节点通过第一KDF校验第一信息。Step S203: The first node and the second node verify the first information through the first KDF.
其中,第一信息可以包含第一节点和第二节点传输过的信息,例如拓扑配置消息包含的信息和/或本文中提到的、在执行校验这一动作之前传输的一种或者多种信息。例如第一消息包含的信息、第二消息包含的信息等。可选的,第一信息可以包含传输过的消息中的所有信息,也可以只包含传输过的消息中的部分信息。以第一信息包含拓扑配置消息包含的信息为例,拓扑配置消息里面可能包含多项信息,在校验时可以校验拓扑配置消息中的部分信息,第一网络的拓扑类型或第一网络的安全算法的标识等。或者可选的,校验时可以校验拓扑配置消息中的全部消息,或称为校验整条拓扑配置消息包含的信息。Among them, the first information may include information transmitted by the first node and the second node, such as information contained in a 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 a 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 verifying the information contained in the entire topology configuration message.
进一步的,第一信息还可以包含第一节点和第二节点之间预先确定的参数、密钥等。例如,第一信息可以包含第一密钥、基于第一密钥推演得到的加密密钥、基于第一密钥推演得到的认证加密密钥、基于第一密钥推演得到的完整性保护密钥、或第一参数等中的一项或者多项。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 authentication encryption key derived based on the first key, an integrity protection key derived based on the first key, or the first parameter.
一些场景中,在校验第一信息成功的情况下,第一节点或第二节点继续执行将第二节点加入第一网络 的流程,例如后续的步骤S204。在校验第一信息不成功的情况下,第一节点或第二节点可以中断或结束加入将第二节点加入第一网络的流程,例如不再执行步骤S204。In some scenarios, when the verification of the first information is successful, the first node or the second node continues to execute the addition of the second node to the first network. In the case where the verification of the first information is unsuccessful, the first node or the second node may interrupt or end the process of adding the second node to the first network, for example, not executing step S204.
下面示例性的介绍几种校验第一信息的可能实现方式:Several possible implementation methods of verifying the first information are described below by way of example:
实现方式一:第二节点基于第一信息生成第一验证值,并将第一验证值发送给第一节点,由第一节点进行校验。其中,第一信息包含生成第一验证值之前,第二节点接收或者发送给第一节点的信息,例如拓扑配置消息的信息,再如第二节点的KDF能力、第二节点的密钥协商算法能力等。或者可选的,第一信息包含生成第一验证值之前,第一节点和第二节点共享的信息,例如预先在第一节点和第二节点中配置的参数,再如第一节点和第二节点协商得到的第一密钥,再如基于该第一密钥派生得到的会话安全密钥(即加密密钥、完保密钥、认证加密密钥中的一项或者多项)。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.
作为一种可能的实施方式,第一验证值与第一KDF,以及以下信息中的一项或者多项相关:第一参数、第一密钥、第一消息包含的信息、第二消息包含的信息和拓扑配置消息包含的信息相关联。其中,第一参数为第一节点和第二节点预先定义的参数,其值也可以是固定的,也可能进行变化。第一密钥为第一节点和第二节点预先共享的密钥,例如协商得到的密钥,或者预先设置的密钥,或者基于原本共享的密钥派生得到的密钥。拓扑配置消息可以包含第一网络的信息,第一网络的安全算法的标识等。第二消息包含第一公钥(可选)、第一随机数(可选)、选择密钥协商算法(可选)、选择的KDF(看做第一KDF的指示信息)等。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. Among them, the first parameter is a parameter predefined by the first node and the second node, and its value may also be fixed or may change. The first key is a key pre-shared by the first node and the second node, such as a negotiated key, or a pre-set key, or a key derived from 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 negotiation algorithm (optional), a selected KDF (regarded as indication information of the first KDF), etc.
以上实施方式提供了多种可能的情况,下面示例性的介绍几种可能的设计:The above implementations provide a variety of possible situations. The following are some possible designs as examples:
设计1:第二节点可以基于第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息生成第一验证值,并第一验证值发送给第一节点。进一步的,第一节点可以基于相同的参数和第一KDF,校验第一验证值。例如,第一节点可以基于第一KDF和相同的参数得到第一测试值,并比较第一测试值是否与第一验证值相同,若相同则表示校验第一验证值成功,否则表示校验失败。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. Further, 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 whether the first test value is the same as the first verification value. If they are the same, it indicates that the verification of the first verification value is successful, otherwise it indicates that the verification fails.
示例性地,第一验证值可以满足如下式子:第一验证值=KDF(DH key,第二消息内容,拓扑配置消息内容)。其中,KDF为第一节点和第二节点协商确定的KDF,DH key表示第一节点和第二节点之间预先确定的密钥(看作第一密钥),第二消息内容=第一随机数||第一公钥||选择的密钥协商算法||选择的密钥派生函数,拓扑配置消息内容=加密算法||完整性保护算法。应理解,“||”表示信息联接或拼接。例如,第一随机数为0x11111111,第一公钥为0x00000000,则第一随机数||第一公钥为0x1111111100000000。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 determined by negotiation between 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), the second message content = first random number || first public key || selected key negotiation algorithm || selected key derivation function, topology configuration message content = encryption algorithm || integrity protection algorithm. It should be understood that "||" represents information connection or splicing. For example, if the first random number is 0x111111111 and the first public key is 0x00000000, then the first random number || first public key is 0x1111111100000000.
设计2:第二节点可以基于第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息生成第一验证值,并将第一验证值发送给第一节点。进一步的,第一节点可以基于相同的参数和第一KDF,校验第一验证值。Design 2: The second node can generate a 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, and send the first verification value to the first node. Further, the first node can verify the first verification value based on the same parameters and the first KDF.
示例性地,第一验证值可以满足如下式子:第一验证值=KDF(ZERO,第二消息内容,拓扑配置消息内容)。其中,KDF为第一节点和第二节点协商确定的KDF,ZERO表示N比特的0,例如128比特全0,第二消息内容=选择的密钥派生函数,拓扑配置消息内容=加密算法||完整性保护算法。Exemplarily, the first verification value may satisfy the following formula: first verification value = KDF (ZERO, second message content, topology configuration message content). Wherein, KDF is the KDF determined by negotiation between the first node and the second node, ZERO represents N bits of 0, for example, 128 bits of all 0, the second message content = the selected key derivation function, and the topology configuration message content = encryption algorithm||integrity protection algorithm.
需要说明的是,具体实施过程中,参与生成第一验证值的参数可以更多或者更少。以设计1为例,第二消息内容可以只通过第二消息中的部分信息拼接得到。再如,前述的第一公钥、选择的密钥协商算法等是指在密钥协商场景下的信息,一些实施过程中第一节点和第二节点没有协商密钥,则第一公钥、选择的密钥协商算法等参数则不参与生成第一验证值。It should be noted that, in 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, the selected key negotiation algorithm, etc. refer to information in the key negotiation scenario. In some implementation processes, the first node and the second node do not negotiate a key, then the first public key, the selected key negotiation algorithm and other parameters do not participate in generating the first verification value.
设计3:第一验证值与第一密钥和拓扑配置消息包含的信息相关,例如其可以表示为:第一验证值=KDF(DH key,拓扑配置消息内容)。类似的,第一验证值与第一密钥和拓扑配置消息包含的信息相关,例如其可以表示为:第一验证值=KDF(DH key,第二消息内容)。Design 3: The first verification value is related to the first key and the information contained 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 contained in the topology configuration message, for example, it can be expressed as: first verification value = KDF (DH key, second message content).
设计4:第一验证值与第一参数和拓扑配置消息包含的信息相关,例如其可以表示为:第一验证值=KDF(ZERO,拓扑配置消息内容)。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).
以上4中设计仅为示例性的描述与第一验证值相关的操作,具体实施过程中,参与生成第一验证值得信息可以更多,例如,KDF还可以接收算法指示,以用于指示内部使用何种函数等。另外,以上的参数顺序、表示方式(例如通过KDF()表示KDF算法)等仅为示例,不作为对具体实施方式的限定。The above 4 designs are only exemplary descriptions of operations related to the first verification value. In the specific implementation process, more information may be involved in generating the first verification value. For example, KDF may also receive an algorithm indication to indicate which function is used internally. In addition, the above parameter order, representation method (for example, KDF() is used to represent the KDF algorithm) and the like are only examples and are not intended to limit the specific implementation.
在一种可能的实施方式中,第一验证值携带于第二节点发送第一节点的第三消息。进一步的,消息第三消息晚于消息第一消息。第一随机数可以携带在第一节点发送给第二节点的消息中,例如第二消息,第二消息早于第三消息。In a possible implementation, the first verification value is carried in a third message sent by the second node to the first node. Further, the third message is later than the first message. The first random number may be carried in a message sent by the first node to the second node, such as the second message, which is earlier than the third message.
实现方式二:第一节点基于第一信息生成第二验证值,并将第二验证值发送给第二节点,由第二节点进行校验。 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 is verified by the second node.
作为一种可能的实施方式,第二验证值与第一KDF,以及以下信息中的一项或者多项相关:第一参数、第一密钥、第一消息包含的信息、第二消息包含的信息、第三消息包含的信息和拓扑配置消息包含的信息相关联。第一消息可以包含KDF能力、密钥协商算法能力等中的一项或者多项。第三消息可以包含第二公钥、第二随机数、第一验证值等中的一项或者多项信息。As a possible implementation, the second verification value is related to the first KDF, and one or more of the following information: the first parameter, the first key, the information included in the first message, the information included in the second message, the information included in the third message, and the information included in the topology configuration message. The first message may include one or more of KDF capability, key agreement algorithm capability, etc. The third message may include one or more of the second public key, the second random number, the first verification value, etc.
下面列举几种可能的示例:Here are a few possible examples:
示例一:第一节点可以基于第一KDF、第一密钥、第一消息包含的信息、第三消息包含的信息和拓扑配置消息包含的信息生成第二验证值,并第二验证值发送给第二节点。进一步的,第二节点可以基于相同的参数和第一KDF,校验第二验证值。例如,第二节点可以基于第一KDF和相同的参数得到第二测试值,并比较第二测试值是否与第二验证值相同,若相同则表示校验第二验证值成功,否则表示校验失败。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 whether the second test value 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.
示例性地,第二验证值可以满足如下式子:第二验证值=KDF(DH key,第三消息内容,第一消息内容,拓扑配置消息内容)。其中,KDF为第一节点和第二节点协商确定的KDF,DH key表示第一节点和第二节点之间预先确定的密钥(看作第一密钥),第三消息内容=第二随机数||第二公钥||第一验证值,第一消息内容=密钥协商算法能力||密钥派生函数能力,拓扑配置消息内容=加密算法||完整性保护算法。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). Wherein, KDF is the KDF determined by negotiation between the first node and the second node, DH key represents a key predetermined between the first node and the second node (regarded as the first key), the third message content = second random number || second public key || first verification value, the first message content = key negotiation algorithm capability || key derivation function capability, and the topology configuration message content = encryption algorithm || integrity protection algorithm.
示例二:第一节点可以基于第一KDF、第一参数、第一消息包含的信息、第三消息包含的信息和拓扑配置消息包含的信息生成第二验证值,并将第二验证值发送给第二节点。进一步的,第二节点可以基于相同的参数和第一KDF,校验第一验证值。Example 2: The first node can generate a second verification value based on the first KDF, the first parameter, 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. Further, the second node can verify the first verification value based on the same parameters and the first KDF.
示例性地,第二验证值可以满足如下式子:第二验证值=KDF(ZERO,第三消息内容,第一消息内容,拓扑配置消息内容)。其中,KDF为第一节点和第二节点协商确定的KDF,ZERO表示N比特的0,例如128比特全0,第三消息内容=第二随机数||第二公钥||第一验证值,第一消息内容=密钥协商算法能力||密钥派生函数能力,拓扑配置消息内容=加密算法||完整性保护算法。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). Wherein, KDF is the KDF determined by negotiation between the first node and the second node, ZERO represents N bits of 0, for example, 128 bits of all 0, the third message content = the second random number || the second public key || the first verification value, the first message content = the key negotiation algorithm capability || the key derivation function capability, and the topology configuration message content = the encryption algorithm || the integrity protection algorithm.
需要说明的是,具体实施过程中,参与生成第二验证值的参数可以更多或者更少。It should be noted that, during the specific implementation process, the parameters involved in generating the second verification value may be more or less.
示例3:第二验证值与第一密钥、第三消息包含的信息和第一密钥和拓扑配置消息包含的信息相关,例如其可以表示为:第二验证值=KDF(DH key,第三消息内容,拓扑配置消息内容)。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).
示例4:第二验证值与第一参数、第三消息包含的信息和拓扑配置消息包含的信息相关,例如其可以表示为:第二验证值=KDF(ZERO,第三消息内容,拓扑配置消息内容)。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).
示例5:第二验证值与第一密钥和拓扑配置消息包含的信息相关,例如其可以表示为:第二验证值=KDF(DH key,第三消息内容,拓扑配置消息内容)。Example 5: The second verification value is related to the first key and the 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).
示例6:第二验证值与第一参数和拓扑配置消息包含的信息相关,例如其可以表示为:第二验证值=KDF(ZERO,第三消息内容,拓扑配置消息内容)。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).
在又一种可能的实施方式中,第一节点与第二节点通过第一KDF校验第一信息的过程经过安全保护,以期进一步提升安全性。例如,前述的第一验证值和/或第二验证值,可以经过安全保护。以通过第一验证值为例,一种示例中,第一验证值在传输的过程中经过加密,例如携带第一验证值的消息在接入层被加密,再如,第一验证值(或携带第一验证值的消息)可以被密钥加密形成密文,第二节点可以发送第密文。又一种示例中,参与生成第一验证值的参数包含密钥,从而使得第一验证值不易被破解。In another possible implementation, the process in which the first node and the second node verify the first information through the first KDF is securely protected in order to further improve 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 in another example, the first verification value (or the message carrying the first verification value) can be encrypted by 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.
步骤S204:第一节点向第二节点加密发送第一网络的网络密钥。相应的,第二节点接收来自第一节点的第一网络的网络密钥。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.
可选的,对第一网络的网络密钥NetKey进行加密也可以通过如下方式实现:NetKey被携带于某一消息中,第一节点通过加密密钥对整条消息进行加密。Optionally, encrypting the network key NetKey of the first network may also be implemented in the following manner: NetKey is carried in a message, and the first node encrypts the entire message using the encryption key.
其中,第一网络的网络密钥用于对第一网络中的节点之间的消息进行安全保护,例如用于加密、完保、或认证加密等中的一项或者多项。这里包含直接用于加密、完保、或认证加密等,也可以是先基于第一网络的网络密钥派生得到加密密钥、完保密钥或认证加密密钥等,再通过这些派生的密钥对消息进行安全保护。示例性的,加密密钥Kenc可以通过如下方式推演得到,Kenc=KDF(NetKey,算法标识,"enc"),其中,NetKey为第一网络的网络密钥,算法标识用于指示推演所使用的KDF算法,"enc"可以看作KDF的盐,该标识与加密密钥相关,从而使得对侧设备也可以基于相同的盐派生得到一致的加密密钥。类似的,完整性保护密钥Kint可以通过如下方式推演得到,Kint=KDF(NetKey,算法标识,"int"),其中,算法标识用于指示推演所使用的KDF算法(可以与派生加密密钥的算法不同或相同),"int"可以看作KDF的盐。类似的,认证加密密钥Kac可以通过如下方式推演得到:Kac=KDF(NetKey,算法标识,"auth enc"),其中,算法标识用于指示推演所使用的KDF算法,"auth enc"可以看作KDF的盐。需要说明的是,以上的加密密钥Kenc、完整性保护密钥Kint、完整性保护密钥Kint等可以用于对第一网络中的消息进行安全保护。 Among them, the network key of the first network is used to securely protect messages between nodes in the first network, for example, for one or more of encryption, integrity, or authenticated encryption. This includes being directly used for encryption, integrity, or authenticated encryption, etc., or first deriving an encryption key, integrity key, or authenticated encryption key based on the network key of the first network, and then using these derived keys to securely protect the message. Exemplarily, the encryption key Kenc can be derived in the following manner: Kenc = KDF (NetKey, algorithm identifier, "enc"), where NetKey is the network key of the first network, the algorithm identifier is used to indicate the KDF algorithm used for derivation, and "enc" can be regarded as the salt of KDF, which is related to the encryption key, so that the opposite device can also derive a consistent encryption key based on the same salt. Similarly, the integrity protection key Kint can be derived in the following manner: Kint = KDF (NetKey, algorithm identifier, "int"), where the algorithm identifier is used to indicate the KDF algorithm used for derivation (which can be different from or the same as the algorithm for deriving the encryption key), and "int" can be regarded as the salt of KDF. Similarly, the authentication encryption key Kac can be derived as follows: Kac = KDF (NetKey, algorithm identifier, "auth enc"), where the algorithm identifier is used to indicate the KDF algorithm used for deduction, and "auth enc" can be regarded as the salt of KDF. It should be noted that the above encryption key Kenc, integrity protection key Kint, integrity protection key Kint, etc. can be used to securely protect messages in the first network.
在一种可能的实施方式中,第一节点还可以向第二节点发送第一网络的网络密钥的ID。可选的,第一网络的网络密钥可以为编号、字符串等。或者可选的,第一网络的网络密钥的ID可以为基于第一网络的网络密钥推演得到的。一些方案中,第一网络的网络密钥的ID和第一网络的网络密钥可以携带在同一条消息中。In a 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, etc. 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 schemes, 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.
示例性的,在向第二节点发送第一网络的网络密钥以后,第一节点和第二节点可以通过第一网络的网络密钥对第一节点和第二节点的网络层进行安全保护。Exemplarily, 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 layer of the first node and the second node through the network key of the first network.
下面列举两种第一节点加密发送第一网络的网络密钥的实现方式:Two implementation methods of the first node encrypting and sending the network key of the first network are listed below:
实现方式一,在接入层对消息进行了加密的情况下,第一节点通过接入层的加密机制将第一网络的网络密钥加密发送。具体的,第一节点向第二节点发送第四消息,第四消息包含第一网络的网络密钥,该第四消息在接入层被加密。这种情况下,第一节点和第二节点先建立了接入层连接且接入层加密开启时,而携带第一网络层的网络密钥在传输时可以在第一节点的接入层中经过加密处理,因此,携带第一网络的网络密钥的消息则在接入层被加密。相应的,第二节点接收第四消息时,在第二节点的接入层可以解密第四消息,获取第一网络的网络密钥。Implementation method 1: When the access layer encrypts the message, the first node encrypts and sends the network key of the first network through the encryption mechanism of the access layer. Specifically, the first node sends a fourth message to the second node, and the fourth message includes 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 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. Correspondingly, 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.
实现方式二,第一节点和第二节点可以通过预先(例如在传输该密钥之前)共享的密钥对第一网络的网络密钥进行加密得到密文。在传输时,第一节点向第二节点发送第一网络的网络密钥的密文。相应的,第二节点可以获取该密文,并基于共享的密钥解密密文,得到第一网络的网络密钥。In implementation mode 2, the first node and the second node may encrypt the network key of the first network by using a key shared in advance (for example, 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. Correspondingly, the second node may obtain the ciphertext and decrypt the ciphertext based on the shared key to obtain the network key of the first network.
应理解,上述两种加密发送的方式仅为示例,具体实施过程中可以包含其他能够加密发送第一网络的网络密钥的方式。另外,上述两种方式还可以在不互斥的情况下结合,例如,第一节点和第二节点建立接入层连接后,若接入层连接未开启,则通过密钥对第一网络的网络密钥进行加密得到密文,实现加密传输第一网络的网络密钥。例如,若接入层连接未开启,则基于密钥协商算法交换得到密钥,并基于该密钥(直接或者间接)对第一网络的网络密钥进行加密。而若接入层连接开启,则通过接入层的加密机制将第一网络的网络密钥加密发送。It should be understood that the above two encrypted transmission methods are only examples, and other methods that can encrypt and send the network key of the first network may be included in the specific implementation process. 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 by the key to obtain a ciphertext, thereby realizing 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 negotiation 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 through the encryption mechanism of the access layer.
一种可能的实施方式中,共享的密钥可以是第一节点和第二节点协商得到的密钥,或者,共享的密钥可以是基于第一节点和第二节点协商得到的密钥推演得到的密钥。In a possible implementation manner, the shared key may be a key obtained by negotiation between the first node and the second node, or the shared key may be a key derived based on the key obtained by negotiation between the first node and the second node.
下面先介绍第一节点和第二节点协商得到密钥的过程。一些方案中,第一节点可以基于第一密钥协商算法与第二节点协商确定第一密钥。其中,第一密钥用于对第一节点和第二节点之间传输的信息进行安全保护。可选的,第一密钥可以直接用于通信过程中的信息加密。或者可选的,第一密钥可以用于派生得到其他密钥,其派生得到密钥可以用于通信过程中的信息加密。The following first introduces the process of the first node and the second node negotiating to obtain a key. In some schemes, the first node can negotiate with the second node to determine the first key based on the first key negotiation algorithm. The first key is used to securely protect information transmitted between the first node and the second node. Optionally, the first key can be directly used to encrypt information during the communication process. Alternatively, the first key can be used to derive other keys, and the derived keys can be used to encrypt information during the communication process.
其中,第一密钥协商算法是第一节点和第二节点均支持的算法。一种示例性的协商得到第一密钥的过程如下:第一节点和第二节点确定各自的私钥,第一节点基于第一节点的私钥和通过第一密钥协商算法确定出的公钥确定第一公钥,并将第一公钥提供给第二节点。第二节点基于第二节点的私钥和通过第一密钥协商算法确定出的公钥确定第二公钥,并将第二公钥提供给第一节点。第一节点根据第一节点的私钥和第二公钥确定密钥,便于区分称为DHkey。而第二节点基于第二节点的私钥和第一公钥确定DHkey,在交换的公钥未经过篡改的情况下,两者确定出的DHkey是一致的。可选的,第一公钥可以携带于第二消息中,第二公钥可以携带于第一消息或第三消息中。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. When 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.
可选的,DHkey可以参与生成验证值,即DHkey可以为前述的第一密钥。这里包含直接将DHkey作为第一KDF的输入,或者,基于DHkey计算得到其他秘密值再作为第一KDF的输入。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.
进一步的,DHkey用于派生得到其他密钥,其他密钥包含但不限于是加密密钥、完保密钥、完整性保护密钥等。示例性的,加密密钥=KDF(DHkey,算法标识,加密密钥标识),其中,算法标识用于指示KDF内使用何种算法(或者说用于指定某种KDF),加密密钥标识用于标识派生得到密钥为加密密钥,例如,加密密钥标识为“enc”。类似的,完保密钥==KDF(DHkey,算法标识,完保密钥标识),完保密钥标识例如“int”。类似的,认证加密保护密钥=KDF(DHkey,算法标识,认证加密保护密钥标识),认证加密保护密钥标识例如“"auth enc”。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 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".
示例性的,加密密钥可以用于加密第一网络的网络密钥。进一步的,携带第一网络的网络密钥的消息还可以通过完保密钥进行完整性保护。再示例性的,认证加密密钥可以用于加密第一网络的网络密钥,同事对第一网络的网络密钥进行完保。Exemplarily, the encryption key can be used to encrypt the network key of the first network. Further, the message carrying the network key of the first network can also be integrity protected by the security key. In another exemplary embodiment, the authentication encryption key can be used to encrypt the network key of the first network and simultaneously protect the network key of the first network.
在一种可能的实现中,第一节点和第二节点在密钥协商DHkey过程中使用的第一密钥协商算法也可以是协商得到的。下面列举两种确定第一密钥协商算法的方式:In a possible implementation, the first key agreement algorithm used by the first node and the second node in the key agreement DHkey process may also be obtained through negotiation. Two methods for determining the first key agreement algorithm are listed below:
方式一,第一节点向第二节点告知自身支持的密钥协商算法,由第一节点选择协商密钥所使用的密钥 协商算法,即确定第一密钥协商算法。具体的,第一节点向第二节点发送第一节点的密钥协商算法能力,第一节点的密钥协商算法能力用于指示第一节点支持的密钥协商算法。第一节点接收来自第二节点发送的第一密钥协商算法的指示信息。结合表4,第二节点可以从二者共同支持的KE0、KE1、KE2这3项密钥协商算法中选择一项(或多项)作为第一密钥协商算法。Method 1: The first node informs the second node of the key negotiation algorithm it supports, and the first node selects the key used for negotiating the key. Negotiation algorithm, that is, determining the first key negotiation algorithm. Specifically, the first node sends the key negotiation algorithm capability of the first node to the second node, and the key negotiation algorithm capability of the first node is used to indicate the key negotiation algorithm supported by the first node. The first node receives the indication information of the first key negotiation algorithm sent by the second node. Combined with Table 4, the second node can select one (or more) from the three key negotiation algorithms KE0, KE1, and KE2 that are commonly supported by both nodes as the first key negotiation algorithm.
表4节点的KDF能力
Table 4 KDF capabilities of nodes
可选的,协商密钥协商算法是传输的消息可以为前述携带其他参数的消息为同一条消息,如此可以节省信令开销。例如,第二节点的密钥协商算法能力包含于第一消息,第一密钥协商算法的指示信息包含于第二消息。Optionally, the message transmitted for negotiating the key negotiation algorithm may be the same message as the message carrying other parameters, which can save signaling overhead. For example, the key negotiation algorithm capability of the second node is included in the first message, and the indication information of the first key negotiation algorithm is included in the second message.
方式二,第二节点向第一节点告知自身支持的密钥协商算法,由第二节点选择协商密钥所使用的密钥协商算法。具体的,第二节点向第一节点发送第一节点的密钥协商算法能力,第二节点的密钥协商算法能力用于指示第二节点支持的密钥协商算法。第二节点接收来自第一节点发送的第一密钥协商算法的指示信息。结合表4,第二节点可以从二者共同支持的KE0、KE1、KE2这3项密钥协商算法中选择一项(或多项)作为第一密钥协商算法。Method 2: The second node informs the first node of the key negotiation algorithms it supports, and the second node selects the key negotiation algorithm used to negotiate the key. Specifically, the second node sends the first node's key negotiation algorithm capability to the first node, and the second node's key negotiation algorithm capability is used to indicate the key negotiation algorithms supported by the second node. The second node receives the indication information of the first key negotiation algorithm sent by the first node. Combined with Table 4, the second node can select one (or more) of the three key negotiation algorithms KE0, KE1, and KE2 that are commonly supported by both nodes as the first key negotiation algorithm.
在一种可能的实施方式中,在第一节点向第二节点加密发送网络密钥之前,第一节点可以接收来自第二节点的请求消息,该请求消息用于指示请求第一网络的网络密钥。相应的,第一节点可以响应于该请求消息,向第二节点加密发送网络密钥。In a 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, the request message being used to indicate a request for 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.
进一步的,第一节点向第二节点发送第一网络的网络密钥之后,第二节点可以向第一节点发送网络密钥配置完成消息以指示密钥配置完成。进一步的,第一节点和第二节点可以启动无线邻居协议。Further, 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. Further, the first node and the second node may start a wireless neighbor protocol.
在图2所示的实施例中,第二节点加入第一网络的过程中,已经在第一网络中的第一节点可以通过加密发送的形式将第一网络的网络密钥发送给第二节点,使得网络密钥被安全地分发。而第二节点也可以在第一网络中使用网络密钥安全地传输信息。In the embodiment shown in FIG2 , when the second node joins the first network, the first node already in the first network can send the network key of the first network to the second node in an encrypted form, so that the network key is securely distributed. The second node can also use the network key to securely transmit information in the first network.
进一步的,在加密发送密钥之前,第一节点可向第二节点发送拓扑配置消息,拓扑配置消息中携带第一网络的信息主要包含了网络的一些属性信息。第一节点和第二节点可以协商得到KDF,并基于KDF验证拓扑配置消息包含的信息未受到篡改,从而确定第一节点和第二节点的通信环境安全。在此过程中,由第一节点和第二节点协商得到第一KDF,如此可以适应多种不同安全能力的节点加入网络的情况,使得网络中可以应用于具有多种不同种类设备的场景下,提升网络的包容性。Furthermore, before encrypting and sending the key, the first node may send a topology configuration message to the second node. The information of the first network carried in the topology configuration message mainly includes some attribute information of the network. The first node and the second node can negotiate to obtain the KDF, and verify based on the KDF that the information contained in the topology configuration message has not been tampered with, thereby determining that the communication environment of the first node and the second node is secure. In this process, the first node and the second node negotiate to obtain the first KDF, which can adapt to the situation where nodes with various security capabilities join the network, so that the network can be applied to scenarios with various types of devices, thereby improving the inclusiveness of the network.
上述方案中提到了接入层连接,下面介绍两种建立接入层连接的信令流程。可选的,建立接入层连接的流程也可以称为接入流程、关联流程。具体的,关联是指两个节点得到一致的通信密钥并建立连接的过程。以下以终端节点接入管理节点的流程为例进行介绍,其中,管理节点为第一节点或第二节点,相应的,终端节点可以为第二节点或第一节点。The above scheme mentions access layer connection. Two signaling processes for establishing access layer connection are introduced below. Optionally, the process of establishing access layer connection can also be called access process or association process. Specifically, association refers to the process in which two nodes obtain consistent communication keys and establish a connection. The following is an introduction to the process of terminal node accessing the management node as an example, where the management node is the first node or the second node, and correspondingly, the terminal node can be the second node or the first node.
请参见图3,图3是一种无安全上下文的关联流程的示意图,包含了认证和安全上下文流程,为了便于区分以下将关联过程中交互的消息(或称为信息)分别表示为T1-T5。在该关联流程之前,终端节点和管理节点中没有安全上下文,也没有协商得到会话密钥,不具备安全上下文。在关联时,终端节点发送消息T1,消息T1中包含终端节点ID、第一密钥协商参数和第三新鲜参数。管理节点确定第二密钥协商参数和第四新鲜参数,并根据第一密钥协商参数和第二密钥协商参数确定第一密钥。进一步,管理节点可以基于第一密钥(如密钥KKE)、第三新鲜参数和第四新鲜参数确定第二密钥(如密钥Kgt)。可选的,管理节点可以基于第二密钥(或第一密钥)派生得到会话密钥,用于对消息进行安全保护。管理节点将第二密钥协商参数和第四新鲜参数通过消息T2提供给终端节点,可选消息T2中携带认证信息(即第一认证信息),以用于校验密钥、身份、或者消息完整性。终端节点通过相同的方式得到第一密钥,或者以及第二密钥。 进一步的,终端节点通过也基于第二密钥(或第一密钥)派生得到会话密钥,用于对后消息进行安全保护。如此,终端节点和管理节点协商得到一致的密钥。终端节点进一步可以生成第二认证信息,并携带于消息T3发送给管理节点。由管理节点对第二认证信息进行校验,若校验成功则管理节点向终端节点发送消息T4,完成关联。可选终端节点通过消息T5进行响应,表明关联完成。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 distinction, the messages (or information) exchanged during the association process are represented as T1-T5. Before the association process, there is no security context in the terminal node and the management node, and 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. Further, the management node can determine the second key (such as the key K KE ), the third fresh parameter, and the fourth fresh parameter. Optionally, the management node can derive a session key based on the second key (or the first key) for security protection of the message. The management node provides the second key negotiation parameter and the fourth fresh parameter to the terminal node through a message T2, and the optional 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 manner. Furthermore, the terminal node also derives a session key based on the second key (or the first key) to protect the subsequent messages. 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 send it to the management node in a message T3. 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 optional terminal node responds with a message T5, indicating that the association is complete.
应理解,具体实施过程中,关联流程可以交互更多消息,或者消息中可以携带更多或者更少的参数。例如,第三新鲜参数和第四新鲜参数可以不携带,在得到第二密钥时可以根据第一密钥和counter得到第二密钥。再如,第一认证信息或第二认证信息可以不携带。再如,消息T1中可选还可以携带终端节点的安全能力(用于指示终端节点支持的安全算法)、密钥协商算法的指示信息等中的一项或者多项。再如,消息T2中还可以携带认证信息的长度、会话密钥的长度、第二密钥的ID(或第一密钥的ID)、安全算法的指示信息。再如,消息T4中还可以携带终端节点为管理节点分配的临时ID、第二密钥的有效期、第一密钥的有效期等中的一项或者多项。在终端节点属于某通信组的情况下,管理节点还可以在消息T4中携带通信组的组密钥、组密钥的ID、组安全算法、组密钥的有效期等中的一项或者多项。It should be understood that in the specific implementation process, the association process may exchange more messages, or the message may carry more or fewer parameters. For example, the third fresh parameter and the fourth fresh parameter may not be carried, and the second key may be obtained according to the first key and the counter when the second key is obtained. For another example, the first authentication information or the second authentication information may not be carried. For another example, the message T1 may optionally carry one or more of the security capabilities of the terminal node (used to indicate the security algorithm supported by the terminal node), the indication information of the key negotiation algorithm, etc. For another example, the 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 the indication information of the security algorithm. For another example, the message T4 may also carry one or more of 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. In the case where the terminal node belongs to a communication group, the management node may also carry one or more of 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 the message T4.
前述提到的安全上下文是指包含于通信安全相关的参数的一组信息,例如包含密钥、新鲜参数、密钥协商参数、安全算法的信息、终端的身份标识等中的一项或者多项。安全算法的信息包含安全算法的指示信息、安全算法的版本等中的一项或者多项。The aforementioned security context refers to a set of information including parameters related to communication security, such as one or more of a key, a freshness parameter, a key negotiation parameter, information about a security algorithm, an identity of a terminal, etc. The information about a security algorithm includes one or more of indication information of a security algorithm, a version of a security algorithm, etc.
示例性地,一种安全上下文可以包含如下信息中的一项或者多项:终端节点的固定ID、终端节点的临时ID、共享密钥(例如表示为Kgt)、共享密钥的有效期、共享密钥的标识(例如:Kgt ID)、密钥协商算法的指示信息、信令面的加密算法的指示信息、信令面的完整性保护算法的指示信息、信令面的加密密钥、信令面的完整性保护密钥、用户面的加密算法的指示信息、用户面的完整性保护算法的指示信息、用户面的认证加密算法的指示信息、用户面的加密密钥、用户面的完整性保护密钥、用户面的认证加密密钥、密钥推演计数器counter、COUNTERg、全局帧号(Global Frame Number,GFN)、组密钥(例如表示为GK)、GK的标识(GK ID)、组算法(Galgorithm)、组密钥的有效期(GK expiration)、组全局帧号(Group Global Frame Number,GGFN)。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), a 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 GK (GK ID), a group algorithm (Galgorithm), a validity period of the group key (GK expiration), and a group global frame number (GGFN).
请参见图4,图4是一种有安全上下文的关联流程的示意图,为了便于区分以下将消息(或信息)分别表示为T6-T8。在该关联流程之前,管理节点获取了该终端节点的安全上下文,关联上下文的内容可以参见前述。在关联时,终端节点向管理节点发送消息T7,携带终端节点的身份标识(可选为临时身份标识或者固定身份标识),可选携带Kgt ID。可选的,该消息T7可以通过完整性保护密钥进行完整性保护。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) are represented as T6-T8 below. 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.
管理节点根据终端节点的身份标识获取与该终端节点的共享的完整性保护密钥,并根据该完整性保护密钥检查关联消息的完整性。在管理节点检查关联请求消息的完整性成功的情况下,则发送消息T7,管理节点和终端节点之间建立关联。可选的,在管理节点检查关联请求消息的完整性成功的情况下,管理节点还可以为终端节点分配临时ID,此时,消息T7中可以携带管理节点为终端节点分配的临时ID。The management node obtains the shared integrity protection key with the terminal node according to the identity of the terminal node, and checks the integrity of the association message according to the integrity protection key. If the management node successfully checks the integrity of the association request message, it sends message T7, and an association is established between the management node and the terminal node. Optionally, if the management node successfully checks the integrity of the association request message, the management node can also assign a temporary ID to the terminal node. In this case, the temporary ID assigned by the management node to the terminal node can be carried in message T7.
可理解的,完整性保护密钥可以包含于安全上下文中,前述“根据该完整性保护密钥检查关联消息的完整性”也可以替换为“根据安全上下文检查关联消息的完整性”。进一步的,安全上下文可以包含完整性保护算法的指示信息和完整性保护密钥,管理节点可以通过完整性保护密钥和指定的完整性保护算法,检查消息T6的完整性。可选的,这里的完整性保护密钥可以为信令面的完整性保护算法It is understandable that the integrity protection key may be included in the security context, and the aforementioned "checking the integrity of the associated message according to the integrity protection key" may also be replaced by "checking the integrity of the associated message according to the security context". Further, the security context may include indication information of the integrity protection algorithm and the integrity protection key, and the management node may check the integrity of the message T6 by using the integrity protection key and the specified integrity protection algorithm. Optionally, the integrity protection key here may be the integrity protection algorithm of the signaling plane.
进一步的,管理节点使用信令面的完整性保护算法和信令面完整性保护密钥Ks.int对消息T7进行完整性保护。可选的,当信令面加密保护启动的情况下,管理节点还可以使用信令面的加密算法和信令面的加密密钥Ks.enc对消息T7做加密保护。Further, the management node uses the integrity protection algorithm of the signaling plane and the signaling plane integrity protection key Ks.int to perform integrity protection on message T7. Optionally, when the signaling plane encryption protection is enabled, the management node may also use the encryption algorithm of the signaling plane and the encryption key Ks.enc of the signaling plane to perform encryption protection on message T7.
可选终端节点通过消息T8进行响应,表明关联完成。一些场景中,如果消息T7进行了加密,则终端节点解密消息T7。如果消息T7进行完整性保护,则终端节点验证消息T7的完整性,若完整性验证通过,则关联完成,终端节点可以向管理节点发送消息T8。The optional terminal node responds with message T8, indicating that the association is complete. In some scenarios, if message T7 is encrypted, the terminal node decrypts message T7. If message T7 is integrity protected, the terminal node verifies the integrity of message T7. If the integrity verification passes, the association is complete and the terminal node can send message T8 to the management node.
图2所示的实施例提供了多种可能的方案,下面结合图5、图6、图7、图8、或图9对其中的部分可能设计进行示例性的说明。应理解,图5、图6、图7、图8、或图9所示实施例中的逻辑、术语等可以参见前述。另外,本申请部分图示中,将消息指示的信息通过括号在附图中进行了示意性的描述,但这并不表示对消息内容的严格限定。例如,图5所示的拓扑配置消息,虽然图示为安全算法,但具体实施过程中,拓扑配置消息中可能携带的是安全算法的标识。在下文中,其中,第一节点为已经在第一网络中的节点,一些方案中被称为在网设备。第二节点为需要加入第一网络的节点,一些场景中被称为入网设备。第一网络可以为mesh网络,当然,对于第一网络为其他拓扑类型网络的情况本申请也同样适用。 The embodiment shown in FIG. 2 provides a variety of possible solutions. The following is an exemplary description of some of the possible designs in conjunction with FIG. 5, FIG. 6, FIG. 7, FIG. 8, or FIG. 9. It should be understood that the logic, terminology, etc. in the embodiments shown in FIG. 5, FIG. 6, FIG. 7, FIG. 8, or FIG. 9 can refer to the above. In addition, in some of the illustrations of this application, the information indicated by the message is schematically described in the accompanying drawings by brackets, but this does not represent a strict limitation on the content of the message. For example, the topology configuration message shown in FIG. 5, although the diagram shows a security algorithm, in the specific implementation process, the topology configuration message may carry the identifier of the security algorithm. In the following, the first node is a node that is already in the first network, and is referred to as an in-network device in some schemes. The second node is a node that needs to join the first network, and is referred to as a networked device in some scenarios. The first network can be a mesh network. Of course, the present application is also applicable to the case where the first network is a network of other topology types.
一种可能的设计中,第一节点在发送网络密钥时通过接入层的加密机制实现网络密钥的加密。请参见图5,图5是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S502、步骤S504和步骤S505,进一步还可以包含步骤S501和/或步骤S503。步骤S501至步骤S502具体如下:In one possible design, the first node implements encryption of the network key through an encryption mechanism of the access layer when sending the network key. Please refer to Figure 5, which is a flow chart of another communication method provided by an embodiment of the present application. The communication method may include step S502, step S504 and step S505, and may further include step S501 and/or step S503. Steps S501 to S502 are as follows:
步骤S501:第一节点发送拓扑配置消息。相应的,第二节点可以接收来自第一节点的拓扑配置消息。Step S501: The first node sends a topology configuration message. Correspondingly, the second node may receive the topology configuration message from the first node.
拓扑配置消息可以包含第一网络的信息。示例性地,拓扑配置消息可以包含第一网络的信息。再示例性地,拓扑配置信息还可以用于指示第一网络所使用的安全算法。例如,拓扑配置消息包含第一网络使用的加密算法、完整性保护算法。或者,拓扑配置消息包含第一网络使用的认证加密算法。The topology configuration message may include information of the first network. Exemplarily, the topology configuration message may include information of the first network. Again exemplarily, the topology configuration information may also be used to indicate a security algorithm used by the first network. For example, the topology configuration message includes an encryption algorithm and an integrity protection algorithm used by the first network. Alternatively, the topology configuration message includes an authentication encryption algorithm used by the first network.
步骤S502:第一节点与第二节点建立接入层连接。Step S502: The first node establishes an access layer connection with the second node.
例如,第一节点和第二节点通过图3或图4所示的流程进行连接,第一节点和第二节点的接入层连接可以开启加密。For example, the first node and the second node are connected through the process shown in FIG. 3 or FIG. 4 , and encryption may be enabled for the access layer connection between the first node and the second node.
步骤S503:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自第二节点的密钥请求消息。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.
其中,密钥请求消息中包含指示信息,指示第一网络的网络密钥。The key request message includes indication information indicating the network key of the first network.
步骤S504:第一节点向第二节点发送第一网络的网络密钥。相应的,第二节点接收第一网络的网络密钥。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.
具体的,第一节点将第一网络的网络密钥携带于第四消息中,第四消息在接入层被加密。相应的,第二节点在接入层接收第四消息时,可以通过接入层的密钥解密第四消息,得到第一网络的网络密钥。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.
可选的,在发送之前,第一节点确定第一节点加入的第一网络,并确定第一网络的网络密钥。Optionally, before sending, the first node determines a first network that the first node joins, and determines a network key of the first network.
步骤S505:第一节点与第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
在图5所示的实施例中,第一节点通过接入层加密机制从而秘密传输第一网络的网络密钥,提升第一网络的网络密钥的安全性。该第一网络的网络密钥被用于网络层的安全保护,提升了节点之间网络层传输的信息安全性。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 security protection of the network layer, thereby improving the security of information transmitted between nodes at the network layer.
又一种可能的设计中,第一节点和第二节点可以协商得到第一密钥,并基于第一密钥派生得到加密密钥,在向第二节点发送网络密钥的过程中,第一节点可以使用加密密钥对网络密钥进行加密。相应的,第二节点通过加密密钥,可以解密得到网络密钥。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. In the process of sending the 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.
请参见图6,图6是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S602-步骤S608、步骤S610和步骤S611。进一步还可以包含步骤S601和/或步骤S609。步骤S601至步骤S509具体如下: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 S509 are as follows:
步骤S601:第一节点发送拓扑配置消息。相应的,第二节点接收该拓扑配置消息。Step S601: The first node sends a topology configuration message, and correspondingly, the second node receives the topology configuration message.
步骤S602:第一节点与第二节点建立接入层连接。Step S602: The first node establishes an access layer connection with the second node.
可选的,第一节点和第二节点的接入层连接可以开启加密,如此可以进一步提高网络密钥分发的安全性。或者,第一节点和第二节点的接入层连接不开启加密,此时,后续第一节点可以通过第一密钥派生的加密密钥实现网络密钥的加密发送。Optionally, the access layer connection between the first node and the second node may 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 is not encrypted, in which case the first node can subsequently encrypt and send the network key using an encryption key derived from the first key.
步骤S603:第一节点向第二节点发送第一公钥。相应的,第二节点接收来自第一节点的第一公钥。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.
具体的,第一节点产生第一私钥,并根据第一密钥协商算法,生成相应的第一公钥发送给第二节点。可选的,第一密钥协商算法可以是第一节点或者第二节点选择的。Specifically, the first node generates a first private key, and generates a corresponding first public key according to a first key agreement algorithm and sends it to the second node. Optionally, the first key agreement algorithm may be selected by the first node or the second node.
步骤S604:第二节点向第一节点发送第二公钥。相应的,第一节点接收来自第二节点的第二公钥。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.
具体的,第二节点产生第二私钥,并根据第一密钥协商算法,生成相应的第二公钥发送给第一节点。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.
步骤S605:第一节点确定第一密钥。Step S605: The first node determines the first key.
具体的,第一节点根据第一私钥、第二公钥,并根据第一密钥协商算法确定第一密钥。Specifically, the first node determines the first key according to the first private key, the second public key, and a first key negotiation algorithm.
步骤S606:第二节点确定第一密钥。Step S606: The second node determines the first key.
具体的,第二节点根据第一私钥、第二公钥,并根据第一密钥协商算法确定第一密钥。Specifically, the second node determines the first key according to the first private key, the second public key, and the first key negotiation algorithm.
步骤S607:第一节点根据第一密钥确定加密密钥。Step S607: The first node determines an encryption key according to the first key.
具体的,第一节点根据第一密钥推演出其他密钥,例如加密密钥。进一步的,第一节点还可以基于第一密钥推演完保密钥。Specifically, the first node derives other keys, such as an encryption key, based on the first key. Furthermore, the first node may also derive a security key based on the first key.
步骤S608:第二节点根据第一密钥确定加密密钥。Step S608: The second node determines an encryption key according to the first key.
参照步骤S607。Refer to step S607.
步骤S609:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自第二节点的密钥请求 消息。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. information.
步骤S610:第一节点向第二节点发送第一网络的网络密钥。Step S610: The first node sends the network key of the first network to the second node.
具体的,第一节点确定第一节点加入的第一网络的网络密钥NetKey。在发送第一网络的网络密钥时,使用加密密钥加密发送。Specifically, the first node determines a network key NetKey of a first network that the first node joins, and when sending the network key of the first network, encrypts and sends it using an encryption key.
例如,第一节点可以通过加密密钥加密第一网络的网络密钥NetKey,得到NetKey的密文并发送给第二节点。相应的,第二节点可以使用加密密钥解密密文,得到第一网络的网络密钥NetKey。For example, the first node can encrypt the network key NetKey of the first network with the encryption key, obtain the ciphertext of NetKey and send it to the second node. Correspondingly, the second node can decrypt the ciphertext with the encryption key to obtain the network key NetKey of the first network.
应理解,具体实施过程中对第一网络的网络密钥NetKey进行加密也可以通过如下方式实现:NetKey被携带于第四消息,第一节点通过加密密钥对第四消息进行加密。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: NetKey is carried in the fourth message, and the first node encrypts the fourth message using the encryption key.
步骤S611:第一节点与第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
在图6所示的实施例中,第一节点和第二节点协商得到第一密钥,并基于第一密钥推演加密密钥,从而秘密传输第一网络的网络密钥,提升第一网络的网络密钥的私密性。该第一网络的网络密钥被用于网络层的安全保护,提升了节点之间网络层传输的信息安全性。In the embodiment shown in FIG6 , the first node and the second node negotiate to obtain the first key, and derive the encryption key based on the first key, thereby secretly transmitting the network key of the first network, thereby improving the privacy of the network key of the first network. The network key of the first network is used for security protection of the network layer, thereby improving the information security of the network layer transmission between nodes.
进一步的,协商密钥时使用的密钥协商算法也可以是协商得到的,从而是的本方法适用于具有不同的密钥协商能力的节点,提升了网络对于多种类型节点的容纳能力,增强了网络可用性。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.
在一些可能的实施方式中,第一节点在传输第一网络的密钥之前,可以对第一节点和第二节点共享的信息进行校验(例如之前传输的信息、或者预先定义的信息)。在共享的信息未被篡改的情况下,第一节点再向第二节点发送第一网络的网络密钥,以提升第一网络的网络密钥的私密性,提升节点的通信安全性。In some possible implementations, before transmitting the key of the first network, the first node may verify the information shared by 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 to enhance the privacy of the network key of the first network and enhance the communication security of the nodes.
请参见图7,图7是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S701-步骤S716中的部分或者全部步骤。应理解,以下仅以S701-S716的步骤顺序为例进行示例性地描述,具体实施过程中,部分步骤执行的时机可以变更。步骤S701-步骤S716具体如下: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 step S701-step S716. It should be understood that the following is only described exemplarily by taking the step sequence of S701-S716 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S701-step S716 are as follows:
步骤S701:第一节点发送拓扑配置消息。Step S701: The first node sends a topology configuration message.
具体的,第一节点可以在拓扑配置消息中携带指示第一网络所使用的安全算法的信息。例如,拓扑配置消息包含第一网络使用的加密算法、完整性保护算法。或者,拓扑配置消息包含第一网络使用的认证加密算法。Specifically, the first node may carry 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.
一些可能的方案中,第一个入网设备通过mesh管理节点加入第一网络时,第一网络的安全算法由管理节点配置,或者通过管理节点和第一个入网设备协商确定。In some possible solutions, when a first network-entering device joins the first network through a mesh management node, a 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.
可理解的,第一节点发送拓扑配置消息,相应的,第二节点可以接收来自第一节点的拓扑配置消息。It can be understood that the first node sends a topology configuration message, and correspondingly, the second node can receive the topology configuration message from the first node.
步骤S702:第二节点判断是否支持第一网络的安全算法。Step S702: The second node determines whether it supports the security algorithm of the first network.
其中,第一网络的安全算法即第一节点在拓扑配置消息中指示的安全算法。The security algorithm of the first network is the security algorithm indicated by the first node in the topology configuration message.
若第二节点支持第一节点发送的安全算法,则执行后续流程。若第二节点不支持第一节点发送的安全算法,则结束,即不执行后续流程。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.
步骤S703:第一节点与第二节点建立接入层连接。Step S703: The first node establishes an access layer connection with the second node.
例如,第一节点和第二节点通过图3或图4所示的流程进行连接。For example, the first node and the second node are connected through the process shown in FIG. 3 or FIG. 4 .
可选的,第一节点和第二节点的接入层连接可以开启加密,如此可以进一步提高网络密钥分发的安全性。或者,第一节点和第二节点的接入层连接不开启加密,此时,后续第一节点可以通过第一密钥派生的加密密钥实现网络密钥的加密发送。Optionally, the access layer connection between the first node and the second node may 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 is not encrypted, in which case the first node can subsequently encrypt and send the network key using an encryption key derived from the first key.
步骤S704:第二节点向第一节点发送第一消息。Step S704: the second node sends a first message to the first node.
其中,第一消息携带密钥协商算法能力和密钥派生函数能力。其中,密钥协商算法能力用于指示第二节点支持的密钥协商算法,密钥派生函数能力用于指示第二节点支持的密钥派生函数。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.
应理解,本文中消息的名称仅用于区分不同的消息,具体实施过程中,消息的名称可以有其他设计。例如,第一消息可以被称为安全请求消息,或者第一消息可以为网络层连接的握手消息或hello消息。It should be understood that the names of the messages in this article are only used to distinguish different messages, and in the specific implementation process, the names of the messages may have other designs. 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 of a network layer connection.
可理解的,第二节点向第一节点发送第一消息,相应的,第一节点接收来自第二节点的第一消息。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.
作为一种可能的实施方式,第一节点根据第二节点的密钥协商算法能力和密钥派生函数能力,选择优先级最高的密钥协商算法和密钥派生函数。当然,一些方案中,第二节点所选择密钥协商算法和密钥派生函数也是第一节点自身所支持的密钥协商算法和密钥派生函数。As a possible implementation, the first node selects the key agreement algorithm and key derivation function with the highest priority according to the key agreement algorithm capability and key derivation function capability of the second node. Of course, in some schemes, 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.
进一步的,第一节点可以产生第一私钥,并根据选择的密钥协商算法生成第一公钥。可选的,第一节点还可以生成第一随机数。Further, 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.
步骤S705:第一节点向第二节点发送第二消息。 Step S705: The first node sends a second message to the second node.
其中,第二消息携带第一公钥,第二消息还用于指示第一节点选择的密钥协商算法和第一节点选择的密钥派生函数。应理解,第二消息的名称可以有其他设计,例如,第一消息可以被称为安全响应消息,或者第二消息可以为网络层连接的握手消息或hello消息。The second message carries the first public key, and the second message is also used to indicate the key agreement algorithm selected by the first node and the key derivation function selected by the first node. It should be understood that the name of the second message can have other designs, for example, the first message can be called a security response message, or the second message can be a handshake message or a hello message of a network layer connection.
进一步的,在第一节点生成第一随机数的情况下,第一随机数被携带于第二消息中发送给第二节点。Further, 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.
可理解的,第一节点向第二节点发送第二消息,相应的,第二节点可以接收来自第一节点的第二消息。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.
步骤S706:第二节点确定第一密钥。Step S706: The second node determines the first key.
示例性地,第二节点可以产生第二私钥,基于第一节点选择密钥协商算法根据第二私钥和第一公钥计算第一密钥。可选的,第一密钥也可以被称为协商密钥、DH key等。Exemplarily, the second node may generate a second private key, and based on the key negotiation algorithm selected by the first node, calculate the first key according to 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.
步骤S707:第二节点确定第一验证值。Step S707: The second node determines the first verification value.
作为一种可能的实施方式,第一验证值=KDF(DH key,第二消息内容,拓扑配置消息内容)。其中,DH key为步骤S506中确定的第一密钥,生成第一验证值使用的KDF为第一节点选择的KDF。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.
另外,第二消息内容包含第二消息中的部分或者全部信息,或者,第二消息内容包含根据第二消息中的部分或者全部信息处理得到的信息。示例性地,在第二消息包含第一随机数、第一公钥、选择的密钥协商算法和选择的密钥派生函数的情况下,第二消息内容=第一随机||第一公钥||选择的密钥协商算法||选择的密钥派生函数。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.
类似的,拓扑配置消息内容包含拓扑配置消息中的部分或者全部信息,或者,拓扑配置消息内容包含根据拓扑配置消息中的部分或者全部信息处理得到的信息。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.
作为又一种可能的实现方式,第一验证值=KDF(DH key,第一随机数,拓扑配置消息内容)。As another possible implementation, the first verification value = KDF (DH key, first random number, topology configuration message content).
步骤S708:第二节点向第一节点发送第三消息。Step S708: The second node sends a third message to the first node.
其中,第三消息携带第二公钥和第一验证值。其中,第二公钥可以是第二节点根据第二私钥确定的,具体的,第二节点产生第二私钥,并根据选择的密钥协商算法,生成相应的第二公钥。进一步的,第二节点还生成第二随机数,第二随机数被携带于第三消息中发送给第二节点。The third message carries the second public key and the first verification value. The second public key may be determined by the second node according to the second private key. Specifically, the second node generates the second private key and generates the corresponding second public key according to the selected key agreement algorithm. Furthermore, the second node also generates a second random number, which is carried in the third message and sent to the second node.
应理解,第三消息的名称可以有其他设计,例如,第三消息可以被称为安全验证请求消息,或者第三消息可以为网络层连接的握手消息或hello消息。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.
可理解的,第二节点向第一节点发送第三消息,相应的,第一节点可以接收来自第二节点的第三消息。可选的,第一节点可以验证第一验证值。进一步的,在第一节点验证第一验证值成功的情况下,进行后续流程,例如继续执行步骤S709以及之后的部分或者全部步骤,否则结束流程。It is understandable 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, a subsequent process is performed, such as continuing to execute step S709 and some or all of the subsequent steps, otherwise the process ends.
步骤S709:第一节点确定第一密钥。Step S709: The first node determines the first key.
示例性地,第一节点根据第一私钥和第二公钥,通过选择的密钥协商算法计算第一密钥。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.
步骤S710:第一节点确定第二验证值。Step S710: The first node determines a second verification value.
作为一种可能的实施方式,第二验证值=KDF(DH key,第三消息内容,第二消息内容,拓扑配置消息内容)。其中,DH key为步骤S709中确定的第一密钥,生成第一验证值使用的KDF为第一节点选择的KDF。As a possible implementation, the second verification value = KDF (DH key, third message content, second message content, topology configuration message content). Wherein, 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.
另外,第三消息内容包含第三消息中的部分或者全部信息,或者,第三消息内容包含根据第三消息中的部分或者全部信息处理得到的信息。示例性地,在第三消息包含第二随机数、第二公钥和第一验证值的情况下,第三消息内容=第二随机数||第二公钥||第一验证值。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.
类似的,拓扑配置消息内容包含拓扑配置消息中的部分或者全部信息,或者,拓扑配置消息内容包含根据拓扑配置消息中的部分或者全部信息处理得到的信息。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.
作为又一种可能的实现方式,第一验证值=KDF(DH key,第二随机数,拓扑配置消息内容)。As another possible implementation, the first verification value = KDF (DH key, second random number, topology configuration message content).
步骤S711:第一节点向第二节点发送第五消息。Step S711: the first node sends a fifth message to the second node.
其中,第五消息携带第二验证值。Among them, the fifth message carries the second verification value.
步骤S712:第一节点通过第一密钥,确定加密密钥。Step S712: The first node determines the encryption key using the first key.
进一步的,第一节点还可以基于第一密钥推演完整性保护密钥或认证加密密钥。Furthermore, the first node may also derive an integrity protection key or an authentication encryption key based on the first key.
步骤S713:第二节点通过第一密钥,确定加密密钥。Step S713: The second node determines the encryption key through the first key.
具体的,第一节点基于第一密钥推演加密密钥。Specifically, the first node derives an encryption key based on the first key.
进一步的,第一节点还可以基于第一密钥推演完整性保护密钥或认证加密密钥。Furthermore, the first node may also derive an integrity protection key or an authentication encryption key based on the first key.
步骤S714:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自第二节点的密钥请求消息。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.
步骤S715:第一节点向第二节点发送网络密钥配置消息。Step S715: The first node sends a network key configuration message to the second node.
其中,网络密钥配置消息中包含第一网络的网络密钥。可选的,网络密钥配置消息中还可以包含第一 网络的网络密钥的ID。可选的,第五消息可以为网络密钥配置消息,或者为在接入层被封装的网络密钥配置消息。The network key configuration message includes the network key of the first network. Optionally, the network key configuration message may also include the network key of the first network. The ID of the network key of the network. Optionally, the fifth message may be a network key configuration message, or a network key configuration message encapsulated at the access layer.
可选的,第一节点确定第一节点加入的第一网络的网络密钥NetKey,将该NetKey携带在密钥配置消息中发送给第二节点。Optionally, the first node determines a network key NetKey of a first network joined by the first node, carries the NetKey in a key configuration message and sends it to the second node.
可选的,第一节点可以基于前述的第一密钥推演加密密钥,该网络密钥配置消息可以使用该加密密钥加密发送。相应的,第二节点可以使用加密密钥解密密文,得到第一网络的网络密钥NetKey。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.
进一步的,第一节点还可以基于第一密钥推演完整性保护密钥,可选网络密钥配置消息经过该完整性保护密钥进行完整性保护。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.
可选的,第一节点可以基于前述的第一密钥推演认证加密密钥,该网络密钥配置消息可以使用认证加密密钥认证加密。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.
进一步的,第二节点还可以向第一节点发送第六消息,第六消息用于指示网络密钥配置完成。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.
步骤S716:第一节点与第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
进一步的,第一节点和第二节点可以启动无线邻居协议。Further, the first node and the second node may start a wireless neighbor protocol.
在图7所示的实施例中,在第一节点加入第一网络的过程中,第一节点与第二节点协商密钥协商算法和密钥派生函数。其中,密钥协商算法被用于确定第一密钥,第一密钥用于对二者之间传输的信息进行安全保护。密钥派生函数用于校验二者传输的信息,确保传输的信息不受到篡改。如此,第一节点可以实现在相对安全的环境下分发第一网络的网络密钥,提升网络安全性。而且,通过协商各类安全算法,提升了网络对于多种类型节点的容纳能力,提升了网络可用性。In the embodiment shown in FIG. 7 , during the process of the first node joining the first network, the first node negotiates with the second node on a key negotiation algorithm and a key derivation function. The key negotiation algorithm is used to determine the first key, and the first key is used to securely protect the information transmitted between the two. The key derivation function is used to verify the information transmitted by the two to ensure that the transmitted information is not tampered with. In this way, the first node can distribute the network key of the first network in a relatively safe environment, thereby improving network security. Moreover, by negotiating various security algorithms, the network's capacity to accommodate various types of nodes is improved, thereby improving network availability.
请参见图8,图8是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S801-步骤S813中的部分或者全部步骤。应理解,以下仅以S801-S813的步骤顺序为例进行示例性地描述,具体实施过程中,部分步骤执行的时机可以变更。步骤S801-步骤S813具体如下: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 step S801-step S813. It should be understood that the following is only described exemplarily by taking the step sequence of S801-S813 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S801-step S813 are as follows:
步骤S801:第一节点发送拓扑配置消息。相应的,第二节点可以接收来自第一节点的拓扑配置消息。Step S801: The first node sends a topology configuration message. Correspondingly, the second node may receive the topology configuration message from the first node.
步骤S802:第二节点判断是否支持第一网络的安全算法。Step S802: The second node determines whether it supports the security algorithm of the first network.
步骤S803:第一节点和第二节点建立接入层连接。Step S803: The first node and the second node establish an access layer connection.
步骤S804:第二节点向第一节点发送第一消息。相应的,第一节点接收第一消息。Step S804: the second node sends a first message to the first node. Correspondingly, the first node receives the first message.
其中,第一消息携带密钥协商算法能力。The first message carries the key negotiation algorithm capability.
步骤S805:第一节点向第二节点发送第二消息。相应的,第二节点接收第二消息。Step S805: The first node sends a second message to the second node. Correspondingly, the second node receives the second message.
其中,第二消息携带第一公钥,第二消息还用于指示第一节点选择的密钥协商算法。可选的,第二消息还携带第一随机数。The second message carries the first public key, and the second message is also used to indicate the key agreement algorithm selected by the first node. Optionally, the second message also carries the first random number.
步骤S806:第二节点确定第一密钥。Step S806: The second node determines the first key.
步骤S807:第二节点向第一节点发送第三消息。相应的,第一节点接收第三消息。Step S807: The second node sends a third message to the first node. Correspondingly, the first node receives the third message.
其中,第三消息携带第二公钥。进一步的,第三消息还携带第二随机数。The third message carries the second public key. Furthermore, the third message also carries the second random number.
步骤S808:第一节点确定第一密钥。Step S808: The first node determines the first key.
步骤S809:第二节点通过第一密钥,确定加密密钥。Step S809: The second node determines the encryption key using the first key.
步骤S810:第一节点通过第一密钥,确定加密密钥。Step S810: The first node determines the encryption key through the first key.
步骤S811:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自该密钥请求消息。Step S811: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.
步骤S812:第一节点向第二节点发送第一网络的网络密钥。Step S812: The first node sends the network key of the first network to the second node.
具体的,在发送第一网络的网络密钥,使用加密密钥加密发送。Specifically, when sending the network key of the first network, the encryption key is used to encrypt and send it.
步骤S813:第一节点和第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
在图8所示的实施例中,第一节点和第二节点可以通过协商确定密钥协商算法,并基于密钥协商算法确定第一密钥,第一密钥用于对二者之间传输的信息进行安全保护。若第一节点和第二节点在协商密钥过程中传递的参数未经过篡改,则第二节点和第一节点可以确定一致的第一密钥,从而使得第二节点可以解密密文获取第一网络的网络密钥。如此,第一节点可以实现在相对安全的环境下分发第一网络的网络密钥,提升网络安全性。而且,通过协商密钥协商算法,提升了网络对于多种类型节点的容纳能力,提升了网络可用性。In the embodiment shown in FIG8 , the first node and the second node can determine the key negotiation algorithm through negotiation, and determine the first key based on the key negotiation algorithm, and the first key is used to securely protect the information transmitted between the two nodes. If the parameters transmitted by the first node and the second node during the key negotiation process have not been tampered with, the second node and the first node can determine a consistent first key, so that the second node can decrypt the ciphertext to 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 safe environment, thereby improving network security. Moreover, by negotiating the key negotiation algorithm, the network's capacity to accommodate various types of nodes is improved, and the network availability is improved.
请参见图9,图9是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S901-步骤S916中的部分或者全部步骤。应理解,以下仅以S901-S916的步骤顺序为例进行示例性地描述,具 体实施过程中,部分步骤执行的时机可以变更。步骤S901-步骤S916具体如下:Please refer to FIG. 9, which is a flowchart of another communication method provided in an embodiment of the present application. The communication method may include some or all of the steps in step S901 to step S916. It should be understood that the following description is only based on the sequence of steps S901 to S916. During the implementation process, the timing of executing some steps can be changed. Steps S901 to S916 are as follows:
步骤S901:第一节点发送拓扑配置消息。相应的,第二节点可以接收来自第一节点的拓扑配置消息。Step S901: The first node sends a topology configuration message. Correspondingly, the second node may receive the topology configuration message from the first node.
拓扑配置消息可以包含第一网络的信息和第一节点的密钥协商算法能力。The topology configuration message may include information of the first network and the key negotiation algorithm capability of the first node.
步骤S902:第二节点判断是否支持第一网络的安全算法。相关描述参见步骤S702。Step S902: The second node determines whether it supports the security algorithm of the first network. For related description, see step S702.
步骤S903:第一节点与第二节点建立接入层连接。相关描述参见步骤S703。Step S903: The first node establishes an access layer connection with the second node. For related description, see step S703.
步骤S904:第二节点向第一节点发送第一消息。相应的,第一节点可以接收来自第二节点的第一消息。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.
其中,第一消息携带第二公钥、第二节点选择的密钥协商算法和第二节点的密钥协商算法能力。其中,第二公钥为第二节点基于选择的密钥协商算法和自身产生的第二私钥生成的。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 itself.
可选的,第一消息还携带第二随机数。Optionally, the first message also carries a second random number.
步骤S905:第一节点向第二节点发送第二消息。相应的,第二节点可以接收来自第一节点的第二消息。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.
其中,第二消息携带第一公钥,第二消息还用于指示第一节点选择的密钥派生函数。进一步的,第二消息还携带第一随机数。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.
步骤S906:第二节点确定第一密钥。Step S906: The second node determines the first key.
示例性地,第二节点基于第一节点选择密钥协商算法根据第二私钥和第一公钥计算第一密钥。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.
步骤S907:第一节点确定第一密钥。Step S907: The first node determines the first key.
示例性地,第一节点根据第一私钥和第二公钥,通过选择的密钥协商算法计算第一密钥。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.
步骤S908:第二节点确定第一验证值。Step S908: The second node determines the first verification value.
作为一种可能的实施方式,第一验证值=KDF(DH key,第二消息内容,拓扑配置消息内容)。其中,DH key为步骤S906中确定的第一密钥,生成第一验证值使用的KDF为第二节点选择的KDF。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.
作为又一种可能的实现方式,第一验证值=KDF(DH key,第一随机数,拓扑配置消息内容)。当然,具体实施过程中参与生成第一验证值的可以包含更多或者更少的参数。As another possible implementation, the first verification value = KDF (DH key, first random number, topology configuration message content). Of course, in the specific implementation process, more or fewer parameters may be involved in generating the first verification value.
步骤S909:第二节点向第一节点发送第三消息。Step S909: the second node sends a third message to the first node.
其中,第三消息携带第一验证值。相关描述参见步骤S508。The third message carries the first verification value. For related description, see step S508.
步骤S910:第一节点确定第二验证值。Step S910: The first node determines a second verification value.
作为一种可能的实施方式,第二验证值=KDF(DH key,第三消息内容,第二消息内容,拓扑配置消息内容)。作为又一种可能的实现方式,第一验证值=KDF(DH key,第二随机数,拓扑配置消息内容)。当然,具体实施过程中参与生成第一验证值的可以包含更多或者更少的参数。As a 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 the specific implementation process, more or fewer parameters may be involved in generating the first verification value.
步骤S911:第一节点向第二节点发送第五消息。相应的,第二节点接收来自第一节点的第五消息。其中,第五消息携带第二验证值。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. The fifth message carries the second verification value.
步骤S912:第一节点通过第一密钥,确定加密密钥。Step S912: The first node determines the encryption key using the first key.
步骤S913:第二节点通过第一密钥,确定加密密钥。Step S913: The second node determines the encryption key through the first key.
步骤S914:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自该密钥请求消息。Step S914: the second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.
步骤S915:第一节点向第二节点发送第一网络的网络密钥。Step S915: The first node sends the network key of the first network to the second node.
具体的,第一节点确定第一节点加入的第一网络的网络密钥NetKey。在发送第一网络的网络密钥,使用加密密钥加密发送。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 before sending it.
步骤S916:基于第一网络的网络密钥对网络层进行安全保护。Step S916: Perform security protection on the network layer based on the network key of the first network.
关于图9所示实施例中的相关描述还可以参见前述图7所示的实施例。For the relevant description of the embodiment shown in FIG. 9 , reference can also be made to the embodiment shown in FIG. 7 above.
请参见图10,图10是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S1001-步骤S1011中的部分或者全部步骤。应理解,以下仅以S1001-S1011的步骤顺序为例进行示例性地描述,具体实施过程中,部分步骤执行的时机可以变更。步骤S1001-步骤S1011具体如下: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 step S1001-step S1011. It should be understood that the following is only described exemplarily by taking the step sequence of S1001-S1011 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S1001-step S1011 are as follows:
步骤S1001:第一节点发送拓扑配置消息。相应的,第二节点可以接收来自第一节点的拓扑配置消息。Step S1001: A first node sends a topology configuration message. Correspondingly, a second node may receive the topology configuration message from the first node.
参见步骤S701的描述。See the description of step S701.
步骤S1002:第二节点判断是否支持第一网络的安全算法。相关描述参见步骤S702。Step S1002: The second node determines whether it supports the security algorithm of the first network. For related description, see step S702.
步骤S1003:第一节点与第二节点建立接入层连接。Step S1003: The first node establishes an access layer connection with the second node.
其中,第一节点与第二节点之间的接入层连接加密开启。相关描述参见步骤S703。The access layer connection encryption between the first node and the second node is turned on. For related description, see step S703.
步骤S1004:第二节点向第一节点发送第一消息。相应的,第一节点可以接收来自第二节点的第一消息。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.
其中,第一消息携带第二节点的KDF能力。可选的,第一消息还携带第二随机数。 The first message carries the KDF capability of the second node. Optionally, the first message also carries a second random number.
步骤S1005:第一节点向第二节点发送第二消息。相应的,第二节点可以接收来自第一节点的第二消息。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.
其中,第二消息还用于指示第一节点选择的密钥派生函数。进一步的,第二消息还携带第一随机数。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.
步骤S1006:第二节点确定第一验证值。Step S1006: The second node determines the first verification value.
作为一种可能的实施方式,第一验证值=KDF(第一参数,第二消息内容,拓扑配置消息内容)。其中,第一参数为预先(例如在生成第一验证值之前)定义的参数,例如为ZERO。生成第一验证值使用的KDF为第二节点选择的KDF。As a possible implementation, the first verification value = KDF (first parameter, second message content, topology configuration message content). The first parameter is a parameter defined in advance (for example, before generating the first verification value), for example, ZERO. The KDF used to generate the first verification value is the KDF selected by the second node.
作为又一种可能的实现方式,第一验证值=KDF(第一参数第一随机数,拓扑配置消息内容)。当然,具体实施过程中参与生成第一验证值的可以包含更多或者更少的参数。As another possible implementation, the first verification value = KDF (first parameter, first random number, topology configuration message content). Of course, in the specific implementation process, more or fewer parameters may be involved in generating the first verification value.
步骤S1007:第二节点向第一节点发送第三消息。Step S1007: the second node sends a third message to the first node.
其中,第三消息携带第一验证值。相关描述参见步骤S708。The third message carries the first verification value. For related description, see step S708.
步骤S1008:第一节点验证第一验证值。Step S1008: The first node verifies the first verification value.
示例性地,第一节点根据第一私钥和第二公钥,通过选择的密钥协商算法计算第一密钥。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.
步骤S1009:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自该密钥请求消息。Step S1009: the second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.
步骤S1010:第一节点向第二节点发送第一网络的网络密钥。Step S1010: The first node sends the network key of the first network to the second node.
具体的,第一节点将第一网络的网络密钥携带于第四消息中,第四消息在接入层被加密。相应的,第二节点在接入层接收第四消息时,可以通过接入层的密钥解密第四消息,得到第一网络的网络密钥。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.
步骤S1011:第一节点与第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
在图8所示的实施例中,第一节点通过接入层加密机制从而秘密传输第一网络的网络密钥。在传输密钥之前,第一节点和第二节点可以协商得到KDF,并基于KDF验证拓扑配置消息包含的信息未受到篡改,从而确定第一节点和第二节点的通信环境安全。在此过程中,由第一节点和第二节点协商得到第一KDF,如此可以适应多种不同安全能力的节点加入网络的情况,使得网络中可以应用于具有多种不同种类设备的场景下,提升网络的包容性。In the embodiment shown in FIG8 , the first node secretly transmits the network key of the first network through the access layer encryption mechanism. Before transmitting the key, the first node and the second node can negotiate to obtain the KDF, and verify based on the KDF that the information contained in the topology configuration message has not been tampered with, thereby determining that the communication environment of the first node and the second node is secure. In this process, the first node and the second node negotiate to obtain the first KDF, so that it can adapt to the situation where nodes with multiple different security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the inclusiveness of the network.
请参见图11,图11是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S1101-步骤S1115中的部分或者全部步骤。应理解,以下仅以S1101-S1115的步骤顺序为例进行示例性地描述,具体实施过程中,部分步骤执行的时机可以变更。步骤S1101-步骤S1115具体如下: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 step S1101-step S1115. It should be understood that the following is only described exemplarily by taking the step sequence of S1101-S1115 as an example. During the specific implementation process, the timing of executing some steps can be changed. Steps S1101-step S1115 are as follows:
步骤S1101:第一节点发送拓扑配置消息。相应的,第二节点可以接收来自第一节点的拓扑配置消息。参见步骤S701的描述。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.
步骤S1102:第一节点与第二节点建立接入层连接。其中,第一节点与第二节点之间的接入层连接加密开启。相关描述参见步骤S703。Step S1102: The first node establishes an access layer connection with the second node. The access layer connection encryption between the first node and the second node is enabled. For related description, see step S703.
步骤S1103:第二节点向第一节点发送第一消息。相应的,第一节点可以接收来自第二节点的第一消息。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.
其中,第一消息携带第二节点的安全能力。其中,第二节点的安全能力指示第二节点支持的安全算法、密钥协商算法和KDF。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.
可选的,第一消息还携带第二随机数。Optionally, the first message also carries a second random number.
步骤S1104:第一节点向第二节点发送第二消息。相应的,第二节点可以接收来自第一节点的第二消息。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.
其中,第二消息携带第一公钥,第二消息还用于指示第一节点选择的密钥协商算法和密钥派生函数。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.
示例性地,第一节点根据入网设备的安全算法能力,选择优先级最高的密钥派生函数和优先级最高的密钥协商算法。第一节点产生第一私钥,并根据选择的密钥协商算法确定第一公钥。Exemplarily, the first node selects the key derivation function with the highest priority and the key agreement algorithm with the highest priority according to the security algorithm capability of the networked device. The first node generates a first private key and determines a first public key according to the selected key agreement algorithm.
进一步的,第二消息还用于指示第一网络的安全算法。可选的,第二消息还携带第一随机数。Further, the second message is also used to indicate a security algorithm of the first network. Optionally, the second message also carries a first random number.
在一种可能的实施方式中,若第二节点入网设备支持的安全算法不包含第一网络的安全算法,则第一节点向第二节点发送失败消息,并携带原因值。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 carries a reason value.
步骤S1105:第二节点确定第一密钥。Step S1105: The second node determines the first key.
示例性地,第二节点可以产生第二私钥,基于第一节点选择密钥协商算法根据第二私钥和第一公钥计算第一密钥。可选的,第一密钥也可以被称为网络密钥、DH key等。Exemplarily, 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 according to 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.
步骤S1106:第二节点确定第一验证值。Step S1106: The second node determines the first verification value.
作为一种可能的实施方式,第一验证值=KDF(DH key,第二消息内容,拓扑配置消息内容)。其中,DH key为步骤S1105中确定的第一密钥,生成第一验证值使用的KDF为第一节点选择的KDF。As a possible implementation, the first verification value = KDF (DH key, second message content, topology configuration message content). 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.
作为又一种可能的实现方式,第一验证值=KDF(DH key,第一随机数,拓扑配置消息内容)。As another possible implementation, the first verification value = KDF (DH key, first random number, topology configuration message content).
步骤S1107:第二节点向第一节点发送第三消息。相应的,第一节点接收来自第一节点的第三消息。其中,第三消息携带第二公钥和第一验证值。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.
步骤S1108:第一节点确定第一密钥。Step S1108: The first node determines the first key.
步骤S1109:第一节点确定第二验证值。Step S1109: The first node determines a second verification value.
作为一种可能的实施方式,第二验证值=KDF(DH key,第三消息内容,第二消息内容,拓扑配置消息内容)。其中,DH key为步骤S1105中确定的第一密钥,生成第一验证值使用的KDF为第一节点选择的KDF。As a possible implementation, the second verification value = KDF (DH key, third message content, 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.
作为又一种可能的实现方式,第一验证值=KDF(DH key,第二随机数,拓扑配置消息内容)。As another possible implementation, the first verification value = KDF (DH key, second random number, topology configuration message content).
步骤S1110:第一节点向第二节点发送第五消息。相应的,第二节点接收来自第一节点的第五消息。其中,第五消息携带第二验证值。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. The fifth message carries the second verification value.
步骤S1111:第一节点通过第一密钥,确定加密密钥。Step S1111: The first node determines the encryption key through the first key.
步骤S1112:第二节点通过第一密钥,确定加密密钥。Step S1112: The second node determines the encryption key through the first key.
步骤S1113:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自该密钥请求消息。Step S1113: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.
步骤S1114:第一节点向第二节点发送第一网络的网络密钥。Step S1114: the first node sends the network key of the first network to the second node.
具体的,在发送第一网络的网络密钥,使用加密密钥加密发送。Specifically, when sending the network key of the first network, the encryption key is used to encrypt and send it.
步骤S1115:第一节点与第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
在图11所示的实施例中,在第一节点加入第一网络的过程中,第一节点与第二节点协商密钥协商算法和密钥派生函数。其中,密钥协商算法被用于确定第一密钥,第一密钥用于对二者之间传输的信息进行安全保护。密钥派生函数用于校验二者传输的信息,确保传输的信息不受到篡改。如此,第一节点可以实现在相对安全的环境下分发第一网络的网络密钥,提升网络安全性。而且,通过协商各类安全算法,提升了网络对于多种类型节点的容纳能力,提升了网络可用性。In the embodiment shown in FIG11 , during the process of the first node joining the first network, the first node negotiates with the second node on a key negotiation algorithm and a key derivation function. The key negotiation algorithm is used to determine the first key, and the first key is used to securely protect the information transmitted between the two. The key derivation function is used to verify the information transmitted by the two to ensure that the transmitted information is not tampered with. In this way, the first node can distribute the network key of the first network in a relatively safe environment, thereby improving network security. Moreover, by negotiating various security algorithms, the network's capacity to accommodate various types of nodes is improved, thereby improving network availability.
请参见图12,图12是本申请实施例提供的又一种通信方法的流程示意图。该通信方法可以包含步骤S1201-步骤S1210中的部分或者全部步骤。应理解,以下仅以S1201-S1210的步骤顺序为例进行示例性地描述,具体实施过程中,部分步骤执行的时机可以变更。步骤S1201-步骤S1210具体如下: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 step S1201-step S1210. It should be understood that the following is only described exemplarily by taking the step sequence of S1201-S1210 as an example. During the specific implementation process, the timing of executing some steps may be changed. Steps S1201-step S1210 are as follows:
步骤S1201:第一节点发送拓扑配置消息。相应的,第二节点可以接收来自第一节点的拓扑配置消息。Step S1201: The first node sends a topology configuration message. Correspondingly, the second node may receive the topology configuration message from the first node.
参见步骤S1001的描述。See the description of step S1001.
步骤S1202:第一节点与第二节点建立接入层连接。Step S1202: The first node establishes an access layer connection with the second node.
其中,第一节点与第二节点之间的接入层连接加密开启。相关描述参见步骤S703。The access layer connection encryption between the first node and the second node is turned on. For related description, see step S703.
步骤S1203:第二节点向第一节点发送第一消息。相应的,第一节点可以接收来自第二节点的第一消息。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.
其中,第一消息携带第二节点的KDF能力。可选的,第一消息还携带第二随机数。The first message carries the KDF capability of the second node. Optionally, the first message also carries a second random number.
步骤S1204:第一节点向第二节点发送第二消息。相应的,第二节点可以接收来自第一节点的第二消息。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.
其中,第二消息还用于指示第一节点选择的密钥派生函数和第一网络的安全算法。进一步的,第二消息还携带第一随机数。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.
步骤S1205:第二节点确定第一验证值。Step S1205: The second node determines the first verification value.
作为一种可能的实施方式,第一验证值=KDF(第一参数,第二消息内容,拓扑配置消息内容)。其中,第一参数为预先(例如在生成第一验证值之前)定义的参数,例如为ZERO。生成第一验证值使用的KDF为第二节点选择的KDF。As a possible implementation, the first verification value = KDF (first parameter, second message content, topology configuration message content). The first parameter is a parameter defined in advance (for example, before generating the first verification value), for example, ZERO. The KDF used to generate the first verification value is the KDF selected by the second node.
作为又一种可能的实现方式,第一验证值=KDF(第一参数第一随机数,拓扑配置消息内容)。当然,具体实施过程中参与生成第一验证值的可以包含更多或者更少的参数。As another possible implementation, the first verification value = KDF (first parameter, first random number, topology configuration message content). Of course, in the specific implementation process, more or fewer parameters may be involved in generating the first verification value.
步骤S1206:第二节点向第一节点发送第三消息。Step S1206: the second node sends a third message to the first node.
其中,第三消息携带第一验证值。相关描述参见步骤S708。The third message carries the first verification value. For related description, see step S708.
步骤S1207:第一节点验证第一验证值。Step S1207: The first node verifies the first verification value.
示例性地,第一节点根据第一私钥和第二公钥,通过选择的密钥协商算法计算第一密钥。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.
步骤S1208:第二节点向第一节点发送密钥请求消息。相应的,第一节点接收来自该密钥请求消息。Step S1208: The second node sends a key request message to the first node. Correspondingly, the first node receives the key request message.
步骤S1209:第一节点向第二节点发送第一网络的网络密钥。 Step S1209: The first node sends the network key of the first network to the second node.
具体的,第一节点将第一网络的网络密钥携带于第四消息中,第四消息在接入层被加密。相应的,第二节点在接入层接收第四消息时,可以通过接入层的密钥解密第四消息,得到第一网络的网络密钥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.
步骤S1210:第一节点与第二节点基于第一网络的网络密钥对网络层进行安全保护。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.
在图12所示的实施例中,第一节点通过接入层加密机制从而秘密传输第一网络的网络密钥。在传输密钥之前,第一节点和第二节点可以协商得到KDF,并基于KDF验证拓扑配置消息包含的信息未受到篡改,从而确定第一节点和第二节点的通信环境安全。在此过程中,由第一节点和第二节点协商得到第一KDF,如此可以适应多种不同安全能力的节点加入网络的情况,使得网络中可以应用于具有多种不同种类设备的场景下,提升网络的包容性。In the embodiment shown in FIG12 , the first node secretly transmits the network key of the first network through the access layer encryption mechanism. Before transmitting the key, the first node and the second node can negotiate to obtain the KDF, and verify based on the KDF that the information contained in the topology configuration message has not been tampered with, thereby determining that the communication environment of the first node and the second node is secure. In this process, the first node and the second node negotiate to obtain the first KDF, so that it can adapt to the situation where nodes with multiple different security capabilities join the network, so that the network can be applied to scenarios with multiple different types of devices, thereby improving the inclusiveness of the network.
上述详细阐述了本申请实施例的方法,下面提供本申请实施例的装置。The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.
应理解,本申请实施例中所提供的装置,其中的单元的划分仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。此外,装置中的单元可以以处理器调用软件的形式实现;例如装置包括处理器,处理器与存储器连接,存储器中存储有指令,处理器调用存储器中存储的指令,以实现以上任一种方法或实现该装置各单元的功能,其中处理器例如为通用处理器,例如中央处理单元(Central Processing Unit,CPU)或微处理器,存储器为装置内的存储器或装置外的存储器。或者,装置中的单元可以以硬件电路的形式实现,可以通过对硬件电路的设计实现部分或全部单元的功能,该硬件电路可以理解为一个或多个处理器;例如,在一种实现中,该硬件电路为专用集成电路(application-specific integrated circuit,ASIC),通过对电路内元件逻辑关系的设计,实现以上部分或全部单元的功能;再如,在另一种实现中,该硬件电路为可以通过可编程逻辑器件(programmable logic device,PLD)实现,以现场可编程门阵列(Field Programmable Gate Array,FPGA)为例,其可以包括大量逻辑门电路,通过配置文件来配置逻辑门电路之间的连接关系,从而实现以上部分或全部单元的功能。以上装置的所有单元可以全部通过处理器调用软件的形式实现,或全部通过硬件电路的形式实现,或部分通过处理器调用软件的形式实现,剩余部分通过硬件电路的形式实现。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, and 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 instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or to implement 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 inside the device or a memory outside the device. Alternatively, the units in the device may be implemented in the form of hardware circuits, and the functions of some or all of the units may be implemented by designing the hardware circuits, and the hardware circuits may be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above units may be implemented by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit may be implemented by a programmable logic device (PLD), and a field programmable gate array (FPGA) may be used as an example, which may include a large number of logic gate circuits, and the connection relationship between the logic gate circuits may be configured by a configuration file, so as to implement the functions of some or all of the above units. All units of the above devices may be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.
在本申请实施例中,处理器是一种具有信号的处理能力的电路,在一种实现中,处理器可以是具有指令读取与运行能力的电路,例如中央处理单元(Central Processing Unit,CPU)、微处理器、图形处理器(graphics processing unit,GPU)(可以理解为一种微处理器)、或数字信号处理器(digital signal processor,DSP)等;在另一种实现中,处理器可以通过硬件电路的逻辑关系实现一定功能,该硬件电路的逻辑关系是固定的或可以重构的,例如处理器为专用集成电路(application-specific integrated circuit,ASIC)或可编程逻辑器件(programmable logic device,PLD)实现的硬件电路,例如FPGA。在可重构的硬件电路中,处理器加载配置文档,实现硬件电路配置的过程,可以理解为处理器加载指令,以实现以上部分或全部单元的功能的过程。此外,还可以是针对人工智能设计的硬件电路,其可以理解为一种ASIC,例如神经网络处理单元(Neural Network Processing Unit,NPU)张量处理单元(Tensor Processing Unit,TPU)、深度学习处理单元(Deep learning Processing Unit,DPU)等。In the embodiment of the present application, the processor is a circuit with the ability to process signals. In one implementation, the processor can be a circuit with the ability to read and run instructions, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a microprocessor), or a digital signal processor (DSP); in another implementation, the processor can realize certain functions through the logical relationship of the hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as the processor is 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 can 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.
可见,以上装置中的各单元可以是被配置成实施以上方法的一个或多个处理器(或处理电路),例如:CPU、GPU、NPU、TPU、DPU、微处理器、DSP、ASIC、FPGA,或这些处理器形式中至少两种的组合。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.
此外,以上装置中的各单元可以全部或部分可以集成在一起,或者可以独立实现。在一种实现中,这些单元集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。该SOC中可以包括至少一个处理器,用于实现以上任一种方法或实现该装置各单元的功能,该至少一个处理器的种类可以不同,例如包括CPU和FPGA,CPU和人工智能处理器,CPU和GPU等。In addition, the units in the above device can be integrated together in whole or in part, 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 each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
下面列举几种可能的装置。Several possible arrangements are listed below.
请参见图13,图13是本申请实施例提供的一种通信装置的结构示意图。可选的,该通信装置130可以为独立设备,例如节点等。或者,该通信装置130也可以独立设备(如节点)中的一个器件,例如芯片或者集成电路等。通信装置130用于实现前述的通信方法,例如图2,图5,图6,图7,图8,图9,图10,图11,或图12所示实施例中,任意一个或者多个实施例中所示的通信方法。进一步的,部分场景中,通信装置还用于实现如图3或图4所示的关联流程。Please refer to Figure 13, which is a schematic diagram of the structure 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.
如图13所示,通信装置130包含通信单元1301和处理单元1302。其中,通信单元1301用于实现发送、接收、监听、传输、建立连接、响应等一项或者多项操作,进一步还包含用于实现通信方法的其他操作。处理单元1302用于实现处理、计算、确定、生成、更新、加密、解密等中的一项或者多项操作,进一步还包含用于实现通信方法的其他操作。 As shown in FIG13 , the communication device 130 includes a communication unit 1301 and a processing unit 1302. The communication unit 1301 is used 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. The processing unit 1302 is used 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.
在一种可能的设计中,通信装置130包含通信单元1301和处理单元1302,该通信装置130用于实现前述通信方法中,第一节点一侧的方法。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.
在一种可能的实施方式中,通信单元1301用于:In a possible implementation, the communication unit 1301 is used to:
向第二节点发送拓扑配置消息,拓扑配置消息包含第一网络的信息;Sending a topology configuration message to the second node, where the topology configuration message includes information about the first network;
与第二节点协商确定第一KDF,第一KDF为第一节点和第二节点共同支持的KDF;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;
通信单元1301和处理单元1302用于通过第一KDF与第二节点校验第一信息;The communication unit 1301 and the processing unit 1302 are used to verify the first information with the second node through the first KDF;
通信单元1301还用于在校验第一信息成功的情况下向第二节点加密发送第一网络的网络密钥。其中,第一网络的网络密钥用于对第一网络进行安全保护,例如第一网络的网络密钥用于对第一网络中的节点之间的网络层进行安全保护。The communication unit 1301 is also used to encrypt and send the network key of the first network to the second node when the first information is successfully verified. The network key of the first network is used to perform security protection on the first network, for example, the network key of the first network is used to perform security protection on the network layer between nodes in the first network.
可选的,通信装置130为第一节点或者通信装置130包含于第一节点,而第一网络包含第一节点。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.
在一种可能的实施方式中,通信单元1301还用于向第二节点发送第一网络的网络密钥的ID。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.
在一种可能的实施方式中,第一节点和第二节点传输过的信息包含拓扑配置消息包含的信息。In a possible implementation manner, the information transmitted by the first node and the second node includes information included in a topology configuration message.
第一方面的一种可能的实施方式中,通信单元1301还用于接收来自第二节点的第一验证值,处理单元1302至少根据第一KDF和拓扑配置消息包含的信息校验第一验证值。其中,第一验证值至少与第一KDF和拓扑配置消息包含的信息相关联。In a 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 at least according to the first KDF and the information included in the topology configuration message. The first verification value is at least associated with the information included in the first KDF and the topology configuration message.
进一步的,校验第一信息成功包含:校验第一验证值成功。可选的,第一验证值可以包含于第三消息中,或称为携带于第三消息。Further, 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 referred to as being carried in the third message.
在一种可能的实施方式中,第一KDF可以是第二节点支持的KDF中优先级最高的KDF。可选的,第一KDF可以是第一节点和第二节点共同支持的KDF,此时,第一KDF可以为第一节点和第二节点均支持的KDF,优先级最高的KDF。In a possible implementation, the first KDF may be the KDF with the highest priority among the KDFs supported by the second node. Optionally, the first KDF may be the 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.
在一种可能的实施方式中,通信装置130可以在第二节点和第一节点都支持的KDF中,选择第一KDF并向第二节点指示其选定的第一KDF。In a possible implementation, the communication device 130 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.
在一种可能的实施方式中,通信单元1301还用于:接收来自第二节点的第二节点的KDF能力,向第二节点发送第一KDF的指示信息。其中,第二节点的KDF能用于指示第二节点支持的KDF。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.
一些场景中,第二节点的KDF能力、第一KDF的指示信息等也属于第一信息。如此,第一节点和第二节点可以校验这些信息是否受到篡改,提升安全性。In some scenarios, the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
在一种可能的实施方式中,通信单元1301还用于:接收来自第二节点的第一消息,向第二节点发送第二消息。其中,第一消息包含第二节点的KDF能力,第二消息至少包含第一KDF的指示信息。应理解,第一消息、第二消息还可能包含其他信息。In a possible implementation, the communication unit 1301 is further used to: receive a first message from the second node, and send a second message to the second node. The first message includes the KDF capability of the second node, and the second message includes at least the indication information of the first KDF. It should be understood that the first message and the second message may also include other information.
在一种可能的实施方式中,第一节点和第二节点传输过的信息包含第二消息包含的信息、拓扑配置消息包含的信息等中的一项或者多项。In a possible implementation manner, the information transmitted by the first node and the second node includes one or more of the information included in the second message, the information included in the topology configuration message, and the like.
在一种可能的实施方式中,通信单元1301还用于:接收来自第二节点的第三消息,根据第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息校验第一验证值。其中,第三消息包含第一验证值,第一验证值与第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息相关联,第一密钥可以为第一节点和第二节点协商得到的密钥。进一步的,校验第一信息成功包含:校验第一验证值成功。In a possible implementation, the communication unit 1301 is further used to: receive a third message from the second node, and verify the first verification value according to the first KDF, the first key, the information contained in the second message, and the information contained 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 key, the information contained in the second message, and the information contained in the topology configuration message. The first key can be a key obtained by negotiation between the first node and the second node. Further, verifying the first information successfully includes: verifying the first verification value successfully.
在一种可能的实施方式中,通信单元1301还用于:接收来自第二节点的第三消息,根据第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息校验第一验证值。其中,第三消息包含第一验证值,第一验证值与第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息相关联,第一参数的值为预先定义的。例如,第一参数为128比特的数据,进一步的该128比特为全0。进一步的,校验第一信息成功包含:校验第一验证值成功。In a possible implementation, the communication unit 1301 is also used to: receive a third message from the second node, and verify the first verification value according to the first KDF, the first parameter, the information contained in the second message, and the information contained 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, the information contained in the second message, and the information contained 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 0. Further, the successful verification of the first information includes: the successful verification of the first verification value.
在一种可能的实施方式中,通信单元1301还用于:向第二节点发送第一节点的KDF能力,第一节点的KDF能力指示第一节点支持的KDF;接收来自第二节点的第一KDF的指示信息。一些场景中,第一节点的KDF能力、第一KDF的指示信息等也属于第一信息。In a possible implementation, the communication unit 1301 is further used to: send the KDF capability of the first node to the second node, where the KDF capability of the first node indicates the KDF supported by the first node; and receive indication information of the first KDF from the second node. In some scenarios, the KDF capability of the first node, the indication information of the first KDF, etc. also belong to the first information.
在一种可能的实施方式中,通过第一KDF与第二节点校验第一信息的过程经过安全保护,以期进一步提升安全性。In a possible implementation, the process of verifying the first information through the first KDF and the second node is protected to further improve security.
在一种可能的实施方式中,通信单元1301还用于:向第二节点发送第一随机数。该随机数可以属于第一信息,从而确定携带该随机数的消息是否受到篡改。 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 is tampered with.
在一种可能的实施方式中,处理单元1302还用于:根据第一KDF、第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥生成第二验证值。通信单元1301还用于:向第二节点发送第二验证值。In a possible implementation, the processing unit 1302 is further configured to: 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 communication unit 1301 is further configured to: send the second verification value to the second node.
进一步的,通信单元1301还用于接收来自第二节点的第二随机数。可选的,第二随机数包含于第三消息。Further, 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.
可选的,第二验证值携带于第一节点发送第二节点的第五消息中。进一步的,接收第三消息、发送第五消息的过程可以经过安全保护。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.
在一种可能的实施方式中,通信单元1301和处理单元还用于:基于第一密钥协商算法,与第二节点协商确定第一密钥。其中,第一密钥(DH key)或经由所述第一密钥派生的密钥用于对所述第一节点和所述第二节点之间传输的信息进行安全保护In a possible implementation, the communication unit 1301 and the processing unit are further used to: based on the first key agreement algorithm, negotiate with the second node to determine the 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.
在一种可能的实施方式中,第一密钥协商算法可以是通信装置130和第二节点协商确定的。In a possible implementation, the first key agreement algorithm may be determined through negotiation between the communication device 130 and the second node.
在又一种可能的实施方式中,通信单元1301还用于:向第二节点发送第一节点的密钥协商算法能力,接收来自第二节点发送的第一密钥协商算法的指示信息。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.
可选的,第一节点的密钥协商算法能力包含于拓扑配置消息,第一密钥协商算法的指示信息包含于第一消息。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.
在又一种可能的实施方式中,通信单元1301还用于:接收来自所述第二节点的所述第二节点的密钥协商算法能力,向第二节点发送第一密钥协商算法的指示信息。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.
可选的,第二节点的密钥协商算法能力包含于第一消息,第一密钥协商算法的指示信息包含于第二消息。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.
在又一种可能的实施方式中,处理单元1302还用于:根据第一密钥派生得到加密密钥,并通过加密密钥加密第一网络层的密钥,得到第一网络的网络密钥的密文;In another possible implementation, the processing unit 1302 is further configured to: derive an encryption key according to the first key, and encrypt the key of the first network layer by using the encryption key to obtain a ciphertext of the network key of the first network;
通信单元1301还用于向第二节点发送所述第一网络的网络密钥的密文。The communication unit 1301 is further configured to send the ciphertext of the network key of the first network to the second node.
在又一种可能的实施方式中,通信单元1301和处理单元1302还用于与所述第二节点建立接入层连接,所述第一节点和所述第二节点的接入层加密开启;In yet 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;
通信单元1301还用于向所述第二节点发送第四消息,第四消息包含第一网络的网络密钥,所述第一消息在所述接入层被加密。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.
在又一种可能的实施方式中,通信单元1301还用于向第二节点发送第一网络的安全算法的标识。In yet another possible implementation, the communication unit 1301 is further configured to send an identifier of a security algorithm of the first network to the second node.
在又一种可能的实施方式中,通信单元1301还用于接收来自所述第二节点的所述第二节点的安全能力信息,处理单元1302还用于确定第一网络的安全算法。进一步的,通信单元1301还用于将确定的第一网络的安全算法的标识提供给第二节点。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.
在又一种可能的设计中,通信装置130包含通信单元1301和处理单元1302,该通信装置130用于实现前述通信方法中,第二节点一侧的方法。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.
在一种可能的实施方式中,通信单元1301用于接收来自第一节点的拓扑配置消息。通信单元1301和处理单元1302用于与第一节点协商确定第一密钥派生函数KDF,第一KDF为第一节点和第二节点共同支持的KDF。处理单元1302还用于基于所述第一KDF和第一信息生成第一验证值。通信单元1301还用于:向第一节点发送第一验证值,接收第一节点加密发送的第一网络的网络密钥。其中,第一网络的网络密钥用于对第一网络中的节点之间的网络层进行安全保护。In a possible implementation, the communication unit 1301 is used to receive a topology configuration message from the first node. The communication unit 1301 and the processing unit 1302 are used 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. The processing unit 1302 is also used to generate a first verification value based on the first KDF and the first information. The communication unit 1301 is also used to: send the first verification value to the first node, and receive the network key of the first network encrypted and sent by the first node. The network key of the first network is used to perform security protection on the network layer between nodes in the first network.
在一种可能的实施方式中,第一节点和第二节点传输过的信息包含拓扑配置消息包含的信息。处理单元1302还用于至少根据第一KDF和拓扑配置消息包含的信息生成第一验证值,通信单元1301还用于向第一节点发送第一验证值。可选的,第一验证值可以携带在第三消息中发送给第一节点。In a possible implementation, the information transmitted by the first node and the second node includes information included in the topology configuration message. The processing unit 1302 is further configured to generate a first verification value based on at least the first KDF and the information included in the topology configuration message, and the communication unit 1301 is further configured to send the first verification value to the first node. Optionally, the first verification value may be carried in a third message and sent to the first node.
在一种可能的实施方式中,第一KDF可以是第二节点支持的KDF中优先级最高的KDF。可选的,第一KDF可以是第一节点和第二节点共同支持的KDF,此时,第一KDF可以为第一节点和第二节点均支持的KDF,优先级最高的KDF。In a possible implementation, the first KDF may be the KDF with the highest priority among the KDFs supported by the second node. Optionally, the first KDF may be the 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.
在一种可能的实施方式中,通信单元1301还用于向第一节点发送第二节点的KDF能力,接收来自第一节点的第一KDF的指示信息。一些场景中,第二节点的KDF能力、第一KDF的指示信息等也属于第一信息。如此,第一节点和第二节点可以校验这些信息是否受到篡改,提升安全性。In a possible implementation, the communication unit 1301 is also used to send the KDF capability of the second node to the first node, and receive the indication information of the first KDF from the first node. In some scenarios, the KDF capability of the second node, the indication information of the first KDF, etc. also belong to the first information. In this way, the first node and the second node can verify whether the information has been tampered with, thereby improving security.
在一种可能的实施方式中,通信装置130可以在第二节点和第一节点都支持的KDF中,选择第一KDF并向第二节点指示其选定的第一KDF。 In a possible implementation, the communication device 130 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.
在一种可能的实施方式中,第一节点和第二节点传输过的信息包含第二消息包含的信息和/或拓扑配置消息包含的信息。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.
在一种可能的实施方式中,处理单元1302还用于根据第二消息包含的信息和拓扑配置消息包含的信息第一密钥成生成第一验证值,通信单元1301还用于向第一节点发送第三消息,第三消息包含第一验证值。In a possible implementation, the processing unit 1302 is further used to generate a first verification value based on the first key information included in the second message and the information included 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.
在一种可能的实施方式中,处理单元1302还用于根据第一KDF、第一密钥、第二消息包含的信息和拓扑配置消息包含的信息生成第一验证值,通信单元1301还用于向第一节点发送第三消息,第三消息包含第一验证值。其中,第一密钥为第一节点和第二节点协商得到。In a possible implementation, the processing unit 1302 is further configured to 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, 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.
在一种可能的实施方式中,处理单元1302还用于根据第一KDF、第一参数、第二消息包含的信息和拓扑配置消息包含的信息生成第一验证值,通信单元1301还用于向第一节点发送第三消息,第三消息包含第一验证值。其中,第一参数的值为预先定义的,例如128比特全0。In a possible implementation, the processing unit 1302 is further configured to generate 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, 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 are all 0.
在一种可能的实施方式中,通信单元1301还用于接收来自第二节点的第一随机数,第一随机数用于参与生成验证值,或者用于派生得到密钥等。可选的,第二随机数可以包含于第二消息。进一步的,第一信息包含第二消息中的第二随机数,也即,第一随机数可以参与生成第一验证值。In a possible implementation, the communication unit 1301 is further used to receive a first random number from the second node, and the first random number is used to participate in generating a verification value, or to derive a key, etc. 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.
在一种可能的实施方式中,通信单元1301还用于接收来自第一节点的第五消息,第五消息包含第二验证值,其中,第二验证值与第一KDF和以下信息中的至少一项相关联:第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥。处理单元1302还用于基于第一KDF和相同的信息,校验第一验证值。In a 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, wherein 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.
例如,第二验证值与第一KDF、第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥相关联。第二节点根据第一KDF、第三消息包含的信息、第一消息包含的信息、拓扑配置消息包含的信息和第一密钥校验第二验证值。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 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.
在一种可能的实施方式中,处理单元1302还用于根据第一密钥协商算法,确定第一密钥。该第一密钥或经由第一密钥派生的密钥用于对第一节点和第二节点之间传输的信息进行安全保护。In a 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.
在一种可能的实施方式中,通信单元1301和处理单元1302还用于与第一节点协商确定第一密钥协商算法,第一密钥协商算法属于第二节点支持的密钥协商算法。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 negotiation algorithm, where the first key negotiation algorithm is a key negotiation algorithm supported by the second node.
在又一种可能的实施方式中,通信单元1301还用于接收来自第一节点的所述第一节点的密钥协商算法能力,向第一节点发送第一密钥协商算法的指示信息。可选的,第一节点的密钥协商算法能力包含于拓扑配置消息,第一密钥协商算法的指示信息包含于第一消息。In another possible implementation, the communication unit 1301 is further configured to receive the key negotiation algorithm capability of the first node from the first node, and send indication information of the first key negotiation algorithm to the first node. Optionally, the key negotiation algorithm capability of the first node is included in the topology configuration message, and the indication information of the first key negotiation algorithm is included in the first message.
在又一种可能的实施方式中,通信单元1301还用于向所述第一节点发送所述第二节点的密钥协商算法能力,接收来自所述第一节点的第一密钥协商算法的指示信息。可选的,第二节点的密钥协商算法能力包含于第一消息,第一密钥协商算法的指示信息包含于第二消息。In another possible implementation, the communication unit 1301 is further configured to send the key agreement algorithm capability of the second node to the first node, and receive indication information of the first key agreement algorithm from the first node. 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.
在又一种可能的实施方式中,通信单元1301还用于接收所述第一网络的网络密钥的密文。处理单元1302还用于根据所述第一密钥派生得到加密密钥,通过所述加密密钥解密所述第一网络层的网络密钥的密文,得到所述第一网络的网络密钥。In another possible implementation, the communication unit 1301 is further configured to receive the ciphertext of the network key of the first network. The processing unit 1302 is further configured to derive an encryption key according to the first key, and decrypt the ciphertext of the network key of the first network layer by using the encryption key to obtain the network key of the first network.
在又一种可能的实施方式中,通信单元1301和处理单元1302还用于与第一节点建立接入层连接,该接入层加密开启。通信单元1301还用于接收第四消息,第四消息包含第一网络的网络密钥,第四消息在接入层被加密。处理单元1302还用在接入层解密第四消息,得到第一网络的网络密钥。In another possible implementation, the communication unit 1301 and the processing unit 1302 are further used to establish an access layer connection with the first node, and the access layer encryption is turned on. The communication unit 1301 is also used to receive a fourth message, the fourth message includes a network key of the first network, and the fourth message is encrypted at the access layer. The processing unit 1302 is also used to decrypt the fourth message at the access layer to obtain the network key of the first network.
在又一种可能的实施方式中,通信单元1301还用于接收来自所述第一节点的所述第一网络的安全算法的标识。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.
在又一种可能的实施方式中,通信单元1301还用于向所述第一节点发送所述第二节点的安全能力信息。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.
在又一种可能的实施方式中,通信单元1301还用于接收来自第一节点的第二消息,第二消息指示所述第二节点加入所述第一网络失败。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.
请参见图14,图14是本申请实施例提供的又一种通信装置的结构示意图。该通信装置140可以为独立设备,例如节点,也可以为包含于独立设备中的器件,例如芯片、软件模块、或集成电路等。该通信装置140可以包括至少一个处理器1401和通信接口1402。可选的,还可以包括至少一个存储器1403。进一步可选的,还可以包含连接线路1404,其中,处理器1401、通信接口1402和/或存储器1403通过连接线路1404相连,和/或,通过连接线路1404互相通信以传递控制信号和/或数据信号。 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 contained 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, at least one memory 1403 may also be included. Further optionally, a connection line 1404 may also be included, 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.
其中:in:
处理器1401是进行算术运算和/或逻辑运算的模块,具体可以包含以下模块中的一项或者多项:滤波器、调制解调器、功率放大器、低噪声放大器(low noise amplifier,LNA)、基带处理器、射频处理器、射频电路、中央处理器(central processing unit,CPU)、应用处理器(application processor,AP)、微电子控制单元(microcontroller unit,MCU)、电子控制单元(electronic control unit,ECU)、图形处理器(graphics processing unit,GPU)、微处理器(microprocessor unit,MPU)、专用集成电路(application specific integrated Circuit,ASIC)、图像信号处理器(image signal processor,ISP)、数字信号处理器(digital signal processor,DSP)、现场可编程逻辑门阵列(field programmable gate array,FPGA)、复杂可编程逻辑器件(complex programmable logic device,CPLD)、或协处理器等。Processor 1401 is a module that performs arithmetic operations and/or logical operations, and may specifically include one or more of the following modules: filter, modem, power amplifier, low noise amplifier (LNA), baseband processor, radio frequency processor, radio frequency circuit, central processing unit (CPU), application processor (AP), microcontroller unit (MCU), electronic control unit (ECU), graphics processor (GPU), microprocessor (MPU), application specific integrated circuit (ASIC), image signal processor (ISP), digital signal processor (DSP), field programmable gate array (FPGA), complex programmable logic device (CPLD), or coprocessor, etc.
通信接口1402可以用于为所述至少一个处理器提供信息输入或者输出,或用于接收外部发送的信号和/或向外部发送信号。The communication interface 1402 may be used to provide information input or output for the at least one processor, or to receive externally sent signals and/or send externally sent signals.
例如,通信接口1402可以包含接口电路。For example, communication interface 1402 may include interface circuitry.
例如,通信接口1402可以包括诸如以太网电缆等的有线链路接口,也可以是无线链路(Wi-Fi、蓝牙、通用无线传输、车载短距通信技术以及其他短距无线通信技术等)接口。For example, the communication interface 1402 may include a wired link interface such as an Ethernet cable, or may be a wireless link (Wi-Fi, Bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, and other short-range wireless communication technologies, etc.) interface.
可选的,通信接口1402还可以包括射频发射器、天线等。在通信接口1402包含天线的情况下,天线的数量可以是一个,也可以是多个。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.
作为一种可能的设计,若通信装置140为独立设备时,通信接口1402可以包括接收器和发送器。其中,接收器和发送器可以为相同的部件,或者为不同的部件。接收器和发送器为相同的部件时,可以将该部件称为收发器。As a possible design, if the communication device 140 is an independent 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.
作为又一种可能的设计,若通信装置140为芯片或电路时,通信接口1402可以包括输入接口和输出接口,输入接口和输出接口可以是相同的接口,或者可以分别是不同的接口。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, and the input interface and the output interface may be the same interface, or may be different interfaces.
可选地,通信接口1402的功能可以通过收发电路或收发的专用芯片实现。Optionally, the functions of the communication interface 1402 may be implemented by a transceiver circuit or a dedicated transceiver chip.
存储器1403用于提供存储空间,存储空间中可以存储操作系统和计算机程序等数据。存储器1403可以是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM)等等中的一种或者多种的组合。The memory 1403 is used to provide a storage space in which data such as an operating system and a computer program can be stored. The memory 1403 can be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), etc., or a combination of multiple thereof.
其中,以上列举的通信装置140中各模块或单元的功能和动作仅为示例性说明。The functions and actions of the modules or units in the communication device 140 listed above are only for illustrative purposes.
通信装置140中各功能单元可用于实现前述的通信方法,例如图2,图5,图6,图7,图8,图9,图10,图11,或图12所示的通信方法。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.
可选的,处理器1401,可以是专门用于执行前述方法的处理器(便于区别称为专用处理器),也可以是通过调用计算机程序来执行前述方法的处理器(便于区别称为专用处理器)。可选的,至少一个处理器还可以既包括专用处理器也包括通用处理器。Optionally, the processor 1401 may be a processor specifically used to execute the aforementioned method (for convenience of distinction, referred to as a dedicated processor), or may be a processor that executes the aforementioned method by calling a computer program (for convenience of distinction, referred to as a dedicated processor). Optionally, the at least one processor may include both a dedicated processor and a general-purpose processor.
可选的,在通信装置140包括至少一个存储器1403的情况下,若处理器1401通过调用计算机程序来实现前述通信方法,该计算机程序可以存储在存储器1403中。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 .
本申请实施例还提供了一种芯片,该芯片包括逻辑电路和通信接口。所述通信接口,用于接收信号或者发送信号;所述逻辑电路,用于通过所述通信接口接收信号或者发送信号。所述芯片用于实现前述的通信方法,例如图2,图5,图6,图7,图8,图9,图10,图11,或图12所示的通信方法。The embodiment of the present application also provides a chip, which includes a logic circuit and a communication interface. The communication interface is used to receive a signal or send a signal; the logic circuit is used to receive a signal or send a signal through the communication interface. The chip is 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.
本申请实施例还提供了一种算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器(或通信装置)上运行时,实现前述的通信方法,例如图2,图5,图6,图7,图8,图9,图10,图11,或图12所示的通信方法。An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. 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.
本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机指令,所述计算指令用于实现前述的通信方法,例如图2,图5,图6,图7,图8,图9,图10,图11,或图12所示的通信方法。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.
本申请实施例还提供了一种终端,该终端包含前述的通信装置130和/或通信装置140。The embodiment of the present application further provides a terminal, which includes the aforementioned communication device 130 and/or communication device 140.
作为一种可能的实施方式,终端包含终端节点,其中,终端可以为车辆、无人机、机器人等智能终端或运输工具。As a possible implementation, the terminal includes a terminal node, wherein the terminal may be an intelligent terminal or a means of transportation such as a vehicle, a drone, or a robot.
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。 It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
本申请中实施例提到的“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。In the embodiments of the present 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.
例如,a、b、或c中的至少一项(个),可以表示:a、b、c、(a和b)、(a和c)、(b和c)、或(a和b和c),其中a、b、c可以是单个,也可以是多个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B这三种情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。For example, at least one of a, b, or c can be represented by: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple. "And/or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and/or B can be represented by: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the associated objects are in an "or" relationship.
以及,除非有相反的说明,本申请实施例使用“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。再如,第一节点、第二节点,只是为了方便在不同的实施方式中描述新鲜参数,并不表示其执行操作、重要程度、结构等的不同。Furthermore, unless otherwise specified, the ordinal numbers such as "first" and "second" used in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects. For example, the first node and the second node are only for the convenience of describing fresh parameters in different implementations, and do not indicate differences in their execution operations, importance, structure, etc.
此外,本申请中消息也可以看作是信息的一种,且消息的名称可以进行任意替换,例如,拓扑配置消息也可以被称为拓扑配置服务数据信息。其余的消息、信息等的名称也可以有其他的设计,此处不再一一说明。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 described one by one here.
上述实施例中所用,根据上下文,术语“当……时”可以被解释为意思是“如果……”或“在……后”或“响应于确定……”或“响应于检测到……”。以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的构思和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。In the above embodiments, the term "when..." can be interpreted as meaning "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。 A person 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 instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
Claims (42)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2023/120189 WO2025059942A1 (en) | 2023-09-20 | 2023-09-20 | Communication method, communication apparatus and terminal |
| TW113133617A TW202515211A (en) | 2023-09-20 | 2024-09-05 | Communication method, communication apparatus, and terminal |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2023/120189 WO2025059942A1 (en) | 2023-09-20 | 2023-09-20 | Communication method, communication apparatus and terminal |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025059942A1 true WO2025059942A1 (en) | 2025-03-27 |
Family
ID=95073366
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/120189 Pending WO2025059942A1 (en) | 2023-09-20 | 2023-09-20 | Communication method, communication apparatus and terminal |
Country Status (2)
| Country | Link |
|---|---|
| TW (1) | TW202515211A (en) |
| WO (1) | WO2025059942A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101645877A (en) * | 2008-08-07 | 2010-02-10 | 华为技术有限公司 | Method, system and network node for consulting cipher key derivative function |
| US20200221297A1 (en) * | 2017-09-27 | 2020-07-09 | Huawei Technologies Co., Ltd. | Key derivation algorithm negotiation method and apparatus |
| CN112640506A (en) * | 2020-07-28 | 2021-04-09 | 华为技术有限公司 | Bluetooth node pairing method and related device |
| CN113455032A (en) * | 2020-05-29 | 2021-09-28 | 华为技术有限公司 | Communication method and device |
| CN116208323A (en) * | 2022-12-28 | 2023-06-02 | 中国联合网络通信集团有限公司 | Key agreement method, device, equipment and storage medium |
-
2023
- 2023-09-20 WO PCT/CN2023/120189 patent/WO2025059942A1/en active Pending
-
2024
- 2024-09-05 TW TW113133617A patent/TW202515211A/en unknown
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101645877A (en) * | 2008-08-07 | 2010-02-10 | 华为技术有限公司 | Method, system and network node for consulting cipher key derivative function |
| US20200221297A1 (en) * | 2017-09-27 | 2020-07-09 | Huawei Technologies Co., Ltd. | Key derivation algorithm negotiation method and apparatus |
| CN113455032A (en) * | 2020-05-29 | 2021-09-28 | 华为技术有限公司 | Communication method and device |
| CN112640506A (en) * | 2020-07-28 | 2021-04-09 | 华为技术有限公司 | Bluetooth node pairing method and related device |
| CN116208323A (en) * | 2022-12-28 | 2023-06-02 | 中国联合网络通信集团有限公司 | Key agreement method, device, equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202515211A (en) | 2025-04-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112740733B (en) | Secure access method and device | |
| CN112491533B (en) | Key generation method and device | |
| CN113544672A (en) | Self-confirmation of privacy protection | |
| CN112753203A (en) | Secure communication method and device | |
| CN109314705A (en) | System, apparatus and method for massively scalable dynamic multipoint virtual private network using group encryption keys | |
| KR102816657B1 (en) | Bluetooth node pairing method and related devices | |
| CN113455032A (en) | Communication method and device | |
| US20240244681A1 (en) | Communication method, apparatus, and system | |
| CN113228722B (en) | A pairing method and device | |
| WO2025059942A1 (en) | Communication method, communication apparatus and terminal | |
| CN111416791B (en) | Data transmission method, equipment and system | |
| JP7677568B2 (en) | Key acquisition method and related device | |
| CN120826924A (en) | Method, device, chip and storage medium for establishing an interoperability channel | |
| WO2025092760A1 (en) | Communication method and related apparatus | |
| WO2025087066A1 (en) | Communication method and related apparatus | |
| WO2025176028A1 (en) | Communication method and related apparatus | |
| CN115714681B (en) | Data verification method, device and storage medium | |
| CN113039766A (en) | Optimized equal-cost Simultaneous Authentication (SAE) authentication in wireless networks | |
| CN120358491A (en) | Communication method and communication device | |
| WO2025076793A1 (en) | Secure communication method and apparatus | |
| CN121511578A (en) | A User-Level Homomorphic Encryption Management Method and Device | |
| CN121418809A (en) | A communication method and a communication device | |
| WO2024037048A1 (en) | Communication method and apparatus, and system | |
| WO2025000503A1 (en) | User-level homomorphic encryption management method and apparatus | |
| CN119052805A (en) | Device connection method, device connection apparatus and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23952602 Country of ref document: EP Kind code of ref document: A1 |