Searchable encryption method for wireless medical sensor network based on SGX
By adopting a searchable encryption method based on SGX in wireless medical sensor networks, encrypted index trees and verification tags are generated, and the problem of uncertain range search results is solved, and a secure and verifiable multi-keyword search and range search are realized.
Patent Information
- Application Number
- CN202411540277.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-31
AI Technical Summary
In the prior art, when performing multi-keyword search and range search on text data recorded in Wireless Medical Sensor Networks (WMSN), it is impossible to ensure that the search results of range search are certain.
Using a searchable encryption method for wireless medical sensor network based on SGX, by generating encrypted index trees and ciphertext data sets, the SGX proxy server generates verification tags and verification traps in a trusted execution environment to ensure the verifiable search results. sex.
It realizes the verifiability of search results for multi-keyword search and scope search, prevents cloud servers from dishonestly returning search results, ensures data security and privacy, and reduces computing and communication overhead.
Smart Images

Figure CN119402857A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of secret data search, and in particular relates to a searchable encryption method for wireless medical sensor networks based on SGX. Background Art
[0002] Wireless Medical Sensor Network (WMSN) is a network of various smart medical sensors that are located on or around the patient’s body for real-time health monitoring and support. These sensors are portable, small, connected devices that are worn or implanted in an individual and are used to observe the patient’s vital symptoms. These networks are especially helpful for the elderly who require ongoing care without the need for hospitalization. Monitoring can be done at home and the data is sent wirelessly to the hospital. In emergency situations such as heart attacks, immediate action can be taken. Moreover, this technology enables medical devices to operate without wires or cables, enhancing the mobility of these devices. Other applications include monitoring people with Alzheimer’s disease, monitoring the elderly at home, and performing initial assessments of diseases before detailed diagnosis, etc.
[0003] With the widespread use of WMSN, more and more WMSN data are collected by smart medical sensors worn on the body. In order to better record the patient's physical health information and understand the patient's physical condition more accurately, the medical field has widely adopted this new data collection method to record the patient's physiological parameters in real time, such as blood sugar, heart rate and other information, as well as other related health indicators. However, with the accumulation of WMSN data, how to manage, store and search it safely and effectively has become an important challenge facing the field of medical informationization. In order to ensure the security of data, an important measure is to encrypt and store WMSN record data, and then search and query the encrypted and stored WMSN record data. Many existing keyword-based search technologies are widely used in plaintext data, but cannot be directly used for ciphertext data. Searchable encryption technology provides a method for keyword search on ciphertext.
[0004] Searchable encryption technology is a solution that allows users to search and query encrypted data. At present, patent CN202211062637.4 proposes a searchable encryption method based on a hierarchical index tree, which can realize multi-keyword search and range search.
[0005] However, when performing a multi-keyword search and a range search on the text data recorded in the WMSN, the above prior art cannot guarantee that the search results of the range search are certain. Summary of the invention
[0006] In order to solve the above-mentioned prior art problems, the present invention adopts a searchable encryption method for wireless medical sensor networks based on SGX, including:
[0007] S1. The data owner DO generates a key set, collects health data using sensors, obtains a WMSN record data set, generates an encrypted index tree and a ciphertext data set based on the WMSN record data set and the key set, and uploads the key set, the encrypted index tree and the ciphertext data set to the SGX proxy server; the WMSN record data set includes multiple WMSN records, each WMSN record includes ID information and multiple attributes; wherein WMSN is a wireless medical sensor network;
[0008] S2, the SGX proxy server generates a verification tag based on the key set and the encrypted index tree in the trusted execution environment, and uploads the encrypted index tree, the verification tag, and the ciphertext data set to the cloud server;
[0009] S3. DO transmits the key set to the authorized data user DU through a secure channel. DU generates a corresponding search trap based on its own search request and key set, and sends the search trap to the SGX proxy server.
[0010] S4, the SGX proxy server generates a corresponding verification trapdoor according to the search trapdoor, and sends the search trapdoor and the verification trapdoor to the cloud server;
[0011] S5. The cloud server searches on the encrypted index tree based on the search trap and the ciphertext dataset to obtain the search results and their verification tags. And according to the verification tag and the verification trapdoor to generate a verification certificate, and send the search results and the verification certificate to the SGX proxy server;
[0012] S6. The SGX proxy server verifies the search results according to the verification certificate. If the verification is successful, the search results are sent to the DU. The DU receives and decrypts the search results to complete the data search. Otherwise, the SGX proxy server refuses to receive the search results sent by the cloud server.
[0013] S7. When the data owner DO deletes or adds a WMSN record, it synchronously updates the encrypted index tree.
[0014] Generating an encrypted index tree includes:
[0015] S11, extract the attribute values of the WMSN record data set to construct an attribute value set W = {W1, ..., W r ,...,W R}; If the attribute value set W of attribute r r If the range of is large, then the attribute partition tree of attribute r is constructed;
[0016] S12, generating an index vector for each WMSN record according to the attribute partition tree and the attribute value set;
[0017] S13, constructing a plaintext index tree according to the index vector of each WMSN record;
[0018] S14. Encrypt the plaintext index tree according to the key set to generate an encrypted index tree.
[0019] Attributes include numerical attributes and non-numerical attributes; constructing the attribute partitioning tree of numerical attributes includes:
[0020] Step 1: determine the maximum value range of the attribute value of the numerical attribute, and use the maximum value range as the root node of the attribute partitioning tree; divide the root node to obtain multiple sub-ranges, and use each sub-range as a node of the second layer of the attribute partitioning tree;
[0021] Step 2: divide each node of the previous layer of the attribute partition tree to obtain the child nodes of each node of the previous layer, and use the child nodes of each node of the previous layer as the nodes of the current layer of the attribute partition tree;
[0022] Step 3: Repeat step 2 until a node with a single attribute value is partitioned, and the single attribute value is used as a leaf node to obtain an attribute partition tree of the numerical attribute;
[0023] Constructing an attribute partition tree for non-numeric attributes includes:
[0024] Step 1: Use the semantic inclusion relationship to determine the maximum semantics of the attribute value of the non-numeric attribute, and use the maximum semantics as the root node of the attribute partition tree; divide the root node according to the semantic inclusion relationship and the semantic parallel relationship to obtain multiple sub-semantics, and use each sub-semantic as the node of the second layer of the attribute partition tree;
[0025] Step 2: divide each node of the previous layer of the attribute partition tree to obtain the child nodes of each node of the previous layer, and use the child nodes of each node of the previous layer as the nodes of the current layer of the attribute partition tree;
[0026] Step 3: Repeat step 2 until the node with the minimum semantic attribute value is partitioned, and take the minimum semantic attribute value as the leaf node to obtain the attribute partition tree of the non-numeric attribute.
[0027] The index vector of each WMSN record is generated according to the attribute partition tree and the attribute value set, including: for the attribute r for which the attribute partition tree is constructed * , is the attribute r * Each attribute value of creates a path in, is the jth value of the bth layer of the attribute partition tree b Bit node; each node in the path of each attribute value is represented by a vector, and the attribute r is obtained *The vector representation of each attribute value of ; for the attribute r′ for which the attribute partition tree is not constructed, the vector representation of each attribute value of the attribute r′ is generated according to the position in the attribute value set; the vector representations of the attribute values belonging to the same WMSN record are combined to obtain the index vector of each WMSN record.
[0028] Constructing a plaintext index tree based on the index vector of each WMSN record includes:
[0029] S131, constructing a root node of a plaintext index tree;
[0030] S132, splitting the index vector n of a WMSN record into h index sub-vectors;
[0031] S133, determine whether there is a child node under the root node of the plaintext index tree that is the same as the first index sub-vector If yes, directly execute step S134; otherwise, add a child node with the same index sub-vector as the first one under the root node. And execute step S134;
[0032] S134, determine the node of the i-1th layer of the plaintext index tree Is there a child node with the same index sub-vector as the i-th sub-vector? If yes, directly execute step S135; otherwise, Add a child node with the same index subvector as the i-th And execute step S135;
[0033] S135, determining whether the current plaintext index tree contains all index sub-vectors of the index vector n, if so, adding the ID information of the WMSN record corresponding to the index vector n to the node corresponding to the last index sub-vector; otherwise, returning to step S134;
[0034] S136. Repeat steps S132 to S135 until the index vectors of all WMSN records are added to obtain a plaintext index tree.
[0035] The key set includes: SK i =(M i,1 ,M i,2 ,S i );wherein, SK i is the key set of the i-th level of the plaintext index tree, M i,1 and M i,2 For two The reversible matrix, S i Randomly generated dimensional vector, M i,1 、M i,2 and S iThe dimension of the plaintext index tree is encrypted according to the key set to generate an encrypted index tree, including:
[0036] S141, index vector D of each node u in the plaintext index tree u Multiply by a non-zero random number β to get vector D u ′;
[0037] S142, according to the S of the layer where the node u is located i Generate a random vector {D u1 ′,D u2 ′}, according to the M of the layer where node u is located i,1 and M i,2 and the random vector {D u1 ′,D u2 '} Calculate the encrypted index vector of node u Get the encrypted index tree.
[0038] The key set also includes: (K, α); where K is a pseudo-random function The seed key, is a set of real numbers encoded using λ bits, α is a selected random number; the encrypted index tree includes multiple encrypted indexes, each of which is an encrypted index vector E on a path from the root node to the leaf node in the encrypted index tree u The vector composed of: generating a verification tag according to the key set and the encrypted index tree includes: marking the encrypted index I with the string L∈{0,1}* k Each bit of k The mark of each l According to the mark and key set to generate encryption index I k The verification tag of the lth position The encrypted index I k Verification label for each bit l Composition vector The encrypted index I k First verification tag Composition vector According to the vector and vector Generate encrypted index I k Verification tag in, For marking Generates a pseudo-random number.
[0039] Generating a verification trapdoor includes: using the string L∈{0,1}* to mark the search trapdoor TD l Each bit of According to the mark and key set to generate verification trapdoor The verification trapdoor for each bit of the search trapdoor TD Combine into vector Combine the verification trapdoors of the first search trapdoor into a vector According to the vector and vector Generate verification trapdoor in, For marking Generates a pseudo-random number.
[0040] Generating a verification proof includes: the cloud server obtains a linear polynomial function f, and verifies the tag Homomorphically execute function f on the verification trapdoor and obtain the verification proof σ s =(y0,y1,y2), where y0,y1,y2 are the polynomial coefficients of function f,
[0041] The SGX proxy server verifies the search results based on the verification proof including:
[0042] The SGX proxy server will verify the proof σ s Parse into y0, y1, y2, and calculate the verification tag of the encrypted index of the search results The matching score of the verification trapdoor and the search trapdoor The pseudo-random number Combine into vector The pseudo-random number Combine into vector Calculates the polynomial function f against and The estimated value Judgment equation F1:score s =y0 and the equation If both equations F1 and F2 hold, the verification succeeds; otherwise, the verification fails; where N is the number of bits of the encryption index.
[0043] Beneficial effects:
[0044] 1. The present invention combines homomorphic message authentication code technology with a searchable encryption method based on a hierarchical index tree, generates a verification tag and a verification trapdoor according to the encrypted index tree and the search trapdoor, generates a verification certificate according to the verification tag and the verification trapdoor, and verifies the search results through the verification certificate, thereby realizing the verifiability of the search results of multi-keyword search and range search, and preventing the cloud server from dishonestly returning the search results; 2. The present invention generates verification tags and verification trapdoors by using the trusted execution environment of the SGX proxy server, and verifies the search results in the SGX proxy server according to the verification certificate, thereby ensuring the security and privacy of the data; 3. The present invention uses an attribute hierarchical structure ( That is, the attribute partition tree) reduces the dimension of the index vector, reduces the amount of calculation and communication overhead, and at the same time builds an encrypted index tree according to the attribute partition tree, thereby achieving nonlinear search efficiency; 4. The present invention adds random numbers when generating search traps, so that there is no connectivity between queries, that is, except for DO, other entities cannot generate new search traps based on previous search traps, and the cloud server cannot infer the relationship between search traps, thereby reducing the risk of data leakage; 5. The present invention also provides a dynamic update method for data, which can flexibly handle the addition and deletion of WMSNs without the need for local storage of index trees, thereby reducing the risk of local index tree leakage. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 An architecture diagram of a searchable encryption method for wireless medical sensor networks based on SGX provided in an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of WMSN record data provided by an embodiment of the present invention;
[0047] Figure 3 A heart rate attribute division tree structure diagram provided by an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of an index vector provided by an embodiment of the present invention;
[0049] Figure 5 A diagram of the plaintext index tree structure provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] like Figure 1As shown, the SGX-based searchable encryption method for wireless medical sensor networks includes:
[0052] S1. The data owner DO generates a key set, collects health data using sensors, obtains a WMSN record data set, generates an encrypted index tree and a ciphertext data set based on the WMSN record data set and the key set, and uploads the key set, the encrypted index tree and the ciphertext data set to the SGX proxy server; SGX (Software Guard Extensions) is a software protection extension;
[0053] Specifically, the data owner DO generates and outputs a key set SK=(K,α,M1,M2,S) based on a random security parameter λ, where (K,α) is used for verification, (M1,M2,S) is used to generate encryption indexes and trapdoors, and K is a pseudo-random function The seed key, α is a random value selected, M1 and M2 are two The reversible matrix S is randomly generated dimensional vector, where is the dimension of the i-th level sub-index vector in the index tree; the WMSN record data set is D = {D1, D2, ..., D N}, the ciphertext data set is C={C1,C2,...,C N}, N represents the total number of WMSN records, D n represents the nth WMSN record; extract all attribute values of the WMSN record data set D to construct an attribute value set W = {W1, W2, ..., W R}, R represents the total number of attribute types, W r Represents the set of attribute values of the rth attribute type.
[0054] In one embodiment, the WMSN records data such as Figure 2 As shown in the figure, a WMSN record has four attributes: age, gender, heart rate, and blood sugar. Each attribute has multiple attribute values. Each attribute of a WMSN record corresponds to a specific attribute value. At the same time, each WMSN record has its own ID information.
[0055] Generating an encrypted index tree includes:
[0056] S11, extract the attribute values of the WMSN record data set to construct an attribute value set W = {W1, ..., W r ,...,W R}; If the attribute value set W of attribute r r If the range of is large, then the attribute partition tree of attribute r is constructed;
[0057] S12, generating an index vector for each WMSN record according to the attribute partition tree and the attribute value set;
[0058] S13, constructing a plaintext index tree according to the index vector of each WMSN record;
[0059] S14. Encrypt the plaintext index tree according to the key set to generate an encrypted index tree.
[0060] In one embodiment, when the attribute value set W of attribute r r When the number of possible values in is greater than 2, construct an attribute partition tree for attribute r.
[0061] from Figure 2 As can be seen, the gender attribute has only two attribute values, male and female, which is easy to represent. However, the attribute values of age, heart rate, and blood sugar are numerous. In order to achieve range search within the attribute domain and reduce the length of the index vector, DO constructs attribute partitioning trees for different types of attributes, including numerical attributes and non-numerical attributes.
[0062] Constructing the attribute partition tree of numerical attributes includes:
[0063] Step 1: determine the maximum value range of the attribute value of the numerical attribute, and use the maximum value range as the root node of the attribute partitioning tree; divide the root node to obtain multiple sub-ranges, and use each sub-range as a node of the second layer of the attribute partitioning tree;
[0064] Step 2: divide each node of the previous layer of the attribute partition tree to obtain the child nodes of each node of the previous layer, and use the child nodes of each node of the previous layer as the nodes of the current layer of the attribute partition tree;
[0065] Step 3: Repeat step 2 until a node with a single attribute value is partitioned, and the single attribute value is used as a leaf node to obtain an attribute partition tree of the numerical attribute;
[0066] Figure 3 As shown, in one embodiment, for the numerical attribute class, taking the heart rate attribute as an example, first, determine the maximum value range of the heart rate attribute value that can contain all WMSN records. In this embodiment, the maximum value range is determined to be [41,150], and [41,150] is used as the root node of the heart rate attribute partition tree. The root node [41,150] is divided according to the medically recognized low heart rate, normal heart rate, and high heart rate, and a total of 3 child nodes are obtained, namely, low heart rate [40,60], normal heart rate [61-100], and high heart rate [101,150]. Then, these three child nodes are further divided until only one specific attribute value is left. The attribute value is used as a leaf node, and each leaf node represents the attribute value of the heart rate attribute in a specific WMSN record.
[0067] For non-numeric attribute classes, the semantics of the attribute value is determined, the semantic inclusion relationship is used to define the value range, and the maximum semantics is selected as the root node; layer-by-layer division is performed according to the semantic inclusion relationship and the semantic parallel relationship to obtain the attribute partitioning tree.
[0068] Constructing an attribute partition tree for non-numeric attributes includes:
[0069] Step 1: Use the semantic inclusion relationship to determine the maximum semantics of the attribute value of the non-numeric attribute, and use the maximum semantics as the root node of the attribute partition tree; divide the root node according to the semantic inclusion relationship and the semantic parallel relationship to obtain multiple sub-semantics, and use each sub-semantic as the node of the second layer of the attribute partition tree;
[0070] Step 2: divide each node of the previous layer of the attribute partition tree to obtain the child nodes of each node of the previous layer, and use the child nodes of each node of the previous layer as the nodes of the current layer of the attribute partition tree;
[0071] Step 3: Repeat step 2 until the node with the minimum semantic attribute value is partitioned, and take the minimum semantic attribute value as the leaf node to obtain the attribute partition tree of the non-numeric attribute.
[0072] In one embodiment, DO generates an index vector for a WMSN record through an attribute partition tree and an attribute value set. An index vector of a WMSN record is composed of attribute values of multiple attributes. In this embodiment, four attributes, namely age, gender, heart rate, and blood sugar, are used for illustration.
[0073] The index vector of each WMSN record is generated according to the attribute partition tree and the attribute value set, including: for the attribute r for which the attribute partition tree is constructed * , is the attribute r * Each attribute value of creates a path in, is the jth value of the bth layer of the attribute partition tree b Bit node; each node in the path of each attribute value is represented by a vector, and the attribute r is obtained * The vector representation of each attribute value of ; for the attribute r′ for which the attribute partition tree is not constructed, the vector representation of each attribute value of the attribute r′ is generated according to the position in the attribute value set; the vector representations of the attribute values belonging to the same WMSN record are combined to obtain the index vector of each WMSN record.
[0074] Construct a vector representation of the path of each attribute value of the attribute partition tree, including:
[0075] Assign a vector to each node of the attribute partition tree, including the root node, child node and leaf node; when a node is located at the jth node of the bth layer of the attribute partition tree b bit, then it is represented as where j b ∈J b , J b represents the total number of nodes in the bth layer, b={1,2,...,B}, B represents the total number of layers of the attribute partition tree; if the node There are K child nodes in the bth layer, and the node Is a node The kth child node of Allocate K-dimensional vector And the K-dimensional vector The value of the kth dimension of is 1, and the values of the remaining dimensions are 0.
[0076] like Figure 4 As shown, in one embodiment, the heart rate attribute partition tree is used for illustration, and the corresponding path of the attribute value "59" is P59=(a 1,1 ,a 2,1 ,a 3,2 ,a 4,19 )=("41-150","40-60","51-60","59"), default is root node a 1,1 = "41-150" allocates 1-dimensional vector A 1,1 =1; node a 2,1 = "41-60" is node a 1,1 =The first child node of "41-150", node a 1,1 = "41-150" has 3 child nodes, so it is node a 2,1 = "41-60" allocates 3D vector A 2,1 =100; then process the next layer of nodes in the path, node a 3,2 = "51-60" is node a 2,1 = The second child node of "41-60" and the node with the most child nodes in the previous layer 2,3 = "101-150" has 5 child nodes, so it is node a 3,2 = "51-60" allocates 5-dimensional vector A 3,2 =01000; node a 4,20 = "59" is node a 2,3 = The 9th child node of "101-150", and the node with the most child nodes in the previous layer has 10 child nodes, then it is node a 4,19 = "59" allocates 10-dimensional vector A 4,19 =0000000010, so the vector representation of the attribute value "59" is (A1,1 ,A 2,1 ,A 3,2 ,A 4,19 )=1100010000000000010, the vector representations of the four attributes of age, gender, heart rate, and blood sugar of a WMSN record are combined together to form the index vector of the WMSN, where gender has only two attribute values, male and female. If the cardinality is small, the attribute partition tree is not constructed, but a vector representation is performed based on the position of the attribute value set.
[0077] Constructing a plaintext index tree based on the index vector of each WMSN record includes:
[0078] S131, constructing a root node of a plaintext index tree;
[0079] S132, splitting the index vector n of a WMSN record into h index sub-vectors;
[0080] S133, determine whether there is a child node under the root node of the plaintext index tree that is the same as the first index sub-vector If yes, directly execute step S134; otherwise, add a child node with the same index sub-vector as the first one under the root node. And execute step S134;
[0081] S134, determine the node of the i-1th layer of the plaintext index tree Is there a child node with the same index sub-vector as the i-th sub-vector? If yes, directly execute step S135; otherwise, Add a child node with the same index subvector as the i-th And execute step S135;
[0082] S135, determining whether the current plaintext index tree contains all index sub-vectors of the index vector n, if so, adding the ID information of the WMSN record corresponding to the index vector n to the node corresponding to the last index sub-vector; otherwise, returning to step S134;
[0083] S136. Repeat steps S132 to S135 until the index vectors of all WMSN records are added to obtain a plaintext index tree.
[0084] In one embodiment, Figure 5As shown, DO constructs a plaintext index tree according to the index vectors of the WMSN record data set D. Specifically, there are five index vectors, [100010001], [100110001], [110001001], [110001111], and [110010111]. The five index vectors are processed respectively using a segmentation vector parameter h. In this embodiment, h=3, and three index sub-vectors corresponding to the five index vectors are obtained, [100,010,001], [100,110,001], [110,001,001], [110,001,111], and [110,010,111].
[0085] Construct the root node Root of the index tree. First, add the index vector [100010001] to determine whether there is a child node under the root node Root of the index tree with the same value as the first index sub-vector. Obviously, the root node Root does not have a child node with the value
[100] . Then add a child node with the value
[100] under the node Root. Then, look for a child node with the value
[010] of the second index sub-vector under the branch of the child node
[100] . If there is no child node, add a child node with the value
[010] . Then, look for a child node with the value
[001] under the branch of the child node
[010] . If there is no child node, add a child node with the value
[001] . At this time, all the index sub-vectors of the first WMSN are added, and the ID information of the WMSN is attached to the last child node
[001] , which is the leaf node, with ID = 1. After adding the first four index vectors, when the index vector [110010111] is finally added, it is first determined whether the root node Root has a child node
[110] . If it has been added before, the branch of the child node
[110] is entered to find whether there is a child node
[010] . If not,
[010] is added and a child node
[111] is created in
[010] . Finally, the ID information is attached, with ID = 5.
[0086] Encrypt the plaintext index tree and traverse the layers starting from the root node of the index tree. The subkey of each layer is represented by SK i ={S i ,M i,1 ,M i,2}, where S i is a randomly generated l-dimensional vector, M i,1 ,M i,2 There are two Reversible matrix, is the dimension of the index vector of each node of the plaintext index tree. Encrypt the plaintext index tree T to obtain the encrypted index tree I, where T is the index vector D of each node u. u The plaintext index tree composed of . DO is based on the subkey SK i The plaintext index tree T is encrypted as follows:
[0087] Step 1: D u Multiply by a non-zero random number β to get vector D u ′=D u β.
[0088] Step 2: According to the SK of the layer where node u is located i S i Generate two random vectors {D u1 ′,D u2 ′}, when the vector S of the i-th layer i [i] = 0, then D u1 ′=D u2 ′=D u ′; when S i [i] = 1, then D u1 ′+D u2 ′=D u ′,D u1 ′ and D u2 ′ is set to two random values such that the sum of the two values is equal to D u ′.
[0089] Step 3: Using SK i M i,1 and M i,2 Compute D using matrix multiplication u The final encrypted index vector
[0090] E u represents the encrypted index vector of node u in the encrypted index tree I; for a WMSN record, the encrypted index I i h encrypted index vectors E u It is equivalent to a vector composed of encrypted index vectors on a path from the root node to the leaf node in the encrypted index tree.
[0091] S2, the SGX proxy server generates a verification tag based on the key set and the encrypted index tree in the trusted execution environment, and uploads the encrypted index tree, the verification tag, and the ciphertext data set to the cloud server;
[0092] Furthermore, the steps for generating a verification tag based on the key set and the encrypted index tree are as follows:
[0093] I kl The encrypted index I k The first bit of the encryption index I k Each bit of is marked by a string L, L∈{0,1}* represents the set of all possible strings consisting of 0 and 1, and the marking is obtained The SGX proxy server encrypts each bit of the index in the trusted execution environment. kl Compute the corresponding verification label: in For marking The generated pseudo-random number, F K () is a pseudo-random function The encrypted index I k Verification label for each bit l Composition vector The encrypted index I k First verification tag Composition vector According to the vector and vector Generate encrypted index I k Verification tag in Corresponds one-to-one with the leaf nodes of the encrypted index tree I.
[0094] S3. DO transmits the key set to the authorized data user DU through a secure channel. DU generates a corresponding search trap based on its own search request and key set, and sends the search trap to the SGX proxy server.
[0095] Further, generating the corresponding search trap includes:
[0096] Get the attribute keyword in the search request, and obtain the position vector q based on the attribute keyword combined with the attribute partition tree and the attribute value set; among them, for the attribute category not specified by the data user, all the attribute value position vector bits of its attribute category are set to 1; for the attribute category to be searched, the corresponding attribute value position vector bit is set to 1, and the remaining attribute value position vector bits are set to 0;
[0097] The position vector q is inverted to obtain the query vector Q, and the query vector Q is processed using the segmentation vector parameter h to obtain h query sub-vectors q in sequential order. i ; Among them, each attribute value position in the query vector Q corresponds to the attribute value set one by one, and the attribute partition tree is used to represent the attributes with complex relationships; the subkey SK is used i Encryptionq i , generate search trapdoor
[0098] The encryption process is as follows:
[0099] Step 1: q i Multiply by a non-zero random number β: q i ′=q i β;
[0100] Step 2: According to SK i S i Generate two random vectors {q i1 ′,q i2 ′}, when S i [i]=0, then q i1 ′=q i2 ′=q i ′; when S i [i]=1, then q i1 ′+q i2 ′=q i ′, where q i1 ′ and q i2 ′ is set to two random values such that the sum of the two values is equal to q i ′.
[0101] Step 3: Use subkey SK i M i,1 and M i,2 The inverse of q is encrypted using matrix multiplication i , the generated search trapdoor The complete search trapdoor is TD = {TD1, TD2, ..., TD h}.
[0102] S4, the SGX proxy server generates a corresponding verification trapdoor according to the search trapdoor, and sends the search trapdoor and the verification trapdoor to the cloud server (Cloud Server);
[0103] Furthermore, the steps for generating a verification trapdoor are as follows:
[0104] Each bit of the search trapdoor is labeled by a string L L∈{0,1}*; TD l To search for the lth position of the trapdoor, TD l Marked as Verification Trapdoor in For marking The pseudo-random number generated; the verification trapdoor of TD is expressed as in, Verification trap for each bit of search trap TD The vector composed of A vector of verification trapdoors for the first search trapdoor.
[0105] S5. The cloud server searches on the encrypted index tree based on the search trap and the ciphertext dataset to obtain the search results and their verification tags. And according to the verification tag and the verification trapdoor to generate a verification certificate, and send the search results and the verification certificate to the SGX proxy server;
[0106] Perform a hierarchical traversal on the encrypted index tree, starting from the root node, and convert the encrypted index vector E of the node at the i-th level of the encrypted index tree I into u Sequentially with the i-th search trap TD i Perform a standard inner product. If the result is 0, it means that the node is related to the search trap TD. i If the node matches, it does not match; then the matching filter is performed in the branch of the successfully matched node, and the encrypted indexes of all child nodes of the node are sequentially compared with the i+1th search trap TD i+1 Perform the standard inner product and search according to this rule until the last layer. Finally, the matching node of the last layer of the encrypted index tree points to the ID information of the WMSN encrypted data that matches the query of the data user DU; the final search result is obtained based on the ID information and the ciphertext data set.
[0107] Furthermore, the Eval algorithm of the Homomorphic Message Authentication Code (HMAC) is called to generate a verification proof: The specific steps are as follows:
[0108] The cloud server obtains a polynomial function f, executes the function f homomorphically on the verification tag and the verification trapdoor, and outputs the verification proof σ s =(y0,y1,y2), where y0,y1,y2 are the polynomial coefficients of function f,
[0109] f can be viewed as a circuit consisting of addition and multiplication gates. The algorithm processes f as follows: For each gate f g , given two labels Run a subroutine Get the new label σ, and then pass the new label as input to the next gate of the circuit f. The label obtained at the last gate of f is the final output. g ,σ (1) ,σ (2) ) is defined as follows: where i = 1, 2 and d i >1; when f g :=+:Algorithm calculates polynomial y(x)=y (1) (x)+y (2) The coefficients (y0,…,y d ) where d = max(d1, d2), which can be obtained by simply adding the two coefficient vectors, that is, When f g:=×:Algorithm calculates polynomial y(x)=y (1) (x) y (2) The coefficients (y0,…,y d ), where d = d1·d2. where m = 0,…,d. Finally, the algorithm returns the coefficient vector σ = (y0,…,y d ).
[0110] S6. The SGX proxy server verifies the search results based on the verification certificate. If the verification is successful, the search results are sent to the DU; the DU receives and decrypts the search results to complete the data search.
[0111] Furthermore, the specific steps for the SGX proxy server to verify the search results are as follows:
[0112] The SGX proxy server will verify the proof σ s Parse into y0, y1, y2, calculate the matching score of the verification tag of the encrypted index of the search result and the verification trapdoor of the search trapdoor Configuration parameter set And call the verification function Ver(SK,P,score s ,σ s ) to determine the authenticity of the data. Specifically, the verification function converts the pseudo-random number Composition vector The pseudo-random number Composition vector Calculates the polynomial function f against and The estimated value Judgment equation F1:score s =y0 and equation Is it true? If both equations F1 and F2 are true, the verification is successful; otherwise, the verification fails; where N is the number of bits of the encryption index.
[0113] In one embodiment, DO dynamically updates the data stored in the cloud server. When deleting or adding WMSN records, the purpose is achieved by synchronously updating the nodes of the encrypted index tree on the cloud server. It should be noted that the update of the index is only based on the ID of the WMSN encrypted data and does not require access to the WMSN data content.
[0114] Specifically, when DO adds a WMSN, it first encrypts the WMSN record to be added, and uses the method mentioned above to generate the encrypted index and search trap of the WMSN record, and then sends a request to add data, and sends the encrypted WMSN record, the ID of the WMSN record, the encrypted index and the search trap to the cloud server.
[0115] After receiving the request to add data from DO, the cloud server uses the search trap of the WMSN record to be added to search the encrypted index tree based on the matching query method mentioned in the above embodiment, starts the search from the root node of the encrypted index tree, and performs standard inner product with the i-th sub-search trap of the search trap of the WMSN record to be added. If the result is 0, it means that the node has the same attribute value as the WMSN to be added. Then, matching screening is performed in the branch of the node, and the encrypted indexes of all child nodes of the node are sequentially performed with the i+1-th search trap of the search trap of the WMSN record to be added. And so on. In the search query process, if there is only one node with a standard inner product of 0 when searching the vth layer of the encrypted index tree, and the inner product of the child node of the node with a standard inner product of 0 and the v+1th search trapdoor are not 0, then the node is the largest attribute matching node of the WMSN record to be added in the encrypted index tree; starting from the v+1th subvector of the encrypted index of the WMSN record to be added, add child nodes to this largest attribute matching node according to the construction rules of the index tree, and then continue to add under the child node until all child search trapdoors are added, that is, the final leaf node is obtained, and the ID of the WMSN record to be added is attached to the leaf node to complete the update of the encrypted index tree.
[0116] Specifically, DO needs to delete the discarded medical records in the cloud server to avoid wasting storage resources and reducing search efficiency. Faced with massive WMSN data, it is usually not necessary to specify an ID to delete a record. Instead, it is more likely to delete the corresponding record based on the attribute value that meets the attribute. When DO deletes a WMSN record, it first determines which attribute value data to delete, such as age = 61 and heart rate = 100. According to the conditions for deleting data, DO generates the corresponding search trap according to the above method and sends the search trap to the cloud server; the cloud server receives DO's request to delete data, and searches the encrypted index tree for the search trap for deleting records according to the query method of the above search request. When searching to the last layer, there is a node that meets the requirements. The ID pointed to by the node is the ID of the encrypted WMSN that meets the request to delete data. The cloud server needs to delete the node at the last layer of the encrypted index tree and delete the encrypted WMSN with the corresponding ID in the ciphertext data set.
[0117] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A searchable encryption method for wireless medical sensor networks based on SGX, characterized in that: include: S1. The data owner DO generates a key set, collects health data using sensors, obtains a WMSN record data set, generates an encrypted index tree and a ciphertext data set based on the WMSN record data set and the key set, and uploads the key set, the encrypted index tree and the ciphertext data set to the SGX proxy server; the WMSN record data set includes multiple WMSN records, each WMSN record includes ID information and multiple attributes; wherein WMSN is a wireless medical sensor network; S2, the SGX proxy server generates a verification tag based on the key set and the encrypted index tree in the trusted execution environment, and uploads the encrypted index tree, the verification tag, and the ciphertext data set to the cloud server; S3. DO transmits the key set to the authorized data user DU through a secure channel. DU generates a corresponding search trap based on its own search request and key set, and sends the search trap to the SGX proxy server. S4, the SGX proxy server generates a corresponding verification trapdoor according to the search trapdoor, and sends the search trapdoor and the verification trapdoor to the cloud server; S5. The cloud server searches on the encrypted index tree based on the search trap and the ciphertext dataset to obtain the search results and their verification tags. And according to the verification tag and the verification trapdoor to generate a verification certificate, and send the search results and the verification certificate to the SGX proxy server; S6. The SGX proxy server verifies the search results according to the verification certificate. If the verification is successful, the search results are sent to the DU. The DU receives and decrypts the search results to complete the data search. Otherwise, the SGX proxy server refuses to receive the search results sent by the cloud server. S7. The data owner DO deletes or adds WMSN records and synchronously updates the encrypted index tree.
2. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 1, characterized in that: Generating an encrypted index tree includes: S11, extract the attribute values of the WMSN record data set to construct an attribute value set W = {W1, ..., W r ,...,W R }; If the attribute value set W of attribute r r If the range of is large, then the attribute partition tree of attribute r is constructed; S12, generating an index vector for each WMSN record according to the attribute partition tree and the attribute value set; S13, constructing a plaintext index tree according to the index vector of each WMSN record; S14. Encrypt the plaintext index tree according to the key set to generate an encrypted index tree.
3. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 2, characterized in that: Attributes include numerical attributes and non-numerical attributes; Constructing the attribute partition tree of numerical attributes includes: Step 1: determine the maximum value range of the attribute value of the numerical attribute, and use the maximum value range as the root node of the attribute partitioning tree; divide the root node to obtain multiple sub-ranges, and use each sub-range as a node of the second layer of the attribute partitioning tree; Step 2: divide each node of the previous layer of the attribute partition tree to obtain the child nodes of each node of the previous layer, and use the child nodes of each node of the previous layer as the nodes of the current layer of the attribute partition tree; Step 3: Repeat step 2 until a node with a single attribute value is partitioned, and the single attribute value is used as a leaf node to obtain an attribute partition tree of the numerical attribute; Constructing an attribute partition tree for non-numeric attributes includes: Step 1: Use the semantic inclusion relationship to determine the maximum semantics of the attribute value of the non-numeric attribute, and use the maximum semantics as the root node of the attribute partition tree; divide the root node according to the semantic inclusion relationship and the semantic parallel relationship to obtain multiple sub-semantics, and use each sub-semantic as the node of the second layer of the attribute partition tree; Step 2: divide each node of the previous layer of the attribute partition tree to obtain the child nodes of each node of the previous layer, and use the child nodes of each node of the previous layer as the nodes of the current layer of the attribute partition tree; Step 3: Repeat step 2 until the node with the minimum semantic attribute value is partitioned, and take the minimum semantic attribute value as the leaf node to obtain the attribute partition tree of the non-numeric attribute.
4. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 2, characterized in that: The index vector of each WMSN record is generated according to the attribute partition tree and the attribute value set, including: for the attribute r for which the attribute partition tree is constructed * , is the attribute r * Create a path for each attribute value of in, The jth value of the bth layer of the attribute partition tree b Bit node; each node in the path of each attribute value is represented by a vector, and the attribute r is obtained * The vector representation of each attribute value of ; for the attribute r′ for which the attribute partition tree is not constructed, the vector representation of each attribute value of the attribute r′ is generated according to the position in the attribute value set; the vector representations of the attribute values belonging to the same WMSN record are combined to obtain the index vector of each WMSN record.
5. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 2, characterized in that: Constructing a plaintext index tree based on the index vector of each WMSN record includes: S131, constructing a root node of a plaintext index tree; S132, splitting the index vector n of a WMSN record into h index sub-vectors; S133, determine whether there is a child node under the root node of the plaintext index tree that is the same as the first index sub-vector If yes, directly execute step S134; otherwise, add a child node with the same index sub-vector as the first one under the root node. And execute step S134; S134, determine the node of the i-1th layer of the plaintext index tree Is there a child node with the same index sub-vector as the ith index sub-vector? If yes, directly execute step S135; otherwise, Add a child node with the same index subvector as the i-th And execute step S135; S135, determining whether the current plaintext index tree contains all index sub-vectors of the index vector n, if so, adding the ID information of the WMSN record corresponding to the index vector n to the node corresponding to the last index sub-vector; otherwise, returning to step S134; S136. Repeat steps S132 to S135 until the index vectors of all WMSN records are added to obtain a plaintext index tree.
6. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 2, characterized in that: The key set includes: SK i =(M i,1 ,M i,2 ,S i );wherein, SK i is the key set of the i-th level of the plaintext index tree, M i,1 and M i,2 For two The reversible matrix, S i Randomly generated dimensional vector, M i,1 、M i,2 and S i The dimension of the plaintext index tree is encrypted according to the key set to generate an encrypted index tree, including: S141, index vector D of each node u in the plaintext index tree u Multiply by a non-zero random number β to get vector D u ′; S142, according to the S of the layer where the node u is located i Generate a random vector {D u1 ′,D u2 ′}, according to the M of the layer where node u is located i,1 and M i,2 and the random vector {D u1 ′,D u2 '} Calculate the encrypted index vector of node u Get the encrypted index tree.
7. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 1, characterized in that: The key set also includes: (K, α); where K is a pseudo-random function The seed key, is a set of real numbers encoded using λ bits, α is a selected random number; the encrypted index tree includes multiple encrypted indexes, each of which is an encrypted index vector E on a path from the root node to the leaf node in the encrypted index tree u The vector composed of: generating a verification tag according to the key set and the encrypted index tree includes: marking the encrypted index I with the string L∈{0,1}* k Each bit of k The mark of each l According to the mark and key set to generate encryption index I k The verification tag of the lth position The encrypted index I k Verification label for each bit l Composition vector The encrypted index I k First verification tag Composition vector According to the vector and vector Generate encrypted index I k Verification tag in, For marking Generates a pseudo-random number.
8. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 7, characterized in that: Generating a verification trap door includes: using the string L∈{0,1}* to mark the search trap door TD l Each bit of According to the mark and key set to generate verification trapdoor The verification trapdoor for each bit of the search trapdoor TD Combine into vector Combine the verification trapdoors of the first search trapdoor into a vector According to the vector and vector Generate verification trapdoor in, For marking Generates a pseudo-random number.
9. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 8, characterized in that: Generating a verification proof includes: the cloud server obtains a polynomial function f, and verifies the tag Homomorphically execute function f on the verification trapdoor and obtain the verification proof σ s =(y0,y1,y2), where y0,y1,y2 are the polynomial coefficients of function f, 10. The SGX-based searchable encryption method for wireless medical sensor networks according to claim 9, characterized in that: The SGX proxy server verifies the search results based on the verification proof including: The SGX proxy server will verify the proof σ s Parse into y0, y1, y2, and calculate the verification tag of the encrypted index of the search results The matching score of the verification trapdoor and the search trapdoor The pseudo-random number Combine into vector The pseudo-random number Combine into vector Calculates the polynomial function f against and The estimated value Judgment equation F1:score s =y0 and equation If both equations F1 and F2 hold, the verification succeeds; otherwise, the verification fails; where N is the number of bits of the encryption index.
Citation Information
Patent Citations
Method for multi-keyword fuzzy search of dynamic ciphertext in cloud environment
CN106815350A
Multi-user searchable encryption method and encryption system in Internet of Vehicles environment
CN111556495A
Searchable encryption method for e-commerce platform data privacy protection
CN112272188A
Classified medical data searchable encryption method based on block chain
CN114567465A
Pairing-free searchable encryption method supporting revocation and verification
CN114793176A