Attribute-based searchable encryption method and system with forward and backward privacy on blockchain

By applying attribute-based ciphertext strategy and CP-ABE technology on the blockchain, combining smart contracts and bilinear mapping, the searchable encryption solution on the blockchain is solved, and the searchable, fine-grained access control, The issues of forward and backward privacy achieve higher system stability and security.

CN115412233BActive Publication Date: 2024-11-01SOUTH CHINA UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210990925.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2024-11-01
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

The searchable encryption scheme on existing blockchains is difficult to achieve decentralization of retrieval, fine-grained access control for users, forward and backward privacy of data, resulting in insufficient security and stability of the system.

Method used

Adopt attribute-based ciphertext policy, use Ciphertext Policy Attribute-Based Encryption (CP-ABE) technology, combined with blockchain, to achieve fine-grained access control for users, and ensure data through technologies such as smart contracts and bilinear mapping. forward and backward privacy to avoid single point of failure.

Benefits of technology

It realizes refined control of user access rights, ensures forward and backward privacy of data, improves system stability and retrieval credibility, reduces the possibility of single point of failure, and enhances data security .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115412233B_ABST
    Figure CN115412233B_ABST
Patent Text Reader

Abstract

The present invention discloses a searchable encryption method and system based on attributes with forward and backward privacy on a blockchain. The method includes: S1, generating a system parameter SPP and publishing the SPP, generating private keys dk1 and dk2, generating a private key K for a user u ; S2, generate the index ciphertext set EDB and the updated mapping ∑ for the document, and deploy EDB to the blockchain; S3, when the data user DU performs a retrieval operation, use its private key K u Encrypt the keyword q, obtain the retrieval trap Tra and send it to the blockchain network; S4, determine whether the user has the corresponding access rights according to EDB[H2(C)]; after the permission check is passed, the corresponding status value is obtained according to EDB[H2(C)]; S5, after the data user receives the result set MEI, use the private key K u , and restore the corresponding plaintext content. The present invention can effectively set the user's access rights; at the same time, realize the forward privacy and backward privacy of data; and use blockchain to achieve decentralized retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of information retrieval and cryptography, and specifically relates to an attribute-based searchable encryption method and system with forward and backward privacy on a blockchain. Background Art

[0002] With the rapid development of Internet technology, the popularity of cloud computing technology, and the exponential growth of user data, more and more corporate users and individuals choose to store their data in the cloud, which reduces the cost of managing and storing data. Users can retrieve data in the cloud anytime and anywhere, and can easily share it with those who have obtained permission. However, while cloud computing provides us with convenience, it also poses serious security risks. When data is outsourced to a cloud server in plain text, it may be illegally accessed by cloud service providers or hackers. The usual solution is to encrypt the data and store it in ciphertext on the cloud server, but this also makes traditional plaintext retrieval technology unable to be applied to ciphertext.

[0003] In order to enable users to perform keyword searches on ciphertext data, searchable encryption (SE) technology has been proposed as a solution. Depending on the encryption method, searchable encryption can be divided into symmetric searchable encryption (SSE) and public key searchable encryption (PEKS). In public key-based searchable encryption, the data owner encrypts the data using the public key of the specified user before uploading it to the cloud server. After that, these users can use their private keys to search and decrypt the data.

[0004] However, these two types of searchable encryption schemes mostly rely on trusted institutions in terms of private key generation and distribution. On the one hand, this makes trusted institutions the target of most hackers; on the other hand, once the premise of "trustworthiness" of trusted institutions disappears, the security of user data will be gone. Therefore, researchers have tried to apply blockchain technology with characteristics such as decentralization to the field of searchable encryption and proposed many solutions. These mainly separate data from indexes, store data in the server, store indexes on the blockchain, and use blockchain for encrypted retrieval. The data owner uploads the encrypted data to the server. When the user wants to query keywords, the generated retrieval trap is sent to the blockchain for query, and the corresponding data is obtained from the server based on the returned results. Blockchain-based searchable encryption realizes the decentralization of the retrieval process, ensures the legitimacy of the returned results, and reduces the storage space and search cost of the cloud server.

[0005] Although existing work provides solutions for blockchain-based search, there is currently no solution that can simultaneously solve the three problems of decentralization of retrieval, fine-grained access control for users, and forward and backward privacy of data.

[0006] Decentralization of retrieval can eliminate single point failure problems and thus improve the stability of the system. Most existing work performs retrieval operations through a single server. Fine-grained access control of users plays a very important role in ensuring the data security of data owners, and its multi-user mode has many application scenarios. Some existing blockchain methods do not support this feature. The forward privacy of data ensures that users cannot retrieve data updated after the trapdoor is generated by using the previously generated retrieval trapdoor, while the backward privacy of data ensures that users cannot retrieve data that was previously added but has now been deleted by using the retrieval trapdoor. Most existing work does not take this issue into account, and the solutions that have this security consideration do not refine user access rights.

[0007] In summary, even though some works have proposed excellent solutions to some of the above three problems, they still inevitably make compromises in other aspects and cannot solve the three problems at the same time. Therefore, how to design a complete attribute-based searchable encryption scheme with forward and backward privacy on the blockchain for the above three problems in the context of big data and cloud storage has become a key issue that needs to be solved urgently. Summary of the invention

[0008] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and to provide an attribute-based searchable encryption method and system with forward and backward privacy on a blockchain, which uses ciphertext policy attribute-based encryption (CP-ABE for short) to support fine-grained access control for users and can effectively set user access rights; at the same time, forward privacy and backward privacy of data are achieved; and blockchain is used to achieve decentralized retrieval, which can effectively avoid single point failures.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] The present invention provides, on one hand, an attribute-based searchable encryption method with forward and backward privacy on a blockchain, comprising the following steps:

[0011] S1, the data owner DO generates the system parameter SPP according to the security parameter λ and publishes SPP, then generates the private key dk1 and dk2 according to SPP, and uses the public parameter SPP, the private key dk2 and the attribute set S of the data user, i.e. the useru , generate a private key K for the user u and sent to the user DU through a secure channel;

[0012] S2. The data owner DO uses its private key dk1, data set DB = {OP, ind, W, T}, public parameter SPP and a mapping ∑ to generate an index ciphertext set EDB and an updated mapping ∑ for the document, and deploys EDB to the blockchain, where OP represents the operation mode on the data, i.e., adding or deleting, ind represents the file index set, W represents the keyword set, and T represents the access tree set of the keyword;

[0013] S3. When the data user DU performs a retrieval operation, the data user uses his private key K u Encrypt the keyword q, obtain the retrieval trap Tra and send it to the blockchain network;

[0014] S4. After the blockchain network BP receives the retrieval trap Tra sent by the data user DU, BP first ind ] Get the corresponding access tree T; then use T in the trapdoor q The user's attribute set is calculated on the access tree to obtain C, and EDB[H2(C)] is used to determine whether the user has the corresponding access rights. After the permission check is passed, the corresponding state value is obtained according to EDB[H2(C)]. Starting from this state, the encrypted index related to the keyword q updated before is added to the result set MEI, and finally MEI is returned to the data user.

[0015] S5. After receiving the result set MEI, the data user uses the private key K u , recover the corresponding plaintext content.

[0016] As a preferred technical solution, in step S1, after the data owner DO generates the system parameters SPP, private key dk1 and private key dk2, the system parameters SPP are publicly published in the blockchain network or broadcast to all users, and all users have the right to access the system public parameters SPP; the private keys dk1 and dk2 are stored in the data owner DO, and only the data owner DO has the right to access the private keys dk1 and dk2.

[0017] As a preferred technical solution, step S1 is specifically as follows:

[0018] S11. Data owner DO uses group generator implement Generate (G1, G2, e, g, q), where q is a prime number, G1 and G2 are multiplicative groups with respect to q, g is the generator of G1, and e∶G1×G1→G2 is a bilinear map;

[0019] S12. The data owner DO randomly selects multiple secure hash functions and selects a pseudo-random sequence generation function F, F -1 , F: {0,1} λ *{0,1} λ →{0,1} λ , F -1 is its inverse permutation; the above secure hash function, pseudo-random sequence generation function and the parameters in step S11 are combined into public parameters SPP = (G1, G2, e, g, q, H0, H1, H2, H3H4, h1, h2, h3, h4, F, F -1 ), publish the SPP in the blockchain network or broadcast it to all users in the system, where H0, H1, H2, H3, H4, h1h, 2, h3, h4 all represent secure hash functions;

[0020] S13, the data owner DO initializes an empty mapping ∑, that is, ∑[key] = value, which is maintained by the data owner DO and is used to store the status of the keyword;

[0021] S14. The data owner DO defines the Lagrange coefficient: Where S represents a set, i, j∈Z q * ;

[0022] S15. The data owner randomly selects α, β∈Z q * , calculate g α ,g β and e(g,g) α , we get dk1=(e(g,g) α ,g β ),dk2=(β,g α );

[0023] S16. The data owner randomly selects r∈Z q * ,calculate and k3=g r , for the user's attribute set S u Each attribute a in i , the following calculations are performed: Randomly select Then calculate and The end user's private key And send it to user DU through a secure channel.

[0024] As a preferred technical solution, in step S2, the index ciphertext set EDB refers to the data encrypted by the data owner through the keyword. In the search phase, the access tree index T submitted by the user is ind Find the corresponding visit tree For the keyword w i The server uses the access tree and the search token sent by the user to calculate the result, and uses the result to determine whether there is a corresponding encrypted index to continue the search.

[0025] As a preferred technical solution, step S2 is specifically as follows:

[0026] S21. The data owner DO randomly selects a version number v∈Z q * , calculate and publish version information EV = g v ;

[0027] S22, the data owner performs a query on each keyword w in the dataset DB. i Perform the following calculations and use the mapping ∑ to determine whether the keyword exists. If not, change its status value Initialize, then use the state value to calculate the key Then Stored in the corresponding value Among them is DB(w i ), DB(w i ) is w i The corresponding set of file indexes;

[0028] S23, for DB(w i ) Perform the following calculations and first encrypt the index. The formula is as follows:

[0029]

[0030] Then use the state value to calculate another key Store the encrypted index in the corresponding value Among them,

[0031]

[0032]

[0033] S24, then the data owner randomly selects a secret number s∈Z q * , and calculate s is the secret value of the root of the access tree as an attribute; let t be The root node of For each node x in the , do the following calculation, if x is t, then randomly select d t =k t -1 degree polynomial q t , and set q t (0) = s, randomly set d t polynomial q t The coefficients of q t Definition; otherwise, randomly select d x =k x -1 degree polynomial q x , and set q x (0) = q parent(x) (index(x));

[0034] S25. Let X be the set of all leaf nodes, and perform the following calculation for each leaf node x:

[0035]

[0036]

[0037] Finally, the corresponding access tree is obtained

[0038] S26. Finally, calculate the value that matches the user trapdoor and access the index T of the tree ind

[0039]

[0040]

[0041] And calculate using its hash value as the key The result of XORing another hash value with the state value is used as the value in,

[0042]

[0043]

[0044] S27. The data owner will Insert into smart contract.

[0045] As a preferred technical solution, step S3 is specifically as follows:

[0046] S31, the data user's private key is Use k2 and q to calculate temp,

[0047]

[0048] S32, then use k1 and temp to calculate T q ,

[0049]

[0050] S33, finally use the version number EV to calculate the access tree index T with version information ind ,

[0051]

[0052] S34, data user DU obtains the retrieval trap according to the above variable combination:

[0053] Tra=<T ind ,T q ,S u >

[0054] in,

[0055]

[0056]

[0057]

[0058] S35. The data user DU sends the retrieval trap Tra to the blockchain network.

[0059] As a preferred technical solution, step S4 is specifically as follows:

[0060] S41. The blockchain network obtains the index T of the access tree from the trapdoor ind , thus obtaining the access tree T = EDB[T ind ];

[0061] S42, let x represent a node of T, and perform the following calculation for each leaf node x in T: Let a represent the attribute corresponding to the leaf node x, that is, a=attr(x). If a∈S u , then calculate F x ,

[0062]

[0063] Otherwise F x =⊥; perform the following calculation for each non-leaf node x in T: Let S x Indicates k x The size of the set of child nodes z belonging to x, if S x If it does not exist, then Fx =⊥, otherwise use Lagrange interpolation to calculate F x ,

[0064]

[0065] in,

[0066] i=index(z),

[0067] is the Lagrange coefficient

[0068] Let t represent the root node of T: If F t =⊥, then return 0, otherwise calculate C,

[0069]

[0070] in,

[0071]

[0072] S43, then calculate the key according to C if It means that the user does not have the corresponding access rights; otherwise, get the corresponding value

[0073]

[0074] And according to Calculate the status value

[0075]

[0076] S44, then enter the loop, and pass the status value Get Key

[0077]

[0078] if If it is not empty, the corresponding value is obtained. Otherwise, the loop ends and the result set MEI is returned.

[0079]

[0080] use Get the length of the index set containing the current keyword in this state

[0081]

[0082] Let j range from 1 to First use the state value and j get the key

[0083]

[0084] So as to obtain the value

[0085]

[0086] Then calculate the encrypted index And add it to the result set MEI,

[0087]

[0088] Finally when When , backtrack to the previous state value

[0089]

[0090] And assign it to Continue the LOOP.

[0091] As a preferred technical solution, step S5 is specifically as follows:

[0092] S51. Data user for each of the MEI Do the following calculations, first calculate temp,

[0093]

[0094] Then decrypt to get the file index

[0095]

[0096] S52: Use the file index to obtain the file on the cloud storage server to obtain the corresponding document.

[0097] On the other hand, the present invention provides an attribute-based searchable encryption system with forward and backward privacy on a blockchain, which is applied to the attribute-based searchable encryption method with forward and backward privacy on the blockchain, and the searchable encryption system includes: a cloud storage subsystem running on a cloud server, an initialization and encryption subsystem running on a data owner, a retrieval trapdoor generation and decryption subsystem running on a data user, and a retrieval subsystem running on a blockchain network;

[0098] The cloud storage subsystem is used to store the file ciphertext, and return the file ciphertext according to the corresponding file index, and send it to the data user;

[0099] The initialization and encryption subsystem includes an initialization module, a private key storage module and an encryption module; wherein the initialization module is used to generate system public parameters, private keys and user private keys, and publicly publish the system public parameters on the blockchain network, save the two private keys to the private key storage module, and send the user private key to the data user; the master private key storage module is used to store the master private key, which is only accessible to the data owner; the encryption module is responsible for encrypting the file and storing it in the cloud storage subsystem, and using the private key to encrypt the index set and access tree corresponding to each keyword to obtain the index ciphertext, and send the index ciphertext to the blockchain network;

[0100] The retrieval trapdoor generation and decryption subsystem includes a user trapdoor generation module and a data decryption module; wherein the user trapdoor generation module is responsible for using the user's private key and the retrieval keyword to calculate a legal retrieval trapdoor and send the retrieval trapdoor to the blockchain network; the data decryption module uses the user's private key to restore the plaintext index of the encrypted index set retrieved, and sends the plaintext index to the cloud server to obtain the corresponding file;

[0101] The retrieval subsystem includes an encrypted data set storage module and a retrieval module; wherein the encrypted data set storage module obtains the encrypted index, access tree and related key-value pairs from the data owner and stores them in the blockchain network; the retrieval module is responsible for processing the retrieval trap sent by the data user, and determines whether the user has access rights based on the retrieval trap, and then returns the encrypted index set containing the retrieval keyword to the user.

[0102] Yet another aspect of the present invention provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the attribute-based searchable encryption method with forward and backward privacy on the blockchain.

[0103] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0104] 1. Guarantee forward privacy and backward privacy. The present invention allows the retrieval system to add a specific state value to each update and retrieval trap, so as to control the retrieval time span of the trap, so that the previously generated retrieval trap cannot retrieve the data content updated later, that is, forward privacy. Each update, whether addition or deletion, is reflected by the operator op, which makes it impossible for the adversary to obtain useful information on the index without the user's private key, thereby achieving backward privacy.

[0105] 2. Fine-grained access control: The present invention supports the segmentation of user attributes, and uses an access tree to control access to each keyword. Only when the user's attributes satisfy the access tree can the user retrieve the corresponding results.

[0106] 3. Decentralized retrieval; the present invention also supports the use of smart contracts deployed on the blockchain to perform retrieval operations, which brings better system stability and retrieval credibility to data users in searching encrypted data, reduces the possibility of single point failures, and can ensure the correctness of retrieval results.

[0107] 4. Practicality and security: The present invention is constructed using prime order groups, bilinear mappings, and ciphertext policy attribute searchable encryption scheme (CP-ABSE). It has the characteristics of flexible expressiveness of access control and access policies, has strong security, and balances issues such as forward privacy, backward privacy, and decentralization of data retrieval, and has good practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0109] Figure 1 is an example diagram of a fine-grained access control tree used in the present invention;

[0110] Figure 2 It is a flow chart of a method for an attribute-based searchable encryption scheme with forward and backward privacy on a blockchain of the present invention;

[0111] Figure 3 It is a method and system structure diagram of an attribute-based searchable encryption scheme with forward and backward privacy on the blockchain of the present invention. DETAILED DESCRIPTION

[0112] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0113] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0114] Before introducing the technical solution of the present invention, the mathematical basis and definitions related to the present invention are explained as follows.

[0115] (1) Bilinear pair mapping:

[0116] Let G1 and G2 represent two cyclic multiplicative groups with the same order q, and define the mapping on G1 and G2 as e:G1*G1→G2; if the mapping e satisfies the following properties (1.1)-(1.3), then e is a bilinear pairing mapping.

[0117] (1.1) Bilinear: For all And x,y∈G1, we have e(x a ,y b )=e(x,y) ab ; For all x1,x2,y∈G1, e(x1x2,y)=e(x1,y)e(x2,y); For all x,y1,y2∈G1, e(x,y1y2)=e(x,y1)e(x,y2).

[0118] (1.2) Computability: For any x,y∈G1, there exists a polynomial time algorithm to efficiently compute e(x,y)∈G2.

[0119] (1.3) Non-degeneracy: If g is a generator of G1, then e(g,g) is a generator of G2.

[0120] (2) Access structure and access tree:

[0121] (2.1) Access structure: Let P = {P1, P2, ..., P n} represents a set of participants; for a monotone set If and only if the set When B∈A, Then C∈A. That is, A is a subset of the power set of the participant set, which is a set of sets. B and C are subsets of the participant set. When B is included in A, that is, it is an element of A. If B is a subset of C at the same time, then C is also included in A, that is, C is also an element of A, then A is monotone.

[0122] (2.2) Access tree: Let T represent a tree of access control policies; in T, each non-leaf node represents a threshold gate, described by its child nodes and threshold, and each leaf node represents an attribute, represented by num x and k x Represents the number of child nodes of node x and its threshold. Here, for a non-leaf node, its threshold k x There are three cases: k x =1 means node x is an OR gate; k x =num x Indicates that node x is an AND gate; 1<k x <num x indicates that node x is a threshold gate. And we define k x =1, it means that node x is a leaf node.

[0123] Several symbolic definitions about the access tree are as follows: (x) represents the parent node of x; for a leaf node x, attr(x) is used to represent the attribute associated with the leaf node; index(x) represents the label of x; given a node y containing c child nodes, its child nodes are numbered from 1 to c.

[0124] Determine whether the access tree is satisfied: Let T x is a subtree of T with node x as the root node; if a set of attributes S satisfies T x , then it is represented as T x (S) = 1. Where T x (S) is calculated as follows: if x is a non-leaf node, then T is calculated for all child nodes x′ of node x. x′ (S), if and only if at least k x When the child node returns 1, T x (S) returns 1. If x is a leaf node, then T x (S) returns 1. Therefore, according to the above recursive calculation, if the set S satisfies T, then T r (S)=1, where r is the root node of T.

[0125] Access tree structure as attached Figure 1, starting from the root node, whose threshold value is 2, and there are 3 child nodes, a polynomial is randomly generated, whose highest degree is the threshold value minus 1, so the highest degree of the root node is 1, and then the constant term is set to the secret number (the secret number is the number that needs to be kept secret); so the random polynomial of the root node is f(x) = 5 + 3x, and the secret number is 5. In addition, the child nodes of the root node are marked as 1, 2, 3... from left to right, and the node mark value is substituted into the f(x) function, and the obtained value is passed to the marked child node for secret storage; therefore, the "3 / 3" node (the first node on the left) is marked as 1, and the secret value passed to the "3 / 3" node is f(1) = 5 + 3*1 = 8, the middle "teacher" node (middle node) is marked as 2, and the secret value passed to the "teacher" node is f(2) = 5 + 3*2 = 11, and the "1 / 2" node (right node) is marked as 3, and the secret value passed to the "1 / 2" node is f(3) = 5 + 3*3 = 14.

[0126] To decrypt the source data encrypted by this access tree, there are three attributes that the data accessor needs to meet: the user attributes are ("School of Computer Science" and "Master's degree" and "Second year of graduate school") and "Teacher"; the user attributes are "Teacher" and ("Network Laboratory" or "Cloud Laboratory"); the user attributes are ("School of Computer Science" and "Master's degree" and "Second year of graduate school") and ("Network Laboratory" or "Cloud Laboratory"), otherwise access is not possible.

[0127] (2.3) Pseudo-random permutation function, which implements a function that cannot be distinguished from random permutation. When the mapping F:{0,1} L *{0,1} λ →{0,1} L is a pseudo-random permutation function, it satisfies the following properties: for any K←{0,1} λ , the mapping F is from {0,1} L to {0,1} L bijection of; for any probabilistic polynomial-time adversary where K←{0,1} λ , f is a random permutation function on an L-bit string, ε is negligible; for any K←{0,1} λ and x←{0,1} L , there exists an efficient algorithm to calculate F K (x).

[0128] like Figure 2As shown in FIG. 1 , the execution process of the attribute-based searchable encryption method with forward and backward privacy on the blockchain of this embodiment is as follows: first, the data owner DO initializes the system public parameter SPP, and then publicly publishes the system public parameter on the blockchain network or broadcasts it to all system users. All users in the system have the right to access the system public parameter. Then DO generates private keys dk1 and dk2 based on SPP, and uses the public parameter SPP, private key dk2 and the user's attribute set S u , generate a user private key K for the user u , and finally send the user private key to the user DU through a secure channel. When uploading a file, the data owner first uploads the encrypted file to the cloud storage server. After obtaining the file index returned by the cloud storage server, the data owner uses the private key dk1, the data set DB = {OP, ind, W, T}, the system public parameter SPP, and a mapping ∑ to generate the index ciphertext set EDB and the updated mapping ∑ for the document, and deploys the ciphertext set EDB to the blockchain. When the data user DU performs a retrieval operation, the data user uses his private key K u The keyword q is encrypted to obtain the retrieval trap Tra and send it to the blockchain network.

[0129] After the blockchain network BP receives the retrieval trap Tra sent by the data user DU, BP first ind ] Get the corresponding access tree T; then use T in the trapdoor q A series of calculations are performed on the access tree to obtain C, and EDB[H2(C)] can be used to determine whether the user has the corresponding access rights. After the permission check is passed, the corresponding state value is obtained according to EDB[H2(C)]. Starting from this state, the encrypted index related to the keyword q that was updated before is added to the result set MEI, and finally MEI is returned to the data user. After receiving the result set MEI, the data user uses the private key K u , restore the corresponding plaintext index and obtain the corresponding file from the cloud storage server.

[0130] Furthermore, the steps of the attribute-based searchable encryption method with forward and backward privacy in this embodiment are specifically as follows:

[0131] S1. System initialization step: The data owner DO generates the system parameter SPP based on the security parameter λ and publishes it, then generates the private keys dk1 and dk2 based on the SPP, and then uses the public parameter SPP, the private key dk2 and the attribute set S of the data user, i.e. the user u , generate a private key K for the user u and sent to user DU through a secure channel.

[0132] It can be understood that the above-mentioned data owner DO can be a medical institution with a lot of data, which is responsible for generating the system parameter SPP, as well as the private key dk1 for file index encryption and the private key dk2 for generating user private keys, where the system public parameter SPP is a collection of a series of parameters, and the private key dk1 and the private key dk2 are both one-dimensional arrays of size 2.

[0133] After the data owner DO generates the system parameters SPP, private key dk1 and private key dk2, the system public parameters SPP are publicly published in the blockchain network or broadcast to all users in the system. All users in the system have the right to access the system public parameters SPP; private keys dk1 and private keys dk2 are properly stored in the data owner DO, and only the data owner DO has the right to access private keys dk1 and private keys dk2.

[0134] Furthermore, the step S1 specifically includes the following contents:

[0135] S11. Data owner DO uses group generator implement Generate (G1, G2, e, g, q). Where q is a prime number, G1 and G2 are multiplicative groups with respect to q, g is the generator of G1, and e∶G1×G1→G2 is a bilinear map.

[0136] S12. The data owner DO randomly selects nine secure hash functions, H0: {0,1} * →Z q * ,H1:G1*0,1} * →{0,1} λ+1 , H2, H3: G2→{0,1} 2λ , H4: {0,1} * →G1,h1:{0,1} λ →{0,1} 2λ ,h2: h3: h4: Where N max Refers to the maximum number of indexes containing keywords. Select a pseudo-random sequence generation function F / F -1 , F: {0,1} λ *{0,1} λ →{0,1} λ , F -1 is its inverse permutation. Combine the above security function, pseudo-random sequence generation function and the parameters in the first step into the system public parameter SPP = (G1, G2, e, g, q, H0, H1, H2, H3, H4, h1, h2, h3, h4, F, F-1 ), publish it in the blockchain network or broadcast it to all users in the system.

[0137] S13. The data owner DO initializes an empty mapping ∑, ie, ∑[key]=value. The mapping is maintained by the data owner DO and is used to store the status of the keyword.

[0138] S14. The data owner DO defines Lagrange coefficients: Where S represents a set, i, j∈Z q * .

[0139] S15. The data owner randomly selects α,β∈Z q * , calculate g α ,g β and e(g,g) α , we get dk1=(e(g,g) α ,g β ),dk2=(β,g α ).

[0140] S16. The data owner randomly selects r∈Z q * ,calculate and k3=g r , for the user's attribute set S u Each attribute a in i , the following calculations are performed: Randomly select Then calculate and The end user's private key And send it to user DU through a secure channel.

[0141] S2, encryption step: the data owner uses his private key dk1, data set DB = {OP, ind, W, T}, system public parameter SPP and a mapping ∑ to generate an index ciphertext set EDB and an updated mapping ∑ for the document, and deploys EDB to the blockchain. Among them, OP = {addition, deletion}, ind = {ind1, ind2, ...}, W = {w1, w2 ... w D},

[0142] The index ciphertext set EDB refers to the data encrypted by the data owner through the keyword. In the search phase, the access tree index T submitted by the user is used to ind Find the corresponding visit tree For the keyword w i The server uses the access tree and the search token sent by the user to calculate the result, and uses the result to determine whether there is a corresponding encrypted index to continue the search.

[0143] Furthermore, the specific content of step S2 is:

[0144] S21. The data owner DO randomly selects a version number v∈Z q * , calculate and publish version information EV = g v .

[0145] S22, the data owner performs a query on each keyword w in the dataset DB. i Perform the following calculations and use the mapping ∑ to determine whether the keyword exists. If not, change its status value Initialize, then use the state value to calculate the key Then Stored in the corresponding value Among them is DB(w i ), DB(w i ) is w i The corresponding set of file indexes.

[0146] S23, for DB(w i ) Perform the following calculations and first encrypt the index. The formula is as follows:

[0147]

[0148] Then use the state value to calculate another key Store the encrypted index in the corresponding value Among them,

[0149]

[0150]

[0151] S24, then the data owner randomly selects a secret number s∈Z q * , and calculate s is the secret value of the root of the tree as an attribute access. Let t be The root node of For each node x in the , do the following calculation, if x is t, then randomly select d t =k t -1 degree polynomial q t , and set q t(0) = s, randomly set d t polynomial q t The coefficients of q t Definition; otherwise, randomly select d x =k x -1 degree polynomial q x , and set q x (0)= parent(x) (index(x)).

[0152] S25. Let X be the set of all leaf nodes, and perform the following calculation for each leaf node x:

[0153]

[0154]

[0155] Finally, the corresponding access tree is obtained

[0156] S26. Finally, calculate the value that matches the user trapdoor and access the index T of the tree ind

[0157]

[0158]

[0159] And calculate using its hash value as the key The result of XORing another hash value with the state value is used as the value in,

[0160]

[0161]

[0162] S27. The data owner will Insert into smart contract.

[0163] S3, retrieval trap generation step: When the data user DU performs a retrieval operation, the data user uses his private key K u The keyword q is encrypted to obtain the retrieval trap Tra and send it to the blockchain network.

[0164] Furthermore, the step S3 is specifically as follows:

[0165] S31, the data user's private key is Use k2 and q to calculate temp,

[0166]

[0167] S32, then use k1 and temp to calculate T q ,

[0168]

[0169] S33, finally use the version number EV to calculate the access tree index T with version information ind ,

[0170]

[0171] S34, data user DU obtains the retrieval trap according to the above variable combination:

[0172] Tra= <T ind ,T q ,S u >

[0173] in,

[0174]

[0175]

[0176]

[0177] S35. The data user DU sends the retrieval trap Tra to the blockchain network.

[0178] S4, ciphertext search step: After the blockchain network BP receives the retrieval trap Tra sent by the data user DU, BP first searches according to EDB[T ind ] Get the corresponding access tree T; then use T in the trapdoor q A series of calculations are performed on the access tree based on the user's attribute set to obtain C. According to EDB[H2(C)], it can be determined whether the user has the corresponding access rights. After the permission check is passed, the corresponding state value is obtained according to EDB[H2(C)]. Starting from this state, the encrypted index related to the keyword q updated before is added to the result set MEI, and finally MEI is returned to the data user.

[0179] Furthermore, the specific content of step S4 is:

[0180] S41. The blockchain network obtains the index T of the access tree from the trapdoor ind , thus obtaining the access tree T = EDB[T ind ].

[0181] S42, let x represent a node of T, and perform the following calculation for each leaf node x in T: Let a represent the attribute corresponding to the leaf node x, that is, a=attr(x). If a∈S u , then calculate F x ,

[0182]

[0183] Otherwise F x =⊥; perform the following calculation for each non-leaf node x in T: Let S x Indicates k x The size of the set of child nodes z belonging to x, if S x If it does not exist, then F x =⊥, otherwise use Lagrange interpolation to calculate F x ,

[0184]

[0185]

[0186] in,

[0187] i=index(z),

[0188] is the Lagrange coefficient

[0189] Let t represent the root node of T: If F t =⊥, then return 0, otherwise calculate C,

[0190]

[0191] in,

[0192]

[0193] S43, then calculate the key according to C if It means that the user does not have the corresponding access rights; otherwise, get the corresponding value

[0194]

[0195] And according to Calculate the status value

[0196]

[0197] S44, then enter the loop, and pass the status value Get Key

[0198]

[0199] if If it is not empty, the corresponding value is obtained. Otherwise, the loop ends and the result set MEI is returned.

[0200]

[0201] use Get the length of the index set containing the current keyword in this state

[0202]

[0203] Let j range from 1 to First use the state value and j get the key

[0204]

[0205] So as to obtain the value

[0206]

[0207] Then calculate the encrypted index And add it to the result set MEI,

[0208]

[0209] Finally when When , backtrack to the previous state value

[0210]

[0211] And assign it to Continue the LOOP.

[0212] S5, decryption step: After the data user receives the result set MEI, use the private key K u , recover the corresponding plaintext content.

[0213] Furthermore, the specific content of step S5 is:

[0214] S51. Data user for each of the MEI Do the following calculations, first calculate temp,

[0215]

[0216] Then decrypt to get the file index

[0217]

[0218] S52: Use the file index to obtain the file on the cloud storage server to obtain the corresponding document.

[0219] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.

[0220] like Figure 3 As shown, in another embodiment of the present application, a searchable encryption system with forward and backward privacy based on attributes on a blockchain is provided, comprising a cloud storage subsystem running on a cloud server, an initialization and encryption subsystem running on a data owner, a retrieval trapdoor generation and decryption subsystem running on a data user, and a retrieval subsystem running on a blockchain network;

[0221] The cloud storage subsystem is used to store the file ciphertext, and return the file ciphertext according to the corresponding file index, and send it to the data user;

[0222] The initialization and encryption subsystem includes an initialization module, a private key storage module and an encryption module; wherein the initialization module is used to generate system public parameters, private keys and user private keys, and publicly publish the system public parameters on the blockchain network, save the two private keys to the private key storage module, and send the user private key to the data user; the master private key storage module is used to store the master private key, which is only accessible to the data owner; the encryption module is responsible for encrypting the file and storing it in the cloud storage subsystem, and using the private key to encrypt the index set and access tree corresponding to each keyword to obtain the index ciphertext, and send the index ciphertext to the blockchain network;

[0223] The retrieval trapdoor generation and decryption subsystem includes a user trapdoor generation module and a data decryption module; wherein the user trapdoor generation module is responsible for using the user's private key and the retrieval keyword to calculate a legal retrieval trapdoor and send the retrieval trapdoor to the blockchain network; the data decryption module uses the user's private key to restore the plaintext index of the encrypted index set retrieved, and sends the plaintext index to the cloud server to obtain the corresponding file;

[0224] The retrieval subsystem includes an encrypted data set storage module and a retrieval module; wherein the encrypted data set storage module obtains the encrypted index, access tree and related key-value pairs from the data owner and stores them in the blockchain network; the retrieval module is responsible for processing the retrieval trap sent by the data user, and determines whether the user has access rights based on the retrieval trap, and then returns the encrypted index set containing the retrieval keyword to the user.

[0225] For ease of explanation, in the structural diagram of an embodiment of an attribute-based searchable encryption system with forward and backward privacy on a blockchain, only the parts related to the embodiment of the present invention are shown. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the diagram, or a combination of certain components, or a different arrangement of components.

[0226] In addition, in the implementation of the attribute-based searchable encryption system with forward and backward privacy on the blockchain of the above-mentioned embodiment, the logical division of each program module is only an example. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the multi-party privacy-preserving machine learning system based on homomorphic encryption and trusted hardware is divided into different program modules to complete all or part of the functions described above.

[0227] In another embodiment, a computer-readable storage medium is provided, storing a program, and when the program is executed by a processor, the attribute-based searchable encryption method with forward and backward privacy on the blockchain is implemented, specifically:

[0228] S1, the data owner DO generates the system parameter SPP according to the security parameter λ and publishes SPP, then generates the private key dk1 and dk2 according to SPP, and uses the public parameter SPP, the private key dk2 and the attribute set S of the data user, i.e. the user u , generate a private key K for the user u and sent to the user DU through a secure channel;

[0229] S2. The data owner DO uses its private key dk1, data set DB = {OP, ind, W, T}, public parameter SPP and a mapping ∑ to generate an index ciphertext set EDB and an updated mapping ∑ for the document, and deploys EDB to the blockchain, where OP represents the operation mode on the data, i.e., adding or deleting, ind represents the file index set, W represents the keyword set, and T represents the access tree set of the keyword;

[0230] S3. When the data user DU performs a retrieval operation, the data user uses his private key K uEncrypt the keyword q, obtain the retrieval trap Tra and send it to the blockchain network;

[0231] S4. After the blockchain network BP receives the retrieval trap Tra sent by the data user DU, BP first ind ] Get the corresponding access tree T; then use T in the trapdoor q The user's attribute set is calculated on the access tree to obtain C, and EDB[H2(C)] is used to determine whether the user has the corresponding access rights. After the permission check is passed, the corresponding state value is obtained according to EDB[H2(C)]. Starting from this state, the encrypted index related to the keyword q updated before is added to the result set MEI, and finally MEI is returned to the data user.

[0232] S5. After receiving the result set MEI, the data user uses the private key K u , recover the corresponding plaintext content.

[0233] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0234] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0235] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. An attribute-based searchable encryption method with forward and backward privacy on blockchain, characterized in that: The steps include: S1 and data owner D0 generate system parameters SPP according to security parameters λ and publish SPP, then generate private keys dk1 and dk2 according to SPP, and use public parameters SPP, private key dk2 and attribute set S of data user, i.e. user u , generate a private key K for the user u and sent to the user DU through a secure channel; step S1 is specifically as follows: S11, data owner D0 uses group generator implement Generate (G1, G2, e, g, q), where q is a prime number, G1 and G2 are multiplicative groups with respect to q, g is the generator of G1, and e: G1×G1→G2 is a bilinear map; S12. The data owner D0 randomly selects multiple secure hash functions and selects a pseudo-random sequence generation function F, F -1 , F: {0, 1} λ *{0, 1} λ →{0, 1} λ , F-1 is its inverse permutation; the above secure hash function, pseudo-random sequence generation function and the parameters in step S11 are combined into public parameters SPP = (G1, G2, e, g, q, H0, H1, H2, H3, H4, h1, h2, h3, h4, F, F -1 ), publish the SPP in the blockchain network or broadcast it to all users in the system, where H0, H1, H2, H3, H4, h1, h2, h3, h4 all represent secure hash functions; S13, the data owner D0 initializes an empty mapping ∑, that is, ∑[key] = value, which is maintained by the data owner D0 and is used to store the status of the keyword; S14. The data owner D0 defines the Lagrange coefficient: Where S represents a set, i, j∈Z q * ; S15. The data owner randomly selects α, β∈Z q * , calculate g α , g β and e(g, g) α , we get dk1 = (e(g, g)α, g β ), dk2 = (β, gα); S16. The data owner randomly selects r∈Z q * ,calculate and k3=g r , for the user's attribute set S u Each attribute a in i , the following calculations are performed: Randomly select Then calculate and The end user's private key And send it to the user DU through a secure channel; S2. The data owner D0 uses its private key dk1, data set DB = {0P, ind, W, T}, public parameter SPP and a mapping ∑ to generate an index ciphertext set EDB and an updated mapping ∑ for the document, and deploys EDB to the blockchain, where OP represents the operation mode on the data, i.e., adding or deleting, ind represents the file index set, W represents the keyword set, and T represents the access tree set of the keyword; S3. When the data user DU performs a retrieval operation, the data user uses his private key K u Encrypt the keyword q, obtain the retrieval trap Tra and send it to the blockchain network; S4. After the blockchain network BP receives the retrieval trap Tra sent by the data user DU, BP first ind ] Get the corresponding access tree T; then use T in the trapdoor q The user's attribute set is calculated on the access tree to obtain C, and EDB[H2(C)] is used to determine whether the user has the corresponding access rights. After the permission check is passed, the corresponding state value is obtained according to EDB[H2(C)]. Starting from this state, the encrypted index related to the keyword q updated before is added to the result set MEI, and finally MEI is returned to the data user. S5. After receiving the result set MEI, the data user uses the private key K u , recover the corresponding plaintext content.

2. The attribute-based searchable encryption method with forward and backward privacy on the blockchain according to claim 1, characterized in that: In step S1, after the data owner D0 generates the system parameters SPP, private key dk1 and private key dk2, the system parameters SPP are publicly published in the blockchain network or broadcast to all users, and all users have the right to access the system public parameters SPP; the private keys dk1 and dk2 are stored in the data owner D0, and only the data owner D0 has the right to access the private keys dk1 and dk2.

3. The attribute-based searchable encryption method with forward and backward privacy on the blockchain according to claim 1, characterized in that: In step S2, the index ciphertext set EDB refers to the data encrypted by the data owner through the keyword. During the search phase, the access tree index T submitted by the user is used to ind Find the corresponding visit tree For the keyword w i The server uses the access tree and the search token sent by the user to calculate the result, and uses the result to determine whether there is a corresponding encrypted index to continue the search.

4. The attribute-based searchable encryption method with forward and backward privacy on the blockchain according to claim 1, characterized in that: Step S2 is specifically as follows: S21. The data owner D0 randomly selects a version number v∈Z q * , calculate and publish version information EV = g v ; S22, the data owner performs a query on each keyword w in the dataset DB. i Perform the following calculations and use the mapping ∑ to determine whether the keyword exists. If not, change its status value Initialize, then use the state value to calculate the key Then Stored in the corresponding value Among them is DB(w i ), DB(w i ) is w i The corresponding set of file indexes; S23, for DB(w i ) Perform the following calculations and first encrypt the index. The formula is as follows: Then use the state value to calculate another key Store the encrypted index in the corresponding value Among them, S24, then the data owner randomly selects a secret number s∈Z q * , and calculate s is the secret value of the root of the access tree as an attribute; let t be The root node of For each node x in the , do the following calculation, if x is t, then randomly select d t =k t -1 degree polynomial q t , and set q t (0) = s, randomly set d t polynomial q t The coefficients of q t Definition; otherwise, randomly select d x =k x -1 degree polynomial q x , and set q x (0) = q parent(x) (index(x)); S25. Let X be the set of all leaf nodes, and perform the following calculation for each leaf node x: Finally, the corresponding access tree is obtained S26. Finally, calculate the value that matches the user trapdoor and access the index T of the tree ind And calculate using its hash value as the key The result of XORing another hash value with the state value is used as the value in, S27. The data owner will take the above key-value pairs Insert into smart contract.

5. The attribute-based searchable encryption method with forward and backward privacy on the blockchain according to claim 1, characterized in that: Step S3 is specifically as follows: S31, the data user's private key is Use k2 and q to calculate temp, S32, then use k1 and temp to calculate T q , S33, finally use the version number EV to calculate the access tree index T with version information ind , S34, data user DU obtains the retrieval trap according to the above variable combination: Between= <T ind ,T q ,S u > in, S35. The data user DU sends the retrieval trap Tra to the blockchain network.

6. The attribute-based searchable encryption method with forward and backward privacy on the blockchain according to claim 1, characterized in that: Step S4 is specifically as follows: S41. The blockchain network obtains the index T of the access tree from the trapdoor ind , thus obtaining the access tree T = EDB[T ind ]; S42, let x represent a node of T, and perform the following calculation for each leaf node x in T: Let a represent the attribute corresponding to the leaf node x, that is, a=attr(x). If a∈S u , then calculate F x , Otherwise F x =⊥; perform the following calculation for each non-leaf node x in T: Let S x Indicates k x The size of the set of child nodes z belonging to x, if S x If it does not exist, then F x =⊥, otherwise use Lagrange interpolation to calculate F x , in, i=index(z), is the Lagrange coefficient Let t represent the root node of T: If F t =⊥, then return 0, otherwise calculate C, in, S43, then calculate the key according to C if It means that the user does not have the corresponding access rights; otherwise, get the corresponding value And according to Calculate the status value S44, then enter the loop, and pass the status value Get Key if If it is not empty, the corresponding value is obtained. Otherwise, the loop ends and the result set MEI is returned. use Get the length of the index set containing the current keyword in this state Let j range from 1 to First use the state value and j get the key So as to obtain the value Then calculate the encrypted index And add it to the result set MEI, Finally When , backtrack to the previous state value And assign it to Continue the LOOP.

7. The attribute-based searchable encryption method with forward and backward privacy on the blockchain according to claim 1, characterized in that: Step S5 is specifically as follows: S51. Data user for each of the MEI Do the following calculations, first calculate temp, Then decrypt to get the file index S52: Use the file index to obtain the file on the cloud storage server to obtain the corresponding document.

8. A searchable encryption system with forward and backward privacy based on attributes on blockchain, characterized in that: An attribute-based searchable encryption method with forward and backward privacy on a blockchain as described in any one of claims 1 to 7, the searchable encryption system comprising: a cloud storage subsystem running on a cloud server, an initialization and encryption subsystem running on a data owner, a retrieval trap generation and decryption subsystem running on a data user, and a retrieval subsystem running on a blockchain network; The cloud storage subsystem is used to store the file ciphertext, and return the file ciphertext according to the corresponding file index, and send it to the data user; The initialization and encryption subsystem includes an initialization module, a private key storage module and an encryption module; wherein the initialization module is used to generate system public parameters, private keys and user private keys, and publicly publish the system public parameters on the blockchain network, save the two private keys to the private key storage module, and send the user private key to the data user; the private key storage module is used to store private keys, and only the data owner is allowed to access; the encryption module is responsible for encrypting the file and storing it in the cloud storage subsystem, and using the private key to encrypt the index set and access tree corresponding to each keyword to obtain the index ciphertext, and send the index ciphertext to the blockchain network; The retrieval trapdoor generation and decryption subsystem includes a user trapdoor generation module and a data decryption module; wherein the user trapdoor generation module is responsible for using the user's private key and the retrieval keyword to calculate a legal retrieval trapdoor and send the retrieval trapdoor to the blockchain network; the data decryption module uses the user's private key to restore the plaintext index of the encrypted index set retrieved, and sends the plaintext index to the cloud server to obtain the corresponding file; The retrieval subsystem includes an encrypted data set storage module and a retrieval module; wherein the encrypted data set storage module obtains the encrypted index, access tree and related key-value pairs from the data owner and stores them in the blockchain network; the retrieval module is responsible for processing the retrieval trap sent by the data user, and determines whether the user has access rights based on the retrieval trap, and then returns the encrypted index set containing the retrieval keyword to the user.

9. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the attribute-based searchable encryption method with forward and backward privacy on the blockchain described in any one of claims 1 to 7 is implemented.