Reliable and fair attribute encryption outsourcing decryption method based on smart contract
By using smart contract decomposition and decryption tasks on the Ethereum platform, the problem of fairness and high decryption cost in attribute encryption outsourcing decryption is solved, and efficient, fair and reliable attribute encryption outsourcing decryption is achieved.
Patent Information
- Application Number
- CN202411257462.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The existing attribute encryption outsourcing decryption method cannot guarantee fairness between the decryption cloud server and the data owner, and decryption is expensive and difficult to implement on resource-constrained mobile devices.
A smart contract-based approach is adopted to decrypt decryption tasks into verifiable metacomputing blocks, and fairness and reliability are ensured through smart contracts to avoid the introduction of redundant information.
It realizes efficient, fair and reliable attribute encryption outsourcing decryption on the Ethereum platform, reducing the cost of decryption and ensuring the fairness and credibility of decryption cloud servers.
Smart Images

Figure CN119420471A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of OABE technology, and in particular to a reliable and fair attribute encryption outsourcing decryption method based on smart contracts. Background Art
[0002] With the development of cloud computing, more and more individuals and enterprises tend to outsource their data to cloud servers because of their huge storage and computing capabilities. Security issues are one of the main obstacles hindering the widespread deployment of cloud computing. Encryption is a basic method to protect data confidentiality, and attribute-based encryption is a promising representative for flexible access control of outsourced encrypted data.
[0003] In an attribute-based encryption system, the user's data is encrypted using an access policy or attribute set, and the user's private key is generated under the attribute set or access policy. The ciphertext can be decrypted with the private key if and only if the attribute set satisfies the access policy.
[0004] However, one of the main drawbacks of attribute-based encryption is the complex decryption cost, which is proportional to the size of the access policy. This limitation makes attribute-based encryption schemes infeasible for mobile application scenarios that use resource-constrained mobile devices (e.g., smartphones) to retrieve data from encrypted ciphertext stored in the cloud.
[0005] This problem can be solved by outsourcing the decryption task to a cloud server. Although the attribute encryption outsourcing decryption method enables mobile devices to effectively decrypt ciphertext, it cannot prevent a malicious decryption cloud server from returning an erroneous transformed ciphertext. The decryption cloud server has a strong economic incentive to return an erroneous result because decryption consumes computing resources. The decryption cloud server can just return a randomly transformed ciphertext to save its computing resources. However, many current attribute encryption outsourcing decryption methods cannot guarantee fairness between the decryption cloud server and the data owner. Therefore, a secure, fair and reliable attribute encryption outsourcing decryption method is needed.
[0006] Intuitively, the current OABE solution can be directly adapted to the Ethereum environment by using smart contracts instead of decryption cloud servers. Unfortunately, due to some special properties of smart contracts in Ethereum, this simple approach is difficult to implement. The main challenges are as follows: The first challenge is gasLimit. In Ethereum, in order to prevent the system from being attacked by resource consumption of complex transactions, Ethereum stipulates that each transaction that calls a smart contract function is subject to a gas consumption limit called gasLimit. Each operation in the call, including sending and storing data and performing calculations, will consume a set amount of gas. Under this limit, the storage and calculation steps of a given transaction are relatively limited. Therefore, since the size of ABE ciphertext and conversion key varies with the access structure (i.e., attribute set), in order not to exceed the gas limit, we divide the ABE ciphertext and conversion key into small blocks. Divide the ABE ciphertext and conversion key into several blocks and upload them to the smart contract with enough transactions, so that each transaction consumes less gas than gasLimit. In addition, when calling a smart contract, the sender sets the size of the gasPrice value to determine how much he is willing to buy gas at. The higher the price, the higher the miner's packaging priority for the transaction. Ethereum also requires that the account balance of the issuing party is greater than the gas cost of executing the transaction. Otherwise, the execution will be terminated immediately and the consumed gas cannot be refunded. Therefore, it is a challenge to design smart contracts with regard to gas costs, so that the amount of gas consumed by some decryption functions in smart contracts should be within an acceptable range.
[0007] The second challenge is the verifier's dilemma problem. In Ethereum, when a transaction that calls a smart contract function is broadcast to the network, miners need to verify the correctness of the transaction. Since the verification of partial decryption results is very computationally resource-intensive, especially when the access structure size is large, rational miners may skip the verification of these transactions in order to stay ahead in the competition to mine new blocks. Therefore, transactions that call smart contracts to generate conversion ciphertexts will not be packaged into rational miners' blocks. To alleviate this problem, our main idea is to decompose the conversion task into meta-computation blocks that can be efficiently verified. Therefore, the verification work of each meta-conversion result will not exceed a critical value, and rational miners will include transactions that calculate the meta-result into their blocks. Summary of the invention
[0008] The purpose of the present invention is to provide a reliable and fair attribute encryption outsourcing decryption method based on smart contracts to overcome the deficiencies in the prior art.
[0009] To achieve the above object, the present invention provides the following technical solutions: The present application discloses a reliable and fair attribute encryption outsourcing decryption method based on smart contracts, including a sender, a node in an Ethereum network, a smart contract, a storage cloud server and a trusted authority, characterized in that the method comprises the following steps: S1: The sender sets the initial state, obtains the general attribute description, and outputs the master key and public parameters through a trusted authority; S2: The sender obtains the attribute set, inputs the master key, public parameters and attribute set, and then executes it through a trusted authority and outputs the private key; S3: The sender defines an access mechanism through the attribute set, obtains the ciphertext through the public parameters, the encapsulated key and the access structure, and transmits it to the storage cloud server; S4: The sender inputs the public parameter and the private key to obtain the conversion key and the corresponding retrieval key; S5: The sender obtains the set W, the storage cloud server sends the ciphertext to the smart contract in segments, and the sender sends the conversion key and the set W to the smart contract in segments; S6: The node in the Ethereum network obtains the public parameters, ciphertext, and conversion key and calculates and outputs the meta-element; the node in the Ethereum network issues a transaction, uploads the meta-element to the smart contract, and the smart contract calculates and outputs the conversion ciphertext; S7: The sender obtains the encapsulated key through the public parameters, the converted ciphertext, and the retrieved key.
[0010] Preferably, the step S1 includes the following sub-steps: S11: The trusted authority includes a public key generator, which obtains a cyclic multigroup of a prime order and a generator of the cyclic multigroup, generates a bilinear pairing parameter, and outputs the bilinear pairing parameter; S12: The public key generator initializes a hash function to map attributes to elements in the cyclic multigroup; S13: Get a random element a from the integer field; S14: The public key generator calculates the master key and public parameters and outputs them.
[0011] Preferably, the step S2 includes the following sub-steps: S21: The sender inputs the attribute set and the master key to the public key generator; S22: The public key generator obtains a random element s from a non-zero element in the integer field; S23: The public key generator calculates the private key through the generator of the cyclic multigroup of prime order, the random element a, the random element s, the attribute set and the hash function, and outputs it.
[0012] Preferably, step S3 includes the following sub-steps: S31: The sender defines an access structure through the attribute set and inputs the key and access structure into the smart contract, where the access structure is a row-column matrix M in the form of ; S32: Smart contract obtains random vector ; S33: According to the row and column matrix of the access structure, let , for the i The attributes of the row are obtained by combining with random vector calculation ,in is the matrix M i OK; S34: According to the row and column matrix of the access structure, for , select several from the integer domain , the smart contract obtains the ciphertext through calculation and outputs it.
[0013] Preferably, the step S4 includes the following sub-steps: S41: The sender enters the private key into the smart contract; S42: The smart contract selects a random element from the non-zero integer domain ; S43: Smart contracts through random elements Calculate and output the conversion key and the corresponding retrieval key.
[0014] Preferably, step S5 includes the following sub-steps: S51: The sender obtains the collection , the set W satisfies ,in Is a collection , where the attribute set Satisfy access structure ; S52: Divide the ciphertext into n' parts, divide the conversion key into n parts, divide the set W into n'' parts, and send each part to the smart contract separately S53: The smart contract obtains n'' sets of W respectively, and sums up each set of W. After all sets of W are obtained, it enters S54; S54: The smart contract obtains n conversion keys and sums up each conversion key. After all the conversion keys are obtained, it enters S55; S55: The smart contract obtains n' ciphertexts and sums up each ciphertext. After all ciphertexts are obtained, it enters S6.
[0015] Preferably, step S6 includes the following sub-steps: S61: Nodes within Ethereum perform calculations and output meta-elements of the transformed ciphertext ; S62: Nodes in Ethereum call transactions to pass meta elements Send to smart contract; S63: Smart Contract Acquisition Elements , when all meta elements When all are uploaded to the smart contract, the ciphertext is converted and output.
[0016] Preferably, step S7 includes the following sub-steps: S71: The sender inputs public parameters, converts ciphertext and retrieves the key; S72: The smart contract obtains public parameters, converts ciphertext and retrieves the key, and outputs the key; S73: The sender inputs the converted ciphertext and the recovery key; S74: The smart contract obtains the converted ciphertext and the recovery key and outputs data T and the key, where T is all the meta-elements The sum of .
[0017] The present application also discloses a reliable and fair attribute encryption outsourcing decryption device based on a smart contract, comprising a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement any of the above-mentioned reliable and fair attribute encryption outsourcing decryption methods based on a smart contract.
[0018] The present application also discloses a computer-readable storage medium on which a program is stored. When the program is executed by a processor, it implements any of the above-mentioned reliable and fair attribute encryption and decryption outsourcing methods based on smart contracts.
[0019] Beneficial effects of the present invention: (1) The present invention does not introduce redundant information, thus avoiding the additional burden on the decryption cloud server and the user to check the validity of the converted ciphertext; (2) The present invention achieves verifiability and defensibility, which can not only allow users to discover improper behavior of the decryption cloud server, but also prevent malicious accusations from the decryption cloud server; (3) The present invention works in a pay-as-you-go model, ensuring that the decryption cloud server is rewarded when and only when it returns the correctly converted ciphertext; (4) The present invention divides large-scale ciphertext data so that a single large computing transaction is divided into multiple meta-computing transactions, thereby ensuring that the gas amount of a single transaction is low and the verification calculation amount is small, thereby solving the verifier's dilemma problem.
[0020] The features and advantages of the present invention will be described in detail through embodiments in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of a reliable and fair attribute encryption outsourcing decryption method based on smart contracts of the present invention; Figure 2It is a structural schematic diagram of a reliable and fair attribute encryption outsourcing decryption device based on smart contracts of the present invention; Figure 3 It is a schematic flow chart of the steps of a reliable and fair attribute encryption outsourcing decryption method based on smart contracts of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below through the accompanying drawings and embodiments. However, it should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the scope of the present invention. In addition, in the following description, the description of known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0023] See also Figure 1 , 3 , an embodiment of the present invention provides a reliable and fair attribute encryption outsourcing decryption method based on smart contracts. In this work, we first proposed a reliable and fair attribute-based encryption and outsourcing decryption (hereinafter referred to as OABE) scheme based on smart contracts in the Ethereum platform. In our scheme, the original ciphertext and the converted ciphertext do not require additional redundant information, which makes our scheme more efficient than previous attribute encryption outsourcing decryption methods. At the same time, the scheme is verifiable and defensible. Finally, the scheme adopts a pay-as-you-go model to achieve fairness between the decryption cloud server and the mobile device. The following is the specific algorithm of the present invention: Setup(λ,U). The setup algorithm is executed by a trusted authority. When inputting a security parameter λ and a general attribute description U, it outputs a master key msk and public public parameters PP.
[0024] KeyGen(PP, msk, The KeyGen algorithm is also executed by a trusted authority. After inputting the public parameters PP, the master secret key msk and an attribute set , output the private key sk.
[0025] Encrypt(PP, K, ). The sender executes the encryption algorithm to generate attribute encrypted ciphertext, and then outsources it to the storage cloud server. Input public parameters PP, a wrapped key K and an access structure As input, output ciphertext CT.
[0026] (PP, sk). The algorithm is executed by the data owner equipped with a mobile device. On inputting the public parameters PP and his private key sk, it outputs the transformation key TK and the corresponding retrieval key RK.
[0027] (PP, CT, TK). The algorithm is executed by nodes in the Ethereum network. When the public parameter PP, ciphertext CT and conversion key TK are input, the node calculates the meta-element of the converted ciphertext CT , and issue a transaction to convert the meta element Upload to the smart contract. Once all metadata segments are uploaded, the smart contract calculates the transformed ciphertext CT'.
[0028] (PP,CT', RK). The algorithm is executed locally by the data owner. When the public parameter PP, the transformed ciphertext CT' and the retrieval key RK are input, the encapsulated key K is output.
[0029] In our scheme, we adopt the concept of key encapsulation mechanism (KEM), in which the symmetric key K is encrypted using attribute-based encryption, and the plaintext under the symmetric key K is encrypted using a symmetric key encryption algorithm (e.g., AES). In our architecture, the data owner retrieves the symmetric key K from the KEM ciphertext using the OABE technique. Then, the data owner downloads the symmetric key encrypted ciphertext from the storage cloud server and decrypts the ciphertext using the symmetric key k. In this paper, we only consider the OABE part. Our construction is based on the CP-ABE and outsourced decryption scheme of Green et al. We first give the outsourced decryption method based on smart contracts and the improved attribute-based encryption scheme, and then give the specific smart contract protocol of the outsourced decryption CP-ABE scheme. The outsourced decryption method CP-ABE we proposed is as follows.
[0030] . λ refers to the security level of the selected password, for example, the number of bits of the key. U is an overall summary of the following series of parameters, and is also the sum of the bilinear pairing parameters, hash functions and other parameters in the description.
[0031] Public Key Generator (PKG) generates bilinear pairing parameters ,in is a prime number Cyclic multigroup Generator. PKG initializes a hash function , map the attributes to Then it selects a random element Finally, it sets the master key to and public parameters .
[0032] . Enter the master key and a property set , PKG selects a random element And calculate . Output private key .
[0033] Enter the symmetric key to be encapsulated And access structure , where M is matrix, Will Each row of is associated with an attribute. The algorithm selects a random vector .for ,calculate ,in yes No. OK. Then it selects , and calculate the ciphertext ,in . Enter a private key , the algorithm selects a random element And set in .
[0034] . When entering the ciphertext and conversion key The data owner first finds a collection Make ,in Is a collection if satisfy , and if Dissatisfied The data owner establishes a smart contract and then , Conversion Key and Divide into n parts and send each part to the smart contract through transactions, so that each transaction fee will not exceed the gasLimit.
[0035] We use the attribute-based encryption (ABE) encryption strategy, which treats each line of the ciphertext as an attribute. All i satisfy the access policy and need to satisfy . And the subsequent calculations also need to use W As input for outsourced decryption.
[0036] . Ethereum miners can execute , which is defined as the output element Next, the miner can send the meta-result to Sent to the smart contract. When all are uploaded to the smart contract, the state of the smart contract is set to meta-computation, which indicates that the data owner can retrieve the plaintext with these meta-elements. Finally, the converted ciphertext is set to .
[0037] . The algorithm is executed locally by the data owner. Input public parameters , a converted ciphertext and a retrieval key , output the wrapped key . Input the converted ciphertext and a recovery key , data owner calculation .
[0038] Init: Set state := INIT, execute the above , , and Get public parameters , ciphertext and conversion key . And set .
[0039] Create: Upon receiving a of ("create", $deposit, $reward, )back, 1. Check if state = INIT, 2. Check if $deposit ≥ $reward, 3. Check if balance[O]>$deposit, 4.balance[O] := balance[O]- $deposit, 5. Set state := CREATED.
[0040] UploadTK: Upon receiving the of ("uploadTK", , )back, is uploaded to the contract. Note that Need to be divided into Upload a copy. = 1, then it means this is The first copy and ,otherwise >1, = .
[0041] 1. Check if state = CREATED, 2. Check if msg.sender = , 3.Judgment = 1, if = 1, add , 4. For each ,Add to , and set , 5. Determine whether , if true, set state := TK_UPLOADED.
[0042] Refers to the following The sum of This means that when a single transaction cannot When all uploads are completed, you need to upload them in multiple times. To indicate which one it is.
[0043] UploadCT: Upon receiving the ("uploadCT", , )back, is uploaded to the contract. Note that It also needs to be divided into Upload a copy. = 1, then it means this is The first copy and ,in otherwise >1, = .
[0044] 1. Check if state = TK_UPLOADED, 2. Check if msg.sender = , 3.Judgment = 1, if = 1, add , 4. For each ,Add to , and set , 5. Determine whether , if true, set state := CT_UPLOADED.
[0045] UploadShare: Upon receiving the content contract ("uploadShare", )back, is uploaded to the contract. Note that It also needs to be divided into Upload the copy.
[0046] 1. Check if state = CT_UPLOADED, 2. Check if msg.sender = , 3. For each ,Add to , and set , 4. Determine whether , if true, set state := SHARE_UPLOADED.
[0047] ComputeMeta: Upon receiving a message from a node N (“computeMeta”, , ),in back, 1. Check if state := SHARE_UPLOADED, 2. Check that $deposit ≥ $reward, 3. If ,Then i. ii. Transfer $reward to node N; iii. $deposit $deposit - $reward.
[0048] 4. If = , set state := META_Computed.
[0049] Set state := CLAIMED.
[0050] The present invention discloses a reliable and fair attribute encryption outsourcing decryption method based on smart contracts.
[0051] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A reliable and fair attribute encryption outsourcing decryption method based on smart contracts, including a sender, a node in an Ethereum network, a smart contract, a storage cloud server, and a trusted authority, characterized in that: The method comprises the following steps: S1: The sender sets the initial state, obtains the general attribute description, and outputs the master key and public parameters through a trusted authority; S2: The sender obtains the attribute set, inputs the master key, public parameters and attribute set, and then executes it through a trusted authority and outputs the private key; S3: The sender defines an access mechanism through the attribute set, obtains the ciphertext through the public parameters, the encapsulated key and the access structure, and transmits it to the storage cloud server; S4: The sender inputs the public parameter and the private key to obtain the conversion key and the corresponding retrieval key; S5: The sender obtains the set W, the storage cloud server sends the ciphertext to the smart contract in segments, and the sender sends the conversion key and the set W to the smart contract in segments; S6: The node in the Ethereum network obtains the public parameters, ciphertext, and conversion key and calculates and outputs the meta-element; the node in the Ethereum network issues a transaction, uploads the meta-element to the smart contract, and the smart contract calculates and outputs the conversion ciphertext; S7: The sender obtains the encapsulated key through the public parameters, converted ciphertext and retrieved key.
2. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 1, characterized in that: The step S1 includes the following sub-steps: S11: The trusted authority includes a public key generator, which obtains a cyclic multigroup of a prime order and a generator of the cyclic multigroup, generates a bilinear pairing parameter, and outputs the bilinear pairing parameter; S12: The public key generator initializes a hash function to map attributes to elements in the cyclic multigroup; S13: Get a random element a from the integer field; S14: The public key generator calculates the master key and public parameters and outputs them.
3. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 2, characterized in that: The step S2 includes the following sub-steps: S21: The sender inputs the attribute set and the master key to the public key generator; S22: The public key generator obtains a random element s from a non-zero element in the integer field; S23: The public key generator calculates the private key through the generator of the cyclic multigroup of prime order, the random element a, the random element s, the attribute set and the hash function, and outputs it.
4. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 1, characterized in that: The step S3 includes the following sub-steps: S31: The sender defines an access structure through the attribute set and inputs the key and access structure into the smart contract, where the access structure is a row-column matrix M in the form of ; S32: Smart contract obtains random vector ; S33: According to the row-column matrix of the access structure, let, for the i The attributes of the row are obtained by combining with random vector calculation ,in is the matrix M i OK; S34: According to the row and column matrix of the access structure, for , select several from the integer domain , the smart contract obtains the ciphertext through calculation and outputs it.
5. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 1, characterized in that: The step S4 includes the following sub-steps: S41: The sender enters the private key into the smart contract; S42: The smart contract selects a random element from the non-zero integer domain ; S43: Smart contracts through random elements Calculate and output the conversion key and the corresponding retrieval key.
6. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 4, characterized in that: The step S5 includes the following sub-steps: S51: The sender obtains the collection , the set W satisfies ,in Is a collection , where the attribute set satisfies the access structure ; S52: Divide the ciphertext into n' parts, divide the conversion key into n parts, divide the set W into n'' parts, and send each part to the smart contract separately S53: The smart contract obtains n'' sets of sets W respectively, and sums up each set of sets W. After all sets of sets W are obtained, it enters S54; S54: The smart contract obtains n conversion keys and sums up each conversion key. After all the conversion keys are obtained, it enters S55; S55: The smart contract obtains n' ciphertexts and sums up each ciphertext. After all ciphertexts are obtained, it enters S6.
7. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 1, characterized in that: The step S6 includes the following sub-steps: S61: Nodes within Ethereum perform calculations and output meta-elements of the transformed ciphertext ; S62: Nodes in Ethereum call transactions to pass meta elements Send to smart contract; S63: Smart Contract Acquisition Elements , when all meta elements When all are uploaded to the smart contract, the ciphertext is converted and output.
8. A reliable and fair attribute encryption and decryption outsourcing method based on smart contracts as claimed in claim 1, characterized in that: The step S7 includes the following sub-steps: S71: The sender inputs public parameters, converts ciphertext and retrieves the key; S72: The smart contract obtains public parameters, converts ciphertext and retrieves the key, and outputs the key; S73: The sender inputs the converted ciphertext and the recovery key; S74: The smart contract obtains the converted ciphertext and the recovery key and outputs data T and the key, where T is all the meta-elements The sum of .
9. A reliable and fair attribute encryption and decryption outsourcing device based on smart contracts, characterized by: It includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement a reliable and fair attribute encryption outsourcing decryption method based on a smart contract as described in any one of claims 1-12.
10. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, a reliable and fair attribute encryption outsourcing decryption method based on a smart contract as described in any one of claims 1-12 is implemented.
Citation Information
Patent Citations
BGN type cryptograph decryption outsourcing scheme based on attributes
CN107154845A
Efficient attribute encryption algorithm-based outsourcing decryption method for server
CN108880796A
Multi-keyword searchable encryption method and system supporting Boolean access control strategy
CN112100649A
Automobile network threat intelligence security sharing method and system, and storage medium
CN115801276A
Dynamic attribute-based encryption access control method with multiple time granularity constraints
CN117596036A
