A lightweight access method and system based on blockchain
By using blockchain and elliptic curve point multiplication operations to replace bilinear pairing CP-ABE solutions in cloud storage environments, the problems of centralized systems are easily paralyzed and computationally inefficient, achieving efficient access control and security enhancement.
Patent Information
- Application Number
- CN202110668763.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-16
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-06-16
AI Technical Summary
The existing CP-ABE solution has problems such as paralysis of centralized systems and low bilinear pairing computing efficiency in cloud storage environments, which affects the efficiency and security of access control.
A lightweight access method based on blockchain is adopted, point multiplication operations on the elliptic curve group are used instead of bilinear pairing operations, and combined with the CP-ABE algorithm, data encryption, decryption and attribute private key management are realized through the blockchain network to build a decentralized access control system.
It improves the computing and communication efficiency in the cloud storage environment, realizes fine-grained access control, and enhances the fault tolerance and security of the system through the decentralized characteristics of blockchain.
Smart Images

Figure CN113434875B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain and attribute-based encryption technology, and in particular to a lightweight access method and system based on blockchain. Background Art
[0002] With the rapid development of cloud technology, more and more people are choosing to store their data on third-party cloud servers. Compared to traditional storage technologies, cloud storage not only offers open and shared services but also addresses the challenges posed by massive data growth. However, cloud storage technology currently faces a number of challenges, including the inability to adequately guarantee user data security. Once a server is attacked and sensitive data is leaked, users will suffer immeasurable losses.
[0003] To protect data security on cloud servers, encrypted storage is often required. In practice, cloud storage also needs to provide one-to-many sharing services and flexible access control for users. This makes many traditional encryption schemes, such as role-based access control (RBAC) and identity-based encryption (IBE), unable to meet these requirements. To address this, Sahai and Water proposed attribute-based encryption (ABE). In subsequent research, ABE was further categorized into ciphertext-policy attribute-based encryption (CP-ABE) and key-policy attribute-based encryption (KP-ABE). Using CP-ABE in cloud storage to protect user privacy has become a hot topic. Compared to traditional encryption schemes, CP-ABE can achieve one-to-many ciphertext sharing while ensuring data security and implement fine-grained access control. Furthermore, because CP-ABE's access control policy is determined by the data owner based on user attributes, it eliminates the need to know the user's specific identity in advance, thus better protecting user privacy.
[0004] While CP-ABE offers a robust access control approach, several issues currently hinder its use in cloud environments. These are primarily the following: 1. The vast majority of CP-ABE schemes are centralized, requiring a central authority. The drawback of these schemes is that if the central authority is compromised by an attack, the entire access control system becomes ineffective. 2. Existing CP-ABE schemes are based on bilinear pairing operations, which are computationally expensive and require high communication overhead. The large number of bilinear pairing operations during the encryption and decryption phases significantly reduces the overall efficiency of the system, making it unsuitable for cloud storage devices.
[0005] Blockchain technology can effectively address the first problem mentioned above. Blockchain is a distributed database. With the exception of the first block, each subsequent block is linked to the previous one using a cryptographic hash algorithm. Blocks can only be added after reaching consensus among nodes, ensuring that data cannot be tampered with. These factors make blockchain decentralized, highly transparent, and tamper-resistant compared to other centralized solutions. Consequently, several access control schemes have been proposed that utilize blockchain as the underlying technology and incorporate CP-ABE. For example, patent application number 201911408586.4, "A Blockchain-Based Multi-Cloud CP-ABE Access Control Method," builds on the traditional CP-ABE scheme by incorporating a multi-cloud storage architecture. This approach improves system fault tolerance while providing user privacy. However, this scheme requires user access control to be divided into multiple components, stored in different clouds, reducing system efficiency. Furthermore, the CP-ABE in this scheme is based on bilinear pairing, which further increases computational overhead. Summary of the Invention
[0006] The embodiment of the present invention provides a lightweight access method and system based on blockchain. The technical solution is as follows:
[0007] In one aspect, a lightweight access method based on blockchain is provided. The method is implemented by a lightweight access system based on blockchain, the system including a data owner, a data user, an attribute management agency, a DHT-based blockchain network, and a data service provider. The method includes:
[0008] The attribute management agency sets relevant parameters; wherein, the relevant parameters include the master key s, the hash function h, and the elliptic curve E(q, a, b, G, p), where q is the order of the elliptic curve, G is the base point of the elliptic curve, and a and b are the elliptic curve y 2 =x 3 +ax+b coefficient, p is a large prime number;
[0009] The data owner sets an access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext to the data service provider;
[0010] The data service provider sends the ciphertext and ciphertext storage address information to the transaction Tx storage Sending to the said blockchain network;
[0011] The data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Sending to the said blockchain network;
[0012] The attribute management agency uses the attribute set ω of the data user through transaction Tx secretkey Issuing an attribute private key to the data user;
[0013] The data user accesses the data through the transaction Tx Access Obtain ciphertext, and decrypt the ciphertext using the attribute private key to obtain plaintext.
[0014] Optionally, the attribute management mechanism sets relevant parameters, including:
[0015] from Randomly select s as the master key in the space and calculate the public key PK = s·G;
[0016] Select a hash function h to map the {0,1}* space to {0,1} n space, where n is the security parameter;
[0017] Output public parameters Params = {PK, h, n}.
[0018] Optionally, the data owner sets an access control policy, encrypts the data based on the CP-ABE algorithm, and generates ciphertext, including:
[0019] The data owner sets an access control policy, constructs an access tree Γ according to the access control policy, and uses the Shamir secret sharing scheme to construct a polynomial q for each node u of the access tree in order from top to bottom. u (x);
[0020] calculate And use a lightweight symmetric encryption algorithm to k x As the key to encrypt the message M, that is, C = Enc (k x , M);
[0021] For all leaf nodes y in the visit tree, calculate c respectively y =q y (0) G and c′ y =q y (0)·h(i)modq;
[0022] Output ciphertext CT = (Γ, C, c y ,c′ y ,y∈Y), where Y is the set of all leaf nodes.
[0023] Optionally, the attribute management agency issues an attribute private key to the data user through a transaction Txsecretkey according to the attribute set ω of the data user, including:
[0024] For any attribute i∈ω, Select a random number r in the space i , and calculate d i =(s+r i h(i)) mod q and d i ′=r i G;
[0025] Output data owner private key
[0026] Optionally, decrypting the ciphertext using the attribute private key to obtain plaintext includes:
[0027] Define a function attr(x) to represent the attributes associated with node x, define a recursive algorithm DecryptNode(CT, D, i), and input the ciphertext CT, the private key D, and the node x in the access tree to the recursive algorithm;
[0028] If node x is a leaf node, let i = attr(x); the algorithm is executed as follows:
[0029] If i∈ω, then calculate:
[0030] Decrypt-leaf-node(CT,D,x)
[0031] =dici-ci'di'
[0032] =diqi(0)G-qi(0)h(attr(x))riG
[0033] =sqi(0)G+-qi(0)h(attr(x))riG-qi(0)h(attr(x))riG
[0034] =qi(0)Pk;
[0035] like Then output Decrypt-leaf-node(CT,D,x)=⊥;
[0036] For a non-leaf node u in the access tree, let ωu be any set of du child nodes of u. The algorithm is executed as follows:
[0037]
[0038]
[0039] If there is no such ωu, then output DecryptNode(CM,D,u)=⊥;
[0040] If the data user satisfies the access structure, the above recursive algorithm is used to calculate the value of the root node DecrtptNode(CT,D,R)=qR(0)·Pk=t·Pk=(k′x,k′ y );
[0041] The decrypted data of the recursive algorithm is as follows:
[0042] M′=Dec(C,k′ x )=M
[0043] Wherein, M is the plaintext corresponding to the ciphertext.
[0044] Optionally, the transaction Tx storage The corresponding algorithm is generated by the data service provider. The algorithm is fed with the transaction identifier S, ciphertext CT, and ciphertext storage address Address. The algorithm then outputs the transaction Tx. storage ;
[0045] The steps of the algorithm include:
[0046] Step 101, MD CT =H(CT), calculate the summary of the ciphertext CT for integrity verification;
[0047] Step 102, MD storage =H(S,Address,MD CT ), calculate transaction summary;
[0048] Step 103, SignStorage = sign SK_DO (MD storage ), use the private key of the data user owner to sign the transaction summary;
[0049] Step 104, Tx storage =(S,Enc PK_DO (Address),MD CT ,SignStorage), output transaction Tx storage .
[0050] Optionally, the transaction Tx authorization The corresponding algorithm is generated by the data owner, and the transaction identifier A, data index KW, ciphertext storage address, and access policy ACP are input to the algorithm. The algorithm outputs the transaction Tx authorization ;
[0051] The steps of the algorithm include:
[0052] Step 201, EA = Enc ACP (Address);
[0053] Step 202, MD authorization =H(A,ACP,EA,KW), calculate transaction summary;
[0054] Step203、SignAuthorization=sign SK_DO (MD authorization ), use the data owner’s private key to sign the transaction summary;
[0055] Step 204, Tx authorization =(A,ACP,EA,KW,SignAuthorization), output transaction Tx authorization .
[0056] Optionally, the transaction Tx secretkey The corresponding algorithm is generated by the attribute management agency. The transaction identifier K and the attribute set ω of the data user are input to the algorithm, and the algorithm outputs the transaction Tx secretkey ;
[0057] The steps of the algorithm include:
[0058] Step 301: Run the CP-ABE algorithm based on the data user attribute set ω to generate the data user decryption private key SK;
[0059] Step 302, use the public key of the data user to encrypt its attribute private key SK, SK'=Enc PK_DU (SK);
[0060] Step 303, MD secretkey =H(K,SK'), calculate transaction summary;
[0061] Step 304, SignSK = sign SK_AM (MD secretkey ), use the private key of the attribute management agency to sign the transaction summary;
[0062] Step 305, Tx secretkey =(K,SK',SignSK), output transaction Tx secretkey .
[0063] Optionally, add Tx to the transaction access The identifier C of the corresponding algorithm input transaction and the corresponding transaction Tx authorization , the algorithm outputs transaction Tx access ;
[0064] The steps of the algorithm include:
[0065] Step 401, according to the transaction Tx authorization The ACP in the decryption EA obtains the data storage address, that is, Address = Dec ACP (EA);
[0066] Step 402, MD Access =H(C,Address,KW);
[0067] Step 403, SignCT = sign SK_DU (MD Access ), the data user signs the data access transaction summary using the private key;
[0068] Step 404, Tx Access =(C,KW,Enc PK_DS (Address), SignCT), output transaction Tx Access .
[0069] In one aspect, a blockchain-based lightweight access system is provided. The system is applied to a blockchain-based lightweight access method. The system includes a data owner, a data user, an attribute management agency, a DHT-based blockchain network, and a data service provider, wherein:
[0070] The attribute management agency sets relevant parameters; wherein, the relevant parameters include the master key s, the hash function h, and the elliptic curve E(q, a, b, G, p), where q is the order of the elliptic curve, G is the base point of the elliptic curve, and a and b are the elliptic curve y 2 =x 3 +ax+b coefficient, p is a large prime number;
[0071] The data owner sets an access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext to the data service provider;
[0072] The data service provider sends the ciphertext and ciphertext storage address information to the transaction Tx storage Sending to the said blockchain network;
[0073] The data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Sending to the said blockchain network;
[0074] The attribute management agency uses the attribute set ω of the data user through transaction Tx secretkey Issuing an attribute private key to the data user;
[0075] The data user accesses the data through the transaction Tx AccessObtain ciphertext, and decrypt the ciphertext using the attribute private key to obtain plaintext.
[0076] Optionally, the attribute management mechanism sets relevant parameters, including:
[0077] from Randomly select s as the master key in the space and calculate the public key PK = s·G;
[0078] Select a hash function h to map the {0,1}* space to {0,1} n space, where n is the security parameter;
[0079] Output public parameters Params = {PK, h, n}.
[0080] Optionally, the data owner sets an access control policy, encrypts the data based on the CP-ABE algorithm, and generates ciphertext, including:
[0081] The data owner sets an access control policy, constructs an access tree Γ according to the access control policy, and uses the Shamir secret sharing scheme to construct a polynomial q for each node u of the access tree in order from top to bottom. u (x);
[0082] calculate And use a lightweight symmetric encryption algorithm to k x As the key to encrypt the message M, that is, C = Enc (k x , M);
[0083] For all leaf nodes y in the visit tree, calculate c respectively y =q y (0) G and c′ y =q y (0)·h(i)modq;
[0084] Output ciphertext CT = (Γ, C, c y ,c′ y ,y∈Y), where Y is the set of all leaf nodes.
[0085] Optionally, the attribute management agency issues an attribute private key to the data user through a transaction Txsecretkey according to the attribute set ω of the data user, including:
[0086] For any attribute i∈ω, Select a random number r in the space i , and calculate d i =(s+r i h(i)) mod q and d′ i =ri G;
[0087] Output data owner private key
[0088] Optionally, decrypting the ciphertext using the attribute private key to obtain plaintext includes:
[0089] Define a function attr(x) to represent the attributes associated with node x, define a recursive algorithm DecryptNode(CT, D, i), and input the ciphertext CT, the private key D, and the node x in the access tree to the recursive algorithm;
[0090] If node x is a leaf node, let i = attr(x); the algorithm is executed as follows:
[0091] If i∈ω, then calculate:
[0092] Decrypt-leaf-node(CT,D,x)
[0093] =dici-ci'di'
[0094] =diqi(0)G-qi(0)h(attr(x))riG
[0095] =sqi(0)G+-qi(0)h(attr(x))riG-qi(0)h(attr(x))riG
[0096] =qi(0)Pk;
[0097] like Then output Decrypt-leaf-node(CT,D,x)=⊥;
[0098] For a non-leaf node u in the access tree, let ωu be any set of du child nodes of u. The algorithm is executed as follows:
[0099]
[0100]
[0101] If there is no such ωu, then output DecryptNode(CM,D,u)=⊥;
[0102] If the data user satisfies the access structure, the above recursive algorithm is used to calculate the value of the root node DecrtptNode(CT,D,R)=qR(0)·Pk=t·Pk=(k′ x ,k′ y );
[0103] The decrypted data of the recursive algorithm is as follows:
[0104] M′=Dec(C,k′ x )=M
[0105] Wherein, M is the plaintext corresponding to the ciphertext.
[0106] Optionally, the transaction Tx storage The corresponding algorithm is generated by the data service provider. The algorithm is fed with the transaction identifier S, ciphertext CT, and ciphertext storage address Address. The algorithm then outputs the transaction Tx. storage ;
[0107] The steps of the algorithm include:
[0108] Step 101, MD CT =H(CT), calculate the summary of the ciphertext CT for integrity verification;
[0109] Step 102, MD storage =H(S,Address,MD CT ), calculate the transaction summary;
[0110] Step 103, SignStorage = sign SK_DO (MD storage ), use the private key of the data user owner to sign the transaction summary;
[0111] Step 104, Tx storage =(S,Enc PK_DO (Address),MD CT ,SignStorage), output transaction Tx storage .
[0112] Optionally, the transaction Tx authorization The corresponding algorithm is generated by the data owner, and the transaction identifier A, data index KW, ciphertext storage address, and access policy ACP are input to the algorithm. The algorithm outputs the transaction Tx authorization ;
[0113] The steps of the algorithm include:
[0114] Step 201, EA = Enc ACP (Address);
[0115] Step 202, MD authorization =H(A,ACP,EA,KW), calculate transaction summary;
[0116] Step203、SignAuthorization=sign SK_DO (MD authorization ), use the data owner’s private key to sign the transaction summary;
[0117] Step 204, Tx authorization =(A,ACP,EA,KW,SignAuthorization), output transaction Tx authorization .
[0118] Optionally, the transaction Tx secretkey The corresponding algorithm is generated by the attribute management agency. The transaction identifier K and the attribute set ω of the data user are input to the algorithm, and the algorithm outputs the transaction Tx secretkey ;
[0119] The steps of the algorithm include:
[0120] Step 301: Run the CP-ABE algorithm based on the data user attribute set ω to generate the data user decryption private key SK;
[0121] Step 302, use the public key of the data user to encrypt its attribute private key SK, SK'=Enc PK_DU (SK);
[0122] Step 303, MD secretkey =H(K,SK'), calculate transaction summary;
[0123] Step 304, SignSK = sign SK_AM (MD secretkey ), use the private key of the attribute management agency to sign the transaction summary;
[0124] Step 305, Tx secretkey =(K,SK',SignSK), output transaction Tx secretkey .
[0125] Optionally, add Tx to the transaction access The identifier C of the corresponding algorithm input transaction and the corresponding transaction Tx authorization , the algorithm outputs transaction Tx access ;
[0126] The steps of the algorithm include:
[0127] Step 401, according to the transaction Tx authorization The ACP in the decryption EA obtains the data storage address, that is, Address = Dec ACP (EA);
[0128] Step 402, MD Access =H(C,Address,KW);
[0129] Step 403, SignCT = sign SK_DU (MD Access ), the data user signs the data access transaction summary using the private key;
[0130] Step 404, Tx Access =(C,KW,Enc PK_DS (Address), SignCT), output transaction Tx Access .
[0131] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0132] In the above scheme, in the embodiment of the present invention, the attribute management agency sets the relevant parameters, the data owner sets the access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, stores the ciphertext to the data service provider, and the data service provider sends the ciphertext and the ciphertext storage address information to the transaction Tx storage Send to the blockchain network, the data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Send it to the blockchain network, and the attribute management agency will use the attribute set ω of the data user through transaction Tx secretkey Issue attribute private keys to data users, who then access transactions through data Tx Access Obtain the ciphertext and decrypt it using the attribute private key to obtain the plaintext. This invention uses point multiplication on an elliptic curve group instead of bilinear pairing operations to construct the CP-ABE scheme, improving the scheme's overall computational and communication efficiency. Furthermore, the attribute management mechanism, acting as an on-chain node, enables dynamic management of user attribute private keys. Furthermore, compared to existing solutions, efficiency is improved in the initialization, encryption, and decryption phases. Furthermore, using blockchain as the underlying technology, a lightweight access control solution suitable for cloud environments is constructed, which provides fine-grained access control while improving the overall efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0133] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0134] Figure 1This is a block diagram of a lightweight access system based on blockchain provided by an embodiment of the present invention;
[0135] Figure 2 This is a flowchart of a lightweight access method based on blockchain provided by an embodiment of the present invention;
[0136] Figure 3 This is a running time diagram of a CP-ABE algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0137] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0138] The embodiment of the present invention provides a lightweight access system based on blockchain, which is applied to a lightweight access method based on blockchain. The system includes data owners, data users, attribute management agencies, a blockchain network based on DHT, and data service providers. The specific architecture is shown in the attached figure. Figure 1 As shown in the figure, it mainly includes five entities: data owner (DO), data user (User), attribute management agency (AM), DHT-based blockchain network and data service provider (DS). Four transactions are required: Tx storage 、Tx authorization 、Tx secretkey and Tx access .
[0139] Data owner: formulates access policy, uses CP-ABE algorithm to encrypt data to generate ciphertext, and stores the ciphertext to data service provider DS. storage After completion, an authorization transaction Tx is generated based on the keyword, ciphertext storage address and access control policy authorization , and sent to the blockchain.
[0140] Data service provider: Generates Tx based on the stored ciphertext and ciphertext storage address information storage Sent to the blockchain, the data owner according to Tx storage Obtain the storage address and ciphertext keyword, and then store the ciphertext index information locally.
[0141] Data users: use index information to find the ciphertext authorization transaction, and build the data access transaction Tx based on the ciphertext storage address through authorization verification access After obtaining the ciphertext, use the attribute private key to decrypt the ciphertext to obtain the plaintext.
[0142] Property Management Agency: Through Tx secretkey The transaction issues attribute private keys to data consumers.
[0143] Blockchain: responsible for recording transaction information.
[0144] Txstorage: The encrypted storage transaction provided by the data service provider to the data owner.
[0145] Txauthorization: used to publish the access control policy of the data owner.
[0146] Txsecretkey: enables the attribute management agency to issue attribute private keys to data users.
[0147] Txaccess: The data user obtains the ciphertext from the data service provider.
[0148] The steps of applying the system to the blockchain-based lightweight access method include:
[0149] The attribute management agency is used to set relevant parameters; the relevant parameters include the master key s, the hash function h, and the elliptic curve E(q,a,b,G,p), where q is the order of the elliptic curve, G is the base point of the elliptic curve, and a and b are the elliptic curve y 2 =x 3 +ax+b coefficient, p is a large prime number;
[0150] The data owner sets the access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext with the data service provider;
[0151] The data service provider sends the ciphertext and ciphertext storage address information to the transaction Tx storage Send to the blockchain network;
[0152] The data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Send to the blockchain network;
[0153] The attribute management agency uses the attribute set ω of the data user through transaction Tx secretkey Issue attribute private keys to data users;
[0154] Data users access transactions through data Tx Access Obtain the ciphertext and decrypt it using the attribute private key to obtain the plaintext.
[0155] Optionally, the attribute management agency sets relevant parameters, including:
[0156] from Randomly select s as the master key in the space and calculate the public key PK = s·G;
[0157] Select a hash function h to convert {0,1} *Space is mapped to {0,1} n space, where n is the security parameter;
[0158] Output public parameters Params = {PK, h, n}.
[0159] Optionally, the data owner sets an access control policy and encrypts the data based on the CP-ABE algorithm to generate ciphertext, including:
[0160] The data owner sets the access control policy, constructs the access tree Γ according to the access control policy, and uses the Shamir secret sharing scheme to construct a polynomial q for each node u in the access tree from top to bottom. u (x);
[0161] calculate And use a lightweight symmetric encryption algorithm to k x As the key to encrypt the message M, that is, C = Enc (k x , M);
[0162] For all leaf nodes y in the visit tree, calculate c respectively y =q y (0) G and c′ y =q y (0)·h(i)modq;
[0163] Output ciphertext CT = (Γ, C, c y ,c′ y , y∈Y), where Y is the set of all leaf nodes.
[0164] Optionally, the attribute management agency issues an attribute private key to the data user through the transaction Txsecretkey according to the attribute set ω of the data user, including:
[0165] For any attribute i∈ω, Select a random number r in the space i , and calculate d i =(s+r i h(i)) mod q and d′ i =r i G;
[0166] Output data owner private key
[0167] Optionally, decrypt the ciphertext using the attribute private key to obtain the plaintext, including:
[0168] Define a function attr(x) to represent the attributes associated with node x, define a recursive algorithm DecryptNode(CT, D, i), and input the ciphertext CT, the private key D, and the node x in the access tree to the recursive algorithm;
[0169] If node x is a leaf node, let i = attr(x); the algorithm is executed as follows:
[0170] If i∈ω, then calculate:
[0171] Decrypt-leaf-node(CT,D,x)
[0172] =dici-ci'di'
[0173] =diqi(0)G-qi(0)h(attr(x))riG
[0174] =sqi(0)G+-qi(0)h(attr(x))riG-qi(0)h(attr(x))riG
[0175] =qi(0)Pk;
[0176] like Then output Decrypt-leaf-node(CT,D,x)=⊥;
[0177] For a non-leaf node u in the access tree, let ωu be any set of du child nodes of u. The algorithm is executed as follows:
[0178]
[0179]
[0180] If there is no such ωu, then output DecryptNode(CM,D,u)=⊥;
[0181] If the data user satisfies the access structure, the above recursive algorithm is used to calculate the value of the root node DecrtptNode(CT,D,R)=qR(0)·Pk=t·Pk=(k′x,k′ y );
[0182] The decrypted data of the recursive algorithm is as follows:
[0183] M′=Dec(C,k′ x )=M
[0184] Among them, M is the plaintext corresponding to the ciphertext.
[0185] Optionally, transaction Tx storageThe corresponding algorithm is generated by the data service provider. The algorithm is fed with the transaction identifier S, ciphertext CT, and ciphertext storage address Address. The algorithm then outputs the transaction Tx. storage ;
[0186] The steps of the algorithm include:
[0187] Step 101, MD CT =H(CT), calculate the summary of the ciphertext CT for integrity verification;
[0188] Step 102, MD storage =H(S,Address,MD CT ), calculate transaction summary;
[0189] Step 103, SignStorage = sign SK_DO (MD storage ), use the private key of the data user owner to sign the transaction summary;
[0190] Step 104, Tx storage =(S,Enc PK_DO (Address),MD CT ,SignStorage), output transaction Tx storage .
[0191] Optionally, transaction Tx authorization The corresponding algorithm is generated by the data owner, and the transaction identifier A, data index KW, ciphertext storage address, and access policy ACP are input to the algorithm. The algorithm outputs the transaction Tx authorization ;
[0192] The steps of the algorithm include:
[0193] Step 201, EA = Enc ACP (Address);
[0194] Step 202, MD authorization =H(A,ACP,EA,KW), calculate transaction summary;
[0195] Step203、SignAuthorization=sign SK_DO (MD authorization ), use the data owner’s private key to sign the transaction summary;
[0196] Step 204, Tx authorization =(A,ACP,EA,KW,SignAuthorization), output transaction Tx authorization .
[0197] Optionally, transaction Tx secretkey The corresponding algorithm is generated by the attribute management agency. The algorithm is fed with the transaction identifier K and the attribute set ω of the data user. The algorithm then outputs the transaction Tx. secretkey ;
[0198] The steps of the algorithm include:
[0199] Step 301: Run the CP-ABE algorithm based on the data user attribute set ω to generate the data user decryption private key SK;
[0200] Step 302, use the public key of the data user to encrypt its attribute private key SK, SK'=Enc PK_DU (SK);
[0201] Step 303, MD secretkey =H(K,SK'), calculate transaction summary;
[0202] Step 304, SignSK = sign SK_AM (MD secretkey ), use the private key of the attribute management agency to sign the transaction summary;
[0203] Step 305, Tx secretkey =(K,SK',SignSK), output transaction Tx secretkey .
[0204] Optionally, add a new transaction to Tx access The identifier C of the corresponding algorithm input transaction and the corresponding transaction Tx authorization , the algorithm outputs transaction Tx access ;
[0205] The steps of the algorithm include:
[0206] Step 401, according to the transaction Tx authorization The ACP in the decryption EA obtains the data storage address, that is, Address = Dec ACP (EA);
[0207] Step 402, MD Access =H(C,Address,KW);
[0208] Step 403, SignCT = sign SK_DU (MD Access ), the data user signs the data access transaction summary using the private key;
[0209] Step 404, Tx Access=(C,KW,Enc PK_DS (Address), SignCT), output transaction Tx Access .
[0210] The embodiment of the present invention provides a lightweight access method based on blockchain, which is implemented by a lightweight access system based on blockchain, which includes data owners, data users, attribute management agencies, DHT-based blockchain networks and data service providers, such as Figure 2 As shown, the processing flow of the method may include the following steps:
[0211] Step 1. The attribute management agency sets relevant parameters. The relevant parameters include the master key s, the hash function h, and the elliptic curve E(q, a, b, G, p), where q is the order of the elliptic curve, G is the base point of the elliptic curve, and a and b are the elliptic curve y 2 =x 3 +ax+b coefficient, p is a large prime number.
[0212] Step 2: The data owner sets the access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext to the data service provider.
[0213] In a feasible implementation, after the data owner sets the access control policy and generates the ciphertext, the ciphertext storage address is uploaded to the chain, the access control policy is uploaded to the chain, and then the blockchain broadcasts and reaches consensus on the ciphertext storage address and access policy.
[0214] Step 3. The data service provider sends the ciphertext and ciphertext storage address information to the transaction Tx storage Sent to the blockchain network.
[0215] Step 4. The data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Sent to the blockchain network.
[0216] Step 5. The attribute management agency uses the attribute set ω of the data user through transaction Tx secretkey Issue attribute private keys to data consumers.
[0217] Step 6. Data users access transactions through data Tx Access Obtain the ciphertext and decrypt it using the attribute private key to obtain the plaintext.
[0218] In one feasible implementation, the data owner issues a ciphertext request. The blockchain obtains the ciphertext address requested by the user and calculates the ciphertext index, allowing the data service provider to search for the ciphertext based on the index. The data user verifies that the ciphertext digest is correct. If so, they request an access policy, obtain the access policy through the blockchain, and decrypt the ciphertext using the attribute private key to obtain the plaintext. If the ciphertext digest is incorrect, the request ends and a request failure message is returned.
[0219] Optionally, the main steps of the attribute-based encryption algorithm based on the elliptic curve include the following steps 01-04:
[0220] Step 01. The attribute management agency (AM) inputs the security parameter n and outputs the public key PK and the master key MSK.
[0221] from Randomly select s as the master key in the space and calculate the public key PK = s·G;
[0222] Select a hash function h to map the {0,1}* space to {0,1} n space, where n is the security parameter;
[0223] Output public parameters Params = {PK, h, n}.
[0224] Step 02. The data owner (DO) inputs the plaintext M, public key PK, access structure A, and outputs the ciphertext CT.
[0225] The data owner sets the access control policy, constructs the access tree Γ according to the access control policy, and uses the Shamir secret sharing scheme to construct a polynomial q for each node u in the access tree from top to bottom. u (x);
[0226] calculate And use a lightweight symmetric encryption algorithm to k x As the key to encrypt the message M, that is, C = Enc (k x , M);
[0227] For all leaf nodes y in the visit tree, calculate c respectively y =q y (0) G and c′ y =q y (0)·h(i)modq;
[0228] Output ciphertext CT = (Γ, C, c y ,c′ y ,y∈Y), where Y is the set of all leaf nodes.
[0229] Step 03: The attribute management agency (AM) inputs the master key s and the attribute set ω associated with the data owner, and outputs the private key sk.
[0230] For any attribute i∈ω, Select a random number r in the space i , and calculate d i =(s+r i h(i)) mod q and d′ i =r i G;
[0231] Output data owner private key
[0232] Step 04: The data user (User) inputs the public key PK, private key D, and ciphertext CT. If the decryption is successful, the plaintext M is output.
[0233] Define the function attr(x) to represent the attributes associated with node x, define the recursive algorithm DecryptNode(CT, D, i), and input the ciphertext CT, the private key D and the node x in the access tree to the recursive algorithm;
[0234] If node x is a leaf node, let i = attr(x); the algorithm is executed as follows:
[0235] If i∈ω, then calculate:
[0236] Decrypt-leaf-node(CT,D,x)
[0237] =dici-ci'di'
[0238] =diqi(0)G-qi(0)h(attr(x))riG
[0239] =sqi(0)G+-qi(0)h(attr(x))riG-qi(0)h(attr(x))riG
[0240] =qi(0)Pk;
[0241] like Then output Decrypt-leaf-node(CT,D,x)=⊥;
[0242] For a non-leaf node u in the access tree, let ωu be any set of du child nodes of u. The algorithm is executed as follows:
[0243]
[0244]
[0245] If there is no such ωu, then output DecryptNode(CM,D,u)=⊥;
[0246] If the data user satisfies the access structure, the above recursive algorithm is used to calculate the value of the root node DecrtptNode(CT,D,R)=qR(0)·Pk=t·Pk=(k′x,k′ y );
[0247] The decrypted data of the recursive algorithm is as follows:
[0248] M′=Dec(C,k′ x )=M
[0249] Among them, M is the plaintext corresponding to the ciphertext.
[0250] Optionally, the above transaction Tx storage Use the corresponding algorithm, transaction Tx storage The corresponding algorithm is generated by the data service provider. The algorithm is fed with the transaction identifier S, ciphertext CT, and ciphertext storage address Address. The algorithm then outputs the transaction Tx. storage ;
[0251] The steps of the algorithm include:
[0252] Step 101, MD CT =H(CT), calculate the summary of the ciphertext CT for integrity verification;
[0253] Step 102, MD storage =H(S,Address,MD CT ), calculate transaction summary;
[0254] Step 103, SignStorage = sign SK_DO (MD storage ), use the private key of the data user owner to sign the transaction summary;
[0255] Step 104, Tx storage =(S,Enc PK_DO (Address),MD CT ,SignStorage), output transaction Tx storage .
[0256] Optionally, transaction Tx authorization The corresponding algorithm is generated by the data owner, and the transaction identifier A, data index KW, ciphertext storage address, and access policy ACP are input to the algorithm. The algorithm outputs the transaction Tx authorization ;
[0257] The steps of the algorithm include:
[0258] Step 201, EA = Enc ACP (Address);
[0259] Step 202, MD authorization =H(A,ACP,EA,KW), calculate transaction summary;
[0260] Step203、SignAuthorization=sign SK_DO (MD authorization ), use the data owner’s private key to sign the transaction summary;
[0261] Step 204, Tx authorization =(A,ACP,EA,KW,SignAuthorization), output transaction Tx authorization .
[0262] Optionally, the above transaction Tx secretkey Use the corresponding algorithm, transaction Tx secretkey The corresponding algorithm is generated by the attribute management agency. The algorithm is fed with the transaction identifier K and the attribute set ω of the data user. The algorithm then outputs the transaction Tx. secretkey ;
[0263] The steps of the algorithm include:
[0264] Step 301: Run the CP-ABE algorithm based on the data user attribute set ω to generate the data user decryption private key SK;
[0265] Step 302, use the public key of the data user to encrypt its attribute private key SK, SK'=Enc PK_DU (SK);
[0266] Step 303, MD secretkey =H(K,SK'), calculate transaction summary;
[0267] Step 304, SignSK = sign SK_AM (MD secretkey ), use the private key of the attribute management agency to sign the transaction summary;
[0268] Step 305, Tx secretkey =(K,SK',SignSK), output transaction Tx secretkey .
[0269] Optionally, the above transaction Tx access Use the corresponding algorithm to send transaction Txaccess The identifier C of the corresponding algorithm input transaction and the corresponding transaction Tx authorization , the algorithm outputs transaction Tx access ;
[0270] The steps of the algorithm include:
[0271] Step 401, according to the transaction Tx authorization The ACP in the decryption EA obtains the data storage address, that is, Address = Dec ACP (EA);
[0272] Step 402, MD Access =H(C,Address,KW);
[0273] Step 403, SignCT = sign SK_DU (MD Access ), the data user signs the data access transaction summary using the private key;
[0274] Step 404, Tx Access =(C,KW,Enc PK_DS (Address), SignCT), output transaction Tx Access .
[0275] In the embodiment of the present invention, the attribute management agency sets the relevant parameters, the data owner sets the access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext to the data service provider. The data service provider sends the ciphertext and the ciphertext storage address information to the transaction Tx storage Send to the blockchain network, the data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Send it to the blockchain network, and the attribute management agency will use the attribute set ω of the data user through transaction Tx secretkey Issue attribute private keys to data users, who then access transactions through data Tx Access Obtain the ciphertext and decrypt it using the attribute private key to obtain the plaintext. This invention uses point multiplication on an elliptic curve group instead of bilinear pairing operations to construct the CP-ABE scheme, improving the scheme's overall computational and communication efficiency. Furthermore, the attribute management mechanism, acting as an on-chain node, enables dynamic management of user attribute private keys. Furthermore, compared to existing solutions, efficiency is improved in the initialization, encryption, and decryption phases. Furthermore, using blockchain as the underlying technology, a lightweight access control solution suitable for cloud environments is constructed, which provides fine-grained access control while improving the overall efficiency of the system.
[0276] The embodiments of the present invention provide a functional analysis and performance analysis of a lightweight access method based on blockchain.
[0277] 1. Functional Analysis
[0278] The performance of the proposed CP-ABE scheme was evaluated using a comparative analysis method. The advantages and disadvantages of the proposed scheme were illustrated by comparing it with other schemes in existing research results, as shown in Table 1.
[0279] Table 1 Scheme comparison table
[0280]
[0281] Table 1 compares the present invention's solution with existing solutions from five perspectives. Controls 1, 2, and 3 all rely on traditional attribute-based encryption for access control, which falls short in both application cost and scalability compared to blockchain-based solutions. Control 4 combines blockchain with outsourced decryption to track and revoke malicious users, but this approach also suffers from high application costs. Control 5 uses smart contracts to establish data sharing, but as the number of system users increases, the number of contracts in the system also increases significantly, reducing system efficiency.
[0282] 2. Performance Analysis
[0283] The performance of this solution was evaluated on an Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz and 8.00GB RAM. The code was implemented in Java using the elliptic curve secp-256k1. Testing was performed on four phases: initialization, encryption, key generation, and decryption. Each test started with 5 attributes and increased by 5 attributes each time until the number reached 25. Each experiment was repeated 30 times, and the results were averaged. The time cost of each phase for different attribute sizes is shown in the attached figure. Figure 3 shown.
[0284] Depend on Figure 3 As we know, the system initialization time does not increase with the number of attributes, while the system key generation time and encryption and decryption time are proportional to the number of attributes. Comprehensive analysis shows that the time overhead of all stages is within an acceptable range and can be used in resource-constrained cloud storage environments.
[0285] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0286] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A lightweight access method based on blockchain, characterized in that: The method is implemented by a lightweight access system based on blockchain, which includes data owners, data users, attribute management agencies, a DHT-based blockchain network, and data service providers. The method includes: The attribute management agency sets relevant parameters; wherein, the relevant parameters include the master key s, the hash function h, and the elliptic curve E(q, a, b, G, p), where q is the order of the elliptic curve, G is the base point of the elliptic curve, and a and b are the elliptic curve The coefficient of , p is a large prime number; The data owner sets an access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext to the data service provider; The data service provider sends the ciphertext and ciphertext storage address information to the transaction Tx storage Send to the said blockchain network; The data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Sending to the said blockchain network; The attribute management agency uses the attribute set ω of the data user through transaction Tx secretkey Issuing an attribute private key to the data user; The data user accesses the data through the transaction Tx Access Obtain the ciphertext, and decrypt the ciphertext using the attribute private key to obtain the plaintext.
2. The method according to claim 1, characterized in that The attribute management mechanism sets relevant parameters, including: from Randomly select s as the master key in the space and calculate the public key ; Select a hash function h to convert Space mapping to space, where n is the security parameter; Output public parameters .
3. A lightweight access system based on blockchain, characterized in that: The system is applied to a lightweight access method based on blockchain, and includes data owners, data users, attribute management agencies, a DHT-based blockchain network, and data service providers, wherein: The attribute management agency sets relevant parameters; wherein, the relevant parameters include the master key s, the hash function h, and the elliptic curve E(q, a, b, G, p), where q is the order of the elliptic curve, G is the base point of the elliptic curve, and a and b are the elliptic curve The coefficient of , p is a large prime number; The data owner sets an access control policy, encrypts the data based on the CP-ABE algorithm, generates ciphertext, and stores the ciphertext to the data service provider; The data service provider sends the ciphertext and ciphertext storage address information to the transaction Tx storage Send to the said blockchain network; The data owner sends the keyword, ciphertext storage address and access control policy to the transaction Tx authorization Send to the said blockchain network; The attribute management agency uses the attribute set ω of the data user through transaction Tx secretkey Issuing an attribute private key to the data user; The data user accesses the data through the transaction Tx Access Obtain ciphertext, and decrypt the ciphertext using the attribute private key to obtain plaintext.
Citation Information
Patent Citations
Multi-cloud CP-ABE access control method based on block chain
CN111130757A
Alliance block chain data access control method based on CP-ABE algorithm
CN111371561A
Attribute-based encryption and block chain combined trusted data access control scheme
CN112836229A