A data sharing access control method, system, medium and product

CN122717907APending Publication Date: 2026-09-08YUEXIN SEMICONDUCTOR (ZHUJI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610717055.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-22
Publication Date
2026-09-08

AI Technical Summary

Technical Problem

[0003]传统的数据共享方案难以兼顾安全性与轻量化需求

Benefits of technology

1、降低属性加密计算开销,适配资源受限物联网设备

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122717907A_ABST
    Figure CN122717907A_ABST
Patent Text Reader

Abstract

The application discloses a data sharing access control method and system, a medium and a product. Through a key distribution center, a main public key, a main private key and a decryption key of a data user are generated; through a data owner, a symmetric key is first generated to encrypt original data by using a symmetric encryption algorithm, then the symmetric key is encrypted by using a CP-ABE encryption algorithm based on ECC in combination with the main public key and an access policy, complete ciphertext is generated, and data publishing is performed in combination with data storage and a block chain; through the block chain, identity authentication and attribute policy compatibility verification of the data user are performed in combination with the key distribution center, and the data user is authorized to obtain the complete ciphertext; through the data user, a CP-ABE decryption algorithm based on ECC is first used in combination with an attribute set of the data user, the access policy, the decryption key and an identifier of the data user to restore the symmetric key from the complete ciphertext, and then a symmetric decryption algorithm is used in combination with the symmetric key to restore the original data. The security and lightweight demand of data sharing can be considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data security technology, and in particular to a data sharing access control method, system, medium and product. Background Technology

[0002] With the deep integration of IoT technology and the digital economy, the massive amounts of data generated by IoT devices in scenarios such as industrial IoT, smart homes, and smart healthcare have become core strategic resources. Correspondingly, data sharing has become a key link in mining data value and improving the efficiency of scenario collaboration.

[0003] Traditional data sharing solutions struggle to balance security and lightweight requirements. For example, role-based access control schemes, while providing some degree of permission management, offer coarse-grained permissions that fail to meet high security needs. Similarly, attribute-based encryption schemes based on bilinear pairing, while supporting fine-grained access control, suffer from high computational complexity in bilinear pairing operations, making them unsuitable for the lightweight requirements of IoT devices. Summary of the Invention

[0004] This invention provides a data sharing access control method, system, medium, and product that can balance the requirements of data sharing security and lightweight design.

[0005] In a first aspect, embodiments of the present invention provide a data sharing access control method, applied to a data sharing access control system, wherein the system includes at least a key distribution center, a data owner, a data user, a data storage facility, and a blockchain; the method includes: The key distribution center generates a master public key and a master private key, transmits the master public key to the data owner, and generates and sends a decryption key back to the data user. The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC) based ciphertext policy attribute base encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generating complete ciphertext, and then combines the data storage and the blockchain to publish the data. The blockchain, combined with the key distribution center, is used to verify the identity of the data user and the attribute policy compatibility, authorizing the data user to obtain the complete ciphertext. The data user first uses the CP-ABE decryption algorithm based on ECC, combined with the data user attribute set, the access policy, the decryption key and the data user identifier, to recover the symmetric key from the complete ciphertext. Then, a symmetric decryption algorithm is used in combination with the symmetric key to recover the original data.

[0006] Secondly, embodiments of the present invention provide a data sharing access control system, the system including at least a key distribution center, a data owner, a data user, a data storage, and a blockchain; The key distribution center is used to generate a master public key and a master private key, transmit the master public key to the data owner, and generate and return a decryption key to the data user. The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC) based ciphertext policy attribute base encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generate complete ciphertext, and publish the data in conjunction with the data storage and the blockchain. The blockchain is used in conjunction with the key distribution center to verify the identity of the data user and the compatibility of the attribute policy, and to authorize the data user to obtain the complete ciphertext. The data user first uses the CP-ABE decryption algorithm based on ECC, combined with the data user attribute set, the access policy, the decryption key and the data user identifier, to recover the symmetric key from the complete ciphertext, and then uses the symmetric decryption algorithm combined with the symmetric key to recover the original data.

[0007] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that cause a processor to execute the method described in the first aspect.

[0008] Fourthly, embodiments of the present invention provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the method described in the first aspect.

[0009] The technical solution of this invention involves generating a master public key and a master private key through the key distribution center, transmitting the master public key to the data owner, generating and feeding back a decryption key to the data user, and having the data owner first use a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then using the Elliptic Curve Cryptography (ECC)-based Cipher Policy Attribute Base Encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generating complete ciphertext, and publishing the data using the data storage and the blockchain. Through the blockchain, and in conjunction with the key distribution center, the data user's identity verification and attribute policy compatibility verification are performed, authorizing the data user to obtain the complete ciphertext. Finally, the data user first uses the ECC-based CP-ABE decryption algorithm, combined with the data user's attribute set, the access policy, the decryption key, and the data user's identifier, to recover the symmetric key from the complete ciphertext, and then uses a symmetric decryption algorithm combined with the symmetric key to recover the original data. This solution employs a hybrid architecture combining lightweight symmetric encryption / decryption and ECC-based lightweight CP-ABE asymmetric encryption / decryption, along with dual trusted verification from blockchain and a key distribution center. On one hand, it supports complex access policies, refining access control granularity from traditional roles to attribute combinations. On the other hand, dual trusted verification further enhances the system's security capabilities. It also reduces encryption / decryption computational overhead, thus balancing the security and lightweight requirements of data sharing.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of a data sharing access control method provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of a data sharing access control system provided in Embodiment 2 of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0014] It should be noted that the terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0015] Example 1 Figure 1 This is a flowchart of a data sharing access control method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving the implementation of data sharing access control. The method is applied to a data sharing access control system, which at least includes a key distribution center, a data owner, a data user, a data storage facility, and a blockchain.

[0016] The Key Generation Center (KGC) is a trusted third-party organization responsible for system initialization, key distribution, and other tasks.

[0017] A data owner (DO) is the party that can share data externally, such as IoT devices, including smart medical devices, industrial IoT devices, and smart home devices. These devices can access the internet via their own network modules and perform various computing operations using their own computing and storage modules. Shared data generated by these devices during operation can be encrypted and published, and accessed according to configured access policies.

[0018] A Data User (DU) is a party that can use shared data through authentication and attribute verification, such as IoT devices. A DU possesses attributes such as its affiliated organization and device type. These attributes are used to determine whether a DU has the authority to access shared data, thus enabling secure access to shared data.

[0019] Data storage (DS) is used to store encrypted shared data, such as the InterPlanetary File System (IPFS). IPFS provides a block storage model that offers high transmission efficiency, high security, and content-addressable storage, compensating for the inability of blockchain to store large amounts of data through off-chain storage.

[0020] Blockchain can adopt a consortium blockchain model, where nodes are maintained by authoritative IoT companies and regulatory agencies to oversee the data sharing process. Two smart contracts can be deployed on this blockchain, one providing data sharing services and the other providing data access services. The corresponding distributed ledger stores two types of information: one is data sharing information related to DOs (Data Access Providers), such as data digests, hash values, access policies, and the storage address of encrypted data; the other is data access information related to DUs (Data Access Providers), such as the identifier, attributes, access time, attribute verification status, and access results of the requesting data user. The traceability of the distributed ledger allows the data sharing process to be audited, while its immutability allows DUs to verify the authenticity and reliability of the shared data.

[0021] like Figure 1 As shown, the method includes: S110. Through the key distribution center, generate a master public key and a master private key, and transmit the master public key to the data owner; generate and feed back the decryption key to the data user.

[0022] In this step, system initialization is performed through the key distribution center. Specifically: an attribute space is defined; a first random number for the global system initialization phase is selected from the multiplication group, and a master private key is generated based on this first random number; a second random number for each attribute in the attribute space is selected from the multiplication group, and the attribute public key is calculated using the random generator of the elliptic curve group; a master public key is generated based on the first random number, the random generator, the attribute space, and the attribute public key, and the master public key is transmitted to the data user; a hash function is selected. It is used for mapping identity to attributes.

[0023] in, It is a mathematical structure that contains Each element represents the modulus. The set of integers, They are usually large prime numbers. In cryptography, the computational space is used to define elliptic curve groups, hash functions, etc. In this invention, all encryption, hashing, and other operations are performed within this computational space. Performed within a finite field to ensure the safety and mathematical rigor of the computation. It is a model Multiplication group is used to select random scalar parameters.

[0024] Upon receiving a key request from a data user, the key distribution center verifies the user's identity and the authenticity of the attribute set based on the user identifier and attribute set carried in the request. If verification is successful, a decryption key is generated. Specifically, using the master public key, master private key, user identifier, and attribute set as input, the decryption key component for each attribute in the attribute set is calculated. The user identifier, attribute set, and decryption key components are then combined to form a complete decryption key, which is sent back to the data user. The user identifier is a globally unique credential identifying the data user; the attribute set is a collection of all attributes possessed by the data user, used to match access policies and implement fine-grained access control and authorization verification.

[0025] S120. The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC)-based Cipher Policy Attribute Base Encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generating complete ciphertext, and then combines the data storage and the blockchain to publish the data.

[0026] In this step, the data owner employs a lightweight symmetric encryption algorithm and a lightweight ciphertext-policy attribute-based encryption (CP-ABE) algorithm (i.e., asymmetric encryption) based on elliptic curve cryptography (ECC) to form a hybrid architecture for encrypting the original data. The original data is the data owned by the data owner that is to be encrypted and shared with the data user. The lightweight symmetric encryption algorithm can be implemented based on the Advanced Encryption Standard (AES). AES uses the same 128 / 256-bit key for encryption and decryption, resulting in high computational efficiency. In this invention, it is used to quickly encrypt raw big data for the Internet of Things (IoT) and is suitable for resource-constrained devices. The CP-ABE algorithm is a type of ABE. In this algorithm, the data owner sets an access policy and embeds it into the ciphertext. The data user's decryption key is associated with their own attributes; the ciphertext can only be decrypted if their attributes satisfy the access policy in the ciphertext. The ECC algorithm is a public-key encryption technique based on the elliptic curve discrete logarithm problem. In this invention, it is used to improve the CP-ABE algorithm, replacing the complex bilinear pairing operation in the traditional CP-ABE scheme. Based on its advantages of short key length and low computational overhead, it achieves lightweight attribute encryption, making it suitable for resource-constrained IoT devices.

[0027] The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data. Specifically, a third random number is selected from the multiplication group during the encryption phase, and a 128-bit symmetric key is derived using a hash function. The original data is then encrypted using the AES algorithm based on this symmetric key to obtain the ciphertext. This setup aims to address the issue that asymmetric encryption is unsuitable for encrypting long data streams, thus adapting to the large-scale data encryption needs of IoT devices.

[0028] Through the data owner, the CP-ABE encryption algorithm based on ECC is used, combined with the master public key and access policy to encrypt the symmetric key. Specifically: based on a third random number associated with the symmetric key, the encryption key component is derived using the master public key; through access tree polynomial construction, the reconstruction permission of the encryption key component is bound to the access policy, realizing access policy embedding. This ensures that the encryption key component can only be reconstructed when the data user's attributes satisfy the access policy, thereby restoring the third random number and symmetric key; based on the access policy, the encryption key component, and the secret share of the leaf nodes of the constructed access tree, attribute ciphertext is generated. The advantage of this setup is that encryption can be achieved entirely using ECC scalar multiplication operations, resulting in low computational overhead.

[0029] The data owner combines the encrypted data and attribute encrypted data into a complete encrypted data.

[0030] By having the data owner combine data storage and blockchain for data publication, the complete encrypted text can be transmitted to the data storage, and the metadata related to the complete encrypted text can be published to the consortium blockchain, thus completing the data publication. The metadata related to the complete encrypted text is not limited here.

[0031] S130. Through the blockchain and in conjunction with the key distribution center, the authentication and attribute policy compatibility verification of the data user are performed, and the data user is authorized to obtain the complete ciphertext.

[0032] When a data user requests access to data, dual verification is required through both the blockchain and the key distribution center.

[0033] Using blockchain for data user authentication and attribute policy compatibility verification includes one step: specifically, based on the data user identifier carried in the request, verifying whether the data user has completed identity authentication; and based on the data user attribute set hash value and the original data identifier carried in the request, querying the access policy corresponding to the original data, and initially verifying whether the data user attribute set hash value is compatible with the attribute requirements of the access policy. The purpose of this setup is to perform initial screening and avoid invalid requests.

[0034] After initial verification, the blockchain can send a secondary verification request to the key distribution center. The key distribution center performs attribute policy compatibility verification, including secondary verification, which further verifies whether the data user's attribute set meets the attribute requirements of the access policy. If it does, the blockchain receives a "permission granted" notification and authorizes the data user to obtain the complete encrypted data.

[0035] S140. Using the data user, the CP-ABE decryption algorithm based on ECC is first used, combined with the data user attribute set, the access policy, the decryption key and the data user identifier, to recover the symmetric key from the complete ciphertext, and then the original data is recovered by using the symmetric decryption algorithm combined with the symmetric key.

[0036] After the data user obtains the complete ciphertext, a decryption operation is performed. The decryption operation consists of the following two steps, and complete decryption can only be performed if the data user's attributes meet the access policy; otherwise, decryption will fail.

[0037] The data user executes an ECC-based CP-ABE decryption algorithm. The algorithm's inputs are the attribute ciphertext from the complete ciphertext, the data user's decryption key, the data user's identifier, the data user's attribute set, and the access policy. If the data user's attribute set satisfies the access policy, the secret is reconstructed using the secret share of the leaf node of the access tree in the attribute ciphertext, the decryption key, and the hash value of the data user's identifier, recovering the encryption key component consistent with the encryption phase. A third random number is extracted from the encryption key component, and then a hash function is used to restore the symmetric key consistent with the encryption phase. If the correct encryption key component cannot be reconstructed, the third random number cannot be obtained, and therefore the symmetric key cannot be restored, terminating the decryption process. This algorithm ensures that only data users satisfying the access policy can obtain the symmetric key to complete data decryption. It should be noted that the ECC-based CP-ABE algorithm in this invention uses the master public key for encryption during the encryption phase and the data user's decryption key for decryption during the decryption phase. The encryption and decryption keys are completely different, making it a standard ECC asymmetric encryption system.

[0038] The data user uses the recovered symmetric key and a symmetric decryption algorithm to decrypt the ciphertext in the complete ciphertext, obtaining the original data. The symmetric encryption / decryption algorithm in this invention uses the same symmetric key in both the encryption and decryption stages, conforming to the characteristics of symmetric encryption / decryption.

[0039] The technical solution of this invention involves generating a master public key and a master private key through the key distribution center, transmitting the master public key to the data owner, generating and feeding back a decryption key to the data user, and having the data owner first use a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then using the Elliptic Curve Cryptography (ECC)-based Cipher Policy Attribute Base Encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generating complete ciphertext, and publishing the data using the data storage and the blockchain. Through the blockchain, and in conjunction with the key distribution center, the data user's identity verification and attribute policy compatibility verification are performed, authorizing the data user to obtain the complete ciphertext. Finally, the data user first uses the ECC-based CP-ABE decryption algorithm, combined with the data user's attribute set, the access policy, the decryption key, and the data user's identifier, to recover the symmetric key from the complete ciphertext, and then uses a symmetric decryption algorithm combined with the symmetric key to recover the original data. This solution employs a hybrid architecture combining lightweight symmetric encryption / decryption and ECC-based lightweight CP-ABE asymmetric encryption / decryption, along with dual trusted verification from blockchain and a key distribution center. On one hand, it supports complex access policies, refining access control granularity from traditional roles to attribute combinations. On the other hand, dual trusted verification further enhances the system's security capabilities. It also reduces encryption / decryption computational overhead, thus balancing the security and lightweight requirements of data sharing.

[0040] In one embodiment, generating the master public key and master private key through the key distribution center includes: The key distribution center selects a first random number from the multiplication group to generate a master private key; it then selects a second random number associated with each attribute in the attribute space from the multiplication group, combines it with the random generator of the elliptic curve group to generate an attribute public key, and combines the product of the first random number and the random generator, the attribute space, and the attribute public key to form a master public key.

[0041] The master private key can be represented as , From The first random number selected.

[0042] The attribute public key can be represented as , ,in, For attribute space Each attribute in from The second random number selected. Elliptic curve group The random generator; the master public key can be represented as .

[0043] In one embodiment, generating and sending a decryption key back to the data user through the key distribution center includes: The key distribution center determines the data user identifier and data user attribute set carried in the key request of the data user. Through the key distribution center, for each attribute in the data user attribute set, a decryption key component is constructed based on the master private key, the attribute public key in the master public key, and the hash value of the data user identifier; The key distribution center combines the data user identifier, the data user attribute set, and the decryption key component into a decryption key, and then sends it back to the data user.

[0044] That is, after receiving a key request from a data user, the key distribution center determines the data user identifier carried in the request. and data user attribute set For each attribute in the data user attribute set Calculate the decryption key components : ; in, Master private key; for The hash value; For attributes The corresponding attribute public key, For attributes The corresponding second random number, is a random generator.

[0045] Construct the complete decryption key The decryption key will then be sent back to the data user.

[0046] In one embodiment, the data owner first generates a symmetric key using a symmetric encryption algorithm to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC)-based Ciphertext Policy Attribute Basis Encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generating complete ciphertext, including: The data owner uses a symmetric encryption algorithm to generate a symmetric key based on a third random number selected from a multiplication group and a hash function. The original data is then encrypted using the symmetric key to obtain ciphertext. Through the data owner, the CP-ABE encryption algorithm based on ECC is used to derive an encryption key component from the third random number and the master public key, and the reconstruction permission of the encryption key component is bound to the access policy through access tree polynomial construction to generate attribute ciphertext, which includes the access policy, the encryption key component, and the secret share of the access tree leaf node. The data owner combines the data ciphertext and the attribute ciphertext into a complete ciphertext.

[0047] The symmetric encryption process is as follows: using the symmetric encryption algorithm AES, from... Select the third random number The symmetric key is derived through a hash function. Encrypt the original ciphertext using a symmetric key. Obtain the encrypted data .

[0048] The asymmetric encryption process is as follows: The CP-ABE encryption algorithm based on ECC is used, and a third random number is generated. and the public parameters of the master public key Derived encryption key components The access tree is constructed using polynomials based on the cryptographic key components, forming an access tree from top to bottom. Middle node definition polynomial of order Specifically: For the root node , will be derived core As the root node The secret Random selection A random number determines the polynomial, revealing the core secret. It is split into multiple sub-secrets and distributed to its own child nodes. It is the threshold value of the root node.

[0049] Each non-leaf node obtains its child secret from its corresponding parent node, and then uses its own... The polynomial of order X is further decomposed, and the newly decomposed sub-secrets are distributed to the next level of child nodes. This process is repeated recursively until the secret is decomposed down to the lowest level leaf nodes. Among these, non-leaf nodes... The secret share is represented as , Non-leaf nodes The parent node, Non-leaf nodes A unique index in the list of child nodes of the parent node. Wherein, the threshold value... Used to calculate node coefficients.

[0050] The secret share of the lowest-level leaf node is represented as ,in, This is the child secret that a leaf node obtains from its parent node. For attribute public key The inverse element of the corresponding second random number. Is with attributes A strongly bound secret share can only be held by those who possess the attribute. Only the data user can use their own decryption key component. Handle this share.

[0051] It should be noted that the access tree can be understood as being transformed from the access strategy. Specifically: each logical operator (such as AND / OR) in the access strategy is transformed into a non-leaf node, and the threshold value of this node is entirely determined by the logical operator; each attribute condition in the access strategy is transformed into a leaf node, forming a parent-child tree structure with the non-leaf nodes; ultimately, the entire access tree can reflect the overall access strategy, and only attributes that meet the threshold requirements of the tree structure can pass the subsequent secret reconstruction.

[0052] The attribute ciphertext constructed through asymmetric encryption is represented as follows .

[0053] Combine the data ciphertext and attribute ciphertext into a complete ciphertext. .

[0054] In one embodiment, data publishing is carried out by the data owner, in conjunction with the data storage and the blockchain, including: The data owner uploads the complete ciphertext to the data storage to obtain the storage address, and publishes the corresponding metadata to the blockchain. The metadata includes at least the storage address, the access policy, and the hash value of the complete ciphertext.

[0055] After encryption, the data owner uploads the complete ciphertext to the data storage, obtains the storage address of the complete ciphertext in the data storage, and then forwards the storage address and the hash value of the complete ciphertext. Metadata such as access policies is published to the consortium blockchain to complete data publication.

[0056] In one embodiment, the blockchain, in conjunction with the key distribution center, is used to authenticate the data user and verify attribute policy compatibility, authorizing the data user to obtain the complete ciphertext, including: The blockchain is used to determine the data user identifier, data user attribute set hash value, and original data identifier carried in the data access request of the data user. The authentication is performed based on the data user identifier through the blockchain; the attribute policy compatibility verification, including a first verification, is performed based on the access policy bound to the data user attribute set hash value and the original data identifier; after successful verification, a second verification request is initiated to the key distribution center. Through the key distribution center, using the access tree recursive matching logic, based on the data user's attribute set and the access policy, a secondary verification including the attribute policy compatibility verification is performed; after the verification is successful, the data user is authorized to obtain the complete ciphertext.

[0057] The verification process in the blockchain is as follows: Based on the data user's identifier, verify whether the data user has completed identity authentication, i.e., verify whether an identity registration record exists on the chain; based on the original data identifier, query the access policy of the original data, compare the hash value of the data user's attribute set with the hash value corresponding to the attribute set required by the access policy, and verify whether there is an attribute overlap. If so, the first verification, including attribute policy compatibility verification, is performed. After successful verification, a second verification request is initiated to the key distribution center.

[0058] The verification process in the key distribution center is as follows: The access tree corresponding to the access policy is retrieved, and nodes are recursively verified. If the root node of the access tree is an "AND" node, the data user's attribute set must contain the attributes corresponding to all child nodes under that node. If the root node is an "OR" node, the data user's attribute set must contain the attributes corresponding to any one child node under that node. All leaf nodes (corresponding to specific attributes) of the access tree are traversed to confirm whether the data user's attribute set covers all leaf node attributes that satisfy the access policy. Finally, it is determined whether the access conditions are met. If they are met, the secondary verification, including attribute policy compatibility verification, is performed.

[0059] If all the above verifications pass, the key distribution center authorizes the data user to obtain the storage address of the complete ciphertext, thereby enabling the data user to retrieve the complete ciphertext from the data storage based on that storage address.

[0060] Optionally, the consortium blockchain can also write access records to the blockchain to ensure traceability. Access records can include information such as data user identifier, original data identifier, access timestamp, and verification result.

[0061] In one embodiment, the data user first uses an ECC-based CP-ABE decryption algorithm, combined with the data user attribute set, the access policy, the decryption key, and the data user identifier, to recover the symmetric key from the complete ciphertext. Then, a symmetric decryption algorithm is used in conjunction with the symmetric key to recover the original data, including: Using the data user, the CP-ABE decryption algorithm based on ECC is employed. When the data user's attribute set satisfies the access policy, the secret share of the access leaf node in the attribute ciphertext of the complete ciphertext is reconstructed by combining the decryption key and the data user identifier, thus restoring the encryption key component. A third random number is extracted from the encryption key component and combined with a hash function to restore the symmetric key. The data user uses a symmetric decryption algorithm based on the symmetric key to decrypt the ciphertext in the complete ciphertext and restore the original data.

[0062] The process of restoring the encryption key components is as follows: For each attribute in the data user attribute set that matches the access policy, calculate its corresponding intermediate variable. , represented as: ; in, To decrypt the attributes in the key The corresponding decryption key component, This is the secret share for accessing the leaf nodes in the attribute ciphertext. A hash value identifying the data user; By accessing the tree node coefficients Perform a secret reconstruction to recover the encryption key components, represented as: .

[0063] Extract the third random number from the encryption key component. Then, the symmetric key consistent with the encryption stage is restored using a hash function. .

[0064] The process of restoring the original data can be represented as: .

[0065] In one embodiment, the method further includes: verifying the authenticity of the restored original data through the data user.

[0066] To prevent data from being tampered with during storage or transmission, data users must verify the authenticity of the data. Specifically, they calculate the hash value of the downloaded complete ciphertext, query the hash value of the corresponding stored complete ciphertext from the consortium blockchain, and compare the two hash values. If they match, the data is authentic and valid; otherwise, the data is determined to have been tampered with, its use is rejected, and an anomaly is reported to the consortium blockchain.

[0067] The technical solutions of the embodiments of the present invention have the following beneficial effects: 1. Reduce the computational overhead of attribute encryption and adapt to resource-constrained IoT devices. This invention abandons the complex bilinear pairing operations of traditional CP-ABE schemes and adopts an improved CP-ABE algorithm based on ECC, combined with secret sharing to achieve fine-grained access control. Experimental data shows that, under the same hardware environment, the single encryption / decryption time of the traditional bilinear pairing scheme is 85ms / 120ms, while the single encryption / decryption time of the present invention is only 12ms / 25ms, reducing computational overhead, and the encryption / decryption latency is not significantly affected by the increase in the number of attributes. In other words, while ensuring fine-grained access control, it can reduce encryption and decryption overhead, fully adapting to the real-time and energy consumption requirements of resource-constrained IoT devices.

[0068] 2. Achieve resistance to collusion attacks and traceability of access behavior. This invention enhances security through two core designs: First, it combats collusion attacks. During the key generation phase, the data user identifier is embedded into the decryption key via hashing. Since the hash values ​​of different data user identifiers are unique, even if multiple data users who do not meet the access policy share a private key, they cannot recover the legitimate encryption key by combining the private key components, fundamentally resisting collusion attacks. Second, it ensures traceability of access behavior. The consortium blockchain stores key information throughout the data sharing process, including the complete ciphertext hash value of the data owner, access policy, data user identifier, attribute verification results, access timestamps, etc. The immutability of the distributed ledger ensures that this information cannot be tampered with. Regulatory agencies can trace non-compliant access behavior (such as unauthorized access or false data requests) through on-chain records. Simultaneously, data owners can query the access status of their data in real time, solving the problem of "loss of control after data sharing."

[0069] 3. Ensure data authenticity and avoid the risk of tampering. To address the vulnerability of centralized data storage to tampering, this invention employs an "on-chain + off-chain" collaborative storage model: First, off-chain storage utilizes IPFS to store the complete ciphertext of the original data, leveraging IPFS's distributed block storage characteristics to improve data availability while avoiding the performance bottleneck caused by storing large amounts of data on the blockchain. Second, for on-chain verification, based on key metadata such as the complete ciphertext hash value and access policy digest published by the data owner to the consortium blockchain, the data user can download the complete ciphertext, calculate its hash value, and compare it with the on-chain hash value to verify the data's authenticity. Experimental verification shows that if the ciphertext is tampered with (e.g., by modifying 1 bit of data), the hash value comparison failure rate is 100%, effectively identifying fraudulent data and ensuring the credibility of data sharing.

[0070] 4. Fine-grained access control, balancing flexibility and security. This invention, based on an improved CP-ABE algorithm, supports complex access policies, such as "(Department = Industrial Control) AND (Equipment Type = Sensor) OR (Permission Level = Administrator)". Data owners can define multi-dimensional and multi-level access rules according to actual needs, achieving data sharing with "least privileges". The access control granularity of this invention is refined from the traditional "role" to "attribute combination". For example, in an industrial IoT scenario, it can achieve "only allowing temperature sensors in workshop A to access production data from 8:00 to 18:00", satisfying cross-scenario data sharing needs while avoiding excessive exposure of sensitive information.

[0071] Example 2 Figure 2 This is a schematic diagram of a data sharing access control system according to Embodiment 2 of the present invention. This embodiment is applicable to situations involving the implementation of data sharing access control. Figure 2 As shown, the system includes at least a key distribution center, a data owner, a data user, a data storage facility, and a blockchain.

[0072] The key distribution center is used to generate a master public key and a master private key, transmit the master public key to the data owner, and generate and return a decryption key to the data user. The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC) based ciphertext policy attribute base encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generate complete ciphertext, and publish the data in conjunction with the data storage and the blockchain. The blockchain is used in conjunction with the key distribution center to verify the identity of the data user and the compatibility of the attribute policy, and to authorize the data user to obtain the complete ciphertext. The data user first uses the CP-ABE decryption algorithm based on ECC, combined with the data user attribute set, the access policy, the decryption key and the data user identifier, to recover the symmetric key from the complete ciphertext, and then uses the symmetric decryption algorithm combined with the symmetric key to recover the original data.

[0073] This solution employs a hybrid architecture combining lightweight symmetric encryption / decryption and ECC-based lightweight CP-ABE asymmetric encryption / decryption, along with dual trusted verification from blockchain and a key distribution center. On one hand, it supports complex access policies, refining access control granularity from traditional roles to attribute combinations. On the other hand, dual trusted verification further enhances the system's security capabilities. It also reduces encryption / decryption computational overhead, thus balancing the security and lightweight requirements of data sharing.

[0074] Furthermore, the key distribution center is specifically used for: A first random number is selected from the multiplication group to generate the master private key; a second random number associated with each attribute in the attribute space is selected from the multiplication group, and an attribute public key is generated by combining the random generator of the elliptic curve group; the product of the first random number and the random generator, the attribute space, and the attribute public key are combined to form the master public key.

[0075] Furthermore, the key distribution center is specifically used for: The key request from the data user is used to determine the data user's identifier and data user attribute set. For each attribute in the data user attribute set, a decryption key component is constructed based on the master private key, the attribute public key in the master public key, and the hash value of the data user identifier; The data user identifier, the data user attribute set, and the decryption key component are combined into a decryption key and fed back to the data user.

[0076] Furthermore, the data owner is specifically used for: A symmetric encryption algorithm is used to generate a symmetric key based on a third random number selected from a multiplication group and a hash function. The original data is then encrypted using the symmetric key to obtain the ciphertext. The CP-ABE encryption algorithm based on ECC is adopted. The encryption key component is derived from the third random number and the master public key. The reconstruction permission of the encryption key component is bound to the access policy through the access tree polynomial construction to generate attribute ciphertext. The attribute ciphertext includes the access policy, the encryption key component and the secret share of the access tree leaf node. The data ciphertext and the attribute ciphertext are combined into a complete ciphertext.

[0077] Furthermore, the data owner is specifically used for: The complete ciphertext is uploaded to the data storage to obtain the storage address, and the corresponding metadata is published to the blockchain. The metadata includes at least the storage address, the access policy, and the hash value of the complete ciphertext.

[0078] Furthermore, the blockchain is specifically used for: The process involves determining the data user identifier, data user attribute set hash value, and original data identifier carried in the data access request of the data user; performing authentication based on the data user identifier; performing a primary verification including attribute policy compatibility verification based on the access policy bound to the data user attribute set hash value and the original data identifier; and initiating a secondary verification request to the key distribution center after successful verification. The key distribution center is specifically used for: Using the recursive matching logic of the access tree, a secondary verification is performed based on the data user's attribute set and the access policy, including the attribute policy compatibility verification; after the verification is successful, the data user is authorized to obtain the complete ciphertext.

[0079] Furthermore, the data user is specifically used for: The CP-ABE decryption algorithm based on ECC is used. When the data user attribute set satisfies the access policy, the access leaf node secret share of the attribute ciphertext in the complete ciphertext is reconstructed by combining the decryption key and the data user identifier to restore the encryption key component. A third random number is extracted from the encryption key component and combined with a hash function to restore the symmetric key. A symmetric decryption algorithm is used to decrypt the data ciphertext in the complete ciphertext based on the symmetric key, thereby restoring the original data.

[0080] The data sharing access control system provided in this embodiment of the invention can execute the data sharing access control method provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0081] This invention also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the data sharing access control method provided in this invention.

[0082] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the data sharing access control method provided in this invention.

[0083] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0084] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0085] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A data sharing access control method, characterized in that, An application to a data sharing access control system, the system comprising at least a key distribution center, a data owner, a data user, a data storage facility, and a blockchain; the method comprising: The key distribution center generates a master public key and a master private key, transmits the master public key to the data owner, and generates and sends a decryption key back to the data user. The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC) based ciphertext policy attribute base encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generating complete ciphertext, and then combines the data storage and the blockchain to publish the data. The blockchain, combined with the key distribution center, is used to verify the identity of the data user and the attribute policy compatibility, authorizing the data user to obtain the complete ciphertext. The data user first uses the CP-ABE decryption algorithm based on ECC, combined with the data user attribute set, the access policy, the decryption key and the data user identifier, to recover the symmetric key from the complete ciphertext. Then, a symmetric decryption algorithm is used in combination with the symmetric key to recover the original data.

2. The method according to claim 1, characterized in that, The master public key and master private key are generated through the key distribution center, including: The key distribution center selects a first random number from the multiplication group to generate a master private key; it then selects a second random number associated with each attribute in the attribute space from the multiplication group, combines it with the random generator of the elliptic curve group to generate an attribute public key, and combines the product of the first random number and the random generator, the attribute space, and the attribute public key to form a master public key.

3. The method according to claim 1, characterized in that, The key distribution center generates and sends decryption keys back to the data user, including: The key distribution center determines the data user identifier and data user attribute set carried in the key request of the data user. Through the key distribution center, for each attribute in the data user attribute set, a decryption key component is constructed based on the master private key, the attribute public key in the master public key, and the hash value of the data user identifier; The key distribution center combines the data user identifier, the data user attribute set, and the decryption key component into a decryption key, and then sends it back to the data user.

4. The method according to claim 1, characterized in that, The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data. Then, using the Elliptic Curve Cryptography (ECC)-based ciphertext policy attribute base encryption (CP-ABE) algorithm, combined with the master public key and access policy, the symmetric key is encrypted to generate complete ciphertext, including: The data owner uses a symmetric encryption algorithm to generate a symmetric key based on a third random number selected from a multiplication group and a hash function. The original data is then encrypted using the symmetric key to obtain ciphertext. Through the data owner, the CP-ABE encryption algorithm based on ECC is used to derive an encryption key component from the third random number and the master public key, and the reconstruction permission of the encryption key component is bound to the access policy through access tree polynomial construction to generate attribute ciphertext, which includes the access policy, the encryption key component, and the secret share of the access tree leaf node. The data owner combines the data ciphertext and the attribute ciphertext into a complete ciphertext.

5. The method according to claim 1, characterized in that, Data publication is carried out through the data owner, in conjunction with the data storage and the blockchain, including: The data owner uploads the complete ciphertext to the data storage to obtain the storage address, and publishes the corresponding metadata to the blockchain. The metadata includes at least the storage address, the access policy, and the hash value of the complete ciphertext.

6. The method according to claim 1, characterized in that, Through the blockchain, combined with the key distribution center, the authentication and attribute policy compatibility verification of the data user are performed, authorizing the data user to obtain the complete ciphertext, including: The blockchain is used to determine the data user identifier, data user attribute set hash value, and original data identifier carried in the data access request of the data user. The authentication is performed based on the data user identifier through the blockchain; the attribute policy compatibility verification, including a first verification, is performed based on the access policy bound to the data user attribute set hash value and the original data identifier; after successful verification, a second verification request is initiated to the key distribution center. Through the key distribution center, using the access tree recursive matching logic, based on the data user's attribute set and the access policy, a secondary verification including the attribute policy compatibility verification is performed; after the verification is successful, the data user is authorized to obtain the complete ciphertext.

7. The method according to claim 1, characterized in that, Using the data user, the CP-ABE decryption algorithm based on ECC is first employed, combined with the data user attribute set, the access policy, the decryption key, and the data user identifier, to recover the symmetric key from the complete ciphertext. Then, a symmetric decryption algorithm is used in conjunction with the symmetric key to recover the original data, including: Using the data user, the CP-ABE decryption algorithm based on ECC is employed. When the data user's attribute set satisfies the access policy, the secret share of the access leaf node in the attribute ciphertext of the complete ciphertext is reconstructed by combining the decryption key and the data user identifier, thus restoring the encryption key component. A third random number is extracted from the encryption key component and combined with a hash function to restore the symmetric key. The data user uses a symmetric decryption algorithm based on the symmetric key to decrypt the ciphertext in the complete ciphertext and restore the original data.

8. A data sharing access control system, characterized in that, The system includes at least a key distribution center, a data owner, a data user, a data storage facility, and a blockchain. The key distribution center is used to generate a master public key and a master private key, and to transmit the master public key to the data owner; Generate and send the decryption key back to the data user; The data owner first uses a symmetric encryption algorithm to generate a symmetric key to encrypt the original data, then uses the Elliptic Curve Cryptography (ECC) based ciphertext policy attribute base encryption (CP-ABE) algorithm, combined with the master public key and access policy, to encrypt the symmetric key, generate complete ciphertext, and publish the data in conjunction with the data storage and the blockchain. The blockchain is used in conjunction with the key distribution center to verify the identity of the data user and the compatibility of the attribute policy, and to authorize the data user to obtain the complete ciphertext. The data user first uses the CP-ABE decryption algorithm based on ECC, combined with the data user attribute set, the access policy, the decryption key and the data user identifier, to recover the symmetric key from the complete ciphertext, and then uses the symmetric decryption algorithm combined with the symmetric key to recover the original data.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-7.