Method, device and system for generating communication key among multiple nodes

By grouping nodes and generating group keys and communication keys, the problems of large consumption of key storage resources and insufficient security in traditional multi-node communication systems are solved, and efficient and secure key management and flexible node communication are achieved.

CN120281475APending Publication Date: 2025-07-08CHANGCHUN JIDA ZHENGYUAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510636336.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Traditional multi-node communication systems have problems such as high consumption of key storage resources, insufficient security and difficulty in adapting to dynamic changes of nodes in large-scale node networks. An efficient, secure and flexible inter-node communication key generation and management solution is urgently needed.

Method used

Divide the node into multiple packets, generate group keys and store them in the nodes, and generate node keys and target node keys by calculating the associated IDs of the node and the packets, and generate communication keys in combination with dynamic auxiliary data. The packet and dynamic IDs are used to reduce the pressure of key storage and improve security.

Benefits of technology

It reduces the storage needs of node keys, improves the security and flexibility of communication keys, adapts to dynamic changes of nodes, and reduces system overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281475A_ABST
    Figure CN120281475A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and a system for generating a communication key among multiple nodes, and relates to the field of communication security. The method comprises the steps that group keys and group IDs of m groups are obtained, the total node number is n, and the total node group number is m, mlt; n; iDs of g groups associated with the node are calculated, and g belongs to [1, m]; generating a node key based on the IDs of the g groups and the group key; iDs of g groups associated with the target node are calculated, and g belongs to [1, m]; generating a target node key based on the IDs of the g groups and the group key; and generating a communication key between the node and the target node based on the node key, the target node key, the node ID, the target node ID and the dynamic auxiliary data. According to the technical scheme, the security of multi-node communication can be improved, the key storage pressure is reduced, and the key management and control flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication security, and particularly to a method, apparatus and system for generating communication keys between multiple nodes. Background Art

[0002] In a system for multi-node communication, in some scenarios, the security of communication is crucial, and key management is a key link to ensure communication security. Traditional key management methods have problems such as large consumption of key storage resources, insufficient security, and difficulty in adapting to dynamic changes of nodes when facing a large-scale node network. With the continuous increase in the number of nodes and the increasing complexity of communication requirements, there is an urgent need for an efficient, secure and flexible multi-node communication key generation and management solution. Summary of the Invention

[0003] The present invention provides a method, apparatus and system for generating communication keys between multiple nodes to enhance the security of communication between multiple nodes.

[0004] According to one aspect of the present invention, there is provided a method for generating communication keys between multiple nodes, which is applied to each node, and the method includes:

[0005] Obtain the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n;

[0006] Calculate the IDs of g groups associated with the node, where g ∈ [1, m];

[0007] Generate a node key based on the IDs of the g groups and the group keys;

[0008] Calculate the IDs of g groups associated with the target node, where g ∈ [1, m];

[0009] Generate a target node key based on the IDs of the g groups and the group keys;

[0010] Generate a communication key between the node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data.

[0011] According to one aspect of the present invention, there is provided another method for generating communication keys between multiple nodes, which is applied to each node, and the method includes:

[0012] Obtain the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n;

[0013] Calculate the IDs of g groups associated with each node respectively, where g ∈ [1, m];

[0014] Generate node keys based on the IDs and group keys of the g groups respectively associated with each node;

[0015] Generate communication keys between each pair of nodes respectively based on the node keys, other node keys, node IDs, and other node IDs, and store them.

[0016] According to another aspect of the present invention, there is provided a communication key generation device between multiple nodes, configured in each node, including:

[0017] A data acquisition module, which is used to acquire the group keys of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n;

[0018] A node key generation module, which is used to calculate the IDs of the g groups associated with this node, where g ∈ [1, m], generate node keys based on the IDs and group keys of the g groups, calculate the IDs of the g groups associated with the target node, where g ∈ [1, m], and generate target node keys based on the IDs and group keys of the g groups;

[0019] A communication key generation module, which is used to generate a communication key between this node and the target node based on the node key, target node key, node ID, target node ID, and dynamic auxiliary data.

[0020] According to another aspect of the present invention, there is provided a communication key generation system between multiple nodes, including: a key management system and nodes, where:

[0021] The key management system is used to generate and store the group keys, group IDs, periodically replaced random numbers, node IDs, and node ID sequence lists of the groups where each node is located, and pre-set them into each node;

[0022] The node is used to calculate the IDs of the g groups respectively associated with this node and the target node, and respectively generate node keys and target node keys based on the IDs and group keys of the g groups, and use the node keys, target node keys, node IDs, and target node IDs to generate a communication key between this node and the target node;

[0023] The node encrypts the data to be transmitted based on the communication key and communicates with the target node.

[0024] In the technical solution of the embodiment of the present invention, by obtaining the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n; calculating the IDs of g groups associated with the node, where g ∈ [1, m]; generating a node key based on the IDs of the g groups and the group keys; calculating the IDs of g groups associated with the target node, where g ∈ [1, m]; generating a target node key based on the IDs of the g groups and the group keys; generating a communication key between the node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data. In the above technical solution, the grouped information associated with the node and the target node is calculated respectively, the node keys of the node and the target node are generated respectively based on the grouped information, and the communication key for data interaction between the two is generated based on the node key and the target node key. This can not only relieve the pressure of node key storage, improve the security of the communication key, but also adapt to the dynamic changes of nodes, and at the same time improve the flexibility of key control.

[0025] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0027] Figure 1 is a flowchart of a method for generating a communication key between multiple nodes according to an embodiment of the present invention;

[0028] Figure 2 is a schematic diagram of a method for sequentially intercepting bit strings corresponding to groups associated with a node according to an embodiment of the present invention.

[0029] Figure 3 is a flowchart of another method for generating a communication key between multiple nodes according to an embodiment of the present invention;

[0030] Figure 4 is a schematic structural diagram of a device for generating a communication key between multiple nodes according to an embodiment of the present invention;

[0031] Figure 5 is a schematic architecture diagram of a system for generating a communication key between multiple nodes according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0032] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0034] Figure 1 is a flowchart of a method for generating communication keys between multiple nodes according to an embodiment of the present invention. The embodiments of the present invention are applicable to scenarios of point-to-point data security interaction between multiple nodes, such as the Internet of Things, space interconnection, low-altitude interconnection, etc. This method can be executed by a device for generating communication keys between multiple nodes, and this device can be implemented in the form of hardware and / or software, and can be integrated into an electronic device with the function of generating communication keys between multiple nodes, such as an Internet of Things device, a connected vehicle, a satellite, a drone. As Figure 1 shown, this method includes:

[0035] S110. Obtain the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n.

[0036] In the scenario of point-to-point secure communication between multiple nodes, symmetric encryption algorithms are usually used to generate symmetric keys for secure communication. Symmetric encryption algorithms have the characteristics of fast calculation speed and relatively simple key management, and are suitable for encrypting a large amount of data. Since in multiple nodes, any two points may communicate, symmetric keys for communicating with all other nodes are usually pre-set in the flash or hard disk of each node. On the one hand, this method requires a large amount of storage space; on the other hand, due to the common defects of the key management system of the symmetric encryption mechanism, when one of the nodes has a key leakage, it may lead to the leakage of all node keys.

[0037] To solve the above problems, in the embodiments of the present invention, at the beginning of the creation of the multi-node communication key generation system, all nodes in the current system are assigned to m groups, and the ID values of the m groups are ∈ [0, m - 1], that is, the current total nodes are divided into m groups, and there is no situation where the same node belongs to two different groups. Usually, a group key is set for each group. Each node needs to obtain the group keys of the m groups and the corresponding group ID values, and store the above information obtained in the flash or hard disk as the basic data for subsequent node-to-node communication key generation.

[0038] It should be noted that the value of the number of groups m should not be too large. If it is too large, it will lead to too many group keys stored by each node and is not conducive to the system for key management; if it is too small, the purpose of improving the security of point-to-point communication cannot be achieved.

[0039] Specifically, in this embodiment, let m = 256 and n = 10000, that is, 10000 nodes belong to 256 different groups, and there is no situation where the same node belongs to two different groups. At this time, when the multi-node communication key generation system is created, each node needs to first obtain the group keys of the 256 groups and the ID values corresponding to each group. Let the group ID be GrpIDi, GrpIDi ∈ [0, 255]. Since the values of m, the group key, and the group ID are relatively fixed during the subsequent application process of the system, they can be stored in the flash or hard disk to prevent data loss caused by power failure.

[0040] Furthermore, even if new nodes are added to the system later, they will also belong to one of the m groups.

[0041] An optional method is that the group keys of the m groups are derived from the basic keys of the key management system and pre-set to each node.

[0042] When the multi-node communication key generation system is created, using the basic key at the key management system side and the preset derivation algorithm, a group key can be derived and generated for each of the m groups. Adopting the offline distribution method, the group keys and ID values corresponding to the m groups are distributed to each node device for storage in the non-networked state to ensure the security of the group keys. The basic key is a key generated based on the root key of the key management system, and this key serves as the basic data for generating the group keys in the embodiments of the present invention.

[0043] Specifically, in the embodiments of the present invention, the method for generating the group key is:

[0044] GrpKey i = KDF(Rootkey,Random i )

[0045] Among them, KDF is a derivation function used to generate the group key, such as: SM3-KDF, HKDF (HMAC-based Key Derivation Function); GrpKey i is the group key corresponding to the i-th group; Rootkey is the basic key generated by the key management system; Random i is the random number used to generate the group key of the i-th group, which is generated by the key management system side.

[0046] Since the random numbers used to generate the group keys of each group are different, the generated group keys are not easily broken.

[0047] Or the group key is derived and generated based on the basic key and the group ID generated by the key management system side, where the group ID value ∈ [0, m - 1], and the specific generation method is as follows:

[0048] GrpKey i = KDF(Rootkey, GrpID i || Random i )

[0049] Where GrpID i is the ID value of the i-th group. The splicing order of GrpID i , Random i can be changed.

[0050] Furthermore, to enhance the security of the group key, when creating the multi-node communication key generation system, the key management system can derive ω group keys for each of the m groups based on the basic key it generates, and can set the activation time of the ω group keys. One of the group keys is activated within each preset time period (such as 1 year or 5 years). When entering the next time period, the status of the currently used group key is automatically changed to disabled, and at the same time, one of the ω pre-stored group keys that has not been activated is selected and its status is changed to enabled.

[0051] Optionally, during the application of the multi-node communication key generation system, if the system detects that the group keys stored by the current nodes are stolen or there is a risk of theft, the key management system can send relevant instructions to each node, notify each node to change the status of the currently activated group key to disabled, and select one of the ω pre-stored group keys that has not been activated and change its status to enabled.

[0052] It should be noted that when multiple group keys are preset for each group and activated one by one according to the preset period (such as 1 year or 5 years), the number of groups m and the ID corresponding to each group can remain unchanged.

[0053] S120. Calculate the IDs of g groups associated with the node, where g ∈ [1, m].

[0054] After step S110, each node has stored the group keys and group IDs of m groups. Subsequently, it is necessary to further calculate based on the information of the group keys and corresponding group IDs of the m groups obtained to obtain the IDs of g groups associated with the node, where g ∈ [1, m].

[0055] To enhance the security of the communication key generated by the node, it is necessary to select g groups from m groups, where g < m, as the groups associated with the node, and calculate the communication key based on the information of the g groups associated with the node.

[0056] To ensure the randomness of the groups associated with the node, it is necessary to calculate the IDs of g groups through a preset method, so as to determine the g groups associated with the node.

[0057] An optional method is to use a preset hash algorithm based on the node ID and dynamic auxiliary data to obtain a hash value of k bytes, where k satisfies: k ≥ l × g; according to a preset method, sequentially intercept g bit strings of length l from the k-byte hash value, where l satisfies 2 l = m; parse the g bit strings of length l to obtain g groups of integers, which are the IDs of the g groups associated with the node.

[0058] In the embodiments of the present invention, the node ID refers to the data that can uniquely identify each node. When the communication key generation system between multiple nodes is created, the key management system generates the node ID, and forms an ID list in the order of the ID values, and pre-sets it together with the node ID to each node, where the number of node IDs in the list is greater than n.

[0059] It should be noted that the reason why the number of node IDs given in the ID list is greater than the current total number of nodes n is that the first n IDs in the ID list are the IDs of the n nodes in the current system, and the rest are the pre-allocated ID information for the nodes to be added to the system.

[0060] In addition, when the communication key generation system between multiple nodes is created, the key management system can generate multiple random numbers, determine the method of periodic rotation and use, and pre-set them to each node at the same time, and the key management system can synchronously store the information such as the node ID, random number, group key, and group ID generated by it.

[0061] At the key management system side, the generation and pre-setting of the node ID and random number can be carried out synchronously with the generation and pre-setting of the group key and group ID.

[0062] An optional method is to concatenate the IDs of the g groups according to the order of interception of the g groups of bit strings with a length of l to obtain a temporary node ID.

[0063] Different from the node ID, which is used to uniquely identify the node and is fixed, the node temporary ID is composed of the IDs of the g groups associated with the node. Since the group ID associated with the node is a periodically updated value, the node temporary ID is also a periodically dynamically changing value. It is mainly used to participate in the generation of node keys and communication keys in the following steps to improve key security.

[0064] The dynamic auxiliary data may include: a random number preset by the key management system for periodic rotation, timestamp information synchronized by each node, a temporary node ID, or a sequential concatenation of the three.

[0065] It can be understood that in the process of generating communication keys, the dynamic auxiliary data involved in the calculation of each step can be agreed in advance. The dynamic auxiliary data used in the data calculation of each step can be the same or different, but the dynamic auxiliary data used by each node in the same step calculation process must be the same. Any one of the data including random numbers, synchronization timestamp information, and node temporary ID can be selected as dynamic auxiliary data, or the sequential splicing value of two or three types of data can be selected. In this case, the selected data categories are required to be the same and the splicing order is the same.

[0066] Specifically, if the dynamic auxiliary data used to calculate the IDs of the g groups associated with the node is: param1, param1 = salt1||time, salt1 is one of the random numbers generated by the key management system and preset in each node, and it is agreed that salt1 is selected within a certain period (weekly or daily) to participate in the calculation of the IDs of the g groups associated with each node. Time is the synchronization timestamp information currently obtained by each node.

[0067] Specifically, the calculated ID value is VID i When the IDs of g groups associated with the node are obtained, the corresponding hash value is obtained by using the preset hash algorithm based on the node ID value and the preset dynamic auxiliary data param1.

[0068] h i =Hash(VID i ||param1)

[0069] Hash is the preset hash algorithm. Common hash algorithms include MD5, SHA-1, SHA-256, and SHA-512. i is the hash value obtained by hash operation, and its length can be 128bit, 160bit, 256bit, or 512bit. If the selected hash algorithm is MD5, the obtained hash value is 128bit, 160bit, 256bit, or 512bit. iIs a 16-byte string.

[0070] From the obtained k-byte hash value, according to a certain method, from h i Sequentially intercepting g groups of bit strings with a length of l refers to extracting g groups of partial bytes in h i According to a preset method, each group has a length of l bit strings, and based on this, the IDs of the g groups associated with the node are calculated.

[0071] Figure 2 Disclosed is a schematic diagram of a method for sequentially intercepting bit strings corresponding to groups associated with a node.

[0072] If g groups of bit strings with a length of l are sequentially intercepted, the preset number of groups g associated with each node is 8, and the obtained h i Is a 16-byte string. Since it is necessary to satisfy: 2 l = m, at this time l = 8, that is, a byte string can be extracted each time. At the same time, l×g = 8×8 = 64, 128>64, satisfying: k≥l×g. If the product of l and g is greater than k, then all bytes in k need to be taken out, which is not conducive to operation. Therefore, generally, k≥l×g needs to be satisfied.

[0073] Such as Figure 2 As shown, the method for sequentially intercepting g groups of bit strings with a length of l is: sequentially select the 1st, 3rd, 5th, 7th, 9th, 11th, 13th, and 15th bytes, and thus obtain 8 groups of bit strings with a length of 8. According to the extraction order, they are sequentially parsed into decimal numbers, and the obtained decimal values are all between 0-255, which is consistent with the total number of groups m = 256 and the value range of the group ID [0, 255]. Thus, the group IDs of the g groups associated with the node are determined.

[0074] Specifically, after parsing, if the 8 sequentially extracted strings are represented by corrGrp#0, corrGrp#1, corrGrp#2, corrGrp#3, corrGrp#4, corrGrp#5, corrGrp#6, corrGrp#7 respectively, and their corresponding decimal numbers are: 82, 77, 36, 5, 189, 201, 43, 111, then the IDs of the 8 groups associated with the node are: {82, 77, 36, 5, 189, 201, 43, 111}.

[0075] According to the interception order of the g groups of bit strings with a length of l, the IDs of the above g groups are concatenated to obtain the temporary ID of the node: TempVID = {"82" || "77" || "36" || "5" || "189" || "201" || "43" || "111"}.

[0076] It should be noted that the IDs of the g groups in the embodiments of the present invention are spliced based on the interception order of the bit strings. Therefore, if the interception order is different, the splicing order will be different, and the temporary node IDs obtained will also be different. It can be seen from this that even if the same set of associated group ID values is used, the temporary node IDs obtained by using different splicing orders are different.

[0077] Further, in other embodiments, when m = 512 and l = 9, a string of 9 bits in length needs to be extracted each time. At this time, the value of g can be kept fixed and can still be 8, as long as l×g≤k is satisfied.

[0078] It should be noted that the groups associated with each node are not preset fixed values, but are calculated by each node itself within each preset time period (such as weekly, daily, or monthly), and different methods can be set for sequentially intercepting g groups of bit strings with a length of l within each time period. For example, if the method for sequentially intercepting g groups of bit strings with a length of l within this time period is: sequentially select the 1st, 3rd, 5th, 7th, 9th, 11th, 13th, and 15th bytes as the groups associated with the node, the method for sequentially intercepting g groups of bit strings with a length of l in the next time period can be to sequentially select the 3rd, 5th, 7th, 9th, 11th, 13th, 15th, and 1st bytes or the 0th, 2nd, 4th, 6th, 8th, 10th, 12th, and 14th bytes. At the same time, multiple selection algorithms can be set to be cyclically used in different time periods.

[0079] It can be understood that since the method for calculating the groups associated with the node is variable in each period, each node needs to recalculate the groups associated with the node within each preset time period, so as to generate a new node key based on the new associated group information and then generate a new inter-node communication key, realizing the periodic update of the node key and the communication key, and improving the security of the communication key.

[0080] It can be understood that the dynamic auxiliary data used in the operation are all the same data obtained by each node based on a preset algorithm for operation to ensure the consistency of data generation.

[0081] S130. Generate a node key based on the IDs of the g groups and the group key.

[0082] In this embodiment, a node key is generated based on the IDs of the g groups associated with the node calculated in S120 and the group key.

[0083] Therefore, based on the IDs of the g groups associated with this node calculated by S120, query the group keys of the g groups stored at the node end, and obtain the group keys corresponding to the g strings corrGrp#0, corrGrp#1, corrGrp#2, corrGrp#3, corrGrp#4, corrGrp#5, corrGrp#6, corrGrp#7 extracted in sequence as GrpKey0, GrpKey1, GrpKey2, GrpKey3, GrpKey4, GrpKey5, GrpKey6, GrpKey7 respectively.

[0084] Based on the group keys of the g groups and the dynamic auxiliary data, use a preset derivation function to obtain the node key. The specific generation process is as follows:

[0085] VKey i = KDF(GrpKey0||GrpKey1||GrpKey2||GrpKey3||GrpKey4||GrpKey5||GrpKey6||GrpKey7, param2)

[0086] where VKey i represents the node key of node i, param2 is the dynamic auxiliary data used when generating the node key in this time period. param2 can be the same as param1 or different. Using different dynamic auxiliary data selected in each step can increase the difficulty of cracking the communication key and improve the security of the communication key. However, the dynamic auxiliary data used by each node in each step must be the same.

[0087] In this embodiment, param2 = TempVID i ||salt2||time.

[0088] where TempVID i is the node temporary ID obtained by concatenating the IDs of the g groups associated with node i in this time period. salt2 is the random number used by each node when generating the node key in this time period, usually generated by the key management system and pre-set to each node. In other embodiments, the dynamic auxiliary data selected in each step can also be generated based on salt1, without using salt2, but using salt2 as the random number participating in the generation of dynamic auxiliary data in the next time period. time is the timestamp information obtained when each node synchronously generates the node key.

[0089] It can be understood that the dynamic auxiliary data param2 used when generating the node key can also be defined as: TempVID i ||salt2 or TempVID i||time or salt2||time.

[0090] S140. Calculate the IDs of g packets associated with the target node, where g ∈ [1, m].

[0091] S150. Generate a target node key based on the IDs of the g packets and the group key.

[0092] The target node j refers to the node with which node i wants to communicate. Since the generation of the communication key between the two requires the node key VKey of node i i and the node key VKey of the target node j j to participate in the operation, node i needs to further generate the target node key using the same method as S120 and S130. Since the method for generating the target node key disclosed in S140 and S150 is the same as that for generating the node key in S120 and S130, it will not be elaborated here one by one. Thus, the target node key VKey is obtained. j .

[0093] It should be noted that there is no sequence distinction between the execution of S120, S130 and S140, S150. In practical applications, the node key and the target node key can be generated simultaneously, or the node key can be generated first and then the target node key, or the target node key can be generated first and then the node key.

[0094] Furthermore, the node can calculate the target node key in advance through steps S140 and S150, store it together with the node key, and generate the communication key between the two nodes based on the target node key during communication. In scenarios where communication timeliness is not required, to save storage space, the target node key can also be calculated before the two nodes communicate. Since each node key is not fixed and remains unchanged only within a preset time period, it can be determined whether to pre-generate and store the node key for the node according to factors such as the communication frequency between nodes, the communication timeliness required by the system, the storage space of the node, and the computing power of the node.

[0095] S160. Generate the communication key between this node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data.

[0096] Specifically, the communication key between node i and target node j is based on the node key VKey of node i i and the node key VKey of the target node j j , the ID of node i (VID i ) and the ID of the target node j (VID j), combined with dynamic auxiliary data, generated using a key derivation algorithm or a hashing algorithm. In this embodiment, the KDF derivation algorithm is used to generate the communication key TSK_S ij , and the dynamic auxiliary parameter param3 used can be the same as param2 and param1, or different. Using different dynamic auxiliary data selected in each step can increase the difficulty of cracking the communication key and enhance the security of the communication key. However, the dynamic auxiliary data used by each node in each step must be the same.

[0097] Specifically, the formula is as follows:

[0098] TSK_S ij = KDF(VKey i XOR VKey j , VID i || VID j || param3)

[0099] where TSK_S ij represents the communication key used for communication between node i and node j. In this embodiment, param3 = TempVID i || salt3 || time.

[0100] It can be understood that in other embodiments, the dynamic auxiliary data param3 used when generating the node key can also be defined as: TempVID i || salt3 or TempVID i || time or salt3 || time.

[0101] salt3 is a random number used by each node when generating the communication key within this time period, usually generated by the key management system and pre-set to each node. In other embodiments, the dynamic auxiliary data selected in each step can all be generated based on salt1, and then updated to use salt3 to participate in the generation of dynamic auxiliary data in other time periods. time is the timestamp information obtained when each node synchronously generates the node key.

[0102] It should be noted that this embodiment only discloses the generation of the communication key between this node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data, without limiting the specific algorithm used and the specific participation method of the data. This is because in this embodiment, the communication key can be generated using a key derivation algorithm or a hashing algorithm. Due to different algorithms and different input parameters, the specific participation methods of the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data are different.

[0103] The calculation formula given in the embodiment of the present invention takes the KDF algorithm as an example and has two core input parameters. Parameter 1 is VKey i The result of the exclusive OR with VKey j Parameter 2 is the concatenated value of VID i , VID j , and param3. In practical applications, other auxiliary information can also be used as input parameters, such as the length of the key to be generated, relevant description information, etc.

[0104] When generating the communication key between node i and target node j provided in this embodiment, the concatenation order of parameter 2 is that the ID of this node is in the front and the ID of the target node established for communication is in the back. If the number of input parameters of the algorithm used is 1 or 3, the operation methods of each data participant are different and will not be enumerated one by one here. However, if the input parameter data is related to the order, the data of this node can be set in the front and the data of the target node can be set in the back. At this time, for target node j, when calculating the key used for communication with node i using the same method in this step, the communication key generated by target node j with node i is different, that is, TSK_S ji ≠TSK_S ij , when node i receives the communication data encrypted by target node j using TSK_S ji , it is necessary to generate TSK_S ji in the same way as target node j generates TSK_S ji in order to decrypt the returned data.

[0105] Therefore, it can be understood that in the above content, TSK_S ij is the uplink key, that is, the encryption key used when sending data from this node to the peer target node, and TSK_S ji is the downlink key, that is, the encryption key used when the peer target node returns data to this node. If the uplink key and the downlink key are different, this node also needs to calculate the downlink key used when the target node returns data.

[0106] To reduce the amount of computation, the generation methods of the uplink key and the downlink key can be set so that the generated uplink key and downlink key are the same. The implementation method is as follows:

[0107] Judge the sizes of the node ID and the target node ID;

[0108] Concatenate the node ID and the target node ID in the order of size to obtain the ID concatenated value;

[0109] Generate a communication key based on the node key, the target node key, the ID concatenated value, and the dynamic auxiliary data using a preset hash algorithm or key derivation algorithm.

[0110] For example, when communicating with a target node, first determine the size of the ID of the local node and the target node. Then, when calculating the communication key between the two nodes, splice them in order of the ID size before and after to obtain a fixed splicing value. At this time, the uplink key and the downlink key obtained are the same.

[0111] Specifically, when node i communicates with node j, node i obtains the ID of node j and compares VID i and VID j . If VID i >VID j , then it can be defined that:

[0112] TSK_S ji =TSK_S ij =KDF(VKey i XOR VKey j , VID i ||VID j ||param3)

[0113] If VID i <VID j , then it can be defined that:

[0114] TSK_S ji =TSK_S ij =KDF(VKey i XOR VKey j , VID j ||VID i ||param3)

[0115] Furthermore, since the communication key is not fixed and remains unchanged only within a preset time period, it is possible to determine whether to store the communication key according to the communication frequency between nodes, the communication timeliness required by the system, the size of the node storage space, the computing power of the node, and other situations.

[0116] It should be noted that in the embodiments of the present invention, relatively fixed data such as the group key, the group ID, and other pre-stored random numbers and the ID sequence table can be stored in the hard disk or flash. The data generated within each time period, such as the group ID associated with each node, the node key, and the communication key, which are different within each time period, can be stored in the RAM.

[0117] In the technical solution of the embodiment of the present invention, by obtaining the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n; calculating the IDs of g groups associated with the node, where g ∈ [1, m]; generating a node key based on the IDs of the g groups and the group keys; calculating the IDs of g groups associated with the target node, where g ∈ [1, m]; generating a target node key based on the IDs of the g groups and the group keys; generating a communication key between the node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data.

[0118] In the above technical solution, by grouping multiple nodes, calculating the group IDs associated with each node, and generating node keys and target node keys based on the group IDs and group keys associated with the nodes, and then generating a communication key between the node and the target node based on the node key, the target node key, the node and target node IDs combined with the dynamic auxiliary data, not only reduces the storage space of the keys, but also improves the security of the communication key.

[0119] In addition, when a new node joins the system, only need to calculate the groups associated with the new node and the groups associated with the target nodes communicating with it according to the method provided in this embodiment, obtain the new node key and the target node key, and thus calculate the communication key between the two nodes by using the new node key and the target node key. It can be seen that by adopting the communication key generation method and key management system of the embodiment of the present invention, the system overhead brought by the new node joining the system is small and does not affect the existing system.

[0120] On the contrary, if some of the current n nodes stop operating, it will not affect the generation of communication keys between other nodes in the system.

[0121] Figure 3 It is a flowchart of another method for generating a communication key between multiple nodes provided according to an embodiment of the present invention. The embodiment of the present invention is applicable to scenarios of point-to-point data interaction between multiple nodes, such as the Internet of Things, space interconnection, low-altitude interconnection, etc. It is particularly applicable to business environments with high requirements for communication real-time and attention to data transmission security at the same time. This method can be executed by a device for generating a communication key between multiple nodes, and this device can be implemented in the form of hardware and / or software and can be integrated into an electronic device with the function of generating a communication key between multiple nodes, such as an Internet of Things device, a connected vehicle, a satellite, a low-altitude device. As Figure 3 shown, this method includes:

[0122] S310. Obtain the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n.

[0123] Similar to the specific implementation method disclosed in step S110, at the beginning of the creation of the multi-node communication key generation system, all current nodes in the communication system are classified into m groups, and the ID values of the m groups are set to be in the range of [0, m - 1]. That is, the current total number of nodes n is divided into m groups, and there is no situation where the same node belongs to two different groups.

[0124] Specifically, in this embodiment, let m = 256 and n = 10000, that is, 10000 nodes belong to 256 different groups, and there is no situation where the same node belongs to two different groups. At this time, when building the multi-node communication key generation system, each node needs to first obtain the group keys of 256 groups and the corresponding ID values GrpID ∈ [0, 255]. And because the values of m, the corresponding group keys, and the group IDs are relatively fixed during the subsequent application process of the system, they need to be stored in flash or hard disk to prevent data loss caused by power failure.

[0125] Furthermore, even if new nodes are added to the system later, they will also belong to one of the m groups.

[0126] An optional method is that the group keys of the m groups are derived from the basic key on the key management system side and pre-set to each node.

[0127] When creating the multi-node communication key generation system, using the basic key on the key management system side and the preset derivation algorithm, a group key can be derived for each of the m groups. Adopting the offline distribution method, the group keys and ID values corresponding to the m groups are distributed to each node device for storage in the non-networked state to ensure the security of the group keys. The basic key is a key generated based on the root key of the key management system, and this key is used as the basic data for generating the group keys in the embodiments of the present invention.

[0128] Specifically, in the embodiments of the present invention, the method for generating the group key is as follows:

[0129] GrpKey i = KDF(Rootkey, Random i )

[0130] where KDF is the derivation function used to generate the group key, such as: SM3-KDF, HKDF (HMAC-based Key Derivation Function); GrpKey i is the group key corresponding to the i-th group; Rootkey is the basic key generated by the key management system side; Random i is generated by the key management system side and is the random number used to generate the group key of the i-th group.

[0131] Since the random numbers used to generate each group key are different, the generated group keys are not easily broken.

[0132] Or the group key is derived from the base key and the group ID generated at the key management system side, where the group ID value ∈ [0, m - 1]. The specific generation method is as follows:

[0133] GrpKey i = KDF(Rootkey, GrpID i ||Random i )

[0134] Where GrpID i is the ID value of the i-th group. The splicing order of GrpID i and Random i can be changed.

[0135] Thus, each node obtains the group keys and group IDs of m groups.

[0136] S320. Calculate the IDs of g groups respectively associated with each node, where g ∈ [1, m].

[0137] This embodiment is applicable to a service environment that requires high communication real-time performance and at the same time pays attention to data transmission security. In some scenarios, the point-to-point communication of the communication key generation system between multiple nodes has high timeliness requirements, and the target nodes for communication are uncertain. Each node may communicate with other nodes. Therefore, each node needs to generate and store the communication keys with the other n - 1 nodes in advance. Since the communication keys are not fixed and need to be updated periodically, they can be stored in the RAM, and the storage capacity requirements for the nodes are not high. The periodic update method provided in this embodiment improves the security of the communication keys.

[0138] Therefore, in the embodiment of the present invention, each node needs to calculate the IDs of g groups respectively associated with itself and the other n - 1 nodes in the current system, where the g groups all belong to m, and g < m. The calculation method is the same as the method disclosed in step S120 in the previous embodiment and will not be elaborated here one by one.

[0139] After step S310, each node has stored the group keys and corresponding IDs of m groups. Subsequently, it is necessary to further calculate based on the information of the group keys and corresponding IDs of the m groups obtained to obtain the IDs of g groups associated with each node, where g ∈ [1, m].

[0140] So far, each node has calculated the IDs of g groups associated with the n nodes in the current system.

[0141] S330. Generate the node keys based on the IDs and group keys of the g groups respectively associated with each node.

[0142] In this embodiment, through S320, each node calculates and obtains the IDs of the g groups associated with each node.

[0143] Furthermore, the node needs to query the group keys of the g groups stored at the node end respectively.

[0144] Taking any node i in the system, where i ∈ [1, 10000] as an example, the keys corresponding to the IDs of the g groups associated with it are respectively:

[0145] GrpKey i0 , GrpKey i1 , GrpEy i2 , GrpKey i3 , GrpKey i4 , GrpKey i5 , GrpKey i6 , GrpKey i7 .

[0146] Based on the group keys of the g groups and the dynamic auxiliary data, use a preset derivation function to obtain the node key of node i. The specific generation process is as follows:

[0147] VKey i = KDF(GrpKey i0 ||GrpKey i1 ||GrpKey i2 ||GrpKey i3 ||GrpKey i4 ||GrpKey i5 ||GrpKey i6 ||GrpKey i7 , param2)

[0148] where VKey i represents the key of node i, param2 is the dynamic auxiliary data used by each node to generate the node key in this time period. param2 can be the same as param1, or different. Using different dynamic auxiliary data selected in each step can increase the difficulty of cracking the communication key and improve the security of the communication key. However, the dynamic auxiliary data used by each node in each step must be the same.

[0149] Based on the above formula, each node can calculate and obtain the node keys of the n nodes in the current system and store them.

[0150] It should be noted that this step is basically the same as the method disclosed in step S130. The difference is that in this step, each node needs to calculate the node keys with all the nodes in the current system and store them.

[0151] S340. Respectively generate communication keys between each pair of nodes based on the node keys, other node keys, node IDs, and other node IDs, and store them.

[0152] This step is the same as the method for calculating communication keys disclosed in step 160. The difference is that in this step, each node needs to calculate the communication keys between this node and the other n - 1 nodes in the system, and finally obtain n communication keys. And if the uplink communication key and the downlink communication key specified by the system are different, each node also needs to calculate the uplink communication key and the downlink communication key between this node and each other node respectively, and store them. At this time, each node generates and stores n uplink communication keys and n downlink communication keys.

[0153] When nodes communicate later, they can directly query the pre - stored communication keys to achieve secure and efficient communication with other nodes. Moreover, in the embodiments of the present invention, the node keys and communication keys are updated within a specified time period, which ensures the security of the communication keys.

[0154] The technical solution of the embodiments of the present invention obtains the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n; calculates the IDs of g groups respectively associated with each node, where g ∈ [1, m]; generates node keys based on the IDs of the g groups respectively associated with each node and the group keys; respectively generates communication keys between each pair of nodes based on the node keys, other node keys, node IDs, and other node IDs, and stores them. Through the above - mentioned technical solution, each node calculates the node keys of all the nodes in the system and the communication keys for communicating with the other n - 1 nodes and stores them, which not only improves the security of the communication keys but also ensures the high timeliness of point - to - point communication.

[0155] Figure 4 It is a schematic structural diagram of a device for generating communication keys between multiple nodes according to an embodiment of the present invention. The embodiments of the present invention are applicable to the scenario of point - to - point data security interaction between multiple nodes. This method can be executed by a device for generating communication keys between multiple nodes. This device can be implemented in the form of hardware and / or software and can be integrated into an electronic device with the function of generating communication keys between multiple nodes, such as an Internet of Things device, a connected vehicle, a satellite, a drone, etc. As Figure 4 shown, the device includes:

[0156] A data acquisition module 410, configured to acquire the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n;

[0157] The node key generation module 420 is configured to calculate the IDs of g packets associated with the node, where g ∈ [1, m], generate a node key based on the IDs of the g packets and the group key, calculate the IDs of g packets associated with the target node, where g ∈ [1, m], and generate a target node key based on the IDs of the g packets and the group key;

[0158] The communication key generation module 430 is configured to generate a communication key between the node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data.

[0159] Optionally, the node key generation module 420 is configured to:

[0160] Obtain a k-byte hash value based on the node ID and the dynamic auxiliary data using a preset hash algorithm, where k satisfies: k ≥ l × g;

[0161] Sequentially intercept g bit strings of length l from the k-byte hash value, where l satisfies 2 l = m;

[0162] Parse the g bit strings of length l to obtain g groups of integers, which are the IDs of the g packets associated with the node.

[0163] Concatenate the IDs of the g packets in the intercept order of the g bit strings of length l to obtain a node temporary ID.

[0164] Query the group keys of the g packets associated with the node;

[0165] Generate a node key based on the group keys of the g packets and the dynamic auxiliary data using a preset derivation function.

[0166] The technical solution of this embodiment reduces the storage space of keys and improves the security of communication keys by grouping multiple nodes, calculating the packet IDs associated with each node, generating node keys and target node keys based on the packet IDs associated with the nodes and the group keys, and then generating communication keys between the node and the target node based on the node key, the target node key, the node and target node IDs combined with the dynamic auxiliary data.

[0167] The multi-node communication key generation device provided by the embodiment of the present invention can execute the multi-node communication key generation method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

[0168] Figure 5 It is a schematic diagram of the architecture of a multi-node communication key generation system provided according to an embodiment of the present invention.

[0169] AsFigure 5 As shown, the system includes: a key management system and nodes.

[0170] The key management system is used to generate and store the group key, group ID, periodically replaced random number, node ID, and node ID sequence list of each node's group, and pre-set them into each node;

[0171] The node is used to calculate the IDs of g groups respectively associated with the node and the target node, and generate a node key and a target node key respectively based on the IDs of the g groups and the group key, and generate a communication key between the node and the target node by using the node key, the target node key, the node ID, and the target node ID;

[0172] The node encrypts the data to be transmitted based on the communication key and communicates with the target node.

[0173] The key management system provided in the embodiment of the present invention is configured in a server independent of each node. The server adopts an offline distribution method to pre-set the group key, periodically replaced random number, node ID, and node ID sequence list of each node's group into each node in a non-Internet environment. Then each node is enabled to calculate the communication key and achieve secure communication with the target node based on the calculated communication key. At the same time, the communication key can be updated based on a preset time period.

[0174] The nodes communicate with each other and with the server where the key management system is located through a private network or the Internet. During the operation of the nodes, the key management system can send instructions to each node. For example, enable a new round of group keys pre-set in each node, or require each node to deactivate the current communication key, send instructions to synchronize information such as node deactivation and node addition in the system to each node, and immediately generate a new communication key, etc.

[0175] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0176] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for generating communication keys between multiple nodes, which is applied to each node, and is characterized in that: Obtain the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n; Calculate the IDs of g groups associated with this node, where g ∈ [1, m]; Generate a node key based on the IDs of the g groups and the group keys; Calculate the IDs of g groups associated with the target node, where g ∈ [1, m]; Generate a target node key based on the IDs of the g groups and the group keys; Generate a communication key between this node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data.

2. The method according to claim 1, wherein Obtaining the group keys and group IDs of m groups includes: The group keys of the m groups are derived from the basic keys at the key management system end, or are derived from the basic keys and group IDs at the key management system end, where the group ID values ∈ [0, m - 1], and are preset to each node.

3. The method according to claim 1, wherein The calculating the IDs of g groups associated with this node includes: Obtain a k-byte hash value using a preset hash algorithm based on this node ID and the dynamic auxiliary data, where k ≥ l × g; From the hash value of the k bytes, sequentially intercept g groups of bit strings with a length of l, where l satisfies 2 l = m; Parse the g groups of bit strings with a length of l to obtain g groups of integers, which are the IDs of the g groups associated with this node.

4. The method according to claim 3, characterized in that, It includes: Concatenate the IDs of the g groups in the order of the bit string truncation with a length of l for the g groups to obtain a node temporary ID.

5. The method according to claim 1, wherein The generating a node key based on the IDs of the g groups and the group keys includes: Query the group keys of the g groups associated with this node; Obtain a node key using a preset derivation function based on the group keys of the g groups and the dynamic auxiliary data.

6. The method according to claim 1, characterized in that, The generating a communication key between this node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data includes: Judge the magnitudes of the node ID and the target node ID; Concatenate the node ID and the target node ID in the order of magnitude to obtain an ID concatenation value; Generate a communication key using a preset hash algorithm or key derivation algorithm based on the node key, the target node key, the ID concatenation value, and the dynamic auxiliary data.

7. A method for generating communication keys between multiple nodes, which is applied to each node, and is characterized in that: Obtain the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n; Calculate the IDs of g groups respectively associated with each node, where g ∈ [1, m]; Generate keys for each node based on the IDs of the g groups respectively associated with each node and the group keys; Generate communication keys between each node based on the node key, the keys of other nodes, the node ID, and the IDs of other nodes respectively, and store them.

8. The method according to any one of claims 1-7, characterized in that The dynamic auxiliary data includes: random numbers preset by the key management system, timestamp information synchronized by each node, node temporary IDs, or the sequential concatenation value of the three, and the dynamic auxiliary data used by each node is the same during the communication key generation process.

9. The method according to any one of claims 1-7, characterized in that The node ID is generated by the key management system, which can uniquely identify node information. An arrangement list is formed in the order of the ID sizes and pre-set together with the node ID into each node, where the number of node IDs in the arrangement list is greater than n.

10. A communication key generation device between multiple nodes, configured in each node, characterized in that It includes: A data acquisition module, configured to acquire the group keys and group IDs of m groups, where the total number of nodes is n, the total number of node groups is m, and m < n; A node key generation module, configured to calculate the IDs of g groups associated with the node, where g ∈ [1, m], and generate a node key based on the IDs of the g groups and the group key, calculate the IDs of g groups associated with the target node, where g ∈ [1, m], and generate a target node key based on the IDs of the g groups and the group key; A communication key generation module, configured to generate a communication key between the node and the target node based on the node key, the target node key, the node ID, the target node ID, and the dynamic auxiliary data.

11. A communication key generation system between multiple nodes, characterized in that, The multi-node communication key generation system includes: a key management system, nodes, where: The key management system is configured to generate and store the group keys, group IDs, periodically replaced random numbers, node IDs, and the node ID sequence arrangement list of each node group, and pre-set them into each node; The nodes are configured to calculate the IDs of g groups associated with the node and the target node respectively, and generate a node key and a target node key respectively based on the IDs of the g groups and the group key, and generate a communication key between the node and the target node by using the node key, the target node key, the node ID, and the target node ID; The node encrypts the data to be transmitted based on the communication key and communicates with the target node.