CN114710357A - Dynamic searchable encryption method supporting block verification in editable block chain - Google Patents
Dynamic searchable encryption method supporting block verification in editable block chain Download PDFInfo
- Publication number
- CN114710357A CN114710357A CN202210378780.8A CN202210378780A CN114710357A CN 114710357 A CN114710357 A CN 114710357A CN 202210378780 A CN202210378780 A CN 202210378780A CN 114710357 A CN114710357 A CN 114710357A
- Authority
- CN
- China
- Prior art keywords
- verification
- editable
- data
- search
- data owner
- 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
Links
- 238000012795 verification Methods 0.000 title claims abstract description 110
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000005516 engineering process Methods 0.000 claims abstract description 11
- 238000013475 authorization Methods 0.000 claims description 10
- 239000013256 coordination polymer Substances 0.000 claims description 6
- 125000004122 cyclic group Chemical group 0.000 claims description 3
- 239000002699 waste material Substances 0.000 abstract description 5
- 230000010354 integration Effects 0.000 abstract 1
- 230000008569 process Effects 0.000 description 9
- 241000122205 Chamaeleonidae Species 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000010845 search algorithm Methods 0.000 description 3
- 238000010200 validation analysis Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000003064 k means clustering Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0442—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0435—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0869—Network architectures or network communication protocols for network security for authentication of entities for achieving mutual authentication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
Abstract
本发明提供了一种可编辑区块链中支持分块验证的动态可搜索加密方法。采用端‑云与可编辑区块链结合的新方法来替换以前端‑云式的数据检索及验证方法。分块索引结构具有很好的检索性能,数据所有者将分块后的验证标签传到可编辑区块链,结果验证功能由可编辑区块链实现。其次,根据分块索引生成的结果验证列表为后续的结果验证减少了计算开销。此外,可编辑区块链技术在保证搜索服务的公平性和安全性的前提下,实现数据的可重写存储,避免区块这一宝贵资源的浪费。本发明可以实现区块链的可编辑性和安全可信性的有机融合。在客户端或者云服务器进行恶意行为时,依然可以确保查询服务的公平性和安全性。
The present invention provides a dynamic searchable encryption method supporting block verification in an editable block chain. The front-end-cloud-style data retrieval and verification method is replaced by a new method combining end-cloud and editable blockchain. The block index structure has good retrieval performance. The data owner transmits the block verification label to the editable blockchain, and the result verification function is implemented by the editable blockchain. Second, the result verification list generated according to the block index reduces the computational overhead for subsequent result verification. In addition, the editable blockchain technology realizes the rewritable storage of data under the premise of ensuring the fairness and security of the search service, avoiding the waste of the precious resource of the block. The present invention can realize the organic integration of the editability and security reliability of the blockchain. When the client or cloud server performs malicious behavior, the fairness and security of the query service can still be ensured.
Description
技术领域technical field
本发明涉及信息安全技术领域,具体地说是一种可编辑区块链中支持分块验证的动态可搜索加密方法。The invention relates to the technical field of information security, in particular to a dynamic searchable encryption method supporting block verification in an editable block chain.
背景技术Background technique
可搜索加密(SE,Searchable Encryption)是近年来发展的一种支持用户在密文上进行关键字查找的密码学原语,它能够为用户节省大量的计算和通信开销,并充分利用庞大的计算资源进行密文上的关键字查找。然而在实践中,云服务器和用户并非都是诚实可信的实体。云服务器可能仅返回部分结果以节省计算资源。用户可能为了拒绝支付费用,谎称云服务器的返回结果是错误的。因此存在可靠性问题。Searchable Encryption (SE, Searchable Encryption) is a cryptographic primitive developed in recent years that supports users to search for keywords in ciphertext. It can save users a lot of computing and communication overhead and make full use of huge computing The resource performs a keyword lookup on the ciphertext. In practice, however, cloud servers and users are not all honest and trustworthy entities. Cloud servers may only return partial results to save computing resources. The user may lie about the return result of the cloud server is wrong in order to refuse to pay the fee. So there is a reliability problem.
为了解决恶意服务器返回给用户错误结果的问题,基于PPTrie树状索引的结果可验证的密文检索方案被提出。随后,将比特币引入多方计算来解决公平问题,方案中的协议可以看作是一个智能合约。为了实现验证的公开化,利用伪随机函数和单向函数来完成。将Merkle Hash Tree与k均值聚类相结合,在提升验证效率的同时也提高了安全性。这些方案假定用户是可信的,会诚实的执行验证过程并发布验证结果。但是有些用户可能谎称结果是错误的,达到拒绝支付服务费的目的。In order to solve the problem that malicious servers return wrong results to users, a ciphertext retrieval scheme based on the verifiable results of the PPTrie tree index is proposed. Subsequently, Bitcoin was introduced into multi-party computation to solve the fairness problem, and the protocol in the scheme can be regarded as a smart contract. In order to realize the disclosure of verification, it is done by using pseudo-random function and one-way function. Combining Merkle Hash Tree with k-means clustering improves verification efficiency and security. These schemes assume that the user is trustworthy, will perform the verification process honestly and publish the verification result. But some users may falsely claim that the result is wrong and refuse to pay the service fee.
中国专利申请文件(CN113949548A)公开了一种云存储中私钥可验证且多关键词可搜索的属性加密方法,基于属性加密的基础上将可认证外包与关键词搜索加密相结合,有效的减少了本地负荷和计算资源的浪费并实现快速搜索,并且支持多关键词搜索,可以有效地实现快速搜索,解决了现有技术中存在的网络带宽浪费和计算成本较大的问题。The Chinese patent application document (CN113949548A) discloses an attribute encryption method in which the private key is verifiable and multi-keyword searchable in cloud storage. It saves the waste of local load and computing resources and realizes fast search, and supports multi-keyword search, which can effectively realize fast search, and solve the problems of waste of network bandwidth and large computing cost in the prior art.
中国专利申请文件(CN113282542A)公开了一种具有前向安全的可验证可搜索加密方法,将关键字对应的安全令牌发送给服务器,可防止向服务器暴露文件存储的关键字的相关信息,提高文件存储的安全性,增强对文件注入攻击等不法攻击的抵抗力;确定存储的文件的验证信息,通过验证信息,对服务器返回的搜索到的文件进行完整性校验,能够保证文件存储的完整性,防止服务器对存储的文件的恶意更改;通过生成与验证信息的更新顺序相对应的状态,有利于对验证信息的追溯,便于获得有序的待验证的文件标识符合集,以节省客户端本地对文件标识符的存储操作;通过异或处理的方式,可降低数据处理的复杂度,减少搜索时的通信量,提高搜索效率。The Chinese patent application document (CN113282542A) discloses a verifiable and searchable encryption method with forward security. The security token corresponding to the keyword is sent to the server, which can prevent the relevant information of the keyword stored in the file from being exposed to the server, and improve the The security of file storage, enhance the resistance to illegal attacks such as file injection attacks; determine the verification information of the stored files, and verify the integrity of the searched files returned by the server through the verification information, which can ensure the integrity of the file storage. to prevent malicious changes to the stored files by the server; by generating a state corresponding to the update sequence of the verification information, it is conducive to the traceability of the verification information, and it is convenient to obtain an orderly matching set of file identifiers to be verified, so as to save the client Local storage operation of file identifiers; by means of XOR processing, the complexity of data processing can be reduced, the traffic during search can be reduced, and the search efficiency can be improved.
目前,区块链技术展示了其解决可靠性问题的潜力。将加密索引和加密数据存储在云服务器,用于实现数据存储和搜索的功能。区块链和智能合约用于验证搜索结果的正确性。由于验证操作都是由网络中的所有结点完成的,因此只要大多数结点都是诚实的,就可以保证结果的正确性。但分布式共享中各个结点之间达成一致的效率很低,智能合约进行复杂计算时产生很大计算开销。区块链的不可更改性导致每次新交易都会产生大量的存储开销,进而影响可搜索加密方案中结果验证的效率、数据更新的性能,降低用户的检索体验。Currently, blockchain technology shows its potential to solve reliability problems. Store encrypted indexes and encrypted data on cloud servers for data storage and search functions. Blockchain and smart contracts are used to verify the correctness of search results. Since the verification operation is done by all nodes in the network, the correctness of the result can be guaranteed as long as the majority of nodes are honest. However, the efficiency of reaching consensus among various nodes in distributed sharing is very low, and a lot of computing overhead is incurred when smart contracts perform complex calculations. The immutability of the blockchain results in a large amount of storage overhead for each new transaction, which in turn affects the efficiency of result verification in the searchable encryption scheme, the performance of data update, and reduces the user's retrieval experience.
发明内容SUMMARY OF THE INVENTION
本发明的目的就是提供一种可编辑区块链中支持分块验证的动态可搜索加密方法,该方法可在避免区块的存储和计算限制的同时,还能解决由于用户与云服务器不诚实而导致的查询结果可信性的问题。The purpose of the present invention is to provide a dynamic searchable encryption method that supports block verification in an editable block chain, which can avoid the storage and calculation limitations of blocks, and also solve the problem of dishonesty between users and cloud servers. This leads to the question of the reliability of the query results.
本发明是这样实现的:一种可编辑区块链中支持分块验证的动态可搜索加密方法,包括如下步骤:The present invention is realized as follows: a dynamic searchable encryption method supporting block verification in an editable block chain, comprising the following steps:
A、数据所有者输入安全参数λ,输出系统参数Para;A. The data owner inputs the security parameter λ and outputs the system parameter Para;
B、数据所有者根据系统参数Para生成随机数λr作为数据更新状态并存储在状态集合Map中,并输出加密所需的密钥对(PKD,SKD);B. The data owner generates a random number λ r according to the system parameter Para as the data update state and stores it in the state set Map, and outputs the key pair (PK D , SK D ) required for encryption;
C、对数据所有者的文件进行初始化,根据加密密钥对(PKD,SKD),对查询关键字/文件集合进行加密,生成并输出加密索引表加密后的关键字集CW、加密文件集CD到云服务器中,将生成的结果验证列表L存储到可编辑区块链中;C. Initialize the file of the data owner, encrypt the query keyword/file set according to the encryption key pair (PK D , SK D ), and generate and output the encrypted index table The encrypted keyword set CW and the encrypted file set are CD to the cloud server, and the generated result verification list L is stored in the editable blockchain;
D、当数据使用者发起搜索查询时,将搜索关键字w发送给数据所有者,数据所有者根据搜索关键字w和私钥SKD为数据使用者发送授权信息;数据使用者根据授权信息生成搜索令牌ST;D. When the data user initiates a search query, the search keyword w is sent to the data owner, and the data owner sends authorization information to the data user according to the search keyword w and the private key SK D ; the data user generates the authorization information according to the search token ST;
E、云服务器接收数据使用者发送的搜索令牌ST执行搜索操作:云服务器首先判断搜索令牌的正确性,若符合条件,则根据加密索引表执行搜索操作,并将输出的搜索结果集SR和验证集PR发送到可编辑区块链中;E. The cloud server receives the search token ST sent by the data user and performs the search operation: the cloud server first judges the correctness of the search token, and if it meets the conditions, then according to the encrypted index table Execute the search operation, and send the output search result set S R and verification set P R to the editable blockchain;
F、可编辑区块链接收到云服务器发送的(SR,PR)后,执行验证操作并输出验证结果标识符VR,通过验证则返回1,可编辑区块链会将搜索结果集发送给数据使用者,并向数据使用者收取费用;否则,返回0,将押金将退还给数据使用者。F. After the editable block link receives the (S R , P R ) sent by the cloud server, it performs the verification operation and outputs the verification result identifier VR , and returns 1 if it passes the verification . The editable block chain will set the search result set Send to the data user and charge the data user; otherwise, return 0 and the deposit will be returned to the data user.
优选的,步骤A中,输入安全参数λ,输出双线性对密码参数(G1,G2,e,p,g1);G1和G2是两个乘法循环群,p是一个大素数,e为双线性映射e:G1×G1→G2,g1是G1的生成数;Preferably, in step A, a security parameter λ is input, and a bilinear pair of cryptographic parameters (G 1 , G 2 , e, p, g 1 ) is output; G 1 and G 2 are two multiplicative cyclic groups, and p is a large Prime number, e is the bilinear map e: G 1 ×G 1 →G 2 , g 1 is the generator number of G 1 ;
定义H1:{0,1}*→G1,H2:{0,1}*→Zp是两个哈希函数,Zp是一个阶为p的有限域,h0和h1均∈G1,得到系统参数Para为{G1,G2,e,p,g1,H1,H2,h0,h1}。Definition H 1 : {0,1} * → G 1 , H 2 : {0,1} * → Z p are two hash functions, Z p is a finite field of order p, h 0 and h 1 are both ∈ G 1 , the obtained system parameter Para is {G 1 , G 2 , e, p, g 1 , H 1 , H 2 , h 0 , h 1 }.
优选的,步骤B中,数据所有者从序列{l,…,2λ}中选择随机参数λr∈{l,…,2λ}作为数据更新状态并记录在状态集合Map中;Preferably, in step B, the data owner selects a random parameter λ r ∈ {l,...,2 λ } from the sequence {l,...,2 λ } as the data update state and records it in the state set Map;
数据所有者随机选择一个x∈Zp,并计算非对称随机数密钥对(PKD,SKD),其中SKD=x;The data owner randomly selects an x∈Z p and computes an asymmetric random number key pair (PK D ,SK D ), where SK D = x;
数据所有者存储私钥SKD,并随机选择参数θ∈Zp秘密保存;The data owner stores the private key SK D , and randomly selects the parameter θ∈Zp to keep it secret;
数据所有者将Map和PKD均发送给云服务器和可编辑区块链。The data owner sends both Map and PK D to the cloud server and editable blockchain.
优选的,步骤C中,数据所有者首先构建索引结构,所构建的索引结构由若干完美二叉树组成,除最后两棵完美二叉树的高度可能相同外,其他各完美二叉树的高度级联降低;Preferably, in step C, the data owner first constructs an index structure, and the constructed index structure consists of several perfect binary trees, except that the heights of the last two perfect binary trees may be the same, and the heights of other perfect binary trees are cascaded down;
数据所有者对索引结构按照完美二叉树的个数对其进行分块,分块后计算各块的根结点哈希hri以及块索引哈希h(hri),并计算σi;The data owner divides the index structure into blocks according to the number of perfect binary trees, calculates the root node hash hr i and block index hash h(hr i ) of each block after dividing, and calculates σ i ;
接着数据所有者根据σi计算本地验证标签βj:The data owner then calculates the local verification label β j according to σ i :
其中,k为分块后的块数;j=1,2,……,m,m为关键字个数;Among them, k is the number of blocks after division; j=1, 2, ..., m, m is the number of keywords;
最后生成的结果验证列表为L={β1,β2,…,βm}。The final generated result verification list is L={β 1 ,β 2 ,...,β m }.
优选的,步骤D中,数据使用者将搜索关键字w发送给数据所有者,数据所有者随机选择γ1∈Zp,并计算和其中,r0=H2(d1)是Zp的一个伪随机数,d0和d1即为数据所有者向数据使用者所发送的授权信息;数据使用者根据d0和d1生成搜索令牌ST=(d0,d1)。Preferably, in step D, the data user sends the search keyword w to the data owner, the data owner randomly selects γ 1 ∈ Z p , and calculates and Among them, r 0 =H 2 (d 1 ) is a pseudo-random number of Z p , d 0 and d 1 are the authorization information sent by the data owner to the data user; the data user generates a search token ST=(d 0 , d 1 ) according to d 0 and d 1 .
优选的,步骤E中,云服务器判断搜索令牌的正确性具体是:Preferably, in step E, the cloud server determines the correctness of the search token is specifically:
数据所有者随机的选择x1,x2,y∈Zp,计算和随后,根据v和T计算并将y、T、Ω0、Ω1和Ω2发送给云服务器;The data owner randomly selects x 1 , x 2 , y∈Z p , calculates and Then, according to v and T, calculate and send y, T, Ω 0 , Ω 1 and Ω 2 to the cloud server;
云服务器接收数据所有者发送的y、T、Ω0、Ω1和Ω2,然后判断搜索令牌ST是否满足其中若满足条件,则表示搜索令牌正确。The cloud server receives y, T, Ω 0 , Ω 1 and Ω 2 sent by the data owner, and then judges whether the search token ST satisfies in If the conditions are met, the search token is correct.
优选的,步骤E中,当搜索令牌正确时,云服务器根据加密索引表执行搜索操作,得到搜索结果集SR,然后计算验证标签hriCP为云服务器生成的根结点哈希,同时,云服务器还生成块哈希hr1CP,hr2CP,…,hrkCP,随后将搜索结果集SR和验证集PR={h(hr1CP),h(hr2CP),…,h(hrkCP),μ}发送给可编辑区块链。Preferably, in step E, when the search token is correct, the cloud server searches the encrypted index table according to the Execute the search operation, get the search result set S R , and then calculate the verification label hr iCP is the root node hash generated by the cloud server. At the same time, the cloud server also generates block hashes hr 1CP ,hr 2CP ,...,hr kCP , and then the search result set S R and the verification set P R = {h(hr 1CP ),h(hr 2CP ),…,h(hr kCP ),μ} are sent to the editable blockchain.
优选的,步骤F中,可编辑区块链接收数据所有者发送的更新状态λr,可编辑区块链收到验证标签P=(β,μ)以及搜索结果集SR后,进行结果验证,具体如下:Preferably, in step F, the editable blockchain receives the update state λ r sent by the data owner, and the editable blockchain receives the verification label P=(β, μ) and the search result set SR , and then performs the result verification ,details as follows:
可编辑区块链根据验证标签,计算VDO=e(β,g1);The editable blockchain calculates V DO = e(β, g 1 ) according to the verification label;
并计算 and calculate
然后可编辑区块链验证VCP=VDO是否成立;若成立,则将搜索结果集SR发送给数据使用者;若不成立,则将押金将退还给数据使用者。Then the editable blockchain verifies whether V CP = V DO is established; if so, the search result set SR will be sent to the data user; if not, the deposit will be returned to the data user.
优选的,本发明所提供的可编辑区块链中支持分块验证的动态可搜索加密方法还包括步骤G:文件进行更新时,数据所有者生成新的λr′记录在Map中,并将更新后的加密索引表加密关键字集CW′和加密文件集CD′上传到云服务器,更新后的结果验证列表L′使用可编辑技术上传到可编辑区块链。Preferably, the dynamic searchable encryption method supporting block verification in the editable blockchain provided by the present invention further includes step G: when the file is updated, the data owner generates a new λ r ' and records it in the Map, and records it in the Map. Updated encrypted index table The encrypted keyword set CW' and the encrypted file set CD' are uploaded to the cloud server, and the updated result verification list L' is uploaded to the editable blockchain using the editable technology.
本发明将加密的数据和索引存储在云服务器,结果验证列表存储在可编辑区块链,避免区块的存储和计算限制的同时,解决了由于用户与云服务器不诚实而导致的查询结果可信性的问题。本发明的主要贡献如下:The invention stores encrypted data and indexes in the cloud server, and the result verification list is stored in the editable block chain, which avoids the storage and calculation limitations of blocks, and solves the problem that the query results can be changed due to dishonesty between users and the cloud server. question of reliability. The main contributions of the present invention are as follows:
1)为了保证高效的查询和验证,对索引进行动态划分,利用分块索引实现并行搜索以及更新数据仅影响恒定数量数据。此外,利用分块索引生成的验证标签对查询结果进行分块验证。1) In order to ensure efficient query and verification, the index is dynamically divided, and the block index is used to achieve parallel search and update data only affect a constant amount of data. In addition, the query results are verified in blocks using the verification tags generated by the block index.
2)引入可编辑区块链技术,使拥有修改权限的实体(本发明指数据所有者)可更改区块数据,便于维护验证标签的上传和更新,提高结果验证效率的同时减少验证标签的存储开销。2) Introduce editable blockchain technology, so that entities with modification authority (data owners in the present invention) can modify block data, which is convenient for maintaining the uploading and updating of verification labels, improving the efficiency of result verification and reducing the storage of verification labels overhead.
3)本发明能够阻止云服务器通过搜索陷门来猜测关键字的具体信息,实现搜索模式隐私保护。3) The present invention can prevent the cloud server from guessing the specific information of the keyword through the search trapdoor, so as to realize the privacy protection of the search mode.
4)通过部署到本地私有测试网络(Ganache-cli)中,并且对数据进行分梯度实验。实验结果分析表明,本发明在保证区块数量低速率增长前提下,数据查询和验证性能较其他结果验证方案优势显著。4) By deploying to the local private test network (Ganache-cli), and performing gradient experiments on the data. The analysis of the experimental results shows that the present invention has significant advantages in data query and verification performance compared with other result verification schemes under the premise of ensuring the low-speed growth of the number of blocks.
本发明基于可编辑区块链构建了支持分块验证的动态可搜索加密方法。该方法具有如下优势:首先,分块索引结构具有很好的检索性能;其次,根据分块索引生成的结果验证列表为后续的结果验证减少了计算开销;第三,可编辑区块链技术在保证搜索服务的公平性和安全性的前提下,实现数据的可重写存储,避免区块这一宝贵资源的浪费。The invention constructs a dynamic searchable encryption method supporting block verification based on the editable block chain. This method has the following advantages: first, the block index structure has good retrieval performance; second, the result verification list generated according to the block index reduces the computational overhead for subsequent result verification; third, the editable blockchain technology is used in On the premise of ensuring the fairness and security of the search service, the rewritable storage of data is realized to avoid the waste of the precious resource of the block.
附图说明Description of drawings
图1是本发明的系统模型图。FIG. 1 is a system model diagram of the present invention.
图2是本发明方法的简约流程图。Figure 2 is a simplified flow chart of the method of the present invention.
图3是本发明方法细化后的流程图。FIG. 3 is a detailed flow chart of the method of the present invention.
图4是本发明各实体间数据传输的示意图。FIG. 4 is a schematic diagram of data transmission between entities according to the present invention.
图5是本发明索引结构中添加以及删除结点的示意图。FIG. 5 is a schematic diagram of adding and deleting nodes in the index structure of the present invention.
图6是本发明对索引结构进行分块的示意图。FIG. 6 is a schematic diagram of dividing the index structure into blocks according to the present invention.
具体实施方式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.
为了保证搜索结果的正确性和完整性,本发明引入可编辑区块链作为第三方可信实体。同时,为了不削弱云存储的优势,应使结果验证的开销尽可能小。为了实现以上功能,本发明动态划分索引结构,块索引间并行计算生成验证标签。将验证标签组成的结果验证列表L上传到可编辑区块链中,对云服务器检索的结果进行验证。该验证方式不仅能提高验证标签生成效率、减小列表L的大小,还能降低可编辑区块链验证过程中的计算开销;此外,使用可编辑技术维护L的更新,还能最小化区可编辑块链存储开销。In order to ensure the correctness and integrity of the search results, the present invention introduces an editable blockchain as a third-party trusted entity. At the same time, in order not to weaken the advantages of cloud storage, the overhead of result verification should be kept as small as possible. In order to realize the above functions, the present invention dynamically divides the index structure, and performs parallel computation among the block indexes to generate the verification label. Upload the result verification list L composed of verification tags to the editable blockchain to verify the results retrieved by the cloud server. This verification method can not only improve the efficiency of verification label generation, reduce the size of the list L, but also reduce the computational overhead during the verification process of the editable blockchain; in addition, using the editable technology to maintain the update of L can also minimize the area available Edit blockchain storage overhead.
如图1所示,本发明系统模型包含数据所有者(DO,Data Owner)、数据使用者(DU,Data User)、云服务器(CSP,Cloud Server Platform)以及可编辑区块链(RedactableBlockchain)四个实体。可编辑区块链简称区块链,数据使用者即数据用户(简称用户),云服务器也即云平台(CP,Cloud Platform)。数据所有者可以构建安全的索引和密文文件,并上传到云服务器。同时,数据所有者还可以将生成的结果验证列表L上传到可编辑区块链。在数据使用者提出搜索请求后,数据所有者为合法用户授权。具有搜索权限的数据使用者可以生成令牌并向云服务器提交搜索查询,并可接收区块链发送来的通过验证的搜索结果集,在本地进行解密。云服务器用来存储安全索引和密文文件,同时可以为数据使用者提供搜索服务。执行搜索算法得到搜索结果发送给区块链,供其验证结果正确性。用户对数据的操作都被视为交易过程,该过程通过智能合约(SC,Smart Contract)打包到可编辑区块链中。智能合约属于可编辑区块链,可编辑区块链中的很多操作都是依据智能合约来完成的。智能合约通过结果验证列表L对云服务器得到的搜索结果进行验证,然后将验证通过的搜索结果发送给数据使用者。使用可编辑技术完成对结果验证列表L的更新操作,实现区块链数据在交易级别上的细粒度修改,保证区块数量低速率增长。As shown in FIG. 1 , the system model of the present invention includes a data owner (DO, Data Owner), a data user (DU, Data User), a cloud server (CSP, Cloud Server Platform) and an editable blockchain (Redactable Blockchain) four an entity. The editable blockchain is referred to as blockchain, the data user is the data user (referred to as the user), and the cloud server is also the cloud platform (CP, Cloud Platform). Data owners can build secure index and ciphertext files and upload to cloud servers. At the same time, the data owner can also upload the generated result verification list L to the editable blockchain. After the data user makes a search request, the data owner authorizes the legitimate user. Data consumers with search permissions can generate tokens and submit search queries to cloud servers, and can receive verified search result sets sent from the blockchain and decrypt them locally. Cloud servers are used to store secure indexes and ciphertext files, and can also provide search services for data users. Execute the search algorithm to get the search results and send them to the blockchain for verification of the correctness of the results. The user's operations on the data are all regarded as a transaction process, which is packaged into an editable blockchain through a smart contract (SC, Smart Contract). Smart contracts belong to the editable blockchain, and many operations in the editable blockchain are based on smart contracts. The smart contract verifies the search results obtained by the cloud server through the result verification list L, and then sends the verified search results to the data user. Use editable technology to complete the update operation of the result verification list L, realize fine-grained modification of blockchain data at the transaction level, and ensure that the number of blocks grows at a low rate.
可编辑区块链是区块链领域新兴的热点,旨在保障区块链安全可信等良好性质的前提下实现链上数据的可控编辑操作。本发明将区块链的内哈希函数替换为变色龙哈希函数,利用变色龙哈希的碰撞性实现区块的可编辑。Editable blockchain is an emerging hot spot in the blockchain field. It aims to realize the controllable editing operation of data on the chain under the premise of ensuring the security and credibility of the blockchain. The invention replaces the internal hash function of the block chain with the chameleon hash function, and realizes the editability of the block by utilizing the collision property of the chameleon hash.
变色龙哈希函数是一种带陷门的单向哈希函数。如果掌握陷门信息,则可以轻易地计算任意输入数据的哈希碰撞,从而可以在不改变哈希函数输出的情况下,任意地改变哈希函数的输入。The chameleon hash function is a one-way hash function with a trapdoor. If the trapdoor information is grasped, the hash collision of any input data can be easily calculated, so that the input of the hash function can be changed arbitrarily without changing the output of the hash function.
变色龙哈希函数通常有如下四个算法,即密钥生成算法HG、哈希生成算法CH、哈希验证算法HV以及哈希碰撞算法HC。四个算法分别如下:The chameleon hash function usually has the following four algorithms, namely the key generation algorithm HG, the hash generation algorithm CH, the hash verification algorithm HV and the hash collision algorithm HC. The four algorithms are as follows:
1)HG(1n)=(hk,tk):生成变色龙哈希的公钥hk和私钥(陷门)tk,n为安全性参数。1) HG(1 n )=(hk, tk): the public key hk and the private key (trapdoor) tk for generating the chameleon hash, n is a security parameter.
2)CH(hk,x,r)=(h,ξ):给定公钥hk、任意数据x和随机数r,生成哈希值h和随机数ξ。2) CH(hk, x, r)=(h, ξ): Given public key hk, arbitrary data x and random number r, generate hash value h and random number ξ.
3)HV(hk,x,(h,ξ)):给定公钥hk、任意数据x、哈希值h和随机数ξ,如果(h,ξ)是正确的哈希值,则输出1,否则输出0。3) HV(hk, x, (h, ξ)): Given public key hk, arbitrary data x, hash value h and random number ξ, if (h, ξ) is the correct hash value, output 1 , otherwise output 0.
4)HC(tk,(h,x,ξ),x′):给定陷门tk、三元组(h,x,ξ)和数据x′,输出新随机数ξ′,使得HV(hk,x,(h,ξ))=HV(hk,x′,(h,ξ′))=1。4) HC(tk, (h, x, ξ), x'): Given trapdoor tk, triplet (h, x, ξ) and data x', output a new random number ξ' such that HV(hk , x, (h, ξ))=HV(hk, x', (h, ξ'))=1.
显然,掌握陷门密钥就意味着拥有区块链的修改权,因此陷门密钥的管理对于变色龙哈希函数来说至关重要。Obviously, mastering the trapdoor key means having the right to modify the blockchain, so the management of the trapdoor key is crucial for the chameleon hash function.
如图2所示,本发明的可编辑区块链中支持分块验证的动态可搜索加密方法包括以下步骤:As shown in Figure 2, the dynamic searchable encryption method supporting block verification in the editable blockchain of the present invention includes the following steps:
A、数据所有者输入安全参数λ,输出公共系统参数Para,该公共系统参数Para可被各实体获知。A. The data owner inputs the security parameter λ and outputs the public system parameter Para, and the public system parameter Para can be known by each entity.
B、数据所有者根据公共系统参数Para生成随机数λr作为数据更新状态标识符并存储在状态集合Map中,并输出加密所需的密钥对(PKD,SKD)。B. The data owner generates a random number λ r according to the public system parameter Para as the data update state identifier and stores it in the state set Map, and outputs the key pair (PK D , SK D ) required for encryption.
C、对数据所有者的文件进行初始化,根据加密密钥对(PKD,SKD),对查询关键字/文件集合(W/F)进行加密,生成并输出加密索引表加密后的关键字集CW、加密文件集CD到云服务器中,将生成的结果验证列表L存储到可编辑区块链中。C. Initialize the file of the data owner, encrypt the query key/file set (W/F) according to the encryption key pair (PK D , SK D ), and generate and output the encrypted index table The encrypted keyword set CW and the encrypted file set are CD to the cloud server, and the generated result verification list L is stored in the editable blockchain.
D、当数据使用者发起搜索查询时,将搜索关键字w发送给数据所有者,数据所有者根据搜索关键字w和私钥SKD为数据使用者发送授权信息;数据使用者根据授权信息生成搜索令牌ST。D. When the data user initiates a search query, the search keyword w is sent to the data owner, and the data owner sends authorization information to the data user according to the search keyword w and the private key SK D ; the data user generates the authorization information according to the Search for token ST.
E、云服务器执行搜索操作,云服务器接收数据使用者发送的搜索令牌ST。首先判断令牌的正确性,若符合条件,则根据加密索引表执行搜索操作,并将输出的搜索结果集SR和验证集PR发送到可编辑区块链中。E. The cloud server performs a search operation, and the cloud server receives the search token ST sent by the data user. First judge the correctness of the token, if it meets the conditions, then according to the encrypted index table Execute the search operation and send the output search result set SR and validation set PR to the editable blockchain.
F、可编辑区块链接收到云服务器发送的(SR,PR)后,执行验证操作并输出验证结果标识符VR,通过验证则返回1,可编辑区块链会将搜索结果发送给数据使用者,并向数据使用者收取费用;否则,返回0,将押金将退还给数据使用者。F. After the editable block link receives the ( S R , P R ) sent by the cloud server, it performs the verification operation and outputs the verification result identifier VR, and returns 1 if it passes the verification, and the editable block chain will send the search result To the data user, and charge the data user; otherwise, return 0, and the deposit will be returned to the data user.
本发明所提供的动态可搜索加密方法还包括更新步骤,如下:The dynamic searchable encryption method provided by the present invention also includes an update step, as follows:
G、文件进行更新时,数据所有者生成新的λr′记录在Map中,并将更新后的加密索引表加密关键字集CW′和加密文件集CD′上传到云服务器,更新后的结果验证列表L′使用可编辑技术上传到可编辑区块链。G. When the file is updated, the data owner generates a new λ r ' and records it in the Map, and records the updated encrypted index table The encrypted keyword set CW' and the encrypted file set CD' are uploaded to the cloud server, and the updated result verification list L' is uploaded to the editable blockchain using the editable technology.
下面结合附图对各个步骤进行详细描述。Each step will be described in detail below with reference to the accompanying drawings.
结合图2、图3和图4,在步骤A中,输入安全参数λ,设G1和G2是两个乘法循环群,p是一个大素数,e为双线性映射e:G1×G1→G2,g1是G1的生成数。输出双线性对密码参数(G1,G2,e,p,g1)。Combining Figure 2, Figure 3 and Figure 4, in step A, input the security parameter λ, let G 1 and G 2 be two multiplicative cyclic groups, p is a large prime number, e is a bilinear map e:G 1 × G 1 →G 2 , where g 1 is the generation number of G 1 . Output the bilinear pair of cryptographic parameters (G 1 , G 2 , e, p, g 1 ).
定义H1:{0,1}*→G1,H2:{0,1}*→Zp是两个哈希函数,Zp是一个阶为p的有限域,h0和h1均∈G1,得到公共系统参数为Para={G1,G2,e,p,g1,H1,H2,h0,h1}。Definition H 1 : {0,1} * → G 1 , H 2 : {0,1} * → Z p are two hash functions, Z p is a finite field of order p, h 0 and h 1 are both ∈ G 1 , the public system parameters are obtained as Para={G 1 ,G 2 ,e,p,g 1 ,H 1 ,H 2 ,h 0 ,h 1 }.
在步骤B中,数据所有者在本地初始化系统,数据所有者根据公共系统参数Para,从序列{l,…,2λ}中选择随机参数λr∈{l,…,2λ}作为数据更新状态记录在状态集合Map中。λr作为数据更新状态标识符,用来表示数据是否实现更新。In step B, the data owner initializes the system locally, and the data owner selects a random parameter λ r ∈{l,…,2 λ} from the sequence {l,…,2 λ } as the data update according to the public system parameter Para The state is recorded in the state collection Map. λ r is used as a data update status identifier to indicate whether the data is updated.
随机选择一个x∈Zp,并计算数据所有者的非对称随机数密钥对(PKD,SKD),其中SKD=x。数据所有者存储私钥SKD,并随机选择参数θ∈Zp秘密保存。此外,数据所有者将Map和PKD均发送给云服务器和可编辑区块链。Randomly choose a x∈Z p and compute the data owner’s asymmetric random number key pair (PK D ,SK D ), where SK D =x. The data owner stores the private key SK D , and randomly selects the parameters θ∈Zp and keeps it secret. In addition, the data owner sends both Map and PK D to the cloud server and editable blockchain.
在步骤C中,数据所有者不仅需要对关键字/文件集合(W/F)加密来建立索引,还需要利用分块索引产生用于结果验证的列表L。In step C, the data owner not only needs to encrypt the keyword/file set (W/F) to build the index, but also needs to use the block index to generate the list L for result verification.
数据所有者将文件关键字集W={w1,w2,…,wm}和文件集F={f1,f2,…,fn}作为输入,选择一个安全的对称加密算法Enc=(Ek,Dk)对文件进行加密,加密后的文件为Cj=Ek(fj),j=1,2,…,n。其中,m为关键字数量;n为文件数。对关键字w加密具体是执行如下操作:“||”表示“或”,关键字w和θ取或,再计算哈希,得到加密后的关键字 The data owner takes the file key set W={w 1 ,w 2 ,...,w m } and the file set F={f 1 ,f 2 ,...,f n } as input, and selects a secure symmetric encryption algorithm Enc =(E k , D k ) encrypts the file, and the encrypted file is C j =E k (f j ), j=1,2,...,n. Among them, m is the number of keywords; n is the number of files. Encrypting the keyword w specifically performs the following operations: "||" means "or", the keyword w and θ are ORed, and then the hash is calculated to get the encrypted keyword
本发明采用索引分块实现并行操作,在执行过程中通过并行遍历加快检索速率、方便检查结果验证列表L的生成以及后续的验证操作,使得在查询和验证性能上优势显著。通过分块索引结构对可搜索加密的结果进行分块验证,有效减少客户端的计算开销、存储开销以及通信开销。The present invention adopts index block to realize parallel operation, speed up retrieval rate through parallel traversal during execution, facilitate generation of check result verification list L and subsequent verification operations, so that the query and verification performance has significant advantages. The searchable encrypted result is verified in blocks through the block index structure, which effectively reduces the computing overhead, storage overhead and communication overhead of the client.
本发明中索引结构由多个完美二叉树(除叶子结点之外的每一个结点都有两个孩子,每一层都被完全填充)组成。在构建索引过程中,关键字/文档标识符对(w,id)依序添加,故树形成过程中有先后顺序。除了最后两棵树的高度可能相等外,其他所有的二叉树高度严格降低(级联),此特性将在后续的更新中得到维护。对于任何关键字w,将包含w的文件标识符集打包为多个完美二叉树(三角形),则最大完美二叉树形成,已经形成二叉树的文件标识符被减去以继续形成下一个最大的完美二叉树。因此,除了最后两棵完美二叉树的高度可能相同,其余二叉树的高度依次减少。如图5所示,如果要添加关键字/文档标识符对(w,id),则新添加的结点将作为两个相同高度的完美二叉树的父结点。否则,新结点是高度为1的完美二叉树。要删除(w,id),则是将其替换为最后一个完美二叉树的根结点,并将最小的完美二叉树分成两个较小的二叉树。可以看到,添加和删除后的级联特性没有改变。最后,任何(并行)树遍历算法都可以遍历该数据结构,因此这种结构可以实现并行查询和数据更新,并且具有更新数据仅影响恒定数量数据的特性。The index structure in the present invention is composed of a plurality of perfect binary trees (each node except the leaf node has two children, and each level is completely filled). In the process of index building, keyword/document identifier pairs (w, id) are added in sequence, so there is an order in the tree formation process. All binary trees are strictly reduced in height (cascading) except for the last two trees, which may be of equal height. This feature will be maintained in subsequent updates. For any keyword w, the set of file identifiers containing w is packed into multiple perfect binary trees (triangles), then the largest perfect binary tree is formed, and the file identifiers that have formed the binary tree are subtracted to continue to form the next largest perfect binary tree. Therefore, except for the last two perfect binary trees, which may have the same height, the remaining binary trees decrease in height sequentially. As shown in Figure 5, if a keyword/document identifier pair (w, id) is to be added, the newly added node will serve as the parent node of two perfect binary trees of the same height. Otherwise, the new node is a perfect binary tree of height 1. To remove (w, id), replace it with the root of the last perfect binary tree, and split the smallest perfect binary tree into two smaller binary trees. As you can see, the cascading properties after adding and removing have not changed. Finally, any (parallel) tree traversal algorithm can traverse this data structure, so this structure enables parallel queries and data updates, and has the property that updating data only affects a constant amount of data.
对每一个关键字均执行上述索引结构的建立过程。之后对于关键字集合W中的每个元素wj(1≤j≤m)生成的倒排索引进行索引分块,1≤i≤k(k是索引分块块数)。如图6所示,将索引结构中的每个完美二叉树划分成一个块,因此k即为完美二叉树的个数。图6中k=3,索引结构中结点数为11;分块后的索引结构为I={I1,I2,I3}。如果根据划分后的块生成的结果验证列表进行结果验证时仍旧超过以太坊的Gas限值,则在此块的基础上,将其分为三个子树(块)。如图6中的块索引I1,再次划分的子树分别是根结点(Root0)和除去根结点以外,其左右子结点(左子结点Chd00和右子结点Chd01)重新生成的索引结构。二次划分方式在块内部自行划分,从外部看仍然为整体块结构。如图6中,对I1进行二次分块后有I1={Root0,Chd00,Chd01}。这种分块方式可以实现动态划分,并且有效避免存储浪费。然后根据分块后的结果来计算加密后的根结点哈希然后数据所有者针对根结点哈希,计算块索引哈希h(hri)以及σi。其中,上面公式中,表示异或,H(idri)表示第ri个文档标识符的哈希值,hri表示第i个块的根结点哈希,h(hri)表示块索引哈希。对于某一个确定的块i,其上拥有ri个结点,计算hri即计算该块上所有结点中文档标识符的哈希值,再进行异或。最后,数据所有者将密文以及加密索引上传至云服务器。The above-mentioned process of establishing the index structure is performed for each keyword. Then, perform index block for the inverted index generated by each element w j (1≤j≤m) in the keyword set W, 1≤i≤k (k is the number of index block blocks). As shown in Figure 6, each perfect binary tree in the index structure is divided into a block, so k is the number of perfect binary trees. In FIG. 6 , k=3, and the number of nodes in the index structure is 11; the index structure after partitioning is I={I 1 , I 2 , I 3 }. If the result verification list generated by the divided block still exceeds the gas limit of Ethereum, then it is divided into three subtrees (blocks) on the basis of this block. As shown in the block index I 1 in FIG. 6 , the subtrees divided again are the root node (Root 0 ) and the left and right child nodes (the left child node Chd 00 and the right child node Chd 01 except the root node). ) regenerated index structure. The secondary division method divides itself inside the block, and it is still the overall block structure from the outside. As shown in FIG. 6 , I 1 ={Root 0 , Chd 00 , Chd 01 } after I 1 is divided into two blocks. This block method can realize dynamic division and effectively avoid storage waste. Then calculate the encrypted root node hash according to the result of the block The data owner then calculates the block index hash h(hr i ) and σ i for the root node hash. in, In the above formula, represents XOR, H(id ri ) represents the hash value of the r i th document identifier, hr i represents the root node hash of the ith block, and h(hr i ) represents the block index hash. For a certain block i, there are r i nodes on it, and calculating hr i is to calculate the hash value of the document identifiers in all the nodes on the block, and then perform XOR. Finally, the data owner will cipher the text along with the encrypted index Upload to cloud server.
接着,数据所有者根据σi在本地计算验证标签βj,具体为最终得到与所有关键字相对应的结果验证列表L={β1,β2,…,βm}。数据所有者将结果验证列表L发送到可编辑区块链。可编辑区块链接收到数据所有者发送的结果验证列表L后,根据公钥hk、验证标签βj和随机数r,计算CH(hk,βj,r)=(h,ξ),并存储生成的哈希值h和随机数ξ。Next, the data owner calculates the verification label β j locally according to σ i , specifically Finally, a result verification list L={β 1 , β 2 , . . . , β m } corresponding to all keywords is obtained. The data owner sends the result verification list L to the editable blockchain. After receiving the result verification list L sent by the data owner, the editable block link calculates CH(hk, βj ,r)=( h ,ξ) according to the public key hk, verification label βj and random number r, and Store the generated hash value h and random number ξ.
步骤D中,当数据使用者发起搜索查询时,首先需要向数据所有者请求搜索权限,即:数据使用者将搜索关键字w发送给数据所有者。数据所有者随机选择γ1∈Zp,并计算和其中,r0=H2(d1)是Zp的一个伪随机数,数据所有者将授权信息d0和d1发送给数据使用者,由数据使用者生成搜索令牌ST=(d0,d1)。数据使用者将搜索令牌ST发送给云服务器。In step D, when a data user initiates a search query, it first needs to request a search permission from the data owner, that is, the data user sends the search keyword w to the data owner. The data owner randomly selects γ 1 ∈ Z p , and computes and Among them, r 0 =H 2 (d 1 ) is a pseudo-random number of Z p , The data owner sends the authorization information d 0 and d 1 to the data user, and the data user generates a search token ST=(d 0 , d 1 ). The data consumer sends the search token ST to the cloud server.
数据所有者随机的选择x1,x2,y∈Zp,计算和随后,根据v和T计算并将y、T、Ω0、Ω1和Ω2发送给云服务器,以便云服务器对数据使用者发送的搜索令牌的有效性进行校验。The data owner randomly selects x 1 , x 2 , y∈Z p , calculates and Then, according to v and T, calculate And send y, T, Ω 0 , Ω 1 and Ω 2 to the cloud server, so that the cloud server can verify the validity of the search token sent by the data user.
步骤E中,云服务器获取加密索引和加密关键字集CW后进行如下计算,在搜索关键字之前,首先判断数据使用者发送的搜索令牌ST是否满足其中若满足条件,则表示搜索令牌正确。若搜索令牌不正确,则云服务器反馈给数据使用者。In step E, the cloud server obtains the encrypted index After and the encrypted keyword set CW, the following calculation is performed. Before searching for keywords, first determine whether the search token ST sent by the data user satisfies the in If the conditions are met, the search token is correct. If the search token is incorrect, the cloud server will feed back to the data consumer.
若搜索令牌正确,则云服务器接下来判断λr=λrCP是否成立,λr表示数据所有者生成的最新的更新标识符,λrCP表示本次查询前的上一次查询时的更新标识符,两者相等,则表示两次查询之间没有发生过更新。因此,若λr=λrCP成立,则表示未发生更新,此时由云服务器根据未更新的加密索引执行搜索。若λr=λrCP不成立,则表示关键字由更新后的新索引生成,此时需由云服务器根据更新后的加密索引执行并行搜索算法。If the search token is correct, the cloud server next determines whether λ r =λ rCP is established, where λ r represents the latest update identifier generated by the data owner, and λ rCP represents the update identifier in the last query before this query , the two are equal, indicating that no updates have occurred between the two queries. Therefore, if λ r =λ rCP is established, it means that no update has occurred. At this time, the cloud server uses the unupdated encrypted index Perform a search. If λ r =λ rCP does not hold, it means that the keyword is generated by the updated new index, and the cloud server needs to use the updated encrypted index Execute a parallel search algorithm.
云服务器根据加密索引(未更新的或更新后的加密索引)执行搜索算法,具体是:当索引块数k≥1时,初始化⊥代表空集,对于j=1,2,…,k,若左右子树均不为空chd00≠⊥(∨chd01≠⊥)(“∨”为析取符号,表示“或”,chd00表示左子树,chd01表示右子树),则对每棵完美二叉树执行中序遍历算法,计算 和是满足搜索令牌的文件和文件标识符,和是满足搜索令牌的文件集和文件标识符集,是搜索结果集。The cloud server executes the search algorithm according to the encrypted index (unupdated or updated encrypted index), specifically: when the number of index blocks k ≥ 1, initialize the ⊥ represents an empty set. For j=1,2,…,k, if the left and right subtrees are not empty, chd 00 ≠⊥(∨chd 01 ≠⊥) (“∨” is a disjunctive symbol, indicating “or”, chd 00 represents the left subtree, chd 01 represents the right subtree), then perform the in-order traversal algorithm for each perfect binary tree, and calculate and are the file and file identifiers that satisfy the search token, and is the set of files and file identifiers that satisfy the search token, is the search result set.
云服务器根据SR,索引I={I1,I2,…Ik},计算验证标签hriCP为云服务器生成的根结点哈希,同时,云服务器还生成块哈希hr1CP,hr2CP,…,hrkCP。随后将搜索结果集SR和验证集PR={h(hr1CP),h(hr2CP),…,h(hrkCP),μ}发送给可编辑区块链。The cloud server calculates the verification label according to S R , the index I={I 1 , I 2 ,...I k } hr iCP is the root node hash generated by the cloud server. At the same time, the cloud server also generates block hashes hr 1CP ,hr 2CP ,…,hr kCP . The search result set SR and the validation set PR = {h(hr 1CP ), h(hr 2CP ), . . . , h(hr kCP ), μ} are then sent to the editable blockchain.
步骤F中:可编辑区块链接收数据所有者发送的更新状态λr,可编辑区块链收到验证标签P=(β,μ)以及搜索结果集SR后,进行结果验证,具体如下:In step F: the editable blockchain receives the update state λ r sent by the data owner, and after the editable blockchain receives the verification label P=(β, μ) and the search result set SR , the result is verified as follows. :
可编辑区块链根据本地验证标签β,计算VDO=e(β,g1);The editable blockchain calculates V DO = e(β, g 1 ) according to the local verification label β;
并根据云服务器生成的验证标签μ计算 And calculate according to the verification label μ generated by the cloud server
然后验证VCP=VDO是否成立。Then verify that V CP =V DO holds.
如果VCP=VDO,即If V CP =V DO , that is
则表示搜索结果正确,验证结果输出VR=1,可编辑区块链将搜索结果以及λr记录下来,并将搜索结果发送给数据使用者,并向数据使用者收取费用,数据使用者根据搜索结果在本地解密(数据所有者需将对称加密密钥发送给数据使用者)。如果证VCP=VDO不成立,则输出VR=0,可编辑区块链将押金退还给数据使用者(数据使用者在获得授权信息后支付押金)。It means that the search results are correct, and the verification results output VR = 1. The editable blockchain records the search results and λ r , sends the search results to the data users, and charges the data users. The search results are decrypted locally (the data owner needs to send the symmetric encryption key to the data consumer). If the proof V CP = V DO is not established, output VR = 0, and the editable blockchain will return the deposit to the data user (the data user pays the deposit after obtaining the authorization information).
步骤G中,数据所有者获取关键字w对应的更新状态,若λr′≠λr(λr′代表新的更新后的状态),则执行下面的更新操作。In step G, the data owner obtains the update state corresponding to the keyword w, and if λ r ′≠λ r (λ r ′ represents the new updated state), the following update operation is performed.
令W′,F′表示更新后的关键字集和文档集,选择一个安全的对称加密算法Enc=(Ek,Dk),计算加密后的文件CD′=Ek(F′)。Let W', F' represent the updated keyword set and document set, choose a secure symmetric encryption algorithm Enc=(E k , D k ), and calculate the encrypted file CD'=E k (F').
对于集合W′中的每个元素wj′(1≤j≤m),执行加密算法得到加密索引根据更新后的索引,并行执行相应计算过程,生成新的本地验证标签βi′以及结果验证列表L′。For each element w j ' (1≤j≤m) in the set W', execute the encryption algorithm to obtain the encryption index According to the updated index, the corresponding calculation process is performed in parallel to generate a new local verification label β i ' and a result verification list L'.
将更新后的λr′和L′上传到可编辑区块链。首先,给定安全参数λ,计算Upload the updated λr ' and L' to the editable blockchain. First, given the security parameter λ, calculate
(hk,tk)=HG(1λ)(hk, tk)=HG(1 λ )
生成变色龙哈希的公钥hk和私钥(陷门)tk。Generate the public key hk and private key (trapdoor) tk of the chameleon hash.
接着,计算新的随机数Next, calculate a new random number
ξ′=HC(tk,(h,βi,ξ),βi′)ξ′=HC(tk, (h, β i , ξ), β i ′)
然后,验证HV(hk,βi,(h,ξ))=HV(hk,βi′,(h,ξ′))=1是否成立。Then, it is verified whether HV(hk, β i , (h, ξ))=HV(hk, β i ', (h, ξ'))=1 holds.
如果成立,那么,使用可编辑技术更新本地验证标签成功。If true, then updating the local validation tag using editable technology succeeds.
本发明中,属于可编辑区块链的智能合约是“执行合约条款的计算机交易协议”。具体来说,智能合约系统的每个参与者都运行一个基于交易的状态机,从一个创世状态开始,在区块链上执行交易以将其转变为某个最终状态。由于区块链上只包含有效交易,因此最终状态可以在所有参与者之间自动达成共识。本发明用于根据分块索引生成的检查列表(即结果验证列表)的上传及后续更新,以及用于实现数据的可重写存储而采用的可编辑技术,都是在智能合约中实现的。主要的智能合约有四个,分别为:可编辑区块链合约、检查列表更新合约、公平交易合约和结果验证合约。其中,可编辑区块链合约和检查列表更新合约用于实现检查列表的上传与更新,公平交易合约与结果验证合约确保公平性和结果可验证性。In the present invention, a smart contract belonging to an editable blockchain is a "computer transaction protocol for executing contract terms". Specifically, each participant in a smart contract system runs a transaction-based state machine, starting from a genesis state and executing transactions on the blockchain to transform it into some final state. Since only valid transactions are included on the blockchain, the final state can be automatically agreed upon among all participants. The present invention is used for uploading and subsequent updating of the check list (ie, the result verification list) generated according to the block index, as well as the editable technology used for realizing the rewritable storage of data, all of which are implemented in smart contracts. There are four main smart contracts, namely: Editable Blockchain Contract, Checklist Update Contract, Fair Trade Contract and Result Verification Contract. Among them, the editable blockchain contract and the checklist update contract are used to upload and update the checklist, and the fair trade contract and the result verification contract ensure fairness and result verifiability.
本发明可达到保护用户隐私以及数据安全的目的。本发明的安全目标是强制执行以下约束条件而得到的:The present invention can achieve the purpose of protecting user privacy and data security. The safety goal of the present invention is obtained by enforcing the following constraints:
1)隐私性。在整个搜索过程中,文件和查询关键字保密。云服务器和可编辑区块链都不能够推断出客户端的私有文件和发布的搜索关键字。1) Privacy. Documents and query keywords are kept secret throughout the search process. Neither the cloud server nor the editable blockchain can infer the client's private files and published search keywords.
2)安全性。在程序执行期间,确保除了一系列搜索请求、更新请求和访问模式的结果之外,没有其他信息被披露。本发明将更新操作的结果也视为搜索模式的一部分。2) Security. During program execution, ensure that no other information is disclosed other than the results of a series of search requests, update requests, and access patterns. The present invention also considers the result of the update operation as part of the search pattern.
3)验证性。需要对恶意用户以及恶意云服务器进行双向验证,将验证过程交由可编辑区块链去执行,保证各个实体的诚实操作。3) Verification. It is necessary to perform two-way verification on malicious users and malicious cloud servers, and hand over the verification process to the editable blockchain to ensure the honest operation of each entity.
4)公平性。如果用户和云服务器发生纠纷,可以公平地检测出确切的错误行为者,并强制执行公平交易。也就是说,如果确认云服务器错误地执行了所请求的搜索查询,则应拒绝支付该查询的服务费。反之,如果确认用户伪造了验证结果,则应强制执行本次查询的服务费。4) Fairness. In the event of disputes between users and cloud servers, the exact wrong actors can be fairly detected and a fair deal enforced. That is, if the cloud server is confirmed to have executed the requested search query in error, payment of the service fee for that query shall be refused. Conversely, if it is confirmed that the user has forged the verification result, the service fee for this query should be enforced.
本发明提出的可编辑区块链架构平台、操作功能和公平支付机制是使用Python和以太坊智能合约实现的。本发明在用户和服务器进行恶意行为时,依然可以确保查询服务的公平性和安全性。实验结果表明本发明具有良好的查询性能、验证性能和存储性能。The editable block chain architecture platform, operation function and fair payment mechanism proposed by the present invention are implemented using Python and Ethereum smart contracts. The present invention can still ensure the fairness and security of the query service when the user and the server perform malicious actions. The experimental results show that the invention has good query performance, verification performance and storage performance.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210378780.8A CN114710357B (en) | 2022-04-12 | 2022-04-12 | A Dynamically Searchable Encryption Method Supporting Block Verification in Editable Blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210378780.8A CN114710357B (en) | 2022-04-12 | 2022-04-12 | A Dynamically Searchable Encryption Method Supporting Block Verification in Editable Blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114710357A true CN114710357A (en) | 2022-07-05 |
CN114710357B CN114710357B (en) | 2023-07-21 |
Family
ID=82174415
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210378780.8A Active CN114710357B (en) | 2022-04-12 | 2022-04-12 | A Dynamically Searchable Encryption Method Supporting Block Verification in Editable Blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114710357B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115361165A (en) * | 2022-07-11 | 2022-11-18 | 浙江提提教育科技有限公司 | Verifiable dynamic searchable encryption method based on block chain and renewable encryption |
CN118337505A (en) * | 2024-05-14 | 2024-07-12 | 贵州大学 | A publicly traceable ciphertext transmission method and storage method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110602099A (en) * | 2019-09-16 | 2019-12-20 | 广西师范大学 | Privacy protection method based on verifiable symmetric searchable encryption |
CN112417006A (en) * | 2020-11-30 | 2021-02-26 | 齐鲁工业大学 | Ciphertext keyword searching method, system, device and medium based on block chain |
WO2021068726A1 (en) * | 2019-10-08 | 2021-04-15 | 深圳前海微众银行股份有限公司 | Method and device for storing and searching for transaction hash value in blockchain |
CN113194078A (en) * | 2021-04-22 | 2021-07-30 | 西安电子科技大学 | Cloud-supported privacy protection sequencing multi-keyword search encryption method |
CN113536389A (en) * | 2021-06-15 | 2021-10-22 | 复旦大学 | A fine-grained and controllable decentralized editable blockchain construction method and system |
-
2022
- 2022-04-12 CN CN202210378780.8A patent/CN114710357B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110602099A (en) * | 2019-09-16 | 2019-12-20 | 广西师范大学 | Privacy protection method based on verifiable symmetric searchable encryption |
WO2021068726A1 (en) * | 2019-10-08 | 2021-04-15 | 深圳前海微众银行股份有限公司 | Method and device for storing and searching for transaction hash value in blockchain |
CN112417006A (en) * | 2020-11-30 | 2021-02-26 | 齐鲁工业大学 | Ciphertext keyword searching method, system, device and medium based on block chain |
CN113194078A (en) * | 2021-04-22 | 2021-07-30 | 西安电子科技大学 | Cloud-supported privacy protection sequencing multi-keyword search encryption method |
CN113536389A (en) * | 2021-06-15 | 2021-10-22 | 复旦大学 | A fine-grained and controllable decentralized editable blockchain construction method and system |
Non-Patent Citations (1)
Title |
---|
R. DU AND Y. WANG: "Verifiable Blockchain-Based Searchable Encryption with forward and backward privacy", 2020 16TH INTERNATIONAL CONFERENCE ON MOBILITY, SENSING AND NETWORKING (MSN), pages 630 - 635 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115361165A (en) * | 2022-07-11 | 2022-11-18 | 浙江提提教育科技有限公司 | Verifiable dynamic searchable encryption method based on block chain and renewable encryption |
CN115361165B (en) * | 2022-07-11 | 2024-09-20 | 浙江提提教育科技有限公司 | Verifiable dynamic searchable encryption method based on blockchain and updatable encryption |
CN118337505A (en) * | 2024-05-14 | 2024-07-12 | 贵州大学 | A publicly traceable ciphertext transmission method and storage method |
Also Published As
Publication number | Publication date |
---|---|
CN114710357B (en) | 2023-07-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111835500B (en) | A secure sharing method of searchable encrypted data based on homomorphic encryption and blockchain | |
CN102938767B (en) | The fuzzy keyword search methodology that efficiently can verify that based on the outer packet system of cloud data | |
CN114826703B (en) | Blockchain-based data search fine-grained access control method and system | |
CN113312574A (en) | Cloud data integrity auditing method based on block chain | |
CN107256248A (en) | Encryption method can search for based on asterisk wildcard in cloud storage safety | |
CN110704864A (en) | Blockchain-based government integrity file certificate management method | |
CN113554421A (en) | Police affair resource data governance cooperation method based on block chain | |
CN114710357B (en) | A Dynamically Searchable Encryption Method Supporting Block Verification in Editable Blockchain | |
CN108197499A (en) | A kind of ciphertext data area querying method that can verify that | |
Etemad et al. | Generic dynamic data outsourcing framework for integrity verification | |
CN117650879A (en) | Dynamic cloud data integrity public auditing method based on chameleon hash | |
CN110851848A (en) | Privacy protection method for symmetric searchable encryption | |
CN117828673B (en) | Block chain-based data circulation and privacy protection method and device | |
Du et al. | Block verifiable dynamic searchable encryption using redactable blockchain | |
CN118157984A (en) | SM 9-based policy hidden attribute-based encrypted data retrieval method | |
CN114741711B (en) | Multi-keyword searchable encryption method based on block chain | |
CN116760840A (en) | Efficient data sharing method based on block chain | |
CN116663046A (en) | Private data sharing and retrieving method, system and equipment based on blockchain | |
CN112702159B (en) | Online expert scoring method and system based on block chain | |
CN115906149A (en) | KP-ABE based on directed acyclic graph and user data credible sharing method of block chain | |
CN115580431A (en) | A privacy data access control method based on alliance chain smart contract | |
Junxiang et al. | Dynamic provable data possession with batch-update verifiability | |
CN113468549A (en) | Retrieval method and system for encrypted information evidence based on block chain and electronic equipment | |
CN116132112B (en) | Keyword encryption searching method based on alliance chain intelligent contract | |
Peng et al. | Redactable blockchain in the permissioned setting |
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 |