Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
CN115225260A - Dynamic searchable encryption method - Google Patents
[go: Go Back, main page]

CN115225260A - Dynamic searchable encryption method - Google Patents

Dynamic searchable encryption method Download PDF

Info

Publication number
CN115225260A
CN115225260A CN202210549179.0A CN202210549179A CN115225260A CN 115225260 A CN115225260 A CN 115225260A CN 202210549179 A CN202210549179 A CN 202210549179A CN 115225260 A CN115225260 A CN 115225260A
Authority
CN
China
Prior art keywords
key
segment
file identifier
data
keyword
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210549179.0A
Other languages
Chinese (zh)
Other versions
CN115225260B (en
Inventor
刘琴
彭宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan University filed Critical Hunan University
Priority to CN202210549179.0A priority Critical patent/CN115225260B/en
Publication of CN115225260A publication Critical patent/CN115225260A/en
Application granted granted Critical
Publication of CN115225260B publication Critical patent/CN115225260B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Bioethics (AREA)
  • Computational Linguistics (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a dynamic searchable encryption method, which constructs a file identifier encryption and decryption key by using a double-chain structure, allows a client to update data stored in a server as required, cannot completely recover the double-chain key of a corresponding file after deletion operation is executed, ensures that the deleted file cannot be queried in a subsequent query process so as to realize backward security, and simultaneously has high overall operation efficiency based on simple encryption primitive constructs such as a hash function and a pseudorandom function, and realizes safe and efficient dynamic addition, deletion and query.

Description

一种动态可搜索加密方法A Dynamic Searchable Encryption Method

技术领域technical field

本发明涉及动态可搜索加密技术领域,具体涉及一种基于双链结构来构造密钥从而实现后向安全的动态可搜索加密方法。The invention relates to the technical field of dynamic searchable encryption, in particular to a dynamic searchable encryption method for constructing a key based on a double-chain structure to realize backward security.

背景技术Background technique

随着互联网、物联网、移动终端等网络和智能设备的高速发展,数据的种类和规模正在以前所未有的速度增长,形成了丰富的数据资源。为了更加方便的存储和共享这些数据资源,通常的做法是数据拥有者将自己的在本地客户端的数据托管到云平台等服务端,再由服务端为数据使用者提供各种服务。同时,为了保证数据安全,数据拥有者会在客户端先对数据加密再将密文数据外包到云平台等服务端进行存储。With the rapid development of networks and smart devices such as the Internet, Internet of Things, and mobile terminals, the types and scale of data are growing at an unprecedented rate, forming abundant data resources. In order to store and share these data resources more conveniently, the usual practice is for the data owner to host the data on the local client to the server such as the cloud platform, and then the server provides various services for the data user. At the same time, in order to ensure data security, the data owner will encrypt the data on the client side and then outsource the ciphertext data to a server such as a cloud platform for storage.

为了在加密数据上安全地开展各项云服务,比如基于关键词的查询服务,可搜索加密技术被广泛应用。为了进一步满足大数据环境下数据动态性这一特性,动态可搜索加密被提出,它允许用户按需更新已经外包到云平台中的数据。研究表明,更新过程中如何保证前向安全和后向安全,是可搜索加密技术的两个重要方面。前向安全要求新添加的文件不能使用以前的查询陷门进行检索,后向安全则强调已经删除的文件不能再被检索到。其中,前向安全可以通过陷门置换、关键词计数器等技术实现,而后向安全通常需要复杂的加密原语(如Oblivious RAM,公钥可穿刺加密)或者多轮的交互查询来实现,存在效率低的问题。Sun等人在文献“Practical backward-secure searchable encryption fromsymmetric puncturable encryption”中利用可穿刺伪随机函数构造了对称可穿刺加密方案从而在保证单轮搜索的前提下实现了后向安全。但是该方案在删除过程中需要发送大量的PKS(Public Key Share)到云服务器,造成大量的通信开销;此外,对称可穿刺加密基于AES构造,在构造过程中涉及多轮AES加密,效率较低。因此,如何保证后向安全同时提升动态查询方案的运行效率仍是一个非常棘手的问题。In order to securely carry out various cloud services on encrypted data, such as keyword-based query services, searchable encryption technology is widely used. In order to further meet the characteristics of data dynamics in the big data environment, dynamic searchable encryption is proposed, which allows users to update the data that has been outsourced to the cloud platform on demand. Research shows that how to ensure forward security and backward security in the update process are two important aspects of searchable encryption technology. Forward security requires that newly added files cannot be retrieved using previous query trapdoors, while backward security emphasizes that deleted files cannot be retrieved anymore. Among them, forward security can be realized by trapdoor replacement, keyword counter and other technologies, while backward security usually requires complex encryption primitives (such as Oblivious RAM, public key puncture encryption) or multiple rounds of interactive query to achieve, there is efficiency low problem. In the literature "Practical backward-secure searchable encryption from symmetric puncturable encryption", Sun et al. constructed a symmetric puncturable encryption scheme by using puncture pseudo-random functions to achieve backward security under the premise of ensuring a single round of search. However, this scheme needs to send a large amount of PKS (Public Key Share) to the cloud server during the deletion process, resulting in a lot of communication overhead; in addition, the symmetric puncture encryption is based on AES construction, which involves multiple rounds of AES encryption in the construction process, which is inefficient. . Therefore, how to ensure backward security and improve the running efficiency of dynamic query schemes is still a very difficult problem.

发明内容SUMMARY OF THE INVENTION

为解决现有技术中存在的上述缺陷,本发明提供一种动态可搜索加密方法,利用双链结构来构造文件标识符加解密密钥,其允许客户端按需更新存放在服务端中的数据,执行删除操作后对应文件的双链密钥无法完全恢复,保证删除的文件在后续查询过程中不能被查询到从而实现后向安全,同时方案基于简单的加密原语(例如哈希函数,伪随机函数)构造,整体运行效率高,实现安全且高效的动态添加、删除和查询。In order to solve the above-mentioned defects in the prior art, the present invention provides a dynamic searchable encryption method, which uses a double-chain structure to construct a file identifier encryption and decryption key, which allows the client to update the data stored in the server as needed. , the double-chain key of the corresponding file cannot be completely recovered after the deletion operation is performed, ensuring that the deleted file cannot be queried in the subsequent query process to achieve backward security. At the same time, the scheme is based on simple encryption primitives (such as hash functions, pseudo Random function) structure, the overall operation efficiency is high, and it can realize safe and efficient dynamic addition, deletion and query.

根据本发明的第一方面,提供一种动态可搜索加密方法,其特征在于,包括:数据添加步骤,数据删除步骤,数据查询步骤;According to the first aspect of the present invention, a dynamic searchable encryption method is provided, which is characterized by comprising: a data addition step, a data deletion step, and a data query step;

客户端包括明文索引表DB、主私钥msk、对称加密密钥ke,其中DB存储关键词-文件标识符对,DB中每一个关键词w均对应一个子数据集DB(w),子数据集包括该关键词对应的所有关键词-文件标识符对,子数据集被划分为一个或多个分段,系统参数t表示每个分段能容纳的关键词-文件标识符对最大个数,系统参数d表示每个分段中能被删除的关键词-文件标识符对最大个数;The client includes a plaintext index table DB, a master private key msk, and a symmetric encryption key ke , wherein the DB stores keyword-file identifier pairs, and each keyword w in the DB corresponds to a sub-data set DB(w), The data set includes all keyword-file identifier pairs corresponding to the keyword, and the sub-data set is divided into one or more segments. The system parameter t represents the maximum number of keyword-file identifier pairs that each segment can hold. number, the system parameter d represents the maximum number of keyword-file identifier pairs that can be deleted in each segment;

服务端包括密文索引表EDB,EDB包括查询密文索引表TS和删除密文索引表TD,存储经所述数据添加步骤生成的密文数据;The server includes a ciphertext index table EDB, and the EDB includes a query ciphertext index table T S and a deletion ciphertext index table T D , and stores the ciphertext data generated through the data adding step;

数据添加步骤包括:Data addition steps include:

步骤101:客户端确定待操作的关键词-文件标识符对(w,f)在DB(w)中的次序c,(w,f)在DB(w)中所属的分段p,以及(w,f)在分段p中的次序i,在本地表格Tc(w)记录DB(w)中关键词-文件标识符对的总数cnt和分段总数SStep 101: The client determines the order c of the keyword-file identifier pair (w, f) to be operated in DB(w), the segment p to which (w, f) belongs in DB(w), and ( w,f) order i in segment p, the total number of key-file identifier pairs cnt and the total number of segments S in local table Tc(w) record DB(w)

步骤102:客户端对(w,f)加密并生成数据添加陷门

Figure BDA0003653858870000021
其中e1为(w,f)的第一查询密文,e2为(w,f)的第二查询密文,
Figure BDA0003653858870000022
为e1和e2在TS中的次序,e3为(w,f)的删除密文,
Figure BDA0003653858870000023
为e3在TD中的次序,将τadd发送给服务端;Step 102: The client encrypts (w, f) and generates data to add a trapdoor
Figure BDA0003653858870000021
where e 1 is the first query ciphertext of (w, f), e 2 is the second query ciphertext of (w, f),
Figure BDA0003653858870000022
is the order of e 1 and e 2 in T S , e 3 is the deleted ciphertext of (w, f),
Figure BDA0003653858870000023
For the order of e 3 in TD, send τ add to the server;

步骤103:服务端接收τadd后更新EDB,令

Figure BDA0003653858870000024
Figure BDA0003653858870000025
Step 103: The server updates the EDB after receiving τ add , so that
Figure BDA0003653858870000024
and
Figure BDA0003653858870000025

步骤102中生成e1和e2的步骤具体包括:The steps of generating e 1 and e 2 in step 102 specifically include:

步骤A1:对于w和p,使用msk通过HMAC算法H进行加密,生成分段p的正向链根密钥Kw,p和反向链根密钥K′w,p,(Kw,p,K′w,p)←H(msk,w||p),其中||为字符串连接运算;Step A1: For w and p, use msk to encrypt through HMAC algorithm H, and generate the forward chain root key Kw,p and reverse chain root key K′w,p of segment p, ( Kw,p ,K′ w,p )←H(msk,w||p), where || is a string concatenation operation;

步骤A2:生成(w,f)对应的文件标识符密钥

Figure BDA0003653858870000026
bk=2Kw,p,k,i-K′w,p,k,i,Kw,p,k,i=X(dw,p,k,i),K′w,p,k,i=X(d′w,p,k,t+1-i),dw,p,k←H(Kw,p,k),d′w,p,k←H(K′w,p,k),其中k∈[1,d],
Figure BDA0003653858870000027
表示异或运算,bk为(w,f)的第k个双链密钥,Kw,p,k,i为(w,f)的第k个正向链密钥,K′w,p,k,i为(w,f)的第k个反向链密钥,dw,p,k为分段p的第k个正向链密钥,d′w,p,k为分段p的第k个反向链密钥;Step A2: Generate the file identifier key corresponding to (w, f)
Figure BDA0003653858870000026
b k =2K w,p,k,i -K'w ,p,k,i , Kw,p,k,i =X( dw,p,k ,i), K'w,p,k ,i =X(d′ w,p,k ,t+1-i), dw,p,k ←H( Kw,p,k ), d′ w,p,k ←H( K′w ,p,k ), where k∈[1,d],
Figure BDA0003653858870000027
Indicates the XOR operation, b k is the k-th double-chain key of (w, f), K w, p, k, i is the k-th forward chain key of (w, f), K′ w, p,k,i is the kth reverse chain key of (w,f), dw,p,k is the kth forward chain key of segment p, d′ w,p,k is the segment the k-th reverse chain key of segment p;

其中,X为密钥循环生成算法,第一输入为种子密钥keyseed,第二输入为迭代次数n,输出对keyseed迭代执行n次哈希函数后的数值;Wherein, X is the key cycle generation algorithm, the first input is the seed key key seed , the second input is the number of iterations n, and the output is the value after performing n iterations of the hash function on the key seed ;

步骤A3:使用skw,f加密文件标识符f生成第一查询密文

Figure BDA0003653858870000031
根据一元一次函数Fk(x)=(K′w,p,k,i-Kw,p,k,i)x+bk生成第二查询密文
Figure BDA0003653858870000032
Step A3: Use sk w, f to encrypt the file identifier f to generate the first query ciphertext
Figure BDA0003653858870000031
Generate the second query ciphertext according to the unary linear function F k (x)=(K′ w,p,k,i -K w,p,k,i )x+b k
Figure BDA0003653858870000032

步骤102中生成

Figure BDA0003653858870000033
Figure BDA0003653858870000034
的步骤具体包括:Generated in step 102
Figure BDA0003653858870000033
and
Figure BDA0003653858870000034
The steps specifically include:

步骤B1:使用msk通过伪随机函数F对w进行加密,生成位置计算密钥PKw←F(msk,w);Step B1: use msk to encrypt w through a pseudo-random function F, and generate a position calculation key PK w ←F(msk, w);

步骤B2:使用PKw对(w,f)的位置信息进行加密,生成

Figure BDA0003653858870000035
Figure BDA0003653858870000036
Step B2: Use PK w to encrypt the location information of (w, f) to generate
Figure BDA0003653858870000035
Figure BDA0003653858870000036

步骤102中生成e3的步骤具体包括:The step of generating e3 in step 102 specifically includes:

步骤C1:使用ke通过对称加密算法的加密过程SE.Enc对p和i进行加密,生成删除密文e3←SE.Enc(ke,p||i);Step C1: use k e to encrypt p and i through the encryption process SE.Enc of the symmetric encryption algorithm, and generate the deleted ciphertext e 3 ←SE.Enc( ke ,p||i);

数据删除步骤包括:Data deletion steps include:

步骤201:客户端对待操作的关键词-文件标识符对(w,f)加密并生成数据删除陷门τdel←H(PKw,w||f),将τdel发送给服务端;Step 201: the client encrypts the keyword-file identifier pair (w, f) to be operated and generates a data deletion trapdoor τ del ←H(PK w , w||f), and sends τ del to the server;

步骤202:服务端接收τdel后,获取TDdel]的信息,即(w,f)对应的删除密文e3,发送e3给客户端;Step 202: After receiving τ del , the server obtains the information of T Ddel ], that is, the deleted ciphertext e 3 corresponding to (w, f), and sends e 3 to the client;

步骤203:客户端接收e3后,使用ke通过对称加密算法的解密过程SE.Dec对e3进行解密,生成(w,f)在DB(w)中所属的分段和分段中的次序(p,i)←SE.Dec(ke,e3),将(p,i)记录到本地表格Tc(w);Step 203: After receiving e 3 , the client uses ke to decrypt e 3 through the decryption process SE.Dec of the symmetric encryption algorithm, and generates the segment to which (w, f) belongs in DB(w) and the segment in the segment. Order (p,i)←SE.Dec(k e ,e 3 ), record (p,i) to the local table Tc(w);

数据查询步骤包括:The data query steps include:

步骤301:客户端对应于待操作的关键词w,根据Tc(w)中的cnt、S、以及执行过删除步骤的关键词-文件标识符对所属的分段和分段中的次序,确定DB(w)中执行过数据删除步骤的分段集合R、DB(w)中未执行过数据删除步骤的分段集合Q、以及集合R中每个分段执行了数据删除步骤的次数;Step 301: The client corresponds to the keyword w to be operated, and determines the segment to which the keyword-file identifier pair belongs and the sequence in the segment according to cnt and S in Tc(w) and the keyword-file identifier pair that has performed the deletion step. The segment set R that has performed the data deletion step in DB(w), the segment set Q that has not performed the data deletion step in DB(w), and the number of times that each segment in the set R has performed the data deletion step;

步骤302:客户端生成对应于待操作的关键词w的数据查询陷门τsrh←(cnt,PKw12),其中,第一查询信息τ1←(Kw,q,K′w,q)q∈Q,Kw,q为集合Q中分段q的正向链根密钥,K′w,q为集合Q中分段q的反向链根密钥,第二查询信息τ2←((Kw,r,h,j+1,K′w,r,h,j-1)h∈[1,z],(dw,r,g,d′w,r,g)g∈[z+1,d])r∈R,z是集合R中分段r上执行了数据删除步骤的次数,z≤d,分段r上第j位置的关键词-文件标识符对(w,fr,j)是在分段r上第h次执行数据删除步骤的对象,Kw,r,h,j+1为分段r上第j+1位置关键词-文件标识符对(w,fr,j+1)的第h个正向链密钥,K′w,r,h,j-1为第j-1位置关键词-文件标识符对(w,fr,j-1)的第h个反向链密钥,dw,r,g为分段r的第g个正向链密钥,d′w,r,g为分段r的第g个反向链密钥;客户端发送τsrh给服务端;Step 302: The client generates a data query trapdoor τ srh ←(cnt,PK w12 ) corresponding to the keyword w to be operated, wherein the first query information τ 1 ←(K w,q , K′ w,q ) q∈Q , K w,q is the forward chain root key of the segment q in the set Q, K′ w,q is the reverse chain root key of the segment q in the set Q, the first Second query information τ 2 ←((K w,r,h,j+1 ,K′ w,r,h,j-1 ) h∈[1,z] ,(d w,r,g ,d′ w ,r,g ) g∈[z+1,d] ) r∈R , z is the number of times the data deletion step is performed on the segment r in the set R, z≤d, the keyword at the jth position on the segment r - The file identifier pair (w,f r,j ) is the object of the h-th data deletion step on segment r, and K w,r,h,j+1 is the j+1-th position key on segment r The h-th forward chain key of the word-file identifier pair (w,f r,j+1 ), K′w,r,h,j-1 is the j-1th position keyword-file identifier pair The h-th reverse chain key of (w,f r,j-1 ), d w,r,g is the g-th forward chain key of segment r, d′ w,r,g is the segment The g-th reverse chain key of r; the client sends τ srh to the server;

步骤303:服务端接收τsrh后,根据τsrh获得w对应的未执行过数据删除步骤的文件标识符明文,根据τsrh无法获得w对应的执行过数据删除步骤的文件标识符明文;Step 303: After receiving τ srh , the server obtains, according to τ srh , the plaintext of the file identifier corresponding to w that has not performed the data deletion step, and cannot obtain the plaintext of the file identifier corresponding to w that has performed the data deletion step according to τ srh ;

步骤304:服务端将所获得的所有文件标识符明文作为查询结果返回给客户端;Step 304: The server returns all the obtained file identifiers in plaintext to the client as query results;

进一步地,本发明所提供的动态可搜索加密方法,其特征在于,数据删除步骤还包括:Further, the dynamic searchable encryption method provided by the present invention is characterized in that, the data deletion step further comprises:

服务端发送e3给客户端后,EDB中(w,f)对应的e1、e2、e3中的一个或多个未被清除。After the server sends e 3 to the client, one or more of e 1 , e 2 , and e 3 corresponding to (w, f) in the EDB are not cleared.

进一步地,本发明所提供的动态可搜索加密方法,其特征在于,步骤302还包括:Further, the dynamic searchable encryption method provided by the present invention is characterized in that step 302 further includes:

客户端生成τsrh后,清空TC[w]的内容。After the client generates τ srh , it clears the contents of T C [w].

进一步地,本发明所提供的动态可搜索加密方法,其特征在于,步骤303包括:Further, the dynamic searchable encryption method provided by the present invention is characterized in that step 303 includes:

步骤3031:根据cnt和PKw获取TS中w对应的所有关键词-文件标识符对的第一查询密文和第二查询密文;Step 3031: Obtain the first query ciphertext and the second query ciphertext of all keyword-file identifier pairs corresponding to w in T S according to cnt and PK w ;

步骤3032:根据τ1获得集合Q中的关键词-文件标识符对对应的文件标识符密钥,并解密对应的第一查询密文获得集合Q中的文件标识符明文;Step 3032: Obtain the file identifier key corresponding to the keyword-file identifier pair in the set Q according to τ 1 , and decrypt the corresponding first query ciphertext to obtain the file identifier plaintext in the set Q;

步骤3033:根据τ2获得集合R中未执行过所述数据删除步骤的关键词-文件标识符对对应的文件标识符密钥,并解密对应的第一查询密文获得集合Q中的文件标识符明文。Step 3033: Obtain the file identifier key corresponding to the keyword-file identifier pair in the set R for which the data deletion step has not been performed according to τ 2 , and decrypt the corresponding first query ciphertext to obtain the file identifier in the set Q Run plaintext.

根据本发明的第二方面,提供一种计算机设备,其特征在于,包括:According to a second aspect of the present invention, a computer device is provided, characterized in that it includes:

存储器,用于存储指令;以及memory for storing instructions; and

处理器,用于调用所述存储器存储的指令执行第一方面的动态可搜索加密方法。A processor configured to invoke the instructions stored in the memory to execute the dynamically searchable encryption method of the first aspect.

根据本发明的第三方面,提供一种计算机可读存储介质,其特征在于,存储有指令,所述指令被处理器执行时,执行第一方面的动态可搜索加密方法。According to a third aspect of the present invention, a computer-readable storage medium is provided, characterized in that an instruction is stored, and when the instruction is executed by a processor, the dynamically searchable encryption method of the first aspect is executed.

与现有技术相比,本发明所构思的上述技术方案至少具有以下有益效果:Compared with the prior art, the above-mentioned technical solution conceived by the present invention has at least the following beneficial effects:

(1)本发明基于双链结构的密钥构造方法来构造文件标识符加解密密钥,其允许客户端按需更新存放在服务端中的数据,执行删除操作后对应文件即使在服务端没有被清除,服务端也无法完全恢复该文件的双链密钥从而无法获得解密密钥,确保了该文件在后续查询过程中无法获得明文,即不能被查询到,从而实现动态更新过程的后向安全。(1) The present invention constructs a file identifier encryption and decryption key based on the key construction method of the double-chain structure, which allows the client to update the data stored in the server as needed, and the corresponding file after the deletion operation is performed even if the server does not have it. If it is cleared, the server cannot completely restore the double-chain key of the file and thus cannot obtain the decryption key, which ensures that the file cannot obtain the plaintext in the subsequent query process, that is, it cannot be queried, thus realizing the backward direction of the dynamic update process. Safety.

(2)本发明的加解密操作均采用轻量级原语,特别是数据删除过程中不需要复杂的计算,仅仅需要客户端记录下删除的状态。(2) The encryption and decryption operations of the present invention all use light-weight primitives, especially in the process of data deletion, no complicated calculation is required, and the client only needs to record the deletion state.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention.

图1是根据一示例性实施例示出的动态加密主要步骤流程示意图。FIG. 1 is a schematic flow chart showing the main steps of dynamic encryption according to an exemplary embodiment.

图2是根据一示例性实施例示出的客户端与云服务器交互示意图。FIG. 2 is a schematic diagram illustrating interaction between a client and a cloud server according to an exemplary embodiment.

图3是根据一示例性实施例示出的文件标识符密钥生成过程示意图。FIG. 3 is a schematic diagram illustrating a process of generating a file identifier key according to an exemplary embodiment.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as there is no conflict with each other.

在详细解释本发明的技术方案之前,先列出本文中所涉及的部分符号所表示的含义如下:Before explaining the technical solutions of the present invention in detail, the meanings represented by some symbols involved in this article are listed as follows:

Figure BDA0003653858870000051
Figure BDA0003653858870000051

Figure BDA0003653858870000061
Figure BDA0003653858870000061

这里将详细地对示例性实施例进行说明,其示例表示在附图中。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings.

本发明提供一种动态可搜索加密方法10,如图1所示,其通过数据添加步骤100,数据删除步骤200,数据查询步骤300三个不同过程来实现在云平台等服务端动态更新和安全查询。The present invention provides a dynamic searchable encryption method 10, as shown in FIG. 1, which realizes dynamic update and security on a server such as a cloud platform through three different processes: a data addition step 100, a data deletion step 200, and a data query step 300. Inquire.

其中,客户端通常是数据拥有者的终端设备,如个人电脑、手机等,数据存储量和可提供的功能有限;服务端通常为云平台、集群服务器等大型计算机系统,数据存储量大,可提供强大的功能。数据拥有者经常需要将客户端的数据存放到服务端,以获取更多的服务,但是服务端可能是不可信的,因此需要将加密后的数据存放到服务端,加密数据应可以动态更新,且保证动态更新过程中的前后向安全。Among them, the client is usually the terminal device of the data owner, such as personal computer, mobile phone, etc., with limited data storage capacity and available functions; Provide powerful functions. The data owner often needs to store the client's data on the server to obtain more services, but the server may not be trusted, so the encrypted data needs to be stored on the server. The encrypted data should be dynamically updated, and Guarantee forward and backward security in the dynamic update process.

在初始化阶段,客户端对本地文件数据集预处理形成关键词-文件标识符对的集合,即明文索引表DB,DB中每一个关键词均对应一个子数据集,子数据集包括该关键词对应的所有关键词-文件标识符对,子数据集被划分为一个或多个分段。由于本发明采用分段的思想来生成可查询的密文索引,因此客户端在初始化过程中会生成系统参数(t,d),其中系统参数t表示每个分段能容纳的关键词-文件标识符对最大个数,系统参数d表示每个分段中能被删除的关键词-文件标识符对最大个数。In the initialization stage, the client preprocesses the local file data set to form a set of keyword-file identifier pairs, namely the plaintext index table DB, each keyword in the DB corresponds to a sub-data set, and the sub-data set includes the keyword Corresponding to all keyword-file identifier pairs, the subdataset is divided into one or more segments. Since the invention adopts the idea of segmentation to generate a queryable ciphertext index, the client will generate a system parameter (t, d) during the initialization process, where the system parameter t represents the keyword-file that each segment can accommodate The maximum number of identifier pairs, and the system parameter d indicates the maximum number of keyword-file identifier pairs that can be deleted in each segment.

在一些实施例中,客户端通过将DB处理形成倒排索引来实现数据子集的划分,关键词-文件标识符对(w,f)在DB(w)中的次序c,即为(w,f)在DB上w的倒排索引中的次序。In some embodiments, the client implements the division of data subsets by processing the DB into an inverted index, and the order c of the keyword-file identifier pair (w, f) in DB(w) is (w) ,f) the order in the inverted index of w on the DB.

在初始化阶段,客户端还会生成主私钥msk、对称加密密钥ke。在一些实施例中,客户端根据给定的安全参数λ生成msk和keIn the initialization phase, the client also generates the master private key msk and the symmetric encryption key ke . In some embodiments, the client generates msk and ke according to a given security parameter λ.

在服务端存储有密文索引表EDB,EDB包括查询密文索引表TS和删除密文索引表TD,存储经数据添加步骤100生成的密文数据,在初始化阶段,服务端可以预先生成EDB相应的数据结构,也可以在数据添加步骤100中逐步产生。对于一个关键词-文件标识符对(w,f),其被加密后的密文添加到EDB中,其中的查询密文e1和e2存放在查询密文索引表TS中的

Figure BDA0003653858870000071
位置,用于在数据查询步骤300中解密恢复出明文f,删除密文e3存放在删除密文索引表TD中的
Figure BDA0003653858870000072
位置,用于在数据删除步骤200中向客户端反馈应删除文件的信息,从而被客户端解密后记录。The ciphertext index table EDB is stored on the server. The EDB includes the query ciphertext index table T S and the delete ciphertext index table T D , and stores the ciphertext data generated through the data adding step 100. In the initialization stage, the server can pre-generate the ciphertext data. The corresponding data structure of the EDB can also be gradually generated in the data adding step 100 . For a keyword-file identifier pair (w, f), the encrypted ciphertext is added to the EDB, and the query ciphertexts e 1 and e 2 are stored in the query ciphertext index table T S
Figure BDA0003653858870000071
The position is used to decrypt and restore the plaintext f in the data query step 300, and the deleted ciphertext e3 is stored in the deleted ciphertext index table TD .
Figure BDA0003653858870000072
The location is used to feed back the information of the file to be deleted to the client in the data deletion step 200, so that it is decrypted and recorded by the client.

接下来详细介绍数据添加步骤100,数据删除步骤200,数据查询步骤300。Next, the data adding step 100 , the data deletion step 200 , and the data querying step 300 are described in detail.

在数据添加步骤100,对于待操作的关键词-文件标识符对(w,f),即(w,f)的信息需要被添加到服务端,包括以下步骤:In the data adding step 100, for the keyword-file identifier pair (w, f) to be operated, that is, the information of (w, f) needs to be added to the server, including the following steps:

步骤101,客户端确定(w,f)的位置信息c、p、i,将DB(w)的大小信息cnt和S存入Tc(w)。Step 101, the client determines the position information c, p, and i of (w, f), and stores the size information cnt and S of DB(w) into Tc(w).

具体而言,DB(w)中关键词-文件标识符对的总数cnt在客户端预处理生成DB时就可以得到,在一些实施例中,客户端通过倒排索引,获得w在DB上的倒排索引中的最大排序数,即为DB(w)中关键词-文件标识符对的总数cnt;DB(w)的分段总数S,可以通过计算获得

Figure BDA0003653858870000073
其中
Figure BDA0003653858870000074
表示向上取整。Specifically, the total number cnt of keyword-file identifier pairs in DB(w) can be obtained when the client preprocesses to generate the DB. In some embodiments, the client obtains the data of w on the DB through an inverted index. The maximum number of sorts in the inverted index is the total number of keyword-file identifier pairs cnt in DB(w); the total number of segments S in DB(w) can be obtained by calculation
Figure BDA0003653858870000073
in
Figure BDA0003653858870000074
Indicates rounded up.

对于(w,f)的位置信息,包括其在DB(w)中的次序c,在DB(w)中所属的分段p,(w,f)在分段p中的次序i,在一些实施例中,在DB(w)中的次序c可以通过查找(w,f)在w的倒排索引中的次序即为其获得,所属的分段p可以通过计算获得

Figure BDA0003653858870000075
在分段p中的次序i可以通过计算获得i=c%p,%为取余运算。For the position information of (w,f), including its order c in DB(w), the segment p to which it belongs in DB(w), the order i of (w,f) in segment p, in some In the embodiment, the order c in DB(w) can be obtained by searching the order of (w, f) in the inverted index of w, and the segment p to which it belongs can be obtained by calculation
Figure BDA0003653858870000075
The order i in the segment p can be obtained by calculation i=c%p, % is the remainder operation.

将cnt和S存入本地表格Tc(w),以备在数据查询步骤300调取来构建数据查询陷门。The cnt and S are stored in the local table Tc(w) to be retrieved in the data query step 300 to construct a data query trapdoor.

步骤102:客户端对(w,f)加密并生成数据添加陷门

Figure BDA0003653858870000076
将τadd发送给服务端。Step 102: The client encrypts (w, f) and generates data to add a trapdoor
Figure BDA0003653858870000076
Send τ add to the server.

具体而言,e1为(w,f)的第一查询密文,e2为(w,f)的第二查询密文,

Figure BDA0003653858870000077
为e1和e2在TS中的次序,e3为(w,f)的删除密文,
Figure BDA0003653858870000078
为e3在TD中的次序Specifically, e 1 is the first query ciphertext of (w, f), e 2 is the second query ciphertext of (w, f),
Figure BDA0003653858870000077
is the order of e 1 and e 2 in T S , e 3 is the deleted ciphertext of (w, f),
Figure BDA0003653858870000078
is the order of e 3 in TD

步骤103:服务端接收τadd后更新EDB,令

Figure BDA0003653858870000079
Figure BDA00036538588700000710
Step 103: The server updates the EDB after receiving τ add , so that
Figure BDA0003653858870000079
and
Figure BDA00036538588700000710

数据添加步骤100中的关键在于步骤102中如何生成数据添加陷门τadd中的各个密文以及其存放位置。The key in the data adding step 100 is how to generate each ciphertext in the data adding trapdoor τ add and its storage location in step 102 .

步骤102中生成e1和e2的步骤具体包括:The steps of generating e 1 and e 2 in step 102 specifically include:

步骤A1:对于w和p,使用msk通过HMAC算法H进行加密,生成分段p的正向链根密钥Kw,p和反向链根密钥K′w,p,即(Kw,p,K′w,p)←H(msk,w||p)。Step A1: For w and p, use msk to encrypt through HMAC algorithm H, and generate the forward chain root key Kw,p and reverse chain root key K′w,p of segment p, namely ( Kw, p ,K′w ,p )←H(msk,w||p).

步骤A2:生成(w,f)对应的文件标识符密钥

Figure BDA0003653858870000085
Step A2: Generate the file identifier key corresponding to (w, f)
Figure BDA0003653858870000085

为了生成文件标识符密钥,对于分段p和(w,f),均有若干组正向链和反向链,其数量由系统参数d来决定,即每个分段中能被删除的关键词-文件标识符对最大个数。In order to generate the file identifier key, for segments p and (w, f), there are several groups of forward chains and reverse chains, the number of which is determined by the system parameter d, that is, the number of segments that can be deleted in each segment The maximum number of keyword-file identifier pairs.

公式1中bk为(w,f)的第k个双链密钥,k∈[1,d],

Figure BDA0003653858870000082
表示异或运算,skw,f由d个bk连续异或运算后得到,所以需要获得d个bk的值,bk的具体计算方法为:In formula 1, b k is the k-th double-chain key of (w, f), k∈[1,d],
Figure BDA0003653858870000082
Indicates the XOR operation, sk w, f are obtained after d consecutive XOR operations of b k , so it is necessary to obtain d values of b k , and the specific calculation method of b k is:

bk=2Kw,p,k,i-K′w,p,k,i (公式2);b k = 2K w,p,k,i -K′w ,p,k,i (Equation 2);

Kw,p,k,i=X(dw,p,k,i),K′w,p,k,i=X(d′w,p,k,t+1-i) (公式3); Kw,p,k,i =X( dw,p,k ,i), K'w,p,k,i =X(d' w,p,k ,t+1-i) (Equation 3 );

dw,p,k←H(Kw,p,k),d′w,p,k←H(K′w,p,k) (公式4); dw,p,k ←H( Kw,p ,k), d′ w,p,k ←H( K′w,p,k ) (Equation 4);

其中,Kw,p,k,i为(w,f)的第k个正向链密钥,K′w,p,k,i为(w,f)的第k个反向链密钥,dw,p,k为分段p的第k个正向链密钥,d′w,p,k为分段p的第k个反向链密钥。Among them, K w,p,k,i is the kth forward chain key of (w,f) , K′w,p,k,i is the kth reverse chain key of (w,f) , d w,p,k is the kth forward chain key of segment p, d′ w,p,k is the kth reverse chain key of segment p.

X为密钥循环生成算法,第一输入为种子密钥keyseed,第二输入为迭代次数n,输出对keyseed迭代执行n次哈希函数后的数值。X is the key cycle generation algorithm, the first input is the seed key key seed , the second input is the number of iterations n, and the output is the value after performing n iterations of the hash function on the key seed .

在一些实施例中,该算法的伪代码如下所示:In some embodiments, the pseudocode for the algorithm is as follows:

Figure BDA0003653858870000083
Figure BDA0003653858870000083

根据密钥循环生成算法和公式3可知:According to the key cycle generation algorithm and formula 3, it can be known that:

Kw,p,k,i+1=X(Kw,p,k,i,1),K′w,p,k,i-1=X(K′w,p,k,i,1) (公式5); Kw,p,k,i+1 =X( Kw,p,k,i ,1), K′w,p,k,i-1 =X( K′w,p,k,i ,1 ) (Formula 5);

因此,将(w,f)的第k个正向链密钥再执行一次X算法可以获得正向下一个次序位置的第k个正向链密钥,将(w,f)的第k个反向链密钥执行一次X算法可以获得反向下一个次序位置的第k个反向链密钥。Therefore, the k-th forward chain key of (w, f) is executed again by X algorithm to obtain the k-th forward chain key of the next order position in the forward direction, and the k-th forward chain key of (w, f) The reverse chain key executes the X algorithm once to obtain the k-th reverse chain key in the next order position in the reverse direction.

步骤A3:使用skw,f加密文件标识符f生成第一查询密文

Figure BDA0003653858870000084
根据一元一次函数Fk(x)=(K′w,p,k,i-Kw,p,k,i)x+bk生成第二查询密文
Figure BDA0003653858870000091
Step A3: Use sk w, f to encrypt the file identifier f to generate the first query ciphertext
Figure BDA0003653858870000084
Generate the second query ciphertext according to the unary linear function F k (x)=(K′ w,p,k,i -K w,p,k,i )x+b k
Figure BDA0003653858870000091

所属领域技术人员可以理解,如果要根据密文e1解密出明文f,则需要获得skw,f,即需要计算出每一个bk的值,k∈[1,d]。Those skilled in the art can understand that if the plaintext f is to be decrypted according to the ciphertext e 1 , sk w,f needs to be obtained, that is, the value of each b k needs to be calculated, k∈[1,d].

一方面,从公式3和公式4可以得知,如果获得分段p的正向链根密钥Kw,p和反向链根密钥K′w,p,以及i,即可计算出每一个bk,从而获得分段p上位置i的明文f。On the one hand, it can be known from Equation 3 and Equation 4 that if the forward chain root key Kw,p and reverse chain root key K′w,p and i of segment p are obtained, each a b k , thereby obtaining the plaintext f at position i on segment p.

另一方面,根据公式2可以得知,一元一次函数Fk(x)本质上是根据平面上两个坐标点(1,Kw,p,k,i)和(2,K′w,p,k,i)确定的,bk是Fk(x)的截距,e2存储了该函数的另一个点(3,Fk(3));因此,如果对应于每一个Fk(x),都可以获得(w,f)的正向链密钥Kw,p,k,i和反向链密钥K′w,p,k,i中的任一个,则可以根据(1,Kw,p,k,i)与(3,Fk(3))两个点,或者根据(2,K′w,p,k,i)与(3,Fk(3))两个点,通过拉格朗日插值法计算出每一个Fk(x)的截距bk,从而获得分段p上位置i的明文f。On the other hand, according to formula 2, it can be known that the unary linear function F k (x) is essentially based on two coordinate points on the plane (1,K w,p,k,i ) and (2, K′w,p ,k,i ), b k is the intercept of F k (x), and e 2 stores another point of the function (3,F k (3)); therefore, if for each F k ( x), any one of the forward chain key K w, p, k, i and the reverse chain key K′ w, p, k, i of (w, f) can be obtained, then according to (1 ,K w,p,k,i ) and (3,F k (3)) two points, or according to (2, K′w,p,k,i ) and (3,F k (3)) two points For each point, the intercept b k of each F k (x) is calculated by the Lagrangian interpolation method, so as to obtain the plaintext f of the position i on the segment p.

步骤102中生成

Figure BDA0003653858870000092
Figure BDA0003653858870000093
的步骤具体包括:Generated in step 102
Figure BDA0003653858870000092
and
Figure BDA0003653858870000093
The steps specifically include:

步骤B1:使用msk通过伪随机函数F对w进行加密,生成位置计算密钥PKw←F(msk,w);Step B1: use msk to encrypt w through a pseudo-random function F, and generate a position calculation key PK w ←F(msk, w);

步骤B2:使用PKw对(w,f)的位置信息进行加密,生成

Figure BDA0003653858870000094
Figure BDA0003653858870000095
Step B2: Use PK w to encrypt the location information of (w, f) to generate
Figure BDA0003653858870000094
Figure BDA0003653858870000095

通过以上加密可以对服务端隐藏(w,f)在DB中的位置信息,(w,f)的密文信息即可存储在EDB中加密后的位置上。Through the above encryption, the location information of (w, f) in the DB can be hidden from the server, and the ciphertext information of (w, f) can be stored in the encrypted location in the EDB.

步骤102中生成e3的步骤具体包括:The step of generating e3 in step 102 specifically includes:

步骤C1:使用ke通过对称加密算法的加密过程SE.Enc对p和i进行加密,生成删除密文e3←SE.Enc(ke,p||i)。Step C1: use k e to encrypt p and i through the encryption process SE.Enc of the symmetric encryption algorithm, and generate the deleted ciphertext e 3 ←SE.Enc( ke ,p||i).

其中,称加密算法包括DES算法、3DES算法等多种算法,在一些实施例中,称加密算法使用AES算法。Among them, the encryption algorithm includes DES algorithm, 3DES algorithm and other algorithms, and in some embodiments, the encryption algorithm uses the AES algorithm.

在数据删除步骤200中,对于待操作的关键词-文件标识符对(w,f),即(w,f)在EDB中对应的密文信息需要被删除,包括以下步骤:In the data deletion step 200, for the keyword-file identifier pair (w, f) to be operated, that is, the ciphertext information corresponding to (w, f) in the EDB needs to be deleted, including the following steps:

步骤201:客户端对(w,f)加密并生成数据删除陷门τdel←H(PKw,w||f),将τdel发送给服务端。Step 201: The client encrypts (w, f) and generates a data deletion trapdoor τ del ←H(PK w ,w||f), and sends τ del to the server.

步骤202:服务端接收τdel后,获取TDdel]的信息,即(w,f)对应的删除密文e3,发送e3给客户端。Step 202: After receiving τ del , the server obtains the information of TDdel ], that is, the deleted ciphertext e 3 corresponding to (w, f), and sends e 3 to the client.

从步骤201和步骤B2可知,τdel

Figure BDA0003653858870000096
的生成方式是一致的,内容均为H(PKw,w||f),因此TDdel]即为
Figure BDA0003653858870000101
可获得(w,f)对应的删除密文e3。It can be known from step 201 and step B2 that τ del and
Figure BDA0003653858870000096
The generation method is consistent, and the content is H(PK w ,w||f), so T Ddel ] is
Figure BDA0003653858870000101
The deleted ciphertext e 3 corresponding to (w, f) can be obtained.

步骤203:客户端接收e3后,使用ke通过对称加密算法的解密过程SE.Dec对e3进行解密,生成(w,f)在DB(w)中所属的分段和分段中的次序(p,i)←SE.Dec(ke,e3),将(p,i)记录到本地表格Tc(w);Step 203: After receiving e 3 , the client uses ke to decrypt e 3 through the decryption process SE.Dec of the symmetric encryption algorithm, and generates the segment to which (w, f) belongs in DB(w) and the segment in the segment. Order (p,i)←SE.Dec( ke ,e 3 ), record (p,i) to the local table T c (w);

由于e3是通过对称加密算法加密的,客户端获得e3后,根据客户端对应的ke即可解密获得(w,f)的位置信息(p,i),将其记录到本地表格Tc(w),则是在本地标记该位置的(w,f)已经执行过数据删除步骤200,在EDB中的密文信息应当被删除。Since e 3 is encrypted by a symmetric encryption algorithm, after the client obtains e 3 , it can decrypt the position information (p, i) of (w, f) according to the corresponding ke of the client, and record it in the local table Tc (w), the data deletion step 200 has been performed by (w, f) that marked the location locally, and the ciphertext information in the EDB should be deleted.

所属领域技术人员可以理解,由于不同云平台等服务端数据管理机制的不同,即使客户端发送了删除命令给服务端,服务端不一定实质上清除了对应数据。Those skilled in the art can understand that, due to different data management mechanisms of servers such as different cloud platforms, even if the client sends a delete command to the server, the server may not substantially clear the corresponding data.

在一些实施例中,服务端发送e3给客户端后,EDB中(w,f)对应的e1、e2、e3中的一个或多个未被清除。例如服务端只是标记了e1、e2、e3中某个数据处于“已删除”状态。In some embodiments, after the server sends e 3 to the client, one or more of e 1 , e 2 , and e 3 corresponding to (w, f) in the EDB are not cleared. For example, the server just marks some data in e 1 , e 2 , and e 3 as being in the "deleted" state.

那么在这之后进行查询时,本应已经删除的数据e1、e2、e3可能再次被服务端获取到,服务端可能因此获得该数据的明文,从而产生后向安全风险,这通常是数据所有者不希望看到的。Then, when querying after this, the data e 1 , e 2 , and e 3 that should have been deleted may be obtained by the server again, and the server may obtain the plaintext of the data, thus resulting in a backward security risk, which is usually Data owners don't want to see.

本发明通过在本地记录删除信息,用以在数据查询步骤300中基于本发明的双链密钥结构生成包含删除信息的数据查询陷门,从而有办法可以规避后向安全风险,使服务端执行查询步骤时既能查询到所有未删除数据密文对应的明文,同时还无法获取处于“已删除”状态数据密文(无论服务端是否已经清除了该数据密文)的明文信息。By recording deletion information locally, the present invention is used to generate a data query trapdoor including deletion information based on the double-chain key structure of the present invention in the data query step 300, so that there is a way to avoid backward security risks and enable the server to execute During the query step, the plaintext corresponding to all undeleted data ciphertexts can be queried, and the plaintext information of the data ciphertexts in the "deleted" state (regardless of whether the data ciphertexts have been cleared by the server) cannot be obtained.

在数据查询步骤300中,客户端需返回EDB中关键词w对应的所有文件标识符f的明文信息,通常是为了取回存储在服务端的含有关键词w的文件。对应于待操作的关键词w,包括以下步骤:In the data query step 300, the client needs to return the plaintext information of all file identifiers f corresponding to the keyword w in the EDB, usually in order to retrieve the files containing the keyword w stored in the server. Corresponding to the keyword w to be operated, including the following steps:

步骤301:客户端根据Tc(w)中的信息,得到cnt、S、以及历史删除信息,根据是否执行过删除将DB(w)分为分段集合R与Q。Step 301: The client obtains cnt, S, and historical deletion information according to the information in Tc(w), and divides DB(w) into segment sets R and Q according to whether deletion has been performed.

其中,Tc(w)中的cnt、S在每次执行数据添加步骤100均会更新,历史删除信息包括每一次数据删除步骤200执行后记录在Tc(w)的信息,即删除的关键词-文件标识符对所属的分段和分段中的次序。Wherein, cnt and S in Tc(w) will be updated every time the data addition step 100 is executed, and the historical deletion information includes the information recorded in Tc(w) after the execution of each data deletion step 200, that is, the deleted keyword- The segment to which the file identifier pair belongs and the order within the segment.

根据以上信息可以确定在DB(w)中执行过数据删除步骤的分段集合R,DB(w)中未执行过数据删除步骤的分段集合Q,以及集合R中每个分段执行数据删除步骤200的次数。According to the above information, it can be determined that the segment set R in DB(w) that has performed the data deletion step, the segment set Q that has not performed the data deletion step in DB(w), and each segment in the set R performs data deletion Step 200 times.

步骤302:客户端生成数据查询陷门τsrh←(cnt,PKw12),将τsrh发送给服务端。Step 302: The client generates a data query trapdoor τ srh ←(cnt, PK w , τ 1 , τ 2 ), and sends τ srh to the server.

其中,第一查询信息τ1←(Kw,q,K′w,q)q∈Q,Kw,q为集合Q中分段q的正向链根密钥,K′w,q为集合Q中分段q的反向链根密钥;Among them, the first query information τ 1 ←(K w,q ,K′ w,q ) q∈Q , K w,q is the forward chain root key of the segment q in the set Q, and K′ w,q is the reverse chain root key of segment q in set Q;

第二查询信息τ2←((Kw,r,h,j+1,K′w,r,h,j-1)h∈[1,z],(dw,r,g,d′w,r,g)g∈[z+1,d])r∈R,z是集合R中分段r上执行了数据删除步骤的次数,z≤d,分段r上第j位置的关键词-文件标识符对(w,fr,j)是在分段r上第h次执行的数据删除步骤的对象,Kw,r,h,j+1为分段r上第j+1位置关键词-文件标识符对(w,fr,j+1)的第h个正向链密钥,K′w,r,h,j-1为第j-1位置关键词-文件标识符对(w,fr,j-1)的第h个反向链密钥,dw,r,g为分段r的第g个正向链密钥,d′w,r,g为分段r的第h个反向链密钥;The second query information τ 2 ←((K w,r,h,j+1 ,K′ w,r,h,j-1 ) h∈[1,z] ,(d w,r,g ,d′ w,r,g ) g∈[z+1,d] ) r∈R , z is the number of data deletion steps performed on segment r in the set R, z≤d, the key to the jth position on segment r The word-file identifier pair (w, fr,j ) is the object of the hth data deletion step performed on segment r, and Kw,r,h,j+1 is the j+1th step on segment r The position key-file identifier pair (w,f r,j+1 ) is the h-th forward chain key, and K′w,r,h,j-1 is the j-1th position key-file identifier The h-th reverse chain key of the symbol pair (w,f r,j-1 ), d w,r,g is the g-th forward chain key of segment r, d′ w,r,g is the h-th reverse chain key of segment r;

步骤303:服务端接收τsrh后,根据τsrh获得w对应的未执行过数据删除步骤的文件标识符明文,根据τsrh无法获得w对应的执行过数据删除步骤的文件标识符明文。Step 303: After receiving τ srh , the server obtains the plaintext of the file identifier corresponding to w without performing the data deletion step according to τ srh , and cannot obtain the plaintext of the file identifier corresponding to w with the data deletion step performed according to τ srh.

由于后向安全的要求,数据查询陷门τsrh不能使客户端获得将已执行过数据删除步骤的密文信息解密出来的能力,即不能让客户端获得该类密文信息的文件标识符密钥。对应到步骤302中,分段r上第h次执行的数据删除步骤的对象是(w,fr,j),因此,数据查询陷门τsrh不能包含用以解密f,j的完整信息。Due to the requirement of backward security, the data query trapdoor τ srh cannot enable the client to obtain the ability to decrypt the ciphertext information that has been subjected to the data deletion step, that is, it cannot allow the client to obtain the file identifier password of this type of ciphertext information. key. Corresponding to step 302, the object of the h-th data deletion step performed on segment r is (w,f r,j ). Therefore, the data query trapdoor τ srh cannot contain complete information for decrypting f ,j .

显然,从τ1的内容可知,τ1是用于集合Q中各个分段的解密信息,无法用于集合R中的分段r,所以服务端无法根据τ1恢复fr,jObviously, it can be known from the content of τ 1 that τ 1 is the decryption information used for each segment in the set Q, and cannot be used for the segment r in the set R, so the server cannot restore fr,j according to τ 1 .

并且,从τ2的内容可知,服务端无法τ2的信息解密恢复fr,jMoreover, it can be known from the content of τ 2 that the server cannot decrypt the information of τ 2 to restore fr,j .

具体而言,通过前文中对步骤A3的阐述中可知,如果要恢复fr,j,必须获得(w,fr,j)的每一个bk的值,k∈[1,d]。而计算bk的值最低要求是要获得第k个正向链密钥Kw,r,k,j或者第k个反向链密钥K′w,r,k,jSpecifically, it can be known from the foregoing description of step A3 that if fr,j is to be restored, the value of each b k of (w,f r,j ) must be obtained, k∈[1,d]. The minimum requirement for calculating the value of b k is to obtain the k-th forward chain key K w,r,k,j or the k-th reverse chain key K′w,r,k,j .

一方面,τ2中给出了分段r的第g个(dw,r,g,d′w,r,g),g∈[z+1,d],由公式3可知,据此只能计算获得(w,fr,j)的第g个正向链密钥Kw,r,g,j或者第g个反向链密钥K′w,r,g,j,从而获得(w,fr,j)的bg,但是无法计算出(w,fr,j)的第h个正向链密钥Kw,r,h,j和第h个反向链密钥K′w,r,h,j,h∈[1,z],从而无法获得(w,f,j)的bhOn the one hand, the gth (dw ,r,g ,d′ w,r,g ) of segment r is given in τ 2 , g∈[z+1,d], it can be known from Equation 3, according to Only the g-th forward chain key K w,r,g,j or the g-th reverse chain key K′w,r,g,j of (w,f r,j ) can be obtained by calculating (w,f r,j ) b g , but cannot calculate the h-th forward chain key K w,r,h,j and the h-th reverse chain key of (w,f r,j ) K′ w,r,h,j , h∈[1,z], so the b h of (w,f ,j ) cannot be obtained.

另一方面,τ2中给出了(w,fr,j+1)的第h个正向链密钥Kw,r,h,j+1和(w,fr,j-1)第h个反向链密钥K′w,r,h,j-1,根据公式5仅可以获得(w,fr,j+1)正向往后的各个关键词-文件标识符对(w,fr,j+2)、……、(w,fr,d)的第h个正向链密钥,以及(w,fr,j-1)反向往后的各个关键词-文件标识符对(w,fr,j-2)、……、(w,fr,1)的第h个反向链密钥,从而也无法计算出(w,fr,j)的第h个正向链密钥Kw,r,h,j和第h个反向链密钥K′w,r,h,j,从而无法获得(w,fr,j)的bhOn the other hand, the h-th forward chain key K w,r,h,j+1 and (w,f r,j-1 ) of (w,f r,j+1 ) are given in τ 2 The h-th reverse chain key K′ w,r,h,j-1 , according to formula 5, only each keyword-file identifier pair (w,f r,j+1 ) forward and backward can be obtained (w,f r,j+1 ) ,f r,j+2 ),...,(w,f r,d ) the h-th forward chain key, and (w,f r,j-1 ) reverse each keyword-file The h-th reverse chain key of the identifier pair (w,f r , j-2 ),...,(w,f r,1 ), so it is impossible to calculate the The h forward chain keys K w,r,h,j and the h-th reverse chain key K′w,r,h,j , so that b h of (w,f r,j ) cannot be obtained.

因此,在步骤303中,服务端根据τsrh仅能获得w对应的未执行过数据删除步骤的文件标识符明文,无法获得w对应的执行过数据删除步骤的文件标识符明文。Therefore, in step 303, according to τ srh , the server can only obtain the plaintext of the file identifier corresponding to w for which the data deletion step has not been performed, but cannot obtain the plaintext of the file identifier corresponding to w where the data deletion step has been performed.

步骤304:服务端将所获得的所有文件标识符明文作为查询结果返回给客户端。Step 304: The server returns all the obtained file identifiers in plaintext to the client as query results.

在一些实施例中,步骤303具体包括以下步骤:In some embodiments, step 303 specifically includes the following steps:

步骤3031:根据cnt和PKw获取TS中w对应的所有关键词-文件标识符对的第一查询密文和第二查询密文。Step 3031: Obtain the first query ciphertext and the second query ciphertext of all keyword-file identifier pairs corresponding to w in T S according to cnt and PK w .

具体而言,在步骤3031中,通过计算位置

Figure BDA0003653858870000121
c∈[1,cnt],即可获得所有关键词-文件标识符对的第一查询密文和第二查询密文
Figure BDA0003653858870000122
并且,每个关键词-文件标识符对所属的分段p可以通过计算获得
Figure BDA0003653858870000123
在分段p中的次序i可以通过计算获得i=c%p。Specifically, in step 3031, by calculating the position
Figure BDA0003653858870000121
c∈[1,cnt], the first query ciphertext and the second query ciphertext of all keyword-file identifier pairs can be obtained
Figure BDA0003653858870000122
And, the segment p to which each keyword-file identifier pair belongs can be obtained by calculation
Figure BDA0003653858870000123
The order i in the segment p can be obtained by calculation i=c%p.

步骤3032:根据τ1获得集合Q中的关键词-文件标识符对对应的文件标识符密钥,并解密对应的第一查询密文获得集合Q中的文件标识符明文。Step 3032: Obtain the file identifier key corresponding to the keyword-file identifier pair in the set Q according to τ 1 , and decrypt the corresponding first query ciphertext to obtain the file identifier plaintext in the set Q.

具体而言,在步骤3032中,对于DB(w)中未执行过数据删除步骤的分段q,q∈Q,服务端利用τ1中的Kw,q和K′w,q,根据公式3、公式4和公式5,计算出该分段上所有关键词-文件标识符对的正向链密钥和反向链密钥,并进一步根据公式2获得关键词-文件标识符对的每个双链密钥bk,k∈[1,d],然后根据公式1计算出该分段上所有关键词-文件标识符对的文件标识符密钥,用文件标识符密钥解密对应的第一查询密文,从而计算出该分段上的所有文件标识符明文。Specifically, in step 3032, for the segment q, q∈Q in DB(w) for which the data deletion step has not been performed, the server uses Kw,q and K′w , q in τ 1 , according to the formula 3. Formula 4 and Formula 5, calculate the forward chain key and reverse chain key of all keyword-file identifier pairs on the segment, and further obtain each keyword-file identifier pair according to formula 2. A double-chain key b k , k∈[1,d], then calculate the file identifier key of all keyword-file identifier pairs on the segment according to formula 1, and decrypt the corresponding file identifier key with the file identifier key. First query the ciphertext, thereby calculating the plaintext of all file identifiers on the segment.

可选的,计算双链密钥bk时,利用关键词-文件标识符对的正向链密钥和反向链密钥中的任一个,结合第二查询密文,通过拉格朗日插值法获得双链密钥bkOptionally, when calculating the double-chain key b k , use any one of the forward chain key and the reverse chain key of the keyword-file identifier pair, combined with the second query ciphertext, through Lagrangian The double-chain key b k is obtained by interpolation.

步骤3033:根据τ2获得集合R中未执行过数据删除步骤的关键词-文件标识符对对应的文件标识符密钥,并解密对应的第一查询密文获得集合Q中的文件标识符明文。Step 3033: Obtain the file identifier key corresponding to the keyword-file identifier pair in the set R for which the data deletion step has not been performed according to τ 2 , and decrypt the corresponding first query ciphertext to obtain the file identifier plaintext in the set Q .

具体而言,在步骤3033中,对于DB(w)中执行过数据删除步骤的分段r,r∈R,服务端利用τ2中分段r的第g个正向链密钥和反向链密钥(dw,r,g,d′w,r,g),g∈[z+1,d],根据公式3、公式4计算出该分段上所有关键词-文件标识符对的第g个正向链密钥和反向链密钥,并进一步根据公式2获得关键词-文件标识符对的第g个双链密钥bgSpecifically, in step 3033, for the segment r, r∈R in which the data deletion step has been performed in DB(w), the server uses the g-th forward chain key and reverse key of segment r in τ 2 Chain key (d w,r,g ,d′ w,r,g ), g∈[z+1,d], calculate all keyword-file identifier pairs on this segment according to formula 3 and formula 4 The g-th forward chain key and reverse-chain key of , and further obtain the g-th double-chain key b g of the keyword-file identifier pair according to formula 2.

可选的,计算双链密钥bg时,利用关键词-文件标识符对的第g个正向链密钥和反向链密钥中的任一个,结合第二查询密文,通过拉格朗日插值法获得双链密钥bg Optionally, when calculating the double-chain key b g , use any one of the g-th forward chain key and the reverse chain key of the keyword-file identifier pair, combined with the second query ciphertext, through pulling Grange interpolation method to obtain double-chain key b g

在分段r上,第h次执行的数据删除步骤的对象为(w,fr,j),服务端利用τ2中Kw,r,h,j+1和Kw,r,h,j-1,根据公式5获得(w,fr,j+1)正向往后的各个关键词-文件标识符对的第h个正向链密钥,以及(w,fr,j-1)反向往后的各个关键词-文件标识符对的第h个反向链密钥,并结合第二查询密文,通过拉格朗日插值法获得分段r上除(w,fr,j)以外各个关键词-文件标识符对的第h个双链密钥bhOn segment r, the object of the hth data deletion step is (w, f r,j ), and the server uses Kw ,r,h,j+1 and Kw,r,h, j-1 , according to formula 5, obtain the h-th forward chain key of each keyword-file identifier pair in the forward direction of (w,f r,j+1 ), and (w,f r,j-1 ) The h-th reverse chain key of each keyword-file identifier pair in the reverse direction is combined with the second query ciphertext to obtain the upper division of segment r by Lagrangian interpolation (w,f r, The h-th double-chain key b h of each keyword-file identifier pair other than j ).

对于分段r上所有未执行过数据删除步骤的关键词-文件标识符对,结合bg和bh,根据公式1可获得文件标识符密钥,用文件标识符密钥解密对应的第一查询密文,从而计算出该分段上的所有未执行过数据删除步骤的文件标识符明文。For all keyword-file identifier pairs on segment r that have not performed the data deletion step, combining b g and b h , the file identifier key can be obtained according to formula 1, and the corresponding first file identifier key is decrypted with the file identifier key. Query the ciphertext to calculate the plaintext of all file identifiers on this segment that have not performed the data deletion step.

在一些实施例中,客户端在生成τsrh后,清空TC[w]的内容。这样可以使TC[w]中的内容不会一直增加。清空TC[w]的依据是:根据访问模式,服务端一旦查询w的相关文件后,该关键词包含的文件信息其实已经暴露给了服务端。而至于查询后续再添加的文件,我们根据已有的前向安全技术是可以保证服务端是无法获得新添加数据的对应信息的。In some embodiments, the client clears the content of T C [w] after generating τ srh . This keeps the contents of T C [w] from increasing all the time. The basis for clearing T C [w] is: According to the access mode, once the server queries the relevant files of w, the file information contained in the keyword has actually been exposed to the server. As for querying the files added later, we can ensure that the server cannot obtain the corresponding information of the newly added data according to the existing forward security technology.

基于同一个发明构思,本发明提供一种动态可搜索加密方法的实施例,如图2所示。Based on the same inventive concept, the present invention provides an embodiment of a dynamically searchable encryption method, as shown in FIG. 2 .

客户端运行初始化算法生成系统所需的主私钥msk,对称加密密钥ke和系统参数params←(t,d);为了添加文件到服务端(以云服务器为例),执行数据添加步骤,客户端在本地形成数据添加陷门τadd并发送给云服务器,云服务器收到τadd后更新EDB;为了删除已经外包到云服务器的文件,执行数据删除步骤,客户端生成数据删除陷门τdel并发送给云服务器,云服务器收到后更新EDB并将对应的分段信息返回给客户端,客户端则根据返回结果在本地更新TC;为了查询含有关键词w的文件,执行数据查询步骤,客户端在本地生成数据查询陷门τsrh后发送给云服务器,云服务器收到τsrh后在EDB上查询到未被删除的文件,并将结果IND返回给客户端。The client runs the initialization algorithm to generate the master private key msk, symmetric encryption key ke and system parameters params←(t,d) required by the system; in order to add files to the server (take the cloud server as an example), perform the data addition steps , the client forms a data addition trapdoor τ add locally and sends it to the cloud server, and the cloud server updates the EDB after receiving τ add ; in order to delete the files that have been outsourced to the cloud server, perform the data deletion step, and the client generates a data deletion trapdoor τ del and send it to the cloud server, the cloud server updates the EDB after receiving it and returns the corresponding segment information to the client, and the client updates T C locally according to the returned result; in order to query the file containing the keyword w, execute the data In the query step, the client generates a data query trapdoor τ srh locally and sends it to the cloud server. After receiving the τ srh , the cloud server queries the EDB for files that have not been deleted, and returns the result IND to the client.

在本实施例中,如图3所示,客户端对本地数据集预处理后形成DB,其中DB(w1)中w1对应的文件为{f1,f2,f3,f4,f5,f6,f7,f8},客户端初始化生成主私钥msk,对称加密密钥ke,设置系统参数params←(t=4,d=2)。In this embodiment, as shown in FIG. 3 , the client preprocesses the local data set to form a DB, wherein the files corresponding to w 1 in DB(w 1 ) are {f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 }, the client initially generates the master private key msk, the symmetric encryption key ke , and sets the system parameters params←(t=4, d=2).

执行数据添加步骤,客户端生成τadd发送给云服务器。具体步骤如下:After the data addition step is performed, the client generates τ add and sends it to the cloud server. Specific steps are as follows:

(a)根据系统参数,客户端将DB(w1)分为两段,p1和p2,同时将w1所对应文件总数和分段数写入TC[w1]←(8,2)。如图3所示,p1段对应的文件为{f1,f2,f3,f4},p2段对应的文件为{f5,f6,f7,f8}。(a) According to the system parameters, the client divides DB(w 1 ) into two segments, p 1 and p 2 , and writes the total number of files and segments corresponding to w 1 into T C [w 1 ]←(8, 2). As shown in FIG. 3 , the files corresponding to segment p 1 are {f 1 , f 2 , f 3 , f 4 }, and the files corresponding to segment p 2 are {f 5 , f 6 , f 7 , f 8 }.

(b)客户端利用伪随机函数计算出位置计算密钥

Figure BDA0003653858870000131
利用HMAC算法生成不同分段的正向链根密钥和反向链根密钥,其中p1段对应的
Figure BDA0003653858870000132
Figure BDA0003653858870000133
p2段对应的
Figure BDA0003653858870000134
进一步计算不同分段的正向链密钥和反向链密钥,如图3所示,以p1段为例,由于d=2,p1段有2组正向链密钥和反向链密钥,第1组为
Figure BDA0003653858870000141
第2组为
Figure BDA0003653858870000142
(b) The client uses a pseudo-random function to calculate the location calculation key
Figure BDA0003653858870000131
Use HMAC algorithm to generate forward chain root key and reverse chain root key of different segments, where p 1 segment corresponds to
Figure BDA0003653858870000132
Figure BDA0003653858870000133
corresponding to segment p 2
Figure BDA0003653858870000134
Further calculate the forward chain key and reverse chain key of different segments, as shown in Figure 3, taking the p 1 segment as an example, since d=2, the p 1 segment has 2 sets of forward chain keys and reverse chain keys chain key, group 1 is
Figure BDA0003653858870000141
Group 2 is
Figure BDA0003653858870000142

(c)对于每个关键词-文件标识符对,客户端计算对应的文件标识符密钥来加密文件标识符。如图3所示,以(w1,f1)为例,其在p1段的正向排序为1,反向排序为4,由于d=2,(w1,f1)有2组正向链密钥和反向链密钥,其中第1组为

Figure BDA0003653858870000143
第2组为
Figure BDA0003653858870000144
进一步地,计算(w1,f1)对应的2个双链密钥b1和b2
Figure BDA0003653858870000145
然后计算(w1,f1)对应的文件标识符密钥
Figure BDA0003653858870000146
客户端生成
Figure BDA0003653858870000147
(c) For each keyword-file identifier pair, the client computes the corresponding file identifier key to encrypt the file identifier. As shown in Figure 3, taking (w 1 , f 1 ) as an example, the forward order of the p 1 segment is 1, and the reverse order is 4. Since d=2, there are 2 groups of (w 1 , f 1 ) Forward chain key and reverse chain key, where group 1 is
Figure BDA0003653858870000143
Group 2 is
Figure BDA0003653858870000144
Further, calculate the two double-chain keys b 1 and b 2 corresponding to (w 1 , f 1 ),
Figure BDA0003653858870000145
Then calculate the file identifier key corresponding to (w 1 , f 1 )
Figure BDA0003653858870000146
Client generated
Figure BDA0003653858870000147

(d)对应于(w1,f1),客户端根据

Figure BDA0003653858870000148
Figure BDA0003653858870000149
生成一元一次函数
Figure BDA00036538588700001410
根据
Figure BDA00036538588700001411
Figure BDA00036538588700001412
生成一元一次函数
Figure BDA00036538588700001413
进一步地,计算出
Figure BDA00036538588700001414
(d) corresponds to (w 1 , f 1 ), the client according to
Figure BDA0003653858870000148
and
Figure BDA0003653858870000149
Generate unary linear function
Figure BDA00036538588700001410
according to
Figure BDA00036538588700001411
and
Figure BDA00036538588700001412
Generate unary linear function
Figure BDA00036538588700001413
Further, calculate
Figure BDA00036538588700001414

(e)对应于(w1,f1),客户端计算

Figure BDA00036538588700001415
Figure BDA00036538588700001416
w1||f1),最后产生
Figure BDA00036538588700001417
作为(w1,f1)的τadd并发送给云服务器。(e) corresponds to (w 1 , f 1 ), the client computes
Figure BDA00036538588700001415
and
Figure BDA00036538588700001416
w 1 ||f 1 ), and finally produce
Figure BDA00036538588700001417
τ add as (w 1 , f 1 ) and sent to the cloud server.

云服务器收到后τadd,执行

Figure BDA00036538588700001418
Figure BDA00036538588700001419
After the cloud server receives τ add , execute
Figure BDA00036538588700001418
and
Figure BDA00036538588700001419

执行数据添加步骤,客户端生成τdel发送给云服务器,云服务器根据τdel访问EDB后将删除密文e3返回给客户端。具体步骤如下:Execute the data adding step, the client generates τ del and sends it to the cloud server, and the cloud server returns the deleted ciphertext e3 to the client after accessing the EDB according to τ del . Specific steps are as follows:

(f)以用户希望删除(w1,f1)对应的密文为例,在客户端计算

Figure BDA00036538588700001420
并发送给云服务器;(f) Take the user wish to delete the ciphertext corresponding to (w 1 , f 1 ) as an example, calculate on the client
Figure BDA00036538588700001420
and send it to the cloud server;

(g)云服务器收到τdel,从TDdel]中找到对应的密文

Figure BDA00036538588700001421
发送给客户端。(g) The cloud server receives τ del , and finds the corresponding ciphertext from TDdel ]
Figure BDA00036538588700001421
sent to the client.

(h)云服务器收到τdel,客户端收到

Figure BDA00036538588700001422
后执行
Figure BDA00036538588700001423
获得(w1,f1)位于分段p1的第1个位置,并将该信息存放到TC[w1]。(h) The cloud server receives τ del , and the client receives
Figure BDA00036538588700001422
post execution
Figure BDA00036538588700001423
Obtain (w 1 , f 1 ) at the first position of segment p 1 , and store this information in T C [w 1 ].

值得注意的是,从用户的希望上看,云服务器收到τdel后应当将删除(w1,f1)对应的所有密文,但是云服务器并不一定彻底清除密文数据。It is worth noting that, from the user's point of view, the cloud server should delete all ciphertexts corresponding to (w 1 , f 1 ) after receiving τ del , but the cloud server does not necessarily completely clear the ciphertext data.

执行数据查询步骤,客户端生成τsrh给云服务器,云服务器执行查询后将查询结果IND返回给客户端。Execute the data query step, the client generates τ srh to the cloud server, and the cloud server returns the query result IND to the client after executing the query.

(i)以客户端查询关键词w1为例。客户端首先根据本地TC[w1]获取到w1所对应的p1分段的第1个位置的文件f1在已经执行过数据删除步骤,且为p1分段上的第一次删除,同时获取w1所对应的的文件总数目cnt=8。(i) Take the client query keyword w 1 as an example. The client first obtains the file f 1 at the first position of the p 1 segment corresponding to w 1 according to the local T C [w 1 ]. The data deletion step has been performed, and it is the first time on the p 1 segment. Delete, and obtain the total number of files cnt=8 corresponding to w 1 at the same time.

(j)对于p1分段,客户端将生成

Figure BDA0003653858870000151
Figure BDA0003653858870000152
生成
Figure BDA0003653858870000153
Figure BDA0003653858870000154
对于p2分段,由于未执行过数据删除步骤,生成
Figure BDA0003653858870000155
Figure BDA0003653858870000156
生成
Figure BDA0003653858870000157
将τsrh发送给云服务器(j) For p 1 segment, the client will generate
Figure BDA0003653858870000151
and
Figure BDA0003653858870000152
generate
Figure BDA0003653858870000153
and
Figure BDA0003653858870000154
For the p 2 segment, since the data removal step has not been performed, the resulting
Figure BDA0003653858870000155
and
Figure BDA0003653858870000156
generate
Figure BDA0003653858870000157
Send τ srh to cloud server

(k)当云服务器收到τsrh,首先根据

Figure BDA00036538588700001520
c∈[1,8],找到w1对应的所有关键词-文件标识符对的第一查询密文
Figure BDA0003653858870000158
(k) When the cloud server receives τ srh , first according to
Figure BDA00036538588700001520
c∈[1,8], find the first query ciphertext of all keyword-file identifier pairs corresponding to w 1
Figure BDA0003653858870000158

需要注意的是,对于已经执行过数据删除步骤的(w1,f1),如果云服务器在之前(h)时并未清除(w1,f1)对应的查询密文,此时云服务器还仍然可以根据

Figure BDA0003653858870000159
找到密文
Figure BDA00036538588700001510
但是,由于云服务器根据
Figure BDA00036538588700001511
无法获得
Figure BDA00036538588700001512
Figure BDA00036538588700001513
任一个,从而无法利用拉格朗日插值法获得b1,进而无法获得
Figure BDA00036538588700001514
用以解密
Figure BDA00036538588700001515
所以即使云服务器保留了密文
Figure BDA00036538588700001516
查询结果IND也不会包括明文f1,从而保证了后向安全。It should be noted that for (w 1 , f 1 ) that has already performed the data deletion step, if the cloud server does not clear the query cipher text corresponding to (w 1 , f 1 ) in the previous (h), the cloud server will still according to
Figure BDA0003653858870000159
find ciphertext
Figure BDA00036538588700001510
However, since the cloud server
Figure BDA00036538588700001511
can not get
Figure BDA00036538588700001512
and
Figure BDA00036538588700001513
any one of the
Figure BDA00036538588700001514
to decrypt
Figure BDA00036538588700001515
So even if the cloud server keeps the ciphertext
Figure BDA00036538588700001516
The query result IND also does not include the plaintext f 1 , thus ensuring backward security.

对于

Figure BDA00036538588700001517
c∈[2,8],云服务器根据τsrh的内容获得
Figure BDA00036538588700001518
Figure BDA00036538588700001519
解密可获得fc,云服务器将查询结果IND={f2,f3,f4,f5,f6,f7,f8}返回给客户端。for
Figure BDA00036538588700001517
c∈[2,8], the cloud server obtains according to the content of τ srh
Figure BDA00036538588700001518
right
Figure BDA00036538588700001519
Decryption can obtain f c , and the cloud server returns the query result IND={f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 } to the client.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Other embodiments of the invention will readily suggest themselves to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or conventional techniques in the art not disclosed by this disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the invention being indicated by the following claims.

应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。It should be understood that the present invention is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from its scope. The scope of the present invention is limited only by the appended claims.

Claims (6)

1. A dynamic searchable encryption method, comprising: a data adding step, a data deleting step and a data inquiring step;
the client comprises a plaintext index table DB, a master private key msk and a symmetric encryption key k e Wherein, DB stores keyword-file identifier pairs, each keyword w in DB corresponds to one subdata set DB (w), the subdata set comprises all keyword-file identifier pairs corresponding to the keyword, the subdata set is divided into one or more sections, and system parameter t represents the keyword-text that each section can containThe maximum number of file identifier pairs, and the system parameter d represents the maximum number of keyword-file identifier pairs that can be deleted in each segment;
the server side comprises a ciphertext index table EDB (enhanced data base), and the EDB comprises a query ciphertext index table T S And deleting ciphertext index table T D Storing the ciphertext data generated by the data adding step;
the data adding step includes:
step 101: the client determines the order c of the keyword-file identifier pairs (w, f) to be operated in DB (w), (w, f) the segment p to which the keyword-file identifier pairs belong in DB (w), and the order i of the keyword-file identifier pairs (w, f) in segment p, and records the total number cnt and the total number S of the segments in DB (w) in a local table Tc (w)
Step 102: the client encrypts (w, f) and generates data adding trapdoors
Figure FDA0003653858860000011
Wherein e 1 First query ciphertext of (w, f), e 2 A second query ciphertext of (w, f),
Figure FDA0003653858860000012
is e 1 And e 2 At T S In the order of (b), e 3 The deleted ciphertext of (w, f),
Figure FDA0003653858860000013
is e 3 At T D In the order of (1), will be add Sending the data to the server;
step 103: the server receives tau add Post-update EDB to order
Figure FDA0003653858860000014
And
Figure FDA0003653858860000015
Figure FDA0003653858860000016
said step 102 generating e 1 And e 2 The method specifically comprises the following steps:
step A1: for w and p, encrypting by using msk through an HMAC algorithm H to generate a forward chain root key K of the segment p w,p And reverse chain root Key K' w,p ,(K w,p ,K′ w,p ) And ← H (msk, w | | | p), in which | | | is a string concatenation operation;
step A2: generating (w, f) corresponding file identifier keys
Figure FDA0003653858860000017
b k =2K w,p,k,i -K′ w,p,k,i ,K w,p,k,i =X(d w,p,k ,i),K′ w,p,k,i =X(d′ w,p,k ,t+1-i),d w,p,k ←H(K w,p ,k),d′ w,p,k ←H(K′ w,p K), where k ∈ [1, d ]],
Figure FDA0003653858860000018
Representing an exclusive OR operation, b k The kth double-stranded key of (w, f), K w,p,k,i K-th forward chain key of (w, f), K' w,p,k,i The k-th reverse-link key of (w, f), d w,p,k Kth forward chain key, d 'of segment p' w,p,k The kth reverse link key for segment p;
wherein, X is a key cycle generation algorithm, and the first input is a seed key seed The second input is iteration number n, and the key pair is output seed Iteratively executing the value after the hash function for n times;
step A3: using sk w,f Encrypting the file identifier f to generate a first query ciphertext
Figure FDA0003653858860000021
According to a unary linear function F k (x)=(K′ w,p,k,i -K w,p,k,i )x+b k Generating a second query ciphertext
Figure FDA0003653858860000022
Generated in the step 102
Figure FDA0003653858860000023
And
Figure FDA0003653858860000024
the method specifically comprises the following steps:
step B1: w is encrypted by a pseudorandom function F using msk to generate a location calculation key PK w ←F(msk,w);
And step B2: use of PK w Encrypting the position information of (w, f) to generate
Figure FDA0003653858860000025
Figure FDA0003653858860000026
Said step 102 generating e 3 The method specifically comprises the following steps:
step C1: using k e Enc encrypts p and i through an encryption process SE of a symmetric encryption algorithm to generate a deletion ciphertext e 3 ←SE.Enc(k e ,p||i);
The data deleting step comprises:
step 201: the client encrypts the key word-file identifier pair (w, f) to be operated and generates a data deletion trapdoor tau del ←H(PK w W | | f), will τ del Sending the data to the server;
step 202: the server receives tau del Then, T is obtained Ddel ]I.e. delete the ciphertext e 3 Sending out e 3 Giving the client side;
step 203: the client receives e 3 Then, use k e Decryption by symmetric encryption algorithmDec pair e 3 Decrypting to generate (w, f) the segment in DB (w) and the order (p, i) ← SE e ,e 3 ) Record (p, i) to the local table Tc (w);
the data query step comprises:
step 301: the client side determines a segment set R in DB (w) in which the data deletion step is executed, a segment set Q in DB (w) in which the data deletion step is not executed and the number of times each segment in the set R is executed by the data deletion step according to cnt in Tc (w), S in Tc (w) and the sequence of the segment and the segment of the keyword-file identifier pair in which the deletion step is executed;
step 302: the client generates a data query trapdoor tau corresponding to a keyword w to be operated srh ←(cnt,PK w ,τ 1 ,τ 2 ) Wherein the first query information τ 1 ←(K w,q ,K′ w,q ) q∈Q ,K w,q Is a forward-link root key, K ', of segment Q in set Q' w,q For reverse chain root key of segment Q in set Q, second query information tau 2 ←((K w,r,h,j+1 ,K′ w,r,h,j-1 ) h∈[1,z] ,(d w,r,g ,d′ w,r,g ) g∈[z+1,d] ) r∈R Z is the number of times the data deletion step has been performed on segment R in set R, z is less than or equal to d, and the keyword-file identifier pair (w, f) at the jth position on segment R r,j ) Is the object of performing said data deletion step h on the segment r, K w,r,h,j+1 For the j +1 th position keyword-file identifier pair (w, f) on the segment r r,j+1 ) Of the h forward link key, K' w,r,h,j-1 For the j-1 th position keyword-file identifier pair (w, f) r,j-1 ) H reverse link key of d w,r,g Is the g forward chain key of segment r, d' w,r,g The g-th reverse-link key for segment r; the client sends tau srh Sending the data to the server;
step 303: the server sideReception of srh Then according to τ srh Obtaining the plaintext of the file identifier corresponding to the file w without the data deletion step, and according to the tau srh The plaintext of the file identifier corresponding to w and subjected to the data deletion step cannot be obtained;
step 304: and the server returns all the obtained file identifier cleartexts to the client as query results.
2. The dynamic searchable encryption method according to claim 1, wherein said data deletion step further comprises:
the server sends e 3 After the client is given, corresponding e of (w, f) in EDB 1 、e 2 、e 3 One or more of which are not cleared.
3. The dynamic searchable encryption method according to claim 1, wherein said step 302 further comprises:
the client generates τ srh Then, empty T C [w]The content of (1).
4. The dynamic searchable encryption method according to claim 1, wherein said step 303 comprises:
step 3031: according to cnt and PK w Obtaining T S First query ciphertext and second query ciphertext of all keyword-file identifier pairs corresponding to the medium w;
step 3032: according to τ 1 Obtaining a key word-file identifier pair corresponding to the file identifier key in the set Q, and decrypting the corresponding first query ciphertext to obtain a file identifier plaintext in the set Q;
step 3033: according to τ 2 And obtaining a file identifier key corresponding to the keyword-file identifier pair which does not execute the data deleting step in the set R, and decrypting the corresponding first query ciphertext to obtain the file identifier plaintext in the set Q.
5. A computer device, comprising:
a memory to store instructions; and
a processor to invoke the memory-stored instructions to perform the dynamic searchable encryption method of any of claims 1-5.
6. A computer-readable storage medium having stored thereon instructions that, when executed by a processor, perform the dynamic searchable encryption method of any one of claims 1-5.
CN202210549179.0A 2022-05-20 2022-05-20 A dynamic searchable encryption method Active CN115225260B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210549179.0A CN115225260B (en) 2022-05-20 2022-05-20 A dynamic searchable encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210549179.0A CN115225260B (en) 2022-05-20 2022-05-20 A dynamic searchable encryption method

Publications (2)

Publication Number Publication Date
CN115225260A true CN115225260A (en) 2022-10-21
CN115225260B CN115225260B (en) 2024-04-12

Family

ID=83608229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210549179.0A Active CN115225260B (en) 2022-05-20 2022-05-20 A dynamic searchable encryption method

Country Status (1)

Country Link
CN (1) CN115225260B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115913725A (en) * 2022-11-21 2023-04-04 长沙学院 Forward secure dynamic searchable encryption method and system based on XOR encryption chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105681280A (en) * 2015-12-29 2016-06-15 西安电子科技大学 Searchable encryption method based on Chinese in cloud environment
CN108319670A (en) * 2018-01-23 2018-07-24 湖南大学 The dynamic ranking searching method that can verify that based on cloud computing
CN110166466A (en) * 2019-05-28 2019-08-23 湖南大学 It is a kind of efficiently the multi-user of renewal authority to can search for encryption method and system
CN110457915A (en) * 2019-07-17 2019-11-15 华中科技大学 Efficient searchable symmetric encryption method and system with forward and backward security
CN112734572A (en) * 2021-01-07 2021-04-30 华南农业大学 Fine-grained access control method and system based on double block chains

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105681280A (en) * 2015-12-29 2016-06-15 西安电子科技大学 Searchable encryption method based on Chinese in cloud environment
CN108319670A (en) * 2018-01-23 2018-07-24 湖南大学 The dynamic ranking searching method that can verify that based on cloud computing
CN110166466A (en) * 2019-05-28 2019-08-23 湖南大学 It is a kind of efficiently the multi-user of renewal authority to can search for encryption method and system
CN110457915A (en) * 2019-07-17 2019-11-15 华中科技大学 Efficient searchable symmetric encryption method and system with forward and backward security
CN112734572A (en) * 2021-01-07 2021-04-30 华南农业大学 Fine-grained access control method and system based on double block chains

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
LEILEI DU ET AL.: "Dynamic multi-client searchable symmetric encryption with support for boolean queries", INFORMATION SCIENCES, 31 January 2020 (2020-01-31) *
QIN LIU ET AL.: "Enabling verfiable and dynamic rankedseearch over outsourced data", TSC, 11 June 2019 (2019-06-11) *
YU PENG ET AL.: "Dynamic searchable symmetric encryption with forward and backward privacy", TRUSTCOM, 31 March 2022 (2022-03-31) *
张恩;侯缨盈;李功丽;李会敏;李钰;: "基于错误学习的自适应等级可搜索加密方案", 计算机应用, no. 01, 27 September 2019 (2019-09-27) *
朱小玉;刘琴;王国军;: "云存储中一种支持可验证的模糊查询加密方案", 电子与信息学报, no. 07, 13 April 2017 (2017-04-13) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115913725A (en) * 2022-11-21 2023-04-04 长沙学院 Forward secure dynamic searchable encryption method and system based on XOR encryption chain

Also Published As

Publication number Publication date
CN115225260B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
CN112270006B (en) Searchable encryption method for hiding search patterns and access patterns in e-commerce platforms
CN106815350B (en) Dynamic ciphertext multi-keyword fuzzy search method in cloud environment
CN110457915B (en) Efficient and searchable symmetric encryption method and system with forward and backward security
CN112800445A (en) Boolean query method for forward and backward security and verifiability of ciphertext data
CN105610793A (en) Outsourced data encrypted storage and cryptograph query system and application method therefor
CN102314580A (en) Vector and matrix operation-based calculation-supported encryption method
CN109213731B (en) Multi-Keyword Ciphertext Retrieval Method Based on Iterative Encryption in Cloud Environment
CN116418513B (en) Dynamically searchable encryption methods, decryption methods, encryption devices, and decryption devices
CN116522019B (en) A forward-secure spatiotemporal data retrieval method, system, device, and medium
CN119918088A (en) Homomorphic keyword privacy information retrieval method and system based on polynomial links
CN106874516A (en) Efficient cipher text retrieval method based on KCB trees and Bloom filter in a kind of cloud storage
CN104821876B (en) A kind of dynamic for supporting that physics is deleted can search for symmetric encryption method
CN118509262A (en) Lightweight forward and backward secure public key authentication encryption keyword search method and system
CN105007258B (en) A kind of quick keyword can search for public key encryption method
CN107454059B (en) A search encryption method based on sequence cipher in cloud storage environment
CN114490773A (en) Data query method based on cloud platform and cloud data management system
CN107766739B (en) Phrase retrieval method and device for encrypted text data
CN114253943B (en) A method, device, medium and equipment for constructing an encrypted database
CN115225260B (en) A dynamic searchable encryption method
CN114021163B (en) Dynamic symmetric searchable encryption method and system for hiding addition and deletion associations
CN113434739B (en) A forward-secure multi-user dynamic symmetric encryption retrieval method in cloud environment
CN119675860B (en) A multi-user revocable and searchable encryption method based on blockchain
CN114896620A (en) Quantum encryption-based database indexing method, equipment and storage medium
CN106874379B (en) Ciphertext cloud storage-oriented multi-dimensional interval retrieval method and system
CN109165226B (en) A Searchable Encryption Method for Large Datasets of Ciphertext

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant