Disclosure of Invention
Aiming at the defects in the prior art, the invention provides an inadvertent dynamic searchable encryption method, which solves the problems of low efficiency, high communication overhead and query privacy leakage in the prior art when supporting dynamic data update.
In order to achieve the purpose, the technical scheme adopted by the invention is that the inadvertently dynamic searchable encryption method comprises the following steps:
S1, constructing Labeled PSI protocols based on OKVS and VOLE technical frames by using an encoding algorithm and a decoding algorithm expressed in a formal manner based on a receiver processor and a sender processor at a bottom layer module, and obtaining an intersection result Z and a corresponding label by the receiver processor, wherein the intersection result Z is a keyword set to be searched, and a document identifier set corresponding to the keyword is stored in the corresponding label;
S2, negotiating a database updating method jointly by the client and the server at the application layer, encrypting the plaintext document and completing ciphertext database updating operation, negotiating a database searching method jointly by the client and the server, completing unintentional dynamic searchability of multiple keywords based on Labeled PSI protocols, and decrypting the document after obtaining the searching result by the client.
Further, the step S1 includes the steps of:
s101, generating a random matrix M by a receiver processor according to a key value set (k, v), wherein each row of the random matrix M comprises a random block with fixed length and random starting position, k represents the key set, and v represents a value vector;
S102, according to random block elements, a coding algorithm of OKVS is expressed in a formalized mode to solve z in a linear system M.z=v, wherein z represents a coding result of a key value set after OKVS coding;
S103, recovering a value v i corresponding to the given arbitrary key k i by a decoding algorithm of formal representation OKVS according to the obtained z;
S104, in order to construct Labeled PSI protocols, a receiver processor encodes all keys based on OKVS and encapsulates the encoding results by using a VOLE protocol, wherein after the sender processor and the receiver processor call the VOLE protocol, the sender processor obtains parameters delta, B, the receiver processor obtains parameters A and C and satisfies C=delta A+B, labeled PSI protocols encapsulate OKVS encoding results by using random variables, the encapsulation process is that the receiver processor encapsulates A '=A+P and transmits the A' =A+P to the sender processor, and the sender processor encapsulates K=delta A '+B so that the parameters A and C=delta A' +B are satisfied:
K=ΔA'+B=Δ(A+P)+B=ΔA+B+ΔP=C+ΔP
Wherein delta represents a random scalar generated by the VOLE protocol functional module, A, B and C represent random vectors generated by the VOLE protocol functional module, C=delta A+B is satisfied, A' represents a mask after information is packaged, P represents a coding result after a dataset of a receiver processor is OKVS coded, and K represents an intermediate calculation vector of a sender processor;
S105, according to the packaging result, based on OKVS decoding algorithm of S103, by respectively calculating X ', L ' and Y ', the intersection result Z and the corresponding label are obtained by the receiver processor, and the construction of Labeled PSI protocol is completed:
Z=X'∩Y'
wherein Z represents the final intersection result of Labeled PSI protocols, X ' represents the mask ciphertext of the local set X of the sender processor, L ' represents the ciphertext set after encrypting the document identifier L, and Y ' represents the mask ciphertext of the local set Y of the receiver processor.
Still further, the step S101 includes the steps of:
a1, generating a random matrix M by a receiver processor according to a key value set (k, v), wherein each row of the random matrix M comprises a random block with a fixed length b w and a random starting position;
a2, for each row in the random matrix M, randomly selecting s i as a random block starting position of the ith row by a receiver processor;
a3, generating a b w -bit random block element by using a random predictor according to a key k i corresponding to each row i of the matrix.
Still further, the step S102 includes the steps of:
B1, sequencing by a receiver processor according to the starting position s i of each row of random blocks in the random matrix M, and re-labeling;
B2, traversing random block elements of each row in the random matrix M by a receiver processor, and when M [ i ] [ j ] =1, processing all elements meeting M [ i '] [ j ] =1, i' > i and s i is less than or equal to j by using the following formula:
M[i']=M[i']⊕M[i]
v[i']=v[i']⊕v[i]
wherein, mi represents the elements of the ith row and the jth column in the random matrix M, mi represents all the elements of the ith row in the random matrix M, v i ' represents the elements of the ith row in the value vector, s i represents the initial column position of the ith row random block in the random matrix M, mi ' represents all the elements of the ith row in the random matrix M, v i represents the elements of the ith row in the value vector, mi ' j represents the elements of the jth column in the random matrix M, wherein, the jth column of the random matrix M subjected to row processing operation has only the elements of the ith row as 1, and the elements of the ith row are all 0;
And B3, according to the processing result of the step B2, solving z in the linear system by utilizing the following formula, wherein when a certain row element is 0 in the row processing process, the z is directly made to be ≡F m, otherwise:
zi=<zi,M[i]>+vi
Where F m represents a vector space with dimension m, z i represents the i-th row element of z, and v i represents the i-th row element in the value vector.
Still further, the step S103 includes the steps of:
c1, let v be≡0, calculate the random block start position s≡H (k) corresponding to given arbitrary key k value and element in random block Wherein v represents a value corresponding to a given arbitrary key k value, H (·) represents a random hash function, b w represents the length of each row of random block of the random matrix M, and k represents an arbitrary key to be decoded;
C2, according to the calculation result of the step C1, for j E [1, b w ], v++u [ j ' ]. Z [ s+j-1] is calculated as the last return value, and the recovery of the value v i corresponding to the given arbitrary key k i is completed, wherein j represents the column position of each row of random block in the random matrix M, u [ j ' ] represents the j ' th bit element of the random block, and s represents the starting position of the random block.
Still further, the step S104 includes the steps of:
d1, in order to construct Labeled PSI protocols, a VOLE protocol is called by both a sender processor and a receiver processor, wherein the receiver processor encodes all keys based on OKVS and encapsulates the encoding result by utilizing the VOLE protocol;
d2, after the operation of the VOLE protocol is finished, receiving and obtaining parameters delta and B by a sender processor, and receiving and obtaining parameters A and C by a receiver processor, wherein delta represents a random scalar generated by a VOLE protocol function module, A, B and C represent random vectors generated by the VOLE protocol function module, and C=delta A+B is satisfied;
D3, encapsulating the a 'by the receiver processor, and transmitting the a' to the sender processor by using the following formula:
A'=A+P
Wherein P represents the coding result of OKVS by the receiver, A' represents the mask after the information is packaged;
d4, according to a', calculating K by the sender processor using:
K=ΔA'+B=Δ(A+P)+B=ΔA+B+ΔP=C+ΔP
Where K represents the intermediate calculation vector of the sender processor and P represents the encoding result of the receiver processor dataset after OKVS encoding.
Still further, the step S105 includes the steps of:
E1, according to the encapsulation result, based on OKVS decoding algorithm of S103, the sender processor calculates X 'and L' by using the following formulas respectively:
X'={Ho(Decode(K,x)-ΔHF(x))|x∈X}
L'={Sym_En(Kdoc,l)|l∈L[x]}
Wherein, H o and H F each represent a random hash function, decode (K, X) represents a decoding operation of OKVS, K represents an intermediate calculation vector of a sender processor, X represents an element in a set X, sym_En represents a secure symmetric encryption algorithm, K doc represents a document encryption key, lx represents a document identifier set corresponding to the element X, L represents one element in the document identifier set Lx, and X represents a set of Labeled PSI protocols used by a server;
E2, calculating Y 'by the access processor by using the following formula, and sending the Y' to the sender processor;
Y'={Ho(Decode(C,y),y)|y∈Y}
wherein Decode (C, Y) represents the decoding operation of OKVS, Y represents an element in set Y, C represents a random vector generated by the VOLE protocol;
E3, according to the X 'and the Y', calculating Z by using the following formula to obtain the result of the original data set X and Y:
Z=X'∩Y';
And E4, obtaining a corresponding label { Lz|z epsilon Z } according to Z, and completing construction of Labeled PSI protocols, wherein Lz represents a document identifier set corresponding to the intersection set element Z.
Still further, the step S2 includes the steps of:
S201, respectively generating a secret key, an empty keyword state table and an empty encryption database at a client;
s202, negotiating a database updating method by the client and the server together, encrypting the plaintext document, and completing the ciphertext database updating operation;
S203, negotiating a database searching method by the client and the server together according to the updating result, completing the unintentional dynamic searchability of the multiple keywords based on Labeled PSI protocols, and decrypting the document after obtaining the searching result by the client.
Still further, the step S202 includes the steps of:
F1, generating a series of empty lists T w,Tkw,Tdic,Tcount,Tupdate by the client, wherein a table T w is used for storing keyword information in the updating process, a table T kw is used for storing mapping from a keyword w to a keyword token kt w, a table T dic is used for storing ciphertext information on a document index chain DIC, a table T count is used for storing the number of documents corresponding to the keyword w, and a table T update is used for storing all ciphertext information in the updating process;
F2, extracting documents one by one in a document database DB by a client, calculating a table T w by the client for any keyword w, and searching the keyword sigma [ w ] from a local keyword state table;
f3, responding to the fact that the keyword sigma [ w ] is not found, enabling sigma [ w ] ≡0, and calculating to obtain the latest update times n update of the keyword w;
F4, according to the calculation result of the step F3, the client searches (kt w,stw)←Tkw [ w ] from the table T kw, and if not found, kt w←F(Ks, w) is calculated, And T kw←Tkw∪{w,(ktw,stw), where T kw [ w ] represents the mapping of the keyword w to the keyword token kt w and the search token st w, F (K s, w) represents a pseudo-random function, H () represents a hash function,The latest update times of the keyword w are represented;
F5, according to the calculation result of the step F4, searching T count [ w ] from a table T count by the client, and in response to the fact that the T count [ w ] is not found, making T count [ w ] ≡0 and obtaining c w←Tcount [ w ] +1, wherein T count [ w ] represents and stores a list of the number of document identifiers corresponding to the keyword w, and c w represents the number of documents corresponding to the keyword w in the updating operation process;
F6, according to the calculation result of the step F5, calculating to obtain calculation document encryption information loc (i.e. H (st w,cw)、eid←Sym_En(Kdoc, id)) and T dic[stw]←Tdic[stw { (loc, eid) }, wherein loc represents the address of each node of the document index chain DIC, eid represents the ciphertext encrypted by the document identifier id, sym_En represents symmetric encryption operation, K doc represents a document encryption key, and T dic[stw represents a document index chain corresponding to the search token st w;
f7, for any keyword w epsilon T w, calculating sigma [ w ] ++1, (kt w,stw)←Tkw[w]、cw←Tcount [ w ] and value ≡G (st w,1λ)⊕(op||cw)) by a client, saving (kt w,(value,Tdic[stw ])) in a table T update, and sending the table T update to a server by the client, wherein all keyword sets involved in the updating process are saved in the table T w, sigma [ w ] represents a client local keyword state table, c w represents the number of documents corresponding to the keyword w in the updating process, T count [ w ] represents the number of documents corresponding to the keyword w, value represents an operation information mask of the updating process, G () represents a hash function, op=0 represents a document adding operation, op=1 represents a document deleting operation, and lambda represents a calculation safety parameter;
and F8, merging the table T update with the encryption database EDB by the server to finish updating operation of the ciphertext database.
Still further, the step S203 includes the steps of:
G1, generating Y 'by a client according to an updating result, R' is { }, kt w←F(Ks,w)、stw←H(ktw and sigma [ w ] are calculated for any keyword w, and a search token st w is stored to Y ', wherein Y' represents a set of the client for Labeled PSI protocol, R represents a final result set, kt w represents a keyword token, F (K s, w) represents a pseudo-random function, st w represents a search token, H () represents a hash function, sigma [ w ] represents a keyword, and kt w represents a keyword token;
G2, generating X ", lx≡ { }, for the encryption database EDB, calculating st w←H(ktw,ci by the server, wherein X" represents the set of servers for Labeled PSI protocol, lx represents the set of document identifiers for the corresponding element X, c i represents the c i th node;
G3, according to the generated search token st w, op and c w are obtained through calculation by using the following formula:
(op||cw)←value⊕G(stw,1λ)
Wherein c w represents the number of documents corresponding to the keyword w in the update operation process, value represents an operation information mask corresponding to the update process, G () represents a hash function, op represents an operation type, op=0 represents a document adding operation, op=1 represents a document deleting operation, and λ represents a calculation security parameter;
G4, from 1 to c w, calculating to obtain loc (H) (st w, j) and Eid (EDB) (loc), wherein loc represents the address of the j-th node of the document index chain DIC, and the encrypted ciphertext of the Eid document identifier id, and EDB represents an encrypted database;
G5, saving, by the server, the search token st w to X ", and adding the encrypted document identifier of op=0 to lx, removing the document encrypted identifier of op=1 from lx;
G6, the client and the server call Labeled PSI the protocol together, after Labeled PSI the protocol is operated, the client receives the final result intersection I=X '-U Y' and { L [ Y '] |y' ∈I } corresponding to the intersection element, wherein L [ Y '] represents the encrypted document to be searched by the client, and Y' represents the intersection element;
and G7, saving the L [ y' ] to the set R by the client, decrypting the document by using the key, and completing the encryption processing of the unintentional dynamic searchable.
The invention has the beneficial effects that:
(1) The invention is applicable to new cryptography parameters, the research of PSI in the field of searchable encryption is still blank in the prior art, and the invention provides a new and effective careless keyword search protocol; compared with the traditional dynamic searchable encryption protocol, the invention supports multi-keyword search, realizes forward security and backward security, and protects privacy security of a search mode in the search process;
(2) Compared with the OKS protocol, the method has the advantages that the number of ciphertext is equal to the product of the number of keywords and the number of files, the communication cost is only equal to the number of files corresponding to the query keyword set, the communication efficiency is high, the formal security model is utilized to prove the security of the protocol, namely, the random predictive model is utilized to simulate common attacks, such as keyword attack selection, and the security of the protocol is proved.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and all the inventions which make use of the inventive concept are protected by the spirit and scope of the present invention as defined and defined in the appended claims to those skilled in the art.
Examples
As shown in fig. 1 to 2, the invention provides an inadvertent dynamic searchable encryption method, which comprises a bottom layer module (Labeled PSI) and an application layer, wherein the bottom layer module is mainly used for supporting the implementation of an application layer search algorithm, and the technical structure of the bottom layer module consists of Oblivious Key-Value Stores (OKVS for inadvertent key Value storage) and Vector Oblivious Linear Evaluation (VOLE for transparent vector linear estimation), and mainly comprises two entities, namely a Sender processor Sender and a Receiver processor Receiver. Wherein, the Sender processor Sender holds a data set X, and for any X epsilon X, the Sender processor Sender holds a group of corresponding tag sets { Lx|x epsilon X }, and the Receiver processor Receiver holds a data set Y; the technical architecture consists of Oblivious Key-Value Stores (OKVS) and Vector Oblivious Linear Evaluation (VOLE). The dynamic searchable encryption scheme related to the invention can be divided into three stages of Setup, update and Search, and is based on a special secondary index structure, wherein the index structure comprises keyword index chains (Keyword index chain, KIC) and document index chains (Document index chain, DIC), the keyword index chains KIC are used for storing keyword Update information, the document index chains DIC are used for storing encrypted document information, each keyword w corresponds to one keyword index chain KIC, each keyword index chain KIC comprises n nodes, each node represents one Update operation of the keyword, and the node is linked with one document index chain DIC, and each node of the document index chains DIC corresponds to one encrypted keyword/document pair. The Labeled PSI protocol is a labeled unbalanced privacy set intersection technology. The implementation method is as follows:
S1, constructing Labeled PSI protocols based on OKVS and VOLE technical frameworks by using an encoding algorithm and a decoding algorithm expressed in a formal manner based on a receiver processor and a sender processor at a bottom layer module, and obtaining an intersection result Z and a corresponding label by the receiver processor, wherein the intersection result Z is a keyword set to be searched, and a document identifier set corresponding to the keyword is stored in the corresponding label, and the implementation method is as follows:
S101, generating a random matrix M by a receiver processor according to a key value set (k, v), wherein each row of the random matrix M comprises a random block with fixed length and random starting position, k represents the key set, and v represents a value vector, and the implementation method is as follows:
a1, generating a random matrix M by a receiver processor according to a key value set (k, v), wherein each row of the random matrix M comprises a random block with a fixed length b w and a random starting position;
a2, for each row in the random matrix M, randomly selecting s i as a random block starting position of the ith row by a receiver processor;
a3, generating a b w -bit random block element by using a random predictor according to a key k i corresponding to each row i of the matrix.
In this embodiment, the Receiver processor Receiver generates a random matrix M ε F n×m, each row of which includes a random block of length b w, except that the elements in the random block are randomly taken from {0,1}, the elements outside the block are all 0, for each row i ε [1, n ] in the random matrix, the Receiver processor Receiver randomly selects s i←H(ki) as the starting position of the random block for the ith row, where k i represents the ith key, and then generates the random block elements of bits b w using a random predictor
S102, according to random block elements, a coding algorithm of OKVS is expressed in a formalized mode to solve z in a linear system M.z=v, wherein z represents a coding result of a key value set after OKVS coding, and the implementation method is as follows:
B1, sequencing by a receiver processor according to the starting position s i of each row of random blocks in the random matrix M, and re-labeling;
B2, traversing random block elements of each row in the random matrix M by a receiver processor, and when M [ i ] [ j ] =1, processing all elements meeting M [ i '] [ j ] =1, i' > i and s i is less than or equal to j by using the following formula:
wherein, mi represents the elements of the ith row and the jth column in the random matrix M, mi represents all the elements of the ith row in the random matrix M, v i ' represents the elements of the ith row in the value vector, s i represents the initial column position of the ith row random block in the random matrix M, mi ' represents all the elements of the ith row in the random matrix M, v i represents the elements of the ith row in the value vector, mi ' j represents the elements of the jth column in the random matrix M, wherein, the jth column of the random matrix M subjected to row processing operation has only the elements of the ith row as 1, and the elements of the ith row are all 0;
And B3, according to the processing result of the step B2, solving z in the linear system by utilizing the following formula, wherein when a certain row element is 0 in the row processing process, the z is directly made to be ≡F m, otherwise:
zi=<zi,M[i]>+vi
Where F m represents a vector space with dimension m, z i represents the i-th row element of z, and v i represents the i-th row element in the value vector.
In this embodiment, the encoding algorithm Encode of OKVS is calculated in this step, OKVS is expressed in a formalized form, i.e., the linear system mxz=v needs to be solved, where v= { v 1,v2,...,vn }, M is a random matrix generated from { k 1,k2,...,kn } in I, v represents a value set, v n represents an n-th element, k n represents an n-th element, and I represents a key value set;
The Receiver processor Receiver calculates P=OKVS.Encode (I), wherein the input parameter is I= { (k 1,v1),(k2,v2),...,(kn,vn) }, P represents information coded by OKVS coding algorithm, k n,vn represents nth key and value respectively, firstly the Receiver processor Receiver needs to order according to the starting position s i of each row of random block of the random matrix M and re-label, s 1≤s2≤...≤sn,sn represents the starting position of the nth row of random block in the random matrix M, then the Receiver processor Receiver traverses the random block element j of each row of the random matrix, if M [ I ] [ j ] = 1, all rows I 'satisfying I' > I & s i′ +.j are processed:
Finally, solving the solution z of the linear system according to z i=<zi,M[i]>+vi, and if a certain row element is found to be 0 in the row processing process, directly letting z+.F m.
S103, recovering a value v i corresponding to a given arbitrary key k i by a decoding algorithm of formal representation OKVS according to the obtained z, wherein the implementation method is as follows:
c1, let v be≡0, calculate the random block start position s≡H (k) corresponding to given arbitrary key k value and element in random block Wherein v represents a value corresponding to a given arbitrary key k value, H (·) represents a random hash function, b w represents the length of each row of random block of the random matrix M, and k represents an arbitrary key to be decoded;
C2, according to the calculation result of the step C1, for j E [1, b w ], v++u [ j ' ]. Z [ s+j-1] is calculated as the last return value, and the recovery of the value v i corresponding to the given arbitrary key k i is completed, wherein j represents the column position of each row of random block in the random matrix M, u [ j ' ] represents the j ' th bit element of the random block, and s represents the starting position of the random block.
In this embodiment, this step calculates OKVS a decoding algorithm Decode, which in formalized representation OKVS, i.e., given an arbitrary key value k, the decoder can recover its corresponding value v;
the decoding party has a solution z of a linear system and an arbitrary key value k; let v+.0, the decoder first calculates the random block start position s+.H (k) corresponding to the key and the elements in the block Then for j e 1, b w, and calculating v ≡ v+u [ j ] & z [ s+j-1] as the last return value.
S104, in order to construct Labeled PSI protocols, a receiver processor encodes all keys based on OKVS and encapsulates the encoding results by using a VOLE protocol, wherein after the sender processor and the receiver processor call the VOLE protocol, the sender processor obtains parameters delta, B, the receiver processor obtains parameters A and C and satisfies C=delta A+B, labeled PSI protocols encapsulate OKVS encoding results by using random variables, the encapsulation process is that the receiver processor encapsulates A '=A+P and transmits the A' =A+P to the sender processor, and the sender processor encapsulates K=delta A '+B so that the parameters A and C=delta A' +B are satisfied:
K=ΔA'+B=Δ(A+P)+B=ΔA+B+ΔP=C+ΔP
Wherein Δ represents a random scalar generated by the VOLE protocol function module, a, B, and C each represent a random vector generated by the VOLE protocol function module, and satisfy c=Δa+b, a' represents a mask after information is encapsulated, K represents an intermediate calculation vector of the sender processor, and P represents an encoding result after the receiver processor dataset is OKVS encoded, which is implemented as follows:
d1, in order to construct Labeled PSI protocols, a VOLE protocol is called by both a sender processor and a receiver processor, wherein the receiver processor encodes all keys based on OKVS and encapsulates the encoding result by utilizing the VOLE protocol;
d2, after the operation of the VOLE protocol is finished, receiving and obtaining parameters delta and B by a sender processor, and receiving and obtaining parameters A and C by a receiver processor, wherein delta represents a random scalar generated by a VOLE protocol function module, A, B and C represent random vectors generated by the VOLE protocol function module, and C=delta A+B is satisfied;
D3, encapsulating the a 'by the receiver processor, and transmitting the a' to the sender processor by using the following formula:
A'=A+P
Wherein P represents the coding result of OKVS by the receiver, A' represents the mask after the information is packaged;
d4, according to a', calculating K by the sender processor using:
K=ΔA'+B=Δ(A+P)+B=ΔA+B+ΔP=C+ΔP
Where K represents the intermediate calculation vector of the sender processor and P represents the encoding result of the receiver processor dataset after OKVS encoding.
S105, according to the packaging result, based on OKVS decoding algorithm of S103, by respectively calculating X ', L ' and Y ', the intersection result Z and the corresponding label are obtained by the receiver processor, and the construction of Labeled PSI protocol is completed:
Z=X'∩Y'
wherein, Z represents Labeled PSI final intersection result of protocol, X ' represents mask ciphertext of local set X of sender processor, L ' represents ciphertext set after encrypting document identifier L, namely encrypted document identifier corresponding to keyword in encryption database EDB, Y ' represents mask ciphertext of local set Y of receiver processor, and the implementation method is as follows:
E1, according to the encapsulation result, based on OKVS decoding algorithm of S103, the sender processor calculates X 'and L' by using the following formulas respectively:
X'={Ho(Decode(K,x)-ΔHF(x))|x∈X}
L'={Sym_En(Kdoc,l)|l∈L[x]}
Wherein, H o and H F each represent a random hash function, decode (K, X) represents a decoding operation of OKVS, K represents an intermediate calculation vector of a sender processor, X represents an element in a set X, namely a keyword, sym_En represents a secure symmetric encryption algorithm, K doc represents a document encryption key, lx represents a set of document identifiers corresponding to the element X, L represents one element in the set of document identifiers Lx, and X represents a set of Labeled PSI protocols used by a server;
E2, calculating Y 'by the access processor by using the following formula, and sending the Y' to the sender processor;
Y'={H°(Decode(C,y),y)|y∈Y}
wherein Decode (C, Y) represents the decoding operation of OKVS, Y represents an element in the set Y, i.e., a keyword, C represents a random vector generated by the VOLE protocol;
E3, according to the X 'and the Y', calculating Z by using the following formula to obtain the result of the original data set X and Y:
Z=X'∩Y'
And E4, obtaining a corresponding label { Lz|z epsilon Z } according to Z, and completing construction of Labeled PSI protocols, wherein Lz represents a document identifier set corresponding to the intersection set element Z.
S2, negotiating a database updating method by the client and the server together at an application layer, encrypting a plaintext document and completing ciphertext database updating operation, negotiating a database searching method by the client and the server together, completing unintentional dynamic searchability of multiple keywords based on Labeled PSI protocols, decrypting the document after obtaining a searching result by the client, and realizing the method as follows:
S201, respectively generating a secret key, an empty keyword state table and an empty encryption database at a client;
In this embodiment, the Client generates the key { K s,Kdoc }, an empty key state table σ, and an empty encryption database EDB.
S202, respectively generating a secret key, an empty keyword state table and an empty encryption database at a client, wherein the implementation method comprises the following steps:
F1, generating a series of empty lists T w,Tkw,Tdic,Tcount,Tupdate by the client, wherein a table T w is used for storing keyword information in the updating process, a table T kw is used for storing mapping from a keyword w to a keyword token kt w, a table T dic is used for storing ciphertext information on a document index chain DIC, a table T count is used for storing the number of documents corresponding to the keyword w, and a table T update is used for storing all ciphertext information in the updating process;
F2, extracting documents one by one in a document database DB by a client, calculating a table T w by the client for any keyword w, and searching the keyword sigma [ w ] from a local keyword state table;
f3, responding to the fact that the keyword sigma [ w ] is not found, enabling sigma [ w ] ≡0, and calculating to obtain the latest update times n update of the keyword w;
F4, according to the calculation result of the step F3, the client searches (kt w,stw)←Tkw [ w ] from the table T kw, and if not found, kt w←F(Ks, w) is calculated, And T kw←Tkw∪{w,(ktw,stw), where T kw [ w ] represents the mapping of the keyword w to the keyword token kt w and the search token st w, F (K s, w) represents a pseudo-random function, H () represents a hash function,The latest update times of the keyword w are represented;
F5, according to the calculation result of the step F4, searching T count [ w ] from a table T count by the client, and in response to the fact that the T count [ w ] is not found, making T count [ w ] ≡0 and obtaining c w←Tcount [ w ] +1, wherein T count [ w ] represents and stores a list of the number of document identifiers corresponding to the keyword w, and c w represents the number of documents corresponding to the keyword w in the updating operation process;
F6, according to the calculation result of the step F5, calculating to obtain calculation document encryption information loc (i.e. H (st w,cw)、eid←Sym_En(Kdoc, id)) and T dic[stw]←Tdic[stw { (loc, eid) }, wherein loc represents the address of each node of the document index chain DIC, eid represents the ciphertext encrypted by the document identifier id, sym_En represents symmetric encryption operation, K doc represents a document encryption key, and T dic[stw represents a document index chain corresponding to the search token st w;
F7, for any keyword w E T w, computing sigma [ w ] ≡sigma [ w ] +1, (kt w,stw)←Tkw[w]、cw←Tcount [ w ] and And (kt w,(value,Tdic[stw ])) is saved in a table T update, and the table T update is sent to a server by a client, wherein the table T w stores all keyword sets involved in the updating process, sigma [ w ] represents a client local keyword state table, c w represents the number of documents corresponding to the keyword w in the updating process, T count [ w ] represents the number of documents corresponding to the keyword w, value represents an operation information mask of the updating process, G () represents a hash function, op represents an operation type, op=0 represents a document adding operation, op=1 represents a document deleting operation, lambda represents a calculation security parameter;
and F8, merging the table T update with the encryption database EDB by the server to finish updating operation of the ciphertext database.
In this embodiment, the Client and the Server together negotiate a database Update algorithm Update.
In this embodiment, the Client first generates a series of empty lists T w,Tkw,Tdic,Tcount,Tupdate, where T w is used to store keyword information in the current update process, T kw is used to store a mapping from the keyword w to the keyword token kt w, T dic is used to store ciphertext information on the DIC, T count is used to store the number of documents corresponding to the keyword w, and T update is used to store all ciphertext information in the current update process;
client first reads from document database The method comprises the steps of extracting documents doc= (id, W id) one by one, calculating T w←Tw { W } for any W epsilon W id by a Client, searching a local keyword state table for the keyword sigma [ W ], if not, enabling sigma [ W ]. Times of 0 to be found, obtaining the latest update times n update +% sigma [ W ] +1 of the keyword W, and searching (kt w,stw)←Tkw [ W ] from a list T kw by the Client, if not, calculating kt w←F(Ks, W), and,T kw←Tkw∪{w,(ktw,stw); the Client searches T count [ w ] from the list T count, if not, T count [ w ] ≡0 is caused to obtain c w←Tcount [ w ] +1, and then document encryption information loc≡H (st w,cw)、eid←Sym_En(Kdoc, id) and T dic[stw]←Tdic[stw ≡ { (loc, eid) } are calculated;
Table T w holds all keyword sets in the current update process, and for any w ε T w, client computes σ [ w ] ≡σ [ w ] +1, (kt w,stw)←Tkw[w]、cw←Tcount [ w ] and And (kt w,(value,Tdic[stw ])) is saved in a table T update, finally, the Client sends the list T update to the Server, and the Server merges the list T update with the encryption database EDB, namely EDB≡EDB u T update.
S203, negotiating a database searching method by the client and the server together according to the updating result, completing the unintentional dynamic searchability of the multiple keywords based on Labeled PSI protocol, decrypting the document after obtaining the searching result by the client, and realizing the method as follows:
G1, generating Y 'by a client according to an updating result, R' is { }, kt w←F(Ks,w)、stw←H(ktw and sigma [ w ] are calculated for any keyword w, and a search token st w is stored to Y ', wherein Y' represents a set of the client for Labeled PSI protocol, R represents a final result set, kt w represents a keyword token, F (K s, w) represents a pseudo-random function, st w represents a search token, H () represents a hash function, sigma [ w ] represents a keyword, and kt w represents a keyword token;
G2, generating X ", lx≡ { }, for the encryption database EDB, calculating st w←H(ktw,ci by the server, wherein X" represents the set of servers for Labeled PSI protocol, lx represents the set of document identifiers for the corresponding element X, c i represents the c i th node;
G3, according to the generated search token st w, op and c w are obtained through calculation by using the following formula:
(op||cw)←value⊕G(stw,1λ)
Wherein c w represents the number of documents corresponding to the keyword w in the update operation process, value represents an operation information mask corresponding to the update process, G () represents a hash function, op represents an operation type, op=0 represents a document adding operation, op=1 represents a document deleting operation, and λ represents a calculation security parameter;
G4, from 1 to c w, calculating to obtain loc (H) (st w, j) and Eid (EDB) (loc), wherein loc represents the address of the j-th node of the document index chain DIC, and the encrypted ciphertext of the Eid document identifier id, and EDB represents an encrypted database;
G5, saving, by the server, the search token st w to X ", and adding the encrypted document identifier of op=0 to lx, removing the document encrypted identifier of op=1 from lx;
G6, the client and the server call Labeled PSI the protocol together, after Labeled PSI the protocol is operated, the client receives the final result intersection I=X '-U Y' and { L [ Y '] |y' ∈I } corresponding to the intersection element, wherein L [ Y '] represents the encrypted document to be searched by the client, and Y' represents the intersection element;
and G7, saving the L [ y' ] to the set R by the client, decrypting the document by using the key, and completing the encryption processing of the unintentional dynamic searchable.
In this embodiment, the Client and the Server together negotiate a database Search algorithm Search.
In this embodiment, the Client generates Y ", r≡ { }, calculates kt w←F(Ks,w)、stw←H(ktw, σ [ w ]) for any w∈q, and saves the search token st w to Y"; the Server generates X ", lx ] ≡ { }, calculates st w←H(ktw, i) for the encryption database EDB, where i=1, 2, and calculates from the generated st w Op and c w are obtained, then loc≡H (st w, j), eid≡EDB [ loc ], where j ε [1, c w ]; the Server saves the search token st w to X ", adds the encrypted document identifier of op=0 to Lx, and removes the document encrypted identifier of op=1 from Lx; the Client and the Server call Labeled PSI the protocol together, wherein the Client plays the role of Receiver processor Receiver, the Server plays the role of Sender processor Sender, after the protocol runs, the Client receives the final result intersection I=X". U.Y "and { L [ Y '] |y'. E.I } corresponding to the intersection element, the Client saves the final result L [ Y ] into the set R, and decrypts the document by using the key K doc.
In this embodiment, the present invention is a dynamic searchable encryption model based on a single read single write system model. The invention can be divided into three stages of Setup, update and Search, wherein in the Update stage, the constructed secondary index structure comprises a keyword index chain KIC and a document index chain DIC, namely the part of a dotted line box in figure 2, and in the Search stage, keyword searching is carried out by calling Labeled PSI modules.
In the embodiment, the method and the device are mainly applicable to dynamic data updating scenes and are divided into two entities, namely a Client and a Server. The data document doc= (id, W id) contains a unique document identifier id e {0,1} * and a set of keywords W id, in a plaintext databaseIn (c), the document identifier set corresponding to the keyword W is set as DB (W) = { id|w e W id }. In Setup phase, client generates two symmetric encryption keys K s and K doc, an empty keyword state table σ and an empty ciphertext database EDB, where K s is used for encryption generation of various tokens, K doc is used for encryption of document identifiers, σ is used for saving the number of updates of each keyword
In this embodiment, in order to improve data updating efficiency and reduce communication complexity, the present invention optimizes a traditional inverted index structure and adjusts the structure into a secondary index structure, which includes a keyword index chain KIC and a document index chain DIC. If each update operation is only for one keyword/document pair, the length of the keyword index chain KIC will become longer and one keyword/document set at a time can be processed by introducing the document index chain DIC.
Due to plaintext databasesSimilar to the forward index structure, to encrypt it according to the index structure, a temporary empty mapping table T w,Tkw,Tdic,Tcount,Tupdate needs to be introduced, and each mapping table function is as described above, so the Update phase Client includes the following steps:
Step S1, client side is from plaintext database Extracting a document doc= (id, W id), and storing a keyword W corresponding to the document to T w;
step S2, calculating the latest update times of the keyword w If the keyword w information is not stored in the keyword state table sigma in the process, making sigma [ w ] ≡0;
Step S3, if the information of the keyword w is stored in the mapping table T kw, directly extracting (kt w,stw)←Tkw [ w ]; if the keyword w is processed for the first time, calculating a keyword token kt w and a search token st w corresponding to the keyword w, wherein the formula is as follows:
and saves it into mapping table T kw, i.e., T kw←Tkw∪{w,(ktw,stw);
Step S4, calculating the number c w of document identifiers added to DIC by the keyword w in the round, if the information of the keyword w is stored in the mapping table T count, making c w←Tcount [ w ] +1, otherwise, making T count [ w ] > be less than 0, and calculating the value of c w;
Step S5, calculating encrypted document information loc≡H (st w,cw)、eid←Sym_En(Kdoc, id) and T dic[stw]←Tdic[stw { (loc, eid) };
Repeating S1 to S5 until all documents in the plaintext document database DB are processed, wherein a table T w stores all keyword sets in the updating process, and aiming at all w epsilon T w, constructing a ciphertext database EDB according to the index structure;
Step S6, calculating sigma [ w ] ≡sigma [ w ] +1, (kt w,stw)←Tkw[w]、cw←Tcount [ w ] and value ≡G (st w,1λ)⊕(op||cw) for any keyword w epsilon T w by the Client, wherein value is information stored by a KIC node and comprises the corresponding keyword w update type (op=0 is an adding operation and op=1 is a deleting operation) and the number of documents corresponding to the keyword w c w in the updating process, and storing (kt w,(value,Tdic[stw) in a table T update by the Client and sending the information to a Server.
The Update phase Server updates the local ciphertext database EDB according to the table T update.
Because Labeled PSI protocol is used to ensure the safe operation of the Search mechanism in the Search stage, some safety parameters need to be preset before the formal operation of the protocol to initialize the data set, the Server acts as a Sender role and the Client acts as a Receiver role in the protocol operation stage. In the dynamic searchable encryption Search mechanism provided by the embodiment of the present invention, the Search stage needs the Client side and the Server Fang Shou to generate the data set of locally running Labeled PSI protocol, and mainly includes the following steps:
step S1, client generates a local data set Y' according to a search keyword set Q, and calculates kt w←F(Ks, w) and st w←H(ktw, sigma [ w ] for any keyword w epsilon Q, wherein F is a pseudo-random function, H is a random hash function, sigma is a keyword state table locally held by the Client;
Step S2, the Server generates a local data set X 'according to the ciphertext database EDB, generates a label set L [ X ] corresponding to any X E X', calculates st w←H(ktw, i) and i=1, 2 according to the generated st w, calculates (op|c w)←value⊕G(stw,1λ) to obtain operation types op of all nodes on the KIC and the number c w of the nodes corresponding to the DIC, and then calculates
Loc≡h (st w,j),j=1,2,...,cw and eid≡edb [ loc ];
And step S3, the Server saves all st w to a data set X' and processes the documents corresponding to the keywords according to the operation type op. Specifically, the encrypted document identifier of op=0 is saved to the data set L [ x ], and the encrypted document identifier of op=1 is removed from the data set L [ x ];
step S4, the Client and the Server call Labeled PSI the protocol together, wherein the Client plays the role of Receiver processor Receiver, the Server plays the role of Sender processor Sender, the protocol operation is finished, the Client receives the final result intersection I=X ', U Y' and { L [ Y '] |y' ∈I } corresponding to the intersection element;
Because the Client uses the latest updating times sigma [ w ] of each keyword to dynamically generate a search token st w, the Client cannot obtain a search result by using the previous search token st w', and the forward privacy security of a user is ensured;
and S5, the Client uses the key K doc to decrypt the data set L [ y' ] to obtain a final plaintext result.
Those of ordinary skill in the art will appreciate that the embodiments described herein are intended to aid the reader in understanding the practice of the invention and that the scope of the invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific modifications and combinations from the teachings of the present disclosure without departing from the spirit thereof, and such modifications and combinations remain within the scope of the present disclosure.