Block chain assisted attribute-based ciphertext sorting retrieval system and method
Through the blockchain-assisted attribute-based ciphertext sorting and retrieval system, the problems of encrypted data access control and search result verification in the prior art are solved, efficient data sharing and user privacy protection are achieved, and network and computing overhead is reduced.
Patent Information
- Application Number
- CN202411262550.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-27
AI Technical Summary
The existing searchable encryption technology lacks access control mechanism for encrypted data, and cloud servers are untrusted, resulting in data users being unable to effectively verify search results, increasing computing and network overhead.
Using a blockchain-assisted attribute-based ciphertext sorting search system, the file is encrypted by the data owner and a keyword index is generated, which is stored on the blockchain. The data user generates a search threshold and matches the keyword index, and the cloud server verifies and returns The most relevant ciphertext file, decrypted by data users and verified file integrity, authoritative organizations manage attribute keys for fine-grained access control and attribute revocation.
It realizes fine-grained access control of encrypted data, reduces network bandwidth and computing overhead, and improves the accuracy of search results and user privacy security.
Smart Images

Figure CN119203225A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a blockchain-assisted attribute-based ciphertext sorting and retrieval system and method, and more specifically, to a blockchain-assisted attribute-based ciphertext sorting and retrieval system and method. Background Art
[0002] With the popularity of cloud servers, users with limited storage resources can store large amounts of data on cloud servers. However, cloud servers are centralized devices. After storing data on cloud servers, data owners lose control over the data. Therefore, in order to ensure data security, data owners encrypt local data before uploading it, but it is difficult for cloud servers to retrieve encrypted data, which undoubtedly limits the flexibility of data sharing. In this context, the concept of searchable encryption was proposed.
[0003] According to traditional decryption technology, data users need to download data from the cloud server to the local computer, decrypt it, and then search it, which will cause huge network and storage overhead. Searchable encryption enables searching data without decryption. However, not all results meet the needs of users. It is necessary to rank the query results based on the relevance of the query keywords and files, and only return the k files closest to the user's request. This not only saves network bandwidth overhead, but also reduces the user's time cost, which is more in line with practical requirements.
[0004] Existing searchable encryption technologies do not take into account the search permissions of data users, resulting in a lack of access control mechanisms for encrypted data. Data users have unlimited search capabilities and can submit any search keywords to retrieve data of interest. Fine-grained access control for keywords can be achieved by combining search encryption technology with attribute-based encryption technology. In addition, the attributes of data users may change frequently, so attribute revocation must be considered. At the same time, if the access control policy in the access control structure is exposed, it will lead to the leakage of users' sensitive information, so it is also necessary to consider the hiding of access policies.
[0005] At the same time, many existing solutions regard cloud servers as trusted third parties. However, in reality, cloud servers may return incorrect or incomplete search results to save computing costs or due to system errors. Therefore, data users cannot fully trust cloud servers and need to verify the returned results. However, local verification by data users will cause a lot of computing costs. Summary of the invention
[0006] In order to overcome the shortcomings of the above-mentioned technical problems, the present invention provides a blockchain-assisted attribute-based ciphertext sorting and retrieval system and method.
[0007] The blockchain-assisted attribute-based ciphertext sorting and retrieval system of the present invention includes a data owner, a data user, a blockchain, a cloud server and an authority, and the authority generates a system public parameter and sends it to the data owner, the data user and the cloud server; the characteristic is that: the data owner encrypts a plaintext file set to generate a ciphertext file set, extracts keywords from the plaintext file set to generate a keyword set, uses a ciphertext policy attribute encryption algorithm to encrypt keywords to generate a keyword index, and constructs a query list for each keyword ciphertext, sends the ciphertext file set to the cloud server, and stores the keyword index and the query list in the blockchain; the data user generates a search threshold according to the keyword to be searched, and stores the search threshold in the blockchain; the blockchain matches the search threshold uploaded by the data user with the keyword index, sends the id of the matched keyword ciphertext in the query list to the cloud server, the cloud server searches out the ciphertext file through the file id and sends it to the verification smart contract, and the verification smart contract sends the first K' ciphertext files with the highest correlation that have passed the verification to the data user; after receiving the ciphertext file, the data user decrypts it to obtain a plaintext file, and when it is necessary to revoke the attribute of a data user, the authority generates a new attribute key for the attribute to be revoked to replace the old attribute key.
[0008] The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention is implemented by the following steps:
[0009] a). System initialization; the authority generates system public parameters PK and system master key MSK;
[0010] b) Attribute private key generation: The data user sends the attribute set S to the authority, and the authority generates an attribute private key SK for each data user. u ;
[0011] c). Data encryption; the data owner generates a symmetric key K, K∈Z p * , use the symmetric encryption algorithm to encrypt the data owner's plaintext file set F to generate the ciphertext file set C; extract keywords from the plaintext file set F to generate the keyword set W = {w1, w2, ..., w m}, use the ciphertext policy attribute-based encryption algorithm CP-ABE to encrypt the keyword to generate the keyword index I W ; At the same time, build a query list for each keyword ciphertext:
[0012] Where: id(F τ ) means it contains the keyword w i The file identifier of the τth file, TF-IDF i,τ Indicates the keyword w i and file Fτ 's relevance score;
[0013] Finally, the data owner sends the ciphertext file C to the cloud server and the encrypted keyword index I W and query list Stored in blockchain;
[0014] d). Trapdoor generation: When a data user wants to search for files containing keyword w, a search trapdoor T is generated locally. w And stored in the blockchain through transactions;
[0015] e). Data search; search smart contract read search trap door T w After that with keyword index I w Matching is performed by matching keyword ciphertext C w In the query list The file ID is queried and sent to the cloud server. The cloud server searches for the ciphertext file through the file ID and sends it to the verification smart contract.
[0016] f). Data verification: After the smart contract receives the ciphertext file, it takes the hash value and query list. The hash values of the ciphertext files are compared. If they are equal, the ciphertext files are sorted according to the relevance scores, and only the first K′ ciphertext files that meet the conditions are returned;
[0017] g). Data decryption: After receiving the ciphertext file, the data user uses the symmetric key K to decrypt the plaintext file;
[0018] h). Attribute revocation: When it is necessary to revoke the attribute x′ of a data user, the authority generates a new attribute key for the attribute x′ to replace the old attribute key and generates an attribute conversion key NAK x′ Sent to the blockchain and data users who have not revoked the attribute x′; the blockchain uses the original keyword ciphertext I w and attribute conversion key NAK x′ Calculate the updated keyword ciphertext The data user enters the original attribute private key SK u and attribute conversion key NAK x′ Calculate the updated attribute private key
[0019] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the system initialization described in step a) is implemented by the following steps:
[0020] a-1). Generate a bilinear mapping e:G1×G1→G T , where G1 and G Tis a cyclic group of prime order q, and g is a generator of G1;
[0021] a-2). Define two colliding hash functions is a set of positive integers;
[0022] a-3). Define the Lagrange coefficient:
[0023] a-4). Randomly generate α, Calculate g α ,g β ,e(g,g) α , define the attribute set U, and randomly select Generate attribute private key and attribute public key Return system public parameters PK = {G1, G2, e, g, H, H1, g α ,g β ,g αβ ,e(g,g) α ,PAK x} and system master key MSK={α,β,AK}.
[0024] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the attribute private key generation described in step b) is achieved by the following steps:
[0025] Random Generation calculate for att is the attribute, S uid is the attribute set, randomly selected calculate Finally, the user generates the attribute private key
[0026] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the data encryption described in step c) is implemented by the following steps:
[0027] c-1). Plaintext encryption; the data owner generates a plaintext file set D = {F1, F2, ..., F n}, randomly select K as the symmetric key, and use the symmetric key K to encrypt file F i Get the ciphertext file C i ={Enc K (F i )|i∈[1,n]}, and calculate h(C i ), ciphertext file C i Form a ciphertext file set C;
[0028] c-2) Keyword encryption: For any file f∈D, extract the keyword set W={w1,w2,...,w m}, build a query list for each keyword ciphertext:
[0029] Where: id(F τ ) means it contains the keyword w i The file identifier of the τth file, TF-IDF i,τ Indicates the keyword w i and file F τ 's relevance score;
[0030] Random Selection And as a secret value, calculate and i∈[1,n];
[0031] Execute the secret sharing algorithm and assign a secret order d to each node x in the access tree T. x The polynomial q x , for each node in T, such that the polynomial q x The number of times d x is the threshold value k of the node x -1, i.e. d x =k x -1;
[0032] Starting from the root node t, define q x (0) = s, then randomly select a polynomial q t D t points, complete the t For other nodes x, define q x (0) = q parent(x )(index(x)), and randomly select d x Points to complete q x Definition of;
[0033] Let X be the set of leaf nodes in T. For the nodes in set X calculate and
[0034] For each attribute att, the data user calculates π = e(g α ,H1(att)) to hide the access strategy;
[0035] Finally, the keyword index is Index keyword I w and query list Send to the blockchain.
[0036] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the trapdoor generation described in step d) is achieved by the following steps:
[0037] calculate For each attribute att in the attribute set U, calculate
[0038] Finally, the search trap for the query keyword w is generated And search for trapdoor T w Send to blockchain.
[0039] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the data search described in step e) is implemented by the following steps:
[0040] e-1). If x is a leaf node, let att be the attribute associated with the leaf node x;
[0041] If att∈S uid ,calculate:
[0042]
[0043] like Definition F x =⊥;
[0044] e-2). If node x is a non-leaf node, for the child node z of node x, the result after executing the algorithm is recorded as F z , define the empty set U x To retain F x ≠⊥ for all values;
[0045] If |U x |<k x , indicating that the child node attribute of the x node does not meet the threshold value of the node, abort and output ⊥;
[0046] If |U x |≥k x , indicating that the child node attribute of the x node meets the threshold value of the node. At this time, x Randomly select k x F z value, combined with the Lagrange coefficient Δ i,s (x) Calculate F x value:
[0047]
[0048] e-3). If the user's attribute set S uid If the access tree T is satisfied, the execution result of the algorithm is:
[0049]
[0050] e-4). Verification and π=T π Is it true? If the equation is true, it means that the searched keyword matches successfully; through the matching keyword ciphertext C w Search in the query list and sort by TF-IDF value;
[0051] The correctness proof is as follows:
[0052]
[0053] Searching for smart contracts is done by looking up the list Map(C w ) sends the id of the ciphertext file that meets the query requirements to the cloud server, and the cloud server queries the ciphertext file set C = {C1, C2, ..., C m} and upload to the blockchain.
[0054] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the data verification described in step f) is achieved by the following steps:
[0055] The cloud server sorts the searched ciphertext C by id, hashes the ciphertext with a hash function, and then continues to hash two adjacent hash values in the form of MT until the root node obtains the verified hash value Hash ver , and Hash ver and deposit $GA are sent to the verification smart contract; if Hash root =Hash ver , returns Y to indicate that the ciphertext is correct, sends the ciphertext C to the data user, and submits $GA and $GS to the cloud server together; otherwise, returns N to indicate that the ciphertext is incorrect, deducts $GA as a penalty, and returns $GS and $GA to the data user together.
[0056] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the data decryption described in step g) is achieved by the following steps:
[0057] The data user uses the symmetric key K to decrypt the ciphertext file and finally obtains the plaintext file f = Enc K (F i ).
[0058] In the file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention, the attribute revocation described in step h) is achieved by the following steps:
[0059] h-1). Generate attribute update key; input system public parameter PK and revoked attribute x′, randomly generate As the new attribute private key, calculate the attribute update key and the new attribute public key Sent to the blockchain and to data users without the revocation attribute x′;
[0060] h-2). Update the private key; input the attribute private key SK u and attribute update key NAK x′ , generate a new attribute private key as shown below
[0061]
[0062] h-3). Update index; output new index As shown below:
[0063]
[0064] The beneficial effects of the present invention are as follows: the blockchain-assisted attribute-based ciphertext sorting and retrieval system and method of the present invention, the data owner encrypts the plaintext file set to generate a ciphertext file set, extracts keywords from the plaintext file set to generate a keyword index and constructs a query list, sends the ciphertext file set to the cloud server, and stores the keyword index and the query list in the blockchain; the data user generates a search threshold according to the keyword to be searched, the blockchain matches the search threshold with the keyword index, sends the matched file ID to the cloud server, and the cloud server sends the first K' ciphertext files with the highest correlation that have passed the verification to the data user; the data user decrypts the ciphertext file to obtain the plaintext file after receiving it, and when it is necessary to revoke the attribute of a data user, the authority generates a ciphertext file for the attribute to be revoked. A new attribute key is generated to replace the old attribute key; it can be seen that the blockchain-assisted attribute-based ciphertext sorting and retrieval system and method of the present invention utilizes the decentralized, tamper-proof, secure and reliable characteristics of blockchain to solve the data sharing problem, and sends the closest K' file ciphertext files matching the data user's search keyword to the data user, rather than sending all files to the data user for local retrieval and decryption, which not only saves network bandwidth overhead, but also reduces the user's time cost; by establishing a data user's attribute set, not only fine-grained access control of keywords is achieved, but also the data user's attributes can be revoked and managed; by verifying the file data that needs to be fed back to the data user, the accuracy of the search results is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic diagram of the blockchain-assisted attribute-based ciphertext sorting and retrieval system of the present invention;
[0066] Figure 2 This is a file retrieval flow chart of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention. DETAILED DESCRIPTION
[0067] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0068] like Figure 1 As shown, a schematic diagram of the blockchain-assisted attribute-based ciphertext sorting and retrieval system of the present invention is given, which includes a data owner (Data Owner, DO), a data user (Data User, DU), a blockchain (BlockChain), a cloud server (Cloud Server, CSP) and an authority (Authority Agency, AA). The specific functions of these five entities are as follows:
[0069] Data owner: The data owner extracts keywords from the file locally to form a keyword set, encrypts the keywords using the attribute-based encryption algorithm, specifies an access policy for each keyword, and finally generates a security index and uploads it to the blockchain, encrypts the file and uploads the ciphertext to the cloud server.
[0070] Data user: Each data user has a set of attributes to describe his characteristics. The attribute set is embedded in the user's key. The data user can generate a search trap and send it to the blockchain for search.
[0071] Blockchain: Combine blockchain with access control by taking advantage of the characteristics of blockchain that it cannot be tampered with, is open and transparent, and the characteristics of smart contracts that do not require intermediaries, are self-verified, and automatically execute contract terms. Blockchain stores secure indexes uploaded by data owners without worrying about malicious modification. When blockchain receives search traps sent by data users, it responds to the data user's search and finds matching files, and sends the top K' file IDs ranked by relevance to the cloud server.
[0072] Cloud Server: Cloud servers have huge storage space and powerful computing power, providing on-demand services for the system. Cloud servers are responsible for storing the encrypted files of data owners and sending the retrieved ciphertext to data users, who can decrypt the ciphertext with the key to get the plaintext.
[0073] Authoritative organization: Generates system public parameters and sends them to other entities; receives attributes of data users and generates attribute keys for them.
[0074] like Figure 2 As shown, a file retrieval flow chart of the blockchain-assisted attribute-based ciphertext sorting retrieval system of the present invention is provided, which is implemented by the following steps:
[0075] a). System initialization; the authority generates system public parameters PK and system master key MSK;
[0076] b) Attribute private key generation: The data user sends the attribute set S to the authority, and the authority generates an attribute private key SK for each data user. u ;
[0077] c). Data encryption; the data owner generates a symmetric key K, K∈Z p * , use the symmetric encryption algorithm to encrypt the data owner's plaintext file set F to generate the ciphertext file set C; extract keywords from the plaintext file set F to generate the keyword set W = {w1, w2, ..., w m}, use the ciphertext policy attribute-based encryption algorithm CP-ABE to encrypt the keyword to generate the keyword index I W ; At the same time, build a query list for each keyword ciphertext:
[0078] Where: id(F τ ) means it contains the keyword w i The file identifier of the τth file, TF-IDF i,τ Indicates the keyword w i and file F τ 's relevance score;
[0079] Finally, the data owner sends the ciphertext file C to the cloud server and the encrypted keyword index I W and query list Stored in blockchain;
[0080] d). Trapdoor generation: When a data user wants to search for files containing keyword w, a search trapdoor T is generated locally. w And stored in the blockchain through transactions;
[0081] e). Data search; search smart contract read search trap door T w After that with keyword index I w Matching is performed by matching keyword ciphertext C w In the query list The file ID is queried and sent to the cloud server. The cloud server searches for the ciphertext file through the file ID and sends it to the verification smart contract.
[0082] f). Data verification: After the smart contract receives the ciphertext file, it takes the hash value and query list. The hash values of the ciphertext files are compared. If they are equal, the ciphertext files are sorted according to the relevance scores, and only the first K′ ciphertext files that meet the conditions are returned;
[0083] g). Data decryption: After receiving the ciphertext file, the data user uses the symmetric key K to decrypt the plaintext file;
[0084] h). Attribute revocation: When it is necessary to revoke the attribute x′ of a data user, the authority generates a new attribute key for the attribute x′ to replace the old attribute key and generates an attribute conversion key NAK x′ Sent to the blockchain and data users who have not revoked the attribute x′; the blockchain uses the original keyword ciphertext I w and attribute conversion key NAK x′ Calculate the updated keyword ciphertext The data user enters the original attribute private key SK u and attribute conversion key NAK x′ Calculate the updated attribute private key
[0085] The system initialization described in step a) is achieved by the following steps:
[0086] a-1). Generate a bilinear mapping e:G1×G1→G T , where G1 and G T is a cyclic group of prime order q, and g is a generator of G1;
[0087] a-2). Define two colliding hash functions is a set of positive integers;
[0088] a-3). Define the Lagrange coefficient:
[0089] a-4). Randomly generate α, Calculate g α ,g β ,e(g,g) α , define the attribute set U, and randomly select Generate attribute private key and attribute public key Return system public parameters PK = {G1, G2, e, g, H, H1, g α ,g β ,g αβ ,e(g,g) α ,PAK x} and system master key MSK={α,β,AK}.
[0090] The attribute private key generation described in step b) is achieved by the following steps:
[0091] Random Generation calculate for att is the attribute, S uid is the attribute set, randomly selected calculate Finally, the user generates the attribute private key
[0092] The data encryption described in step c) is achieved by the following steps:
[0093] c-1). Plaintext encryption; the data owner generates a plaintext file set D = {F1, F2, ..., F n}, randomly select K as the symmetric key, and use the symmetric key K to encrypt file F i Get the ciphertext file C i ={Enc K (F i )|i∈[1,n]}, and calculate h(C i ), ciphertext file C i Form a ciphertext file set C;
[0094] c-2) Keyword encryption: For any file f∈D, extract the keyword set W={w1,w2,...,w m}, build a query list for each keyword ciphertext:
[0095] Where: id(F τ ) means it contains the keyword w i The file identifier of the τth file, TF-IDF i,τ Indicates the keyword w i and file F τ 's relevance score;
[0096] Random Selection And as a secret value, calculate and i∈[1,n];
[0097] Execute the secret sharing algorithm and assign a secret order d to each node x in the access tree T. x The polynomial q x , for each node in T, such that the polynomial q x The number of times d x is the threshold value k of the node x -1, i.e. d x =k x -1;
[0098] Starting from the root node t, define q x (0) = s, then randomly select a polynomial q t D t points, complete the t For other nodes x, define q x (0) = q parent(x) (index(x)), and randomly select d x Points to complete q x Definition of;
[0099] Let X be the set of leaf nodes in T. For the nodes in set X calculate and
[0100] For each attribute att, the data user calculates π = e(g α ,H1(att)) to hide the access strategy;
[0101] Finally, the keyword index is Index keyword I w and query list Send to the blockchain.
[0102] The trapdoor generation described in step d) is achieved by the following steps:
[0103] calculate For each attribute att in the attribute set U, calculate
[0104] Finally, the search trap for the query keyword w is generated And search for trapdoor T w Send to blockchain.
[0105] The data search described in step e) is achieved by the following steps:
[0106] e-1). If x is a leaf node, let att be the attribute associated with the leaf node x;
[0107] If att∈S uid ,calculate:
[0108]
[0109] like Definition F x =⊥;
[0110] e-2). If node x is a non-leaf node, for the child node z of node x, the result after executing the algorithm is recorded as F z , define the empty set Ux To retain F x ≠⊥ for all values;
[0111] If |U x |<k x , indicating that the child node attribute of the x node does not meet the threshold value of the node, abort and output ⊥;
[0112] If |U x |≥k x , indicating that the child node attribute of the x node meets the threshold value of the node. At this time, x Randomly select k x F z value, combined with the Lagrange coefficient Δ i,s (x) Calculate F x value:
[0113]
[0114] e-3). If the user's attribute set S uid If the access tree T is satisfied, the execution result of the algorithm is:
[0115]
[0116] e-4). Verification and π=T π Is it true? If the equation is true, it means that the searched keyword matches successfully; through the matching keyword ciphertext C w Search in the query list and sort by TF-IDF value;
[0117] The correctness proof is as follows:
[0118]
[0119] Searching for smart contracts is done by looking up the list Map(C w ) sends the id of the ciphertext file that meets the query requirements to the cloud server, and the cloud server queries the ciphertext file set C = {C1, C2, ..., C m} and upload to the blockchain.
[0120] The data verification described in step f) is achieved by the following steps:
[0121] The cloud server sorts the searched ciphertext C by id, hashes the ciphertext with a hash function, and then continues to hash two adjacent hash values in the form of MT until the root node obtains the verified hash value Hash ver , and Hash verand deposit $GA are sent to the verification smart contract; if Hash root =Hash ver , returns Y to indicate that the ciphertext is correct, sends the ciphertext C to the data user, and submits $GA and $GS to the cloud server together; otherwise, returns N to indicate that the ciphertext is incorrect, deducts $GA as a penalty, and returns $GS and $GA to the data user together.
[0122] The data decryption described in step g) is achieved by the following steps:
[0123] The data user uses the symmetric key K to decrypt the ciphertext file and finally obtains the plaintext file f = Enc K (F i ).
[0124] The attribute revocation described in step h) is achieved by the following steps:
[0125] h-1). Generate attribute update key; input system public parameter PK and revoked attribute x′, randomly generate As the new attribute private key, calculate the attribute update key and the new attribute public key Sent to the blockchain and to data users without the revocation attribute x′;
[0126] h-2). Update the private key; input the attribute private key SK u and attribute update key NAK x′ , generate a new attribute private key as shown below
[0127]
[0128] h-3). Update index; output new index As shown below:
[0129]
[0130] It can be seen that the blockchain-assisted attribute-based ciphertext sorting and retrieval method and system provided by the present invention is based on the alliance blockchain and uses the decentralized, tamper-proof, secure and reliable characteristics of the blockchain to solve the data sharing problem. In addition, through attribute-based searchable encryption, fine-grained access control is performed on the user's search authority for keywords in the ciphertext domain to protect the privacy and security of patients. The present invention fully considers the untrusted relationship between the cloud server and the user in attribute-based encryption, and hides sensitive attribute values in the ciphertext. In addition, by allocating user attribute keys, efficient attribute revocation is achieved to fully ensure user privacy and security.
Claims
1. A blockchain-assisted attribute-based ciphertext sorting and retrieval system, comprising a data owner, a data user, a blockchain, a cloud server and an authority, wherein the authority generates system public parameters and sends them to the data owner, the data user and the cloud server; characterized in that: The data owner encrypts the plaintext file set to generate a ciphertext file set, extracts keywords from the plaintext file set to generate a keyword set, encrypts the keywords using the ciphertext policy attribute encryption algorithm to generate a keyword index, and builds a query list for each keyword ciphertext, sends the ciphertext file set to the cloud server, and stores the keyword index and query list in the blockchain; Data users generate search thresholds based on the keywords they want to search for and store the search thresholds in the blockchain; The blockchain matches the search threshold uploaded by the data user with the keyword index, and sends the ID of the matched keyword ciphertext in the query list to the cloud server. The cloud server searches for the ciphertext file through the file ID and sends it to the verification smart contract. The verification smart contract sends the top K' ciphertext files with the highest correlation that have passed the verification to the data user; after receiving the ciphertext file, the data user decrypts it to obtain the plaintext file. When the attribute of a data user needs to be revoked, the authority generates a new attribute key for the attribute to be revoked to replace the old attribute key.
2. A file retrieval method based on the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 1, characterized in that: This is accomplished by following these steps: a). System initialization; the authority generates system public parameters PK and system master key MSK; b) Attribute private key generation: The data user sends the attribute set S to the authority, and the authority generates an attribute private key SK for each data user. u ; c). Data encryption; the data owner generates a symmetric key K, K∈Z p * , use the symmetric encryption algorithm to encrypt the data owner's plaintext file set F to generate the ciphertext file set C; Extract keywords from the plaintext file set F to generate a keyword set W = {w1, w2, ..., w m }, use the ciphertext policy attribute-based encryption algorithm CP-ABE to encrypt the keyword to generate the keyword index I W ; At the same time, build a query list for each keyword ciphertext: Where: id(F τ ) means it contains the keyword w i The file identifier of the τth file, TF-IDF i,τ Indicates the keyword w i and file F τ 's relevance score; Finally, the data owner sends the ciphertext file C to the cloud server and the encrypted keyword index I W and query list Stored in blockchain; d). Trapdoor generation: When a data user wants to search for files containing keyword w, a search trapdoor T is generated locally. w And stored in the blockchain through transactions; e). Data search; search smart contract read search trap door T w After that with keyword index I w Matching is performed by matching keyword ciphertext C w In the query list The file ID is queried and sent to the cloud server. The cloud server searches for the ciphertext file through the file ID and sends it to the verification smart contract. f). Data verification: After the smart contract receives the ciphertext file, it takes the hash value and query list. The hash values of the ciphertext files are compared. If they are equal, the ciphertext files are sorted according to the relevance scores, and only the first K′ ciphertext files that meet the conditions are returned; g). Data decryption: After receiving the ciphertext file, the data user uses the symmetric key K to decrypt the plaintext file; h). Attribute revocation: When it is necessary to revoke the attribute x′ of a data user, the authority generates a new attribute key for the attribute x′ to replace the old attribute key and generates an attribute conversion key NAK x′ Sent to the blockchain and data users who have not revoked the attribute x′; the blockchain uses the original keyword ciphertext I w and attribute conversion key NAK x′ Calculate the updated keyword ciphertext The data user enters the original attribute private key SK u and attribute conversion key NAK x′ Calculate the updated attribute private key 3. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 2 is characterized in that: The system initialization described in step a) is achieved by the following steps: a-1). Generate a bilinear mapping e:G1×G1→G T , where G1 and G T is a cyclic group of prime order q, and g is a generator of G1; a-2). Define two colliding hash functions H1:{0,1} * →G1; is a set of positive integers; a-3). Define the Lagrange coefficient: a-4). Random generation Calculate g α ,g β ,e(g,g) α , define the attribute set U, and randomly select Generate attribute private key and attribute public key Return system public parameters PK = {G1, G2, e, g, H, H1, g α ,g β ,g αβ ,e(g,g) α ,PAK x } and system master key MSK={α,β,AK}.
4. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 3 is characterized in that: The attribute private key generation described in step b) is achieved by the following steps: Random Generation calculate for att is the attribute, S uid is the attribute set, randomly selected calculate Finally, the user generates the attribute private key 5. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 4 is characterized in that: The data encryption described in step c) is achieved by the following steps: c-1). Plaintext encryption; the data owner generates a plaintext file set D = {F1, F2, ..., F n }, randomly select K as the symmetric key, and use the symmetric key K to encrypt file F i Get the ciphertext file C i ={Enc K (F i )|i∈[1,n]}, and calculate h(C i ), ciphertext file C i Form a ciphertext file set C; c-2) Keyword encryption: For any file f∈D, extract the keyword set W={w1,w2,...,w m }, build a query list for each keyword ciphertext: Where: id(F τ ) means it contains the keyword w i The file identifier of the τth file, TF-IDF i,τ Indicates the keyword w i and file F τ 's relevance score; Random Selection And as a secret value, calculate and Execute the secret sharing algorithm and assign a secret order d to each node x in the access tree T. x The polynomial q x , for each node in T, such that the polynomial q x The number of times d x is the threshold value k of the node x -1, i.e. d x =k x -1; Starting from the root node t, define q x (0) = s, then randomly select a polynomial q t D t points, complete the t For other nodes x, define q x (0) = q parent(x) (index(x)), and randomly select d x Points to complete q x Definition of; Let X be the set of leaf nodes in T. For the nodes in set X calculate and For each attribute att, the data user calculates π = e(g α ,H1(att)) to hide the access strategy; Finally, the keyword index is Index keyword I w and query list Send to the blockchain.
6. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 5 is characterized in that: The trapdoor generation described in step d) is achieved by the following steps: calculate For each attribute att in the attribute set U, calculate Finally, the search trap for the query keyword w is generated And search for trapdoor T w Send to blockchain.
7. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 6 is characterized in that: The data search described in step e) is implemented by the following steps: e-1). If x is a leaf node, let att be the attribute associated with the leaf node x; If att∈S uid ,calculate: like Definition F x =⊥; e-2). If node x is a non-leaf node, for the child node z of node x, the result after executing the algorithm is recorded as F z , define the empty set U x To retain F x ≠⊥ for all values; If |U x |<k x , indicating that the child node attribute of the x node does not meet the threshold value of the node, abort and output ⊥; If |U x |≥k x , indicating that the child node attribute of the x node meets the threshold value of the node. At this time, x Randomly select k x F z value, combined with the Lagrange coefficient Δ i,s (x) Calculate F x value: e-3). If the user's attribute set S uid If the access tree T is satisfied, the execution result of the algorithm is: e-4). Verification and π=T π Is it true? If the equation is true, it means that the searched keyword matches successfully; through the matching keyword ciphertext C w Search in the query list and sort by TF-IDF value; The correctness proof is as follows: Searching for smart contracts is done by looking up the list Map(C w ) sends the id of the ciphertext file that meets the query requirements to the cloud server, and the cloud server queries the ciphertext file set C = {C1, C2, ..., C m } and upload to the blockchain.
8. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 9 is characterized in that: The data verification described in step f) is achieved by the following steps: The cloud server sorts the searched ciphertext C by id, hashes the ciphertext with a hash function, and then continues to hash two adjacent hash values in the form of MT until the root node obtains the verified hash value Hash ver , and Hash ver and deposit $GA are sent to the verification smart contract; if Hash root =Hash ver , returns Y to indicate that the ciphertext is correct, sends the ciphertext C to the data user, and submits $GA and $GS to the cloud server together; otherwise, returns N to indicate that the ciphertext is incorrect, deducts $GA as a penalty, and returns $GS and $GA to the data user together.
9. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 8 is characterized in that: The data decryption described in step g) is achieved by the following steps: The data user uses the symmetric key K to decrypt the ciphertext file and finally obtains the plaintext file f = Enc K (F i ).
10. The file retrieval method of the blockchain-assisted attribute-based ciphertext sorting retrieval system according to claim 9 is characterized in that: The attribute revocation described in step h) is achieved by the following steps: h-1). Generate attribute update key; input system public parameter PK and revoked attribute x′, randomly generate As the new attribute private key, calculate the attribute update key and the new attribute public key Sent to the blockchain and to data users without the revocation attribute x′; h-2). Update the private key; input the attribute private key SK u and attribute update key NAK x′ , generate a new attribute private key as shown below h-3). Update index; output new index As shown below:
Citation Information
Cited By
Access control method based on outsourcing calculation and attribute-based searchable encryption on block chain
CN119995827A
