Data security sharing system and method based on block chain

By managing identity tokens and access policies on the blockchain, combined with the use of public and private keys, user data privacy and security issues in traditional data sharing and identity management are solved, enabling efficient data sharing and simplified identities. manage.

CN119363312APending Publication Date: 2025-01-24SICHUAN TANGGU DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411350628.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In traditional data sharing and identity management solutions, user data has privacy and security issues, and users need to manage multiple identity identifiers and passwords, resulting in memory difficulties and inability to access services.

Method used

Adopt a blockchain -based data security sharing system, create, update and query identity token through identity manager, access the management module management access strategy and store on the blockchain, data providers and data consumers use public keys and privately use private keys and private Data access and decryption of keys, log service module records and data access logs.

Benefits of technology

The data sharing system based on the principle of privacy is implemented to effectively prevent privacy and security attacks, solve the security problems in the data sharing process, and simplify the user's identity management process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363312A_ABST
    Figure CN119363312A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data security sharing system and method based on a block chain, and belongs to the technical field of block chains. The system comprises an identity manager used for creating, updating and querying an identity token according to the identity attribute of a data consumer; the identity token is stored in a block chain ledger; the access management module is used for managing an access strategy, storing the access strategy in the block chain ledger, and maintaining a first public key and a first private key for a digital signature scheme; the data provider is used for providing an access strategy and maintaining a second public key and a second private key for a digital signature scheme and out-of-chain storage of data; the data consumer is used for communicating with other entities in the block chain network; maintaining a third public key and a third private key for a digital signature scheme and an Nym value; and the log service module is used for recording a data access log of the data consumer and providing the data access log to the authorized data provider.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based data security sharing system and method. Background Art

[0002] In the traditional data sharing and identity management process, service providers usually use AAA architecture and service level agreement (SLA) to provide services to users. AAA is the abbreviation of Authentication, Authorization and Accounting, which is a network security architecture used to manage and control user access to network resources. In the AAA architecture, user authentication data, authorization data and audit data are usually managed and stored by a central server.

[0003] Data sharing in the AAA architecture allows service providers to centrally manage and monitor user activities, which means that service providers can monitor, track, leak and control user data, which leads to privacy and security issues for user data. At the same time, for identity management in the AAA architecture, service providers also have the right to decide whether to accept or reject a user's identity authentication based on service policies, user behavior and security considerations, or deliberately allow unauthorized users to pass the authentication. With the increase in network-based services and applications, users need to authenticate on multiple services, which leads to the need for users to manage multiple identity identifiers and passwords. When users are faced with a large number of passwords that need to be remembered, they may forget the passwords for services that they do not use frequently, resulting in the inability to access services.

[0004] Therefore, it is necessary to improve traditional data sharing and identity management solutions to ensure data security and privacy. Summary of the invention

[0005] The embodiments of the present invention provide a data security sharing system and method based on blockchain to solve the security issues in the data sharing process.

[0006] In a first aspect, an embodiment of the present invention provides a data security sharing system based on blockchain, the system comprising: An identity manager, configured to create, update, and query identity tokens according to identity attributes of a data consumer; the identity tokens are stored in a blockchain ledger; wherein the identity attributes correspond to multiple roles of the data consumer; an access management module for managing access policies, storing the access policies in the blockchain ledger, and maintaining a first public key and a first private key for a digital signature scheme; A data provider, configured to provide the access policy, maintain a second public key and a second private key for the digital signature scheme, and off-chain storage of data; A data consumer, for communicating with other entities in the blockchain network to access data; and maintaining a third public key and a third private key and a Nym value for the digital signature scheme; the Nym value is a pseudo-anonymous identity associated with the third public key; The log service module is used to record the data access log of the data consumer and provide the data access log to the authorized data provider.

[0007] In a possible design of the first aspect, the identity manager is implemented based on a chain code, and the chain code is written based on an enterprise-level blockchain platform Hyperledger Fabric v1.4 and a programming language GoLang.

[0008] In a possible design of the first aspect, the identity token is stored in the blockchain ledger in the form of a key-value pair, wherein an identifier of the identity token serves as a key in the key-value pair, and the identity token is converted into a string as a value in the key-value pair; the identifier of the identity token is used to uniquely mark the identity token.

[0009] In a possible design of the first aspect, the identity manager also maintains a correspondence between the identity token and the Nym value of the data consumer, and the Nym value is used to verify the activities of the data consumer in the blockchain network.

[0010] In a possible design of the first aspect, the access management module is used to receive a data provision request from the data provider, wherein the data provision request includes at least a data signature, an access policy, and the second public key; the data signature is verified according to the second public key, and after the signature verification is passed, the access policy is encrypting using the first private key, and the encrypted access policy is stored in the blockchain ledger.

[0011] In a possible design of the first aspect, the access management module is used to receive the data access request of the data consumer, wherein the data access request includes at least the third public key, the Nym value and the data signature; the data signature is verified according to the third public key, and after the signature verification is passed, the identity attributes of the data consumer are verified according to the Nym value; after the identity attribute verification is passed, the requested data is sent to the data consumer.

[0012] In a possible design of the first aspect, the data provider provides the access policy through a data provider application and encrypts the data using a symmetric key.

[0013] In a possible design of the first aspect, the data consumer communicates with other entities in the blockchain network through a data consumer application and uses a decryption device to decrypt the accessed data.

[0014] In a possible design of the first aspect, the decryption device is implemented based on Intel SGX technology.

[0015] In a second aspect, a data security sharing method based on blockchain is applied to the data security sharing system of blockchain described in any possible implementation of the first aspect, and the method includes: The access management module generates a public / private key pair; The data provider sends an access policy to the access management module; The data consumer sends an access request to the access management module; The access management module verifies the access request; The access management module updates a counter.

[0016] The access management module creates a policy object.

[0017] The access management module signs the policy object using the private key of the access management module and stores the signed policy on the blockchain.

[0018] The access management module retrieves a token hash and an identity token signed by the identity manager from the blockchain.

[0019] The access management module confirms whether Cond satisfies the corresponding attribute value.

[0020] The access management module returns an event to the data provider, indicating that the request is allowed.

[0021] The access management module retrieves the policy signed by the access management module from the blockchain, and returns the signed policy to the data consumer.

[0022] In the scheme provided by the embodiment of the present invention, by setting an identity manager, an identity token is created, updated and queried according to the identity attributes of the data consumer; an access management module is used to manage access policies and maintain the first public key and the first private key for the digital signature scheme; a data provider is used to provide access policies, maintain the second public key and the second private key for the digital signature scheme and the off-chain storage of data; a data consumer is used to communicate with other entities in the blockchain network; a third public key and a third private key for the digital signature scheme and the Nym value are maintained; a log service module is used to record the data access log of the data consumer and provide the data access log to the authorized data provider; wherein the identity token and the access policy are both stored in the blockchain ledger. According to the technical scheme of the embodiment of the present invention, the identity identification and authentication of the user based on the identity token is realized through the identity manager, the access policy on the blockchain is stored and evaluated through the access management module, and encrypted data is provided to the authorized user, and the data access log of the data consumer is managed through the log service module. Only the authorized user can obtain the data access log. It can be seen that the system of this embodiment is designed based on the privacy principle, which can effectively prevent privacy and security attacks and solve the security problem in the data sharing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A schematic diagram of the composition of a blockchain-based data security sharing system provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a data security sharing system based on blockchain provided by an embodiment of the present invention; Figure 3 A schematic diagram of the composition of the main entities involved in the identity management process of a blockchain-based data security sharing system provided by an embodiment of the present invention; Figure 4 A schematic diagram of the communication mode of the main entities in the identity management process of a blockchain-based data security sharing system provided by an embodiment of the present invention; Figure 5 A schematic diagram of the composition of the main entities involved in the access control process in a blockchain-based data security sharing system provided by an embodiment of the present invention; Figure 6A flowchart of a data security sharing method based on blockchain technology provided by an embodiment of the present invention; Figure 7 A schematic diagram of the composition of the main components responsible for the decryption protocol in a blockchain-based data security sharing system provided by an embodiment of the present invention; Figure 8 A flowchart of another data security sharing method based on blockchain technology provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0027] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0028] First, some terms involved in the embodiments of the present invention are explained.

[0029] Blockchain: Blockchain is a distributed ledger technology that ensures the immutability and transparency of data through encryption and consensus mechanisms. Blockchain allows multiple parties to conduct transactions and exchange data without a central authority.

[0030] SeTA (Secure Trustless Attribution): generally refers to a technology or system used to ensure accurate attribution and tracking of digital content or behavior without relying on a centralized trust agency. This technology is particularly important in blockchain and decentralized systems, which emphasize removing single points of failure and allowing participants to interact in a distributed and trustless manner.

[0031] Intel SGX (Software Guard Extensions) technology: is a hardware-based security technology provided by Intel that aims to create a Trusted Execution Environment (TEE) to protect data in use.

[0032] GDPR (General Data Protection Regulation): is an EU law whose main purpose is to protect the personal data and privacy of EU citizens and to simplify the regulatory environment in the international business environment.

[0033] Hyperledger Fabric: Hyperledger Fabric is designed to build private or consortium blockchains with different roles and permissions.

[0034] Membership Service: Used to manage identities and permissions in the network.

[0035] Data Provider: refers to an organization that is willing to share data with others.

[0036] Data Consumer (DC): refers to entities that need to obtain data or services. They interact with data providers or blockchain networks through applications.

[0037] Federated Identity Manager: An identity management system that allows users to use a single identity credential, such as a username and password, to access multiple different services and applications, which may be provided by different organizations or entities.

[0038] Blockchain Ledger (Ldgr): is a decentralized distributed ledger that does not rely on a single entity or centralized management structure.

[0039] The following describes application scenarios to which the embodiments of the present invention are applicable.

[0040] For data sharing in the traditional AAA architecture, service providers are able to monitor, track, leak and control user data, which leads to privacy and security issues for user data. At the same time, for identity management in the AAA architecture, service providers also have the right to decide whether to accept or reject a user's identity authentication based on service policies, user behavior and security considerations, or deliberately allow unauthorized users to pass the authentication. With the increase in network-based services and applications, users need to authenticate on multiple services, which leads to the need for users to manage multiple identity identifiers and passwords. When users are faced with a large number of passwords that need to be remembered, they may forget the passwords for services that are not frequently used, resulting in the inability to access services.

[0041] In view of this, the embodiments of the present invention provide a new solution. The applicant studies the applicability of blockchain technology, Intel SGX technology to trusted computing and some cryptographic primitives, and proposes a data security sharing system SeTA that meets the security, privacy and compliance requirements of new laws and regulations. In this system, multiple components such as identity manager, access control module and log service module are set up.

[0042] Figure 1 A schematic diagram of the composition of a data security sharing system based on blockchain provided by an embodiment of the present invention. Figure 1 As shown, the Identity Manager (IdMgr) establishes an identity token for a user who wishes to access personal data. The identity token encapsulates specific attributes to be registered to the Identity Manager (IdMgr), which is a blockchain contract used to store tokens on the blockchain network. When a data provider attempts to authenticate a user, the user must be able to verify that the token in question is valid.

[0043] In the Access Management module, users can use authenticated tokens to assert to data providers that they have access to a specific piece of data. ACM (Access Control Manager) is a blockchain protocol used to store and evaluate access policies on blockchain networks. After obtaining authorization, ACM processes the user's request and provides the user with an encrypted data.

[0044] In the Logging and Monitoring module, only authorized users can use the key to reconstruct the key and decrypt data based on the encryption method. As part of the decryption process, the system generates a data access log. The system maintains all logs and other information in the log storage to ensure reliability.

[0045] In general, SeTA leverages blockchain technology and the certified execution platform Intel SGX to run cryptographic protocols to allow different entities to share personal data in a secure, transparent and accountable manner. SeTA allows data providers, that is, organizations acting as data controllers, to share personal data at different permission levels and granularity while complying with the transparency and accountability principles of GDPR.

[0046] Among them, the integrity of data and calculations stored on the blockchain is guaranteed by a group of miner nodes running the consensus protocol.

[0047] For example, the miner node can be used to run components of SeTA, such as identity manager, access management module, log service module, trust and reputation system module, compliance check module, etc.

[0048] Thus, the blockchain infrastructure provides the required level of security and transparency to run SeTA’s components in a decentralized manner without relying on third-party services. SeTA deploys a blockchain-based federated identity manager to support access control and countability. A user (data consumer) can apply for multiple identities; each with an identifying attribute, called a tag. Data providers implement attribute-based access.

[0049] ACM usually refers to software or hardware components in the field of network or information security that are responsible for managing and implementing access control. It ensures that only authorized users and systems can access protected resources. A federated identity manager is a solution that manages authentication and authorization across different domains and organizations. It allows users to use a set of credentials (such as usernames and passwords) to access multiple different services and applications without having to set up separate accounts for each service or application.

[0050] The relationship between the two can be understood from the following aspects: Integration and interoperability: A federated identity manager may include or inherit from an ACM to ensure that after federated identity authentication, users can access resources according to preset access policies.

[0051] Authentication and Authorization: The federated identity manager is responsible for the authentication process, which is to confirm the identity of the user. Once the identity is verified, the ACM will decide whether the user has permission to access specific resources, which is the authorization process.

[0052] Cross-domain access control: In a federated identity management environment, ACM can extend its capabilities to support access policies across different organizations and trust domains that are coordinated by the federated identity manager.

[0053] Single Sign-On (SSO): Federated Identity Manager supports single sign-on. After a user logs in once, ACM can help manage subsequent access to multiple services and applications without the need for re-authentication.

[0054] Policy enforcement: ACM uses identity information provided by a federated identity manager to enforce fine-grained access policies that define who can access which resources and under what conditions.

[0055] In summary, ACM and federated identity managers are different components in an information security architecture that work together to ensure secure authentication and effective access control in the context of cross-organizational resource sharing and services.

[0056] The control strategy for personal data in the embodiment of the present invention is implemented through an encryption method that supports effective key management. Specifically, the data is encrypted with a symmetric key, and the user can only reconstruct the key when the access policy is met. The evaluation process of the access policy is performed on the blockchain through another contract that is specifically used to maintain and evaluate the access policy.

[0057] The blockchain backend provides SeTA with integrity and auditability of data and processes. Specifically, SeTA uses blockchain to ensure that users’ identity attributes and access policies cannot be modified by malicious users. Blockchain also guarantees the integrity of the access policy evaluation process, as all blockchain operations are conducted in a fully decentralized manner. One of the defining characteristics of the technology is the accountability and traceability it provides. Transparency in access policies and access policy evaluations is a way for data providers to show their compliance with the GDPR principles of accountability and transparency.

[0058] SeTA provides a secure mechanism to collect data decryption logs as proof of authorized access to personal data and to protect against insider threats. The recorded logs enable data subjects and data controllers to audit internal processing and monitor the system for inappropriate access or data disclosure, verify the legality of any processing, and ensure the integrity and security of personal data. To this end, SeTA runs a secure logging protocol on Intel SGX, which was adopted by Ryan (2017). The logs record how personal data is processed, by whom, and for what purpose. This enables data providers to provide this information to data subjects upon request and prove that they have met their legal obligations. The integrity of the data decryption process is ensured by Intel SGX, while the integrity of the logs is guaranteed by strong cryptography.

[0059] The following is a detailed description of the blockchain-based data security sharing system provided by an embodiment of the present invention in conjunction with the accompanying drawings.

[0060] Figure 2 The following is a schematic diagram of a data security sharing system 100 based on blockchain provided by an embodiment of the present invention. Figure 2 As shown, the blockchain-based data security sharing system 100 of this embodiment may include: The identity manager 110 is used to create, update, and query identity tokens according to the identity attributes of the data consumer 140; the identity tokens are stored in the blockchain ledger; wherein the identity attributes correspond to multiple roles of the data consumer 140.

[0061] The access management module 120 is used to manage access policies, store the access policies in the blockchain ledger, and maintain the first public key and the first private key used for the digital signature scheme.

[0062] The data provider 130 is used to provide access policies, maintain the second public key and the second private key used for the digital signature scheme, and off-chain storage of data.

[0063] Data consumer 140 is used to communicate with other entities in the blockchain network to access data; and maintain a third public key and a third private key and a Nym value used for a digital signature scheme; the Nym value is a pseudo-anonymous identity associated with the third public key.

[0064] The log service module 150 is used to record the data access log of the data consumer 140 and provide the data access log to the authorized data provider 130 .

[0065] Optionally, the data security sharing system may also include: a trust and reputation system module and a compliance checking module.

[0066] Among them, the trust and reputation system module is used to calculate and verify the user's trust share, which can be determined based on the user's historical behavior analysis.

[0067] The compliance check module is used to run the compliance check logic to confirm whether the transaction meets the compliance requirements.

[0068] The various components of the blockchain-based data security sharing system 100 are described below.

[0069] Specifically, the identity manager 110 is used to create, update, and query identity tokens based on the identity attributes of the data consumer 140; the identity tokens are stored in the blockchain ledger; wherein the identity attributes correspond to multiple roles of the data consumer 140.

[0070] Figure 3 The following is a schematic diagram of the composition of the main entities involved in the identity management process of a blockchain-based data security sharing system 100 provided in an embodiment of the present invention. Figure 3 As shown, in the process of identity management through the identity manager 110, the main entities involved include the identity provider (IdP), the identity manager (IdMgr) and the federated organization entity (Organisation).

[0071] Among them, the identity manager 110 is implemented based on chaincode, and the chaincode is written based on the enterprise-level blockchain platform Hyperledger Fabric v1.4 and the programming language GoLang.

[0072] The federated organization entity is a group of entities with multiple roles, and each identity provider can have multiple roles, which are identified by the Fabric member service. Among them, the user identified as the data consumer 140 can select the desired identity attributes and apply to the identity manager (IdMgr) for an identity token based on the selected identity attributes. These identity tokens are more granular and can be used regardless of the underlying blockchain platform.

[0073] Among them, the identity manager (IdMgr) can create, update and query identity tokens. The identity token is stored in the blockchain ledger 160 (Ledger) in the form of a key-value pair, wherein the identifier of the identity token is used as the key in the key-value pair, and the identity token is converted into a string as the value in the key-value pair; the identifier of the identity token is used to uniquely mark the identity token. In one example, the identity token can be a JSON object, and when stored, the JSON object is converted into a string as the value in the key-value pair.

[0074] Optionally, the identity manager 110 also maintains a correspondence between the identity token and the Nym value of the data consumer 140 , and the Nym value is used to verify the activities of the data consumer 140 in the blockchain network.

[0075] In one possible scenario, in order to protect privacy, the corresponding relationship can be kept private. When a user conducts transactions or data communications, the Nym value is used as the user's anonymous identity, so that the user can participate in various activities without revealing his or her true identity.

[0076] In another possible scenario, such as when required by law or when resolving disputes, a third party can use a verification mechanism to confirm the correspondence between the identity token and the Nym value, thereby tracing back user behavior. This mechanism protects privacy while providing the possibility of backtracking under certain conditions.

[0077] In another possible scenario, such as an anonymous system, maintaining the above correspondence can be used to establish user trust. For example, when a user needs to prove that he owns a certain Nym value in order to obtain certain permissions or services, without revealing his true identity.

[0078] In another possible scenario, the corresponding relationship can be used to control access rights of different Nym values. For example, for some operations, the user needs to provide a matching identity token to determine whether to perform subsequent operations.

[0079] In another possible scenario, when a certain Nym value engages in abnormal or illegal activities, the user corresponding to the Nym value can be prevented from continuing to use system resources by revoking its identity token.

[0080] In another possible scenario, in some industries, such as financial services, when an audit is required, the corresponding relationship can be used to perform audit operations.

[0081] In another possible scenario, if a user's Nym value is lost or destroyed, the user's anonymous identity can be restored by using the corresponding relationship of the identity token.

[0082] It can be understood that the reason why the identifier of the identity token is used instead of the hash as a reference to the identity token and to retrieve or update the token in this embodiment is that any change in the identity token, such as updating the attribute value field, will generate a brand new hash, that is, the hash value cannot uniquely identify the identity token. In this embodiment, the public key value of the data consumer 140 is also used as the Nym value to link the identity token with the specific data consumer 140. The identity manager (IdMgr) chain code also allows the owner of the identity token to update or change the attribute value in the identity token. In the specific implementation, it is necessary to first verify the Nym value in the request, and then perform the process of updating or changing the attribute value in the identity token. In one possible implementation, the identity manager (IdMgr) can also use the identifier of the identity token to query any identity token when authentication and authorization are required.

[0083] like Figure 4As shown in the figure, when the identity manager (IdMgr) runs on the blockchain network, the peer node (Peer Node) communicates with the chain code (chaincode) through the Shim4 interface based on the chain code communication protocol (Chaincode communication protocol). It should be noted that communicating with the chain code is the only way to interact with the blockchain ledger (Ledger) and its data. The peer node (Peer Node) can also access the file system access (File systemaccess) based on the identity token.

[0084] Specifically, the access control module is used to manage access policies, store access policies in the blockchain ledger, and maintain the first public key and the first private key for the digital signature scheme. The data provider 130 is used to provide access policies, maintain the second public key and the second private key for the digital signature scheme, and the off-chain storage of data. The data consumer 140 is used to communicate with other entities in the blockchain network to access data; and maintain the third public key and the third private key for the digital signature scheme and the Nym value; the Nym value is a pseudo-anonymous identity associated with the third public key.

[0085] In this embodiment, different data providers 130 are allowed to securely share personal data with different data consumers 140. Blockchain is used for both identity and access management through smart contracts. Each data provider 130 runs its own access control manager contract, while only one federated identity manager is responsible for the entire system.

[0086] Figure 5 The following is a schematic diagram of the composition of the main entities involved in the access control process in a blockchain-based data security sharing system 100 provided in an embodiment of the present invention. Figure 5 As shown, we only describe two organizations, where Org 1 provides data and Org 2 hosts users who are willing to access the data. The dotted line represents the identity management protocol, and the solid line represents the data sharing protocol. The components involved in the access control process of this embodiment are described as follows: Identity Manager (IdMgr): A chaincode / contract residing on the blockchain that is responsible for generating and storing user identity tokens. IdMgr maintains the public key pair VKIdMgr and SKIdMgr used for the digital signature scheme.

[0087] Access Control Manager (ACM) module: a chaincode / contract residing on the blockchain, responsible for policy management, authentication, and authorization of data access requests. ACM has the public-private key pair VKACM and SKACM for digital signature schemes.

[0088] Data Provider 130 (DP): allows data providers 130 to define access policies, encrypt data according to these access policies, and support key management schemes. DP maintains off-chain storage (locally) containing personal data stored in an encrypted format using symmetric cryptography. This allows data to be deleted from the system if the data owner withdraws consent, which is in compliance with GDPR. Among them, there are public-private key pairs VKDP and SKDP for digital signature schemes in the DP protocol.

[0089] Data Consumer 140 (DC): An application that provides an interface for data consumer 140 users to communicate with other entities and request access to data. Each DC is given two public / private key pairs: VKDC and SKDC for digital signature schemes, EKDC and DKDC for asymmetric cryptographic schemes, and a unique identifier DC Nym.

[0090] In the above example, by using the identity manager (IdMgr) to generate and store user identity tokens, the user's real identity is hidden, thereby protecting personal privacy. In addition, the data is stored in an encrypted format that can only be decrypted by authorized users, reducing the risk of data leakage. At the same time, since the ACM module allows the definition of fine-grained access policies, it can ensure that only users who meet the access policies can access the data. In addition, since the identity manager and ACM reside on the blockchain, it takes advantage of the decentralized nature of the blockchain and reduces the risk of single point failure. And the identity and access control logic implemented through chain code / contracts is easy to expand and can adapt to changing business needs.

[0091] In one possible implementation, when the access control module provides services to the data provider 130, the access management module 120 is used to receive a data provision request from the data provider 130, where the data provision request includes at least a data signature, an access policy, and a second public key VKDP; the data signature is verified according to the second public key VKDP, and after the signature verification is passed, the access policy is encrypted using the first private key SKACM, and the encrypted access policy is stored in the blockchain ledger.

[0092] In one possible implementation, during the process of the access control module providing services to the data consumer 140, the access management module 120 is used to receive a data access request from the data consumer 140, where the data access request includes at least a third public key VKDC, a Nym value, and a data signature; the data signature is verified according to the third public key VKDC, and after the signature verification is passed, the identity attributes of the data consumer 140 are verified according to the Nym value, and after the identity attribute verification is passed, the requested data is sent to the data consumer 140.

[0093] The following describes how to access data based on the system architecture shown in the above example. Figure 6 A flowchart of a data security sharing method based on blockchain technology provided by an embodiment of the present invention is shown in FIG. Figure 6 , the method comprising: Step 200: The ACM module generates a public key / private key pair.

[0094] Step 201: The data provider sends an access policy to the ACM module.

[0095] Step 202: The data consumer sends an access request to the ACM module.

[0096] Step 203: The ACM module verifies the access request.

[0097] Specifically, if the verification request is signed by DP using its public key VKDP and the verification is successful, execution continues.

[0098] Step 204: The ACM module updates the counter.

[0099] Specifically, the current value of the counter is assigned to a variable nonce, which is used to generate a unique request identifier. The value of the counter is increased by 1 to prepare for the next request.

[0100] Step 205: The ACM module creates a policy object.

[0101] Specifically, the policy object contains the previously defined parameters and the newly generated nonce.

[0102] Step 206: The ACM module signs the policy object using the ACM module's private key and stores the signed policy on the blockchain.

[0103] Step 207: The ACM module retrieves the token hash and identity token signed by the identity manager from the blockchain.

[0104] Step 208: The ACM module confirms whether Cond satisfies the corresponding attribute value.

[0105] Specifically, if the conditions are met, step 209 is executed, and if not, the process ends.

[0106] Step 209: The ACM module returns an event to the data provider, indicating that the request is allowed.

[0107] Step 210: The ACM module retrieves the policy signed by the ACM module from the blockchain and returns the signed policy to the data consumer.

[0108] The above process describes how ACM is initialized, how it processes requests from data providers and data consumers, and how it publishes, evaluates, and queries access policies, ensuring the security of the entire system and the legitimacy of data access.

[0109] Specifically, in a specific example, the ACM chain code can be implemented based on the following algorithm: 1: procedure Initialise [Define a process called Initialise] 2: Generate (V KACM; SKACM) [Generate a public / private key pair, where V KACM is the public key and SKACM is the private key. This pair of keys will be used to access the management module (ACM)] 3: Publish V KACM [Publish the public key V KACM to the blockchain or other publicly accessible medium so that other entities can verify the data signed by ACM. ] 4: Set Counter := 0 [Initialize a counter Counter to 0. This counter may be used to generate a unique request identifier or other purposes. ] 5: end procedure [End the definition of the Initialise process. ] 6: procedure Publish Policy(d-tag;H(e);ACP(d);ACV ) [Define a procedure called Publish Policy to publish access policies. The parameters include the policy tag d-tag, the encrypted hash H(e), the access control attribute ACP(d), and the access control value ACV. ] 7: On receive (request) from DP: [When a request is received from the data provider (DP), perform the following steps. ] 8: if Verify (request; V KDP) == TRUE [If the verification request is signed by DP using its public key VKDP and the verification succeeds, continue execution. ] 9: nonce := Counter [Assign the current value of the counter to a variable nonce, which is used to generate a unique request identifier. ] 10: Counter := Counter + 1 [Increase the value of the counter by 1 to prepare for the next request. ] 11: Parse request as: [Parse the request content. ] 12: Policy := (nonce; d-tag; H(e); ACP(d); ACV ) [Create a policy object Policy, including the previously defined parameters and the newly generated nonce. ] 13: PUT Sign(Policy)SKACM [Sign the policy object Policy using ACM's private key SKACM, and store the signed policy on the blockchain. ] 14: end procedure [End the definition of the Publish Policy process.] 15: procedure Evaluate Policy(H(token); d-tag) [Define a procedure called EvaluatePolicy to evaluate access policies. The parameters include the encrypted token hash H(token) and the policy tag d-tag. ] 16: On receive (request) from DC: [When a request is received from a data consumer (DC), execute the following steps. ] 17: if Verify (request; V KDC) == TRUE [If the verification request is signed by DC using its public key VKDC and the verification succeeds, continue execution. ] 18: GET (d-tag; Sign(Policy)SKACM) [Retrieve the signature of the policy and ACM associated with the d-tag from the blockchain. ] 19: for Cond in Policy: do

For each condition Cond in the policy, perform the following steps.

Retrieve the token hash and token signed by the identity manager (IdMgr) from the blockchain.

Return the signed policy to the requester.

[0110] Specifically, this embodiment implements accountability for access to personal data through the log service module 150 on the basis of accountability, which means that the data owner can obtain information about the usage of his or her data.

[0111] The log service module 150 is used to record the data access logs of the data consumers 140 and provide the data access logs to the authorized data providers 130. The data providers can collect information about how to process data through the log service module 150, showing the data owner's privacy policy and compliance with current data privacy regulations.

[0112] That is, in this embodiment, only authorized users are allowed to retrieve plaintext data. Also, each time data decryption is requested, a decryption key is securely constructed using the encrypted data and some public information, rather than using a single decryption key cached in the decryption device.

[0113] Generally, data access logs should meet the following requirements: 1. Automatically and correctly record each authorized data access; 2. Record data decryption after the access request, that is, the actual data access; 3. It should contain additional information about the data access request, such as the selection time, source and purpose. This type of information can be called "accountability attributes"; 4. The data access log itself must be secure, that is, tamper-proof, prevent illegal insertion, illegal deletion and malicious modification. 5. It should not invade the system of the monitoring data consumer 140, nor should it introduce heavy communication and computing overhead.

[0114] Based on this, this embodiment proposes an enhanced responsible decryption solution, which only supports decryption by authorized users who have obtained the subscription secret SS. Figure 7 The following is a schematic diagram of the composition of the main components responsible for the decryption protocol in a blockchain-based data security sharing system 100 provided in an embodiment of the present invention. Figure 7 As shown, the main components responsible for the decryption protocol include: a data provider 130, a log service module 150 and a data consumer 140, wherein implementation represents a data sharing protocol and a dotted line represents an identity management protocol.

[0115] Among them, the data provider 130 is an organization (Org1) willing to share data with others, providing access policies through the data provider 130 application (Encryptor) and encrypting the data using the symmetric key K1. The Encryptor directly communicates with the off-chain storage (local) containing the personal data stored in the format encrypted using K. Encryptor has a public / private key pair VKDP and SKDP for the digital signature scheme.

[0116] The log service module 150 stores all access requests from authorized data consumers 140. Its main function is to record the data access log after each SS is delivered to the data consumer 140. Each data provider 130 must save its own data access log. In this embodiment, the data access log is organized as an append-only Merkle tree, whose root is H. H refers to the root hash of the Merkle tree. The root hash is a summary of all data in the tree and represents the current state of the entire data access log. If any data in the log changes, the root hash will also change, which makes it possible to detect data tampering.

[0117] Data consumer 140 is the organization (Org2) that hosts the user, and data consumer 140 application (Decryptor) is an application that provides an interface for data consumer 140 to communicate with other entities in the blockchain network and decrypt the accessed data using a decryption device.

[0118] Among them, the decryption device is a trusted device implemented based on Intel SGX technology. Each data consumer 140 application (Decryptor) has a dedicated decryption device, in which the data consumer 140 application (Decryptor) can be regarded as a relay to transfer data to and from the decryption device. The decryption device contains a trusted code that runs in a trusted space called "enclave" to reconstruct the key K and then perform decryption on requests from the decryptor. The decryption device has a public / private key pair VKsgx and SKsgx2 for the digital signature scheme.

[0119] The following describes how to access data based on the system architecture shown in the above example. Figure 8 A flowchart of another data security sharing method based on blockchain technology provided by an embodiment of the present invention is shown in FIG. Figure 8 , the method comprising: Step 300: The decryption device sets a hard-coded key as a constant during the initialization process.

[0120] Step 301: The decryption device generates a public key.

[0121] Step 302: The decryption device publishes the generated public key to the blockchain.

[0122] Specifically, the decryption device also initializes a variable H to 0.

[0123] Step 303: When receiving an access request from a data consumer, the decryption device verifies the access request.

[0124] Specifically, if the verification request is signed by the DC using its public key VKDC and the verification succeeds, the execution continues.

[0125] Step 304: The decryption device assigns the hash value H0 received from the data consumer to the variable H.

[0126] Step 305: The decryption device obtains a key K related to e, ACV and SS from an external system.

[0127] Step 306: The decryption device uses the key K to decrypt the encrypted token e and obtain the decrypted data d. Step 307: The decryption device signs the data d using the hard-coded key SKSGX, and returns the signed data to the data consumer.

[0128] The above process describes how the decryption device SGX enclave is initialized, how to process requests from data consumers, and how to decrypt data and return it to the data consumer after signing, ensuring the security and integrity of the data during transmission.

[0129] Specifically, in a specific example, the decryption device SGX enclave can be implemented by the following algorithm: 1: procedure Initialise [Define a procedure called Initialise. ] 2: Hardcoded: SKSGX [Set a hardcoded key SKSGX as a constant during initialization. This key may be used for subsequent encryption or signing operations. ] 3: Generate (VKSGX) [Generate a public key VKSGX. This public key may be used for subsequent encryption or signing operations. ] 4: Publish (VKSGX) [Publish the generated public key VKSGX to the blockchain or other accessible medium so that other entities can verify data signed with SKSGX. 】 5: Set H := 0 [Initialize a variable H to 0. This variable may be used as the initial value of a hash value or other calculation in subsequent encryption or decryption operations. ] 6: end procedure [End the definition of the Initialise process. ] 7: procedure ECALL(e;ACV; SS;H0; p; ex) [Define a procedure named ECALL to process requests from data consumers (DC). The parameters include the encrypted token e, the access control value ACV, the security parameter SS, the hash value H0, the password p, and the extended parameter ex. ] 8: On receive (request) from DC: [When receiving a request from DC, execute the following steps. ] 9: if Verify (e;H0; p; ex) == TRUE [If the verification request is signed by DC using its public key V KDC and the verification succeeds, continue execution. The Verify function here may be a function used to verify digital signatures. ] 10: H = H0 [Assign the received hash value H0 to variable H. ] 11: GetKey (e; ACV; SS) = K [Get the key K associated with e, ACV, and SS from the external system. The GetKey operation here may be a query operation to obtain the key associated with the access request. ] 12: Decrypt (e)K = d [Use the key K to decrypt the encrypted token e and get the decrypted data d. ] 13: end procedure [End the definition of the ECALL procedure. ] 14: procedure OCALL(d) [Define a procedure named OCALL to process data. The parameter is the decrypted data d.] 15: return Sign(d)SKSGX To DC [Sign data d using the hard-coded key SKSGX and return the signed data to DC. ] 16: end procedure [End the definition of OCALL procedure. ] Among them, Articles 1-6 describe the initialization process. During the initialization process, the public key VKSGX of SGX is generated and released, and the initial hash value is set to 0. Articles 7-13 describe the external call process. In this process, when the data consumer 140DC sends a request, the legitimacy of the request is first verified, including the verification of the integrity of the data and the identity of the requester. After the verification is passed, the decryption key K is obtained and the decryption key K is used to decrypt the data. Articles 14-15 describe the process of output calls. In this process, the decrypted data d is signed with the private key SKSGX and sent to the data consumer 140DC, thereby ensuring the security and integrity of the data during transmission.

[0130] Specifically, in the above example, e: This usually represents an encrypted data element or identifier, which may point to the specific data that needs to be decrypted or the encryption key associated with the data.

[0131] ACV: can stand for Authorization Certificate or Credential, which is used to verify whether the requester has the authority to obtain the key and decrypt the data.

[0132] SS: This parameter may stand for Session Key or Security Parameters, which is part of the information used to obtain or reconstruct the key.

[0133] H0: usually represents an initial hash value or message digest, which is used to verify the integrity of the message and prevent replay attacks.

[0134] p: This parameter can represent a policy or some form of proof, which defines the conditions that the requester must meet in order to decrypt.

[0135] ex: This could be an extended parameter or additional data used to provide more context or aid in the validation process.

[0136] In the blockchain-based data security sharing system and method provided in this embodiment, blockchain is used for identity management and access management, and Intel SGX is used for reliable data sharing. Among them, in the solution using blockchain for identity management, users can select the identity attributes they want to use and then generate their identity tokens. Since these identity tokens contain the identity attributes of the user, when used in conjunction with any attribute-based access control model, it can be used for user authentication or authorization. This access control model allows interoperability between different computing systems and / or service providers, and the identity token is stored on the blockchain network, which also ensures the integrity of the identity token. It can be seen that the solution of using blockchain for identity management in this embodiment is very effective in generating and retrieving identity tokens, even in the case of a large number of concurrent requests. In the solution using blockchain for access management, blockchain is used to achieve data security sharing through an encrypted method, and the access policy is publicly stored and calculated on the blockchain through chain code. The use of blockchain can ensure the transparency and integrity of the access policy and protect the policy evaluation process. The solution for reliable data sharing using Intel SGX relies on a trusted decryption device implemented using Intel SGX, and the data provider 130 will save all authorized data access records in the form of data access logs. Only the user who requested to be recorded can use the decryption device to decrypt the data. It can be seen that by using the software authentication function provided by SGX, it is possible to ensure that the decryption device is not tampered with and allow the data provider 130 to verify the user's public key from the deployed decryption device.

[0137] In the solution provided in this embodiment, by setting an identity manager 110, an identity token is created, updated and queried according to the identity attributes of a data consumer 140; an access management module 120 is used to manage access policies and maintain a first public key and a first private key for a digital signature scheme; a data provider 130 is used to provide access policies, maintain a second public key and a second private key for a digital signature scheme, and off-chain storage of data; a data consumer 140 is used to communicate with other entities in the blockchain network; a third public key and a third private key for a digital signature scheme and a Nym value are maintained; a log service module 150 is used to record data access logs of the data consumer 140 and provide the data access logs to the authorized data provider 130; wherein both the identity token and the access policy are stored in the blockchain ledger. According to the technical solution of the embodiment of the present invention, the identity manager 110 implements the identity identification and authentication of users based on identity tokens, the access management module 120 stores and evaluates the access policies on the blockchain, and provides encrypted data for authorized users, and the log service module 150 manages the data access logs of the data consumers 140. Only authorized users can obtain the data access logs. It can be seen that the system of this embodiment is designed based on the privacy principle, which can effectively prevent privacy and security attacks and solve the security problems in the data sharing process.

[0138] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a computer product, and the present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data security sharing system based on blockchain, characterized in that: include: An identity manager, used to create, update and query identity tokens according to identity attributes of data consumers; The identity token is stored in a blockchain ledger; wherein the identity attributes correspond to multiple roles of the data consumer; an access management module for managing access policies, storing the access policies in the blockchain ledger, and maintaining a first public key and a first private key for a digital signature scheme; A data provider, configured to provide the access policy, maintain a second public key and a second private key for the digital signature scheme, and off-chain storage of data; A data consumer, for communicating with other entities in the blockchain network to access data; and maintaining a third public key and a third private key and a Nym value for the digital signature scheme; the Nym value is a pseudo-anonymous identity associated with the third public key; The log service module is used to record the data access log of the data consumer and provide the data access log to the authorized data provider.

2. The system according to claim 1, characterized in that The identity manager is implemented based on chain code, which is written based on the enterprise-level blockchain platform Hyperledger Fabric v1.4 and the programming language GoLang.

3. The system according to claim 1, characterized in that The identity token is stored in the blockchain ledger in the form of a key-value pair, wherein the identifier of the identity token serves as the key in the key-value pair and the identity token is converted into a string as the value in the key-value pair; the identifier of the identity token is used to uniquely mark the identity token.

4. The system according to claim 1, characterized in that The identity manager also maintains the correspondence between the identity token and the Nym value of the data consumer, and the Nym value is used to verify the activities of the data consumer in the blockchain network.

5. The system according to claim 1, characterized in that The access management module is used to receive a data provision request from the data provider, wherein the data provision request at least includes a data signature, an access policy and the second public key; The data signature is verified according to the second public key, and after the signature verification is passed, the access policy is encrypted using the first private key, and the encrypted access policy is stored in the blockchain ledger.

6. The system according to claim 1, characterized in that The access management module is used to receive the data access request of the data consumer, where the data access request includes at least the third public key, the Nym value and the data signature; verify the data signature according to the third public key, and after the signature verification is passed, verify the identity attributes of the data consumer according to the Nym value; and send the requested data to the data consumer after the identity attribute verification is passed.

7. The system according to claim 1, characterized in that The data provider provides the access policy through a data provider application and encrypts the data using a symmetric key.

8. The system according to claim 1, characterized in that The data consumer communicates with other entities in the blockchain network through the data consumer application and decrypts the accessed data using a decryption device.

9. The system according to claim 8, characterized in that The decryption device is implemented based on Intel SGX technology.

10. A data security sharing method based on blockchain, characterized in that: The method is applied to the data security sharing system of the blockchain according to any one of claims 1 to 9, and the method comprises: The access management module generates a public / private key pair; The data provider sends an access policy to the access management module; The data consumer sends an access request to the access management module; The access management module verifies the access request; The access management module updates a counter. The access management module creates a policy object. The access management module signs the policy object using the private key of the access management module and stores the signed policy on the blockchain. The access management module retrieves a token hash and an identity token signed by the identity manager from the blockchain. The access management module confirms whether Cond satisfies the corresponding attribute value. The access management module returns an event to the data provider, indicating that the request is allowed. The access management module retrieves the policy signed by the access management module from the blockchain, and returns the signed policy to the data consumer.