A data encryption method based on Internet of Things
By analyzing the topology of the IoT sensor network to generate a unique encryption key, the sensor node data is encrypted, which solves the network insecurity problem caused by the same key in the existing technology and improves data security.
Patent Information
- Application Number
- CN202410056503.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-01-15
AI Technical Summary
Existing IoT sensor node data encryption uses the same key. As a result, once a node is compromised, the entire network is insecure, the key is easily leaked, and the data is vulnerable to attacks during transmission.
By analyzing the topology of the sensor network, a topological feature matrix is generated, the node private key is adjusted according to the central characteristics of the node, a unique encryption key is generated, and node data is encrypted with AES to improve encryption complexity and security.
The security of node data is enhanced, the encryption effect is improved through the uniqueness of node characteristics, and the overall security of the sensor network is ensured.
Smart Images

Figure CN118138273B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a data encryption method based on the Internet of Things. Background Art
[0002] Since the sensor network in the Internet of Things environment is an intelligent dedicated network composed of a large number of sensor network nodes with specific functions that communicate and collaborate to complete specific functions, the data it transmits has high security requirements. Therefore, sensor nodes, as an important part of the Internet of Things, are discretely distributed and may be located in remote areas, making them vulnerable to various attacks and information leakage. Therefore, it is necessary to encrypt the node data corresponding to the sensor to ensure data security.
[0003] In the prior art, the encryption of IoT sensor node data generally uses the AES encryption algorithm with a small amount of calculation to encrypt sensor data. Although the amount of calculation is small, all nodes use the same set of keys. This will result in the entire sensor network becoming transparent and insecure once a node is attacked and the node key is leaked. The existing encryption algorithm used for user data uses the same key to encrypt the data collected by all sensors, and the data must be decrypted at all nodes it passes through, exposing the data itself, making it extremely vulnerable to attack, and the key is also easily leaked. Summary of the invention
[0004] The present invention provides a data encryption method based on the Internet of Things to solve the existing problems.
[0005] The data encryption method based on the Internet of Things of the present invention adopts the following technical solution:
[0006] An embodiment of the present invention provides a data encryption method based on the Internet of Things, the method comprising the following steps:
[0007] A sensor network is formed by sensors installed on several devices, and a node network, a node private key, and node data are obtained through the sensor network; the nodes corresponding to the main servers of all devices in the node network are recorded as main nodes;
[0008] Obtain the degree, maximum connected component, adjacency matrix and number of nodes in the node network, obtain the shortest path between nodes in the node network, record the matrix formed by the degree, maximum connected component, shortest path between nodes in the node network and number of nodes as the convolution kernel, and combine the convolution kernel and the adjacency matrix to obtain the topological feature matrix of the node network;
[0009] Obtain the degree of any node in the node network, obtain the number of other nodes directly connected to the node and record it as the number of connections of the node, record the shortest path between the main node and any other node as the first path of the main node, and obtain the central feature of the node according to the degree of the node, the number of nodes, the number of connections of the node and the number of the first path of the main node in the node network; use the value and ordinal number of the elements in the topological feature matrix to adjust the central feature of the node to obtain the node feature of the node;
[0010] The node characteristics are used to shift the node private key to obtain the node encryption key, and the node data of the node is encrypted using the key to obtain the ciphertext;
[0011] Save the ciphertext and key.
[0012] Furthermore, the specific method of obtaining the node network, the node private key and the node data through the sensor network includes:
[0013] First, a device is regarded as a node in the node network, and the nodes corresponding to the master servers of all devices in the node network are recorded as master nodes. There are several master nodes in a node network; the private key corresponding to each device is obtained and recorded as the node private key;
[0014] Then, the data stored in the device corresponding to each node in the node network is recorded as node data.
[0015] Furthermore, the method of obtaining the shortest path between nodes in the node network and recording the matrix formed by the degree of the node network, the maximum connected component, the shortest path between nodes in the node network and the number of nodes as the convolution kernel includes the following specific methods:
[0016] First, the Dijkstra algorithm is used to obtain the shortest path between any two nodes in the node network, and the average of the path lengths of the shortest paths between all nodes is recorded as the average path length of the node network;
[0017] Then, the maximum connected component corresponding to the node network is obtained, and the number of nodes in the maximum connected component is recorded as the number of connected nodes of the node network;
[0018] Finally, the convolution kernel is Where n represents the number of nodes in the node network; It represents the average path length of the node network; TD represents the degree of the node network; Mn represents the number of connected nodes of the node network.
[0019] Furthermore, the method of combining the convolution kernel and the adjacency matrix to obtain the topological feature matrix of the node network includes the following specific methods:
[0020] The convolution result of the convolution kernel and the adjacency matrix is recorded as the topological feature matrix of the node network.
[0021] Furthermore, the central feature of the node is obtained according to the degree of the node, the number of nodes, the number of connections of the node and the number of first paths of the main node in the node network, including the specific method of:
[0022] First, obtain the degree of any node in the node network; obtain the number of times any node appears on the first path of all main nodes, which is recorded as the central parameter of the node;
[0023] Then, the density of the node is obtained according to the number of connections of the node and the degree of the node; the ratio of the central parameter of the node and the number of first paths of all main nodes is recorded as the central degree of the node;
[0024] Finally, the product of density and centrality is recorded as the central feature of the node.
[0025] Furthermore, the density of nodes is obtained according to the number of connections of the nodes and the degree of the nodes, including the specific method of:
[0026] The degree of the node minus 1 is recorded as the degree factor, and the product of the node degree and the degree factor is recorded as the node density factor;
[0027] The ratio of the number of connections of a node to the density factor is recorded as the density of the node.
[0028] Furthermore, the method of using the values and ordinals of the elements in the topological feature matrix to adjust the central features of the nodes to obtain the node features of the nodes includes the following specific methods:
[0029] The central feature of the node is adjusted using the ordinal number of the element in the topological feature matrix to obtain a first feature factor, and the first feature factor is adjusted using the value of the element in the topological feature matrix to obtain a second feature factor;
[0030] The accumulated value of the second characteristic factors between the node and all elements in the topological characteristic matrix is recorded as the node characteristic of the node.
[0031] Furthermore, the method of adjusting the central feature of the node by using the ordinal number of the element in the topological feature matrix to obtain the first feature factor and adjusting the first feature factor by using the value of the element in the topological feature matrix to obtain the second feature factor includes the following specific methods:
[0032] Get the ordinal of any element in the topological feature matrix, multiply the ordinal of any element by the central feature of the node to obtain the first characteristic factor between the node and the element, and add the value of the element to the first characteristic factor to obtain the second characteristic factor between the node and the element.
[0033] Furthermore, the node characteristics are used to shift the node private key to obtain the node encryption key, and the key is used to encrypt the node data of the node to obtain the ciphertext, including the specific method of:
[0034] First, any character in the node private key of the node is recorded as the target character, and the target character in the node private key of the node is converted and shifted to obtain a new binary string of the target character;
[0035] Then, the new binary string of all characters is arranged according to the order of all characters in the node private key of the node, and the arranged string is recorded as the initial string of the node. The initial string of the node is encoded using the ASCII code table to obtain the encryption key of the node;
[0036] Finally, the node data of the node corresponding to the encryption key is encrypted by combining the encryption key and using the AES encryption algorithm to obtain the ciphertext of the node data.
[0037] Furthermore, the method of performing base conversion and shift operation on the target character in the node private key of the node to obtain a new binary string of the target character includes the following specific methods:
[0038] First, convert the target character into binary form and record it as the binary string corresponding to the target character;
[0039] Then, the ordinal number r of the target character in the string corresponding to the node private key is obtained, and the remainder of dividing the node feature of the node by the ordinal number r is recorded as the shift amount of the target character;
[0040] Finally, the binary string corresponding to the target character is logically shifted right to obtain a new binary string of the target character, and the number of bits of the logical right shift is the same as the shift amount of the target character.
[0041] The beneficial effects of the technical solution of the present invention are: by matrixing the network topology structure formed by the Internet of Things formed by multiple devices, a topological feature matrix of the corresponding node network is obtained, the graph characteristics of the node network are characterized, and the central characteristics of the node are obtained according to the corresponding number of nodes in the node network when the node is a node in the shortest path to characterize the importance of the node in the node network. The node characteristics of the node are adjusted through the topological feature matrix, the association between the node and the graph characteristics of the node network is improved, and the complexity of encrypting the node data through the node characteristics is increased, the encryption effect of the node corresponding to the node data is improved, and the security of the node data is enhanced to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 The present invention is a flowchart of the steps of a data encryption method based on the Internet of Things. DETAILED DESCRIPTION
[0044] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the data encryption method based on the Internet of Things proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0045] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0046] The following is a detailed description of a data encryption method based on the Internet of Things provided by the present invention in conjunction with the accompanying drawings.
[0047] See also Figure 1 , which shows a flow chart of a data encryption method based on the Internet of Things provided by an embodiment of the present invention, the method comprising the following steps:
[0048] Step S001: Obtain the node network corresponding to the Internet of Things, the node private key, and the data stored in the device corresponding to each node in the node network.
[0049] It should be noted that the scenario targeted by this embodiment is that in the prior art, the encryption of IoT sensor node data generally adopts the AES encryption algorithm with less computational complexity to encrypt the sensor data. Although the AES encryption algorithm has a small computational complexity, the same set of keys is used in all nodes. This will result in the entire sensor network becoming transparent, open and unsafe once a node is attacked and the node key is leaked.
[0050] Specifically, in order to implement a data encryption method based on the Internet of Things proposed in this embodiment, it is first necessary to obtain the node network corresponding to the Internet of Things, the node private key, and the data stored in the device corresponding to each node in the node network. The specific process is:
[0051] First, a sensor network is formed through sensors installed on several devices. The Internet of Things formed by all devices is obtained through the sensor network and recorded as a node network. One device is regarded as a node, and the nodes corresponding to the main servers of all devices in the node network are recorded as master nodes. There are several master nodes in a node network. The private key corresponding to each device is obtained and recorded as a node private key, and the actual distance between the devices is taken as the distance between the corresponding nodes in the node network.
[0052] It should be noted that since different node keys of the node network need to be uniquely processed, it is necessary to obtain the data stored in each node.
[0053] Then, the data stored in the device corresponding to each node in the node network is obtained and recorded as node data.
[0054] At this point, the node network, node private key and node data are obtained through the above method.
[0055] Step S002: Obtain the degree, maximum connected component, adjacency matrix and the number of nodes in the node network, obtain the shortest path between nodes in the node network, record the matrix formed by the degree, maximum connected component, shortest path between nodes in the node network and the number of nodes as the convolution kernel, and combine the convolution kernel and the adjacency matrix to obtain the topological feature matrix of the node network.
[0056] It should be noted that the unique encryption key is obtained by utilizing the structure of the Internet of Things network and the node-related data of the node to be encrypted, and then the data is encrypted using the unique encryption key.
[0057] Specifically, in step (1), structural features are extracted from the network topology structure of the node network.
[0058] First, the Dijkstra algorithm is used to obtain the shortest path between any main node and a node other than the main node in the node network, which is recorded as the first path of the main node. One main node corresponds to several first paths. The maximum value of all first paths of any main node is obtained and recorded as the second path of the main node; and the Dijkstra algorithm is used to obtain the shortest path between any main node and a node other than the main node in the node network, which is recorded as the first path of the main node. One main node corresponds to several first paths. The maximum value of all first paths of any main node is obtained and recorded as the second path of the main node; and the Dijkstra algorithm is used to obtain the shortest path between any two nodes in the node network, and the average value of the path lengths of the shortest paths between all nodes is recorded as the average path length of the node network.
[0059] It should be noted that since the Dijkstra algorithm is an existing graph algorithm, this embodiment will not be described in detail.
[0060] It should be noted that the second path of the master node reflects the path distance between the node farthest from the master node. The radiation range of the master node can be accurately obtained through the second path, which further reflects the size of the entire node network. The larger the second distance and the larger the node network, the more secure the key generation method used in the present invention is.
[0061] Then, obtain the adjacency matrix of the node network; obtain the maximum connected component corresponding to the node network, and record the number of nodes in the maximum connected component as the number of connected nodes of the node network; obtain the topological feature matrix of the node network, and the specific acquisition method is:
[0062]
[0063] Where J represents the topological feature matrix of the node network; b represents the number of nodes in the node network; represents the average path length of the node network; TD represents the degree of the node network; Mn represents the number of connected nodes in the node network; L represents the adjacency matrix of the IoT structure graph; * represents the convolution operation.
[0064] It should be noted that since the node network is an undirected graph, the out-degree and in-degree of each node in the node network are equal, and the adjacency matrix of the node network is a principal symmetric matrix.
[0065] It should be noted that due to the particularity of the IoT structure graph, the adjacency matrix is a main symmetric matrix, and the adjacency matrix clearly represents the connection relationship between nodes, and can also show the structure of the node network to a certain extent. The number of nodes, average weight, degree, and connected components can all show the graph characteristics of the entire node network to a certain extent. Based on the particularity of the adjacency matrix, a convolution kernel of a main diagonal matrix is constructed in the method of obtaining the topological feature matrix of the node network. Convolve the adjacency matrix to obtain the topological feature matrix of the node network.
[0066] Step (2), obtain the node features of the node.
[0067] First, obtain the degree of any node in the node network; obtain the number of times any node appears on the first path of all main nodes, recorded as the central parameter of the node; record any node as the target node, and record the number of nodes directly connected to the target node as the number of connections of the target node.
[0068] It should be noted that the directly connected nodes refer to nodes that are directly connected through edges in the node network.
[0069] Then, the central feature of any node in the node network is obtained. The specific calculation method is:
[0070]
[0071] Among them, Ce represents the central feature of the node; E represents the number of connections of the node; σ′ represents the central parameter of the node; k represents the degree of the node; σ represents the number of first paths of all main nodes.
[0072] It should be noted that the centrality It reflects the degree to which the node acts as a bridge or midpoint in the node network. The more times a node appears on the first path of all main nodes, the larger the central eigenvalue is, indicating that the node is more important in the topological structure; similarly, the more nodes E directly connected to the node, the closer the connection between the node and the adjacent nodes, and the density of the nodes. The higher it is, the larger the central feature of the node.
[0073] Then, the value and ordinal number of the elements in the topological feature matrix are used to adjust the central feature of the node to obtain the node feature of the node. The specific acquisition method is:
[0074]
[0075] Among them, Nt represents the node feature of the node; J(i) represents the value of the i-th element in the topological feature matrix; I represents the number of elements in the topological feature matrix; Ce represents the central feature of the node.
[0076] It should be noted that the first characteristic factor Ce×i represents the process of adjusting the central characteristics of the node by the ordinal number of the elements in the topological characteristic matrix, and the second characteristic factor J(i)+Ce×i represents the process of adjusting the first characteristic factor by the value of the element in the topological characteristic matrix. By adjusting the node characteristics of the node, the association between the node and the node network is improved, and the complexity of subsequent encryption of the node data by the node characteristics is increased.
[0077] So far, the node features of the nodes are obtained through the above method.
[0078] Step S003: Utilize the node characteristics to shift the node private key to obtain the key, and utilize the key to encrypt the node data of the node to obtain the ciphertext.
[0079] It should be noted that after the encryption key is obtained, the AES encryption algorithm is used to encrypt the data of the node to obtain the encrypted data.
[0080] First, obtain the encryption key of any node based on the node private key, node characteristics and topological characteristics:
[0081] key r =ASCII -1 [bin(KEY r)>>(Ntmodr)]
[0082] Among them, key r Indicates the rth character in the encryption key of the node; >> indicates a logical right shift operation; KEY r Represents the rth character in the node private key of the node; Nt represents the node feature of the node; mod represents the modulus operation; ASCII -1 It means converting binary to character; bin() means converting character to binary.
[0083] Then, the node data of the node corresponding to the encryption key is encrypted by combining the encryption key and using the AES encryption algorithm to obtain the ciphertext of the node data.
[0084] It should be noted that since the AES encryption algorithm is an existing encryption algorithm, this embodiment will not be described in detail.
[0085] At this point, the ciphertext of the node data corresponding to all nodes in the node network is obtained through the above method.
[0086] Step S004: Save the ciphertext and key to complete the encryption process of IoT data.
[0087] Specifically, all ciphertexts are stored in the devices of the corresponding nodes, and the encryption keys of the nodes are uploaded to the key management system for unified management to protect the security of node data.
[0088] At this point, this embodiment is completed.
[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A data encryption method based on the Internet of Things, characterized in that: The method comprises the following steps: A sensor network is formed by sensors installed on several devices, and a node network, a node private key, and node data are obtained through the sensor network; the nodes corresponding to the main servers of all devices in the node network are recorded as main nodes; Obtain the degree, maximum connected component, adjacency matrix and number of nodes in the node network, obtain the shortest path between nodes in the node network, record the matrix formed by the degree, maximum connected component, shortest path between nodes in the node network and number of nodes as the convolution kernel, and combine the convolution kernel and the adjacency matrix to obtain the topological feature matrix of the node network; Obtain the degree of any node in the node network, obtain the number of other nodes directly connected to the node and record it as the number of connections of the node, record the shortest path between the main node and any other node as the first path of the main node, and obtain the central feature of the node according to the degree of the node, the number of nodes, the number of connections of the node and the number of the first path of the main node in the node network; use the value and ordinal number of the elements in the topological feature matrix to adjust the central feature of the node to obtain the node feature of the node; The node characteristics are used to shift the node private key to obtain the node encryption key, and the node data of the node is encrypted using the key to obtain the ciphertext; Save the ciphertext and key; The method of obtaining the shortest path between nodes in the node network and recording the matrix formed by the degree of the node network, the maximum connected component, the shortest path between nodes in the node network and the number of nodes as the convolution kernel includes the following specific methods: First, the Dijkstra algorithm is used to obtain the shortest path between any two nodes in the node network, and the average of the path lengths of the shortest paths between all nodes is recorded as the average path length of the node network; Then, the maximum connected component corresponding to the node network is obtained, and the number of nodes in the maximum connected component is recorded as the number of connected nodes of the node network; Finally, the convolution kernel is ,in Indicates the number of nodes in the node network; represents the average path length of the node network; represents the degree of the node network; Represents the number of connected nodes in the node network; The specific method of combining the convolution kernel and the adjacency matrix to obtain the topological feature matrix of the node network includes: The convolution result of the convolution kernel and the adjacency matrix is recorded as the topological feature matrix of the node network; The method of obtaining the central feature of the node according to the degree of the node, the number of nodes, the number of connections of the node and the number of first paths of the main node in the node network includes: First, obtain the degree of any node in the node network; obtain the number of times any node appears on the first path of all main nodes, which is recorded as the central parameter of the node; Then, the density of the node is obtained according to the number of connections of the node and the degree of the node; the ratio of the central parameter of the node and the number of first paths of all main nodes is recorded as the central degree of the node; Finally, the product of density and centrality is recorded as the central feature of the node; The specific method of obtaining the density of nodes according to the number of connections of nodes and the degree of nodes is as follows: The degree of the node minus 1 is recorded as the degree factor, and the product of the node degree and the degree factor is recorded as the node density factor; The ratio of the number of connections of a node to the density factor is recorded as the density of the node; The method of adjusting the central feature of the node by using the value and ordinal number of the element in the topological feature matrix to obtain the node feature of the node includes the following specific methods: The central feature of the node is adjusted using the ordinal number of the element in the topological feature matrix to obtain a first feature factor, and the first feature factor is adjusted using the value of the element in the topological feature matrix to obtain a second feature factor; The accumulated value of the second characteristic factor between the node and all elements in the topological characteristic matrix is recorded as the node characteristic of the node; The method of adjusting the central feature of the node by using the ordinal number of the element in the topological feature matrix to obtain the first feature factor and adjusting the first feature factor by using the value of the element in the topological feature matrix to obtain the second feature factor includes the following specific methods: Obtain the ordinal number of any element in the topological feature matrix, multiply the ordinal number of any element by the central feature of the node to obtain the first characteristic factor between the node and the element, and add the value of the element to the first characteristic factor to obtain the second characteristic factor between the node and the element; The specific method of using the node characteristics to shift the node private key to obtain the node encryption key, and using the key to encrypt the node data of the node to obtain the ciphertext includes: First, any character in the node private key of the node is recorded as the target character, and the target character in the node private key of the node is converted and shifted to obtain a new binary string of the target character; Then, the new binary string of all characters is arranged according to the order of all characters in the node private key of the node, and the arranged string is recorded as the initial string of the node. The initial string of the node is encoded using the ASCII code table to obtain the encryption key of the node; Finally, the node data of the node corresponding to the encryption key is encrypted by combining the encryption key and using the AES encryption algorithm to obtain the ciphertext of the node data; The specific method of performing base conversion and shift operation on the target character in the node private key of the node to obtain a new binary string of the target character includes: First, convert the target character into binary form and record it as the binary string corresponding to the target character; Then, get the ordinal number of the target character in the string corresponding to the node private key , divide the node feature of the node by the ordinal The remainder is recorded as the shift amount of the target character; Finally, the binary string corresponding to the target character is logically shifted right to obtain a new binary string of the target character, and the number of bits of the logical right shift is the same as the shift amount of the target character.
2. According to claim 1, a data encryption method based on the Internet of Things is characterized in that: The specific method of obtaining the node network, node private key and node data through the sensor network includes: First, a device is regarded as a node in the node network, and the nodes corresponding to the master servers of all devices in the node network are recorded as master nodes. There are several master nodes in a node network; the private key corresponding to each device is obtained and recorded as the node private key; Then, the data stored in the device corresponding to each node in the node network is recorded as node data.
Citation Information
Patent Citations
Graph neural network training method and device, computing equipment and storage medium
CN113221153A
Sensor data encryption method and system based on Internet of Things
CN116684095A
