Blockchain-based Cross-domain Data Sharing Method, System, Device and Storage Medium
By classifying data on the data owner side and adopting cross-domain identity authentication and security sandbox technology, the lack of security and flexibility of cross-domain data sharing in the existing technology is solved, and more efficient and secure data sharing is achieved.
Patent Information
- Application Number
- CN202510163952.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-02-14
AI Technical Summary
The existing blockchain-based cross-domain data sharing method is low in security and flexibility when processing data of different levels of privacy, and cannot meet the data sharing needs in different scenarios.
By classifying data based on the security level of local data and preset data categories on the data owner side, it distinguishes between unconditional shared data, conditional shared data and non-shared data, and uses cross-domain identity authentication and security sandbox technology for data sharing and processing.
Improves the security and flexibility of cross-domain data sharing, ensures that only certified data requesters can access conditional shared data, reduces the risk of data breaches and abuse, and realizes secure shared utilization of data without leaking original data.
Smart Images

Figure CN119652672B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of information security technology, and in particular, relates to a cross-domain data sharing method, system, device and storage medium based on blockchain. Background Art
[0002] With the rapid development of Internet technology, data has become a key factor in promoting social progress and economic development. However, in the process of data sharing, the restriction of cross-domain data access has become a major bottleneck restricting the circulation and utilization of data, which not only affects the efficiency of information exchange and collaboration, but also hinders the data integration between different network systems and the realization of complex business logic.
[0003] As a decentralized, secure, reliable and tamper-proof data storage and transmission technology, blockchain technology has shown great potential in the field of data sharing in recent years. Blockchain provides strong support for data security and privacy protection through its unique encryption algorithm, consensus mechanism and smart contracts. However, in the existing cross-domain data sharing methods based on blockchain, the same data sharing scheme is usually used for data with different privacy levels, resulting in low security and flexibility of cross-domain data sharing, which cannot meet the data sharing needs in different scenarios and thus cannot give full play to the value of data.
[0004] Therefore, how to improve the security and flexibility of cross-domain data sharing has become an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide a blockchain-based cross-domain data sharing method, system, device and storage medium, aiming to improve the security and flexibility of cross-domain data sharing.
[0006] In a first aspect, an embodiment of the present application provides a cross-domain data sharing method based on blockchain, which is applied to a data owner, and the method includes: classifying the local data based on the security level of the local data and a preset data category, the data category including unconditionally shared data, conditionally shared data and non-shared data; receiving a cross-domain data sharing request sent by a data requester, the cross-domain data sharing request carrying identification information of the target data, and the data requester and the data owner are in different domains; determining the data category of the target data based on the identification information of the target data; when the data category of the target data is conditionally shared data, performing cross-domain identity authentication on the data requester, and after the cross-domain identity authentication is passed, sharing the target data with the data requester; when the data category of the target data is non-shared data, constructing a security sandbox locally, obtaining a calculation result based on the security sandbox and the target data, and sending the calculation result to the data requester.
[0007] In a possible implementation, when the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data requester, including: receiving encrypted verification information sent by the data requester, the encrypted verification information is obtained by the data requester encrypting the verification information based on the public key of the data owner, and the verification information includes a trusted certificate, the signature of the data requester and the signature of the certificate issuer; decrypting the encrypted verification information based on the private key of the data owner to obtain the verification information; obtaining the public key of the data requester and the public key of the certificate issuer; verifying the signature of the data requester and the signature of the certificate issuer based on the public key of the data requester and the public key of the certificate issuer respectively, if the signature of the data requester and the signature of the certificate issuer are both verified, the cross-domain identity authentication of the data requester is passed.
[0008] In a possible implementation, after the cross-domain identity authentication is passed, the target data is shared with the data requester, including: encrypting the target data locally using the target key to obtain first encrypted target data; uploading the first encrypted target data to the InterPlanetary File System, and receiving the target hash value returned by the InterPlanetary File System; encrypting the target hash value and the target key based on the session key negotiated with the data requester to obtain an encrypted file, and sending the encrypted file to the data requester, so that the data requester decrypts the encrypted file based on the session key to obtain the target hash value and the target key, obtains the first encrypted target data from the InterPlanetary File System based on the target hash value, and then decrypts the first encrypted target data based on the target key to obtain the target data.
[0009] In a possible implementation, after uploading the first encrypted target data to the InterPlanetary File System and receiving the target hash value returned by the InterPlanetary File System, the method further includes: determining a target keyword of the target data; forming a target key-value pair with the target keyword and the target hash value; constructing a target key-value pair structure based on the target key-value pair; constructing a target oblivious key-value pair storage structure based on the target key-value pair structure; uploading the target oblivious key-value pair storage structure to a smart contract of the blockchain, so that the data requester obtains the target hash value from the smart contract through the target keyword, and obtains the first encrypted target data from the InterPlanetary File System based on the target hash value.
[0010] In a possible implementation, when the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data requester. After the cross-domain identity authentication is passed, the target data is shared with the data requester. It also includes: after the cross-domain identity authentication is passed, transaction information is determined with the data requester, and the transaction information includes transaction fees and transaction time; the transaction information is uploaded to the transaction verification contract on the blockchain; when the transaction verification contract is verified based on the transaction information uploaded by the data owner and the transaction information uploaded by the data requester, the step of sharing the target data with the data requester is performed.
[0011] In a possible implementation, obtaining a calculation result based on the security sandbox and the target data, and sending the calculation result to the data requester, includes: generating a homomorphic encryption public key and a homomorphic encryption private key based on a homomorphic encryption algorithm, and sending the homomorphic encryption public key to the data requester, so that the data requester encrypts the data to be calculated based on the homomorphic encryption public key to obtain encrypted data to be calculated, and sends the encrypted data to be calculated to the security sandbox; encrypting the target data based on the homomorphic encryption public key to obtain second encrypted target data, and sending the second encrypted target data to the security sandbox; in the security sandbox, calculating the encrypted data to be calculated and the second encrypted target data based on the homomorphic encryption algorithm to obtain an encrypted calculation result; using the homomorphic encryption private key to decrypt the encrypted calculation result to obtain the calculation result, and sending the calculation result to the data requester.
[0012] In one possible implementation, after using the homomorphic encryption private key to decrypt the encrypted calculation result to obtain the calculation result and sending the calculation result to the data requester, the method also includes: destroying the security sandbox, and clearing the homomorphic encryption public key, the homomorphic encryption private key, the encrypted data to be calculated, the second encrypted target data, the encrypted calculation result, and the calculation result.
[0013] In a second aspect, an embodiment of the present application provides a cross-domain data sharing system based on blockchain, the system comprising a data requester and a data owner, the data requester and the data owner being in different domains; the data owner being used to classify the local data based on the security level of the local data and a preset data category, the data category comprising unconditionally shared data, conditionally shared data and non-shared data; receiving a cross-domain data sharing request sent by a data requester, the cross-domain data sharing request carrying identification information of target data; determining the data category of the target data based on the identification information of the target data; when the data category of the target data is conditionally shared data, performing cross-domain identity authentication on the data requester, and after the cross-domain identity authentication is passed, sharing the target data with the data requester; when the data category of the target data is non-shared data, constructing a security sandbox locally, obtaining a calculation result based on the security sandbox and the target data, and sending the calculation result to the data requester. The data requester is used to send the cross-domain data sharing request to the data owner; when the data category of the target data is conditionally shared data, perform cross-domain identity authentication on the data owner, and obtain the target data after the cross-domain identity authentication is passed; when the data category of the target data is non-shared data, receive the calculation result sent by the data owner.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in the first aspect or any one of the implementation methods thereof is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or any one of the implementation methods thereof is implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect or any one of the implementation methods thereof.
[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the data owner divides the local data into unconditionally shared data, conditionally shared data or unshared data based on the security level of the local data and the preset data category, introduces data security level classification, fully considers the data sharing needs of different privacy protection levels, and adopts different cross-domain data sharing strategies for data of different security levels, thereby improving the flexibility of cross-domain data sharing; for conditionally shared data, the data requester is first cross-domain authenticated, and the target data is shared with the data requester only after the cross-domain authentication is passed, thereby ensuring that only authenticated data requesters can access the conditionally shared data, thereby improving the trust and transparency in the cross-domain data sharing process, and effectively reducing the risk of data leakage and abuse; for unshared data, a security sandbox is constructed to perform data calculation on the target data, and only the calculation results are sent to the data requester, thereby realizing the safe sharing and utilization of data without leaving the domain, ensuring data sharing without leaking the original data, and improving the security of cross-domain data sharing.
[0018] It can be understood that the cross-domain data sharing system, electronic device, computer-readable storage medium and computer program product based on blockchain provided in the embodiments of the present application have the same beneficial effects as the above-mentioned cross-domain data sharing method based on blockchain, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 A schematic diagram of the architecture of a cross-domain data sharing system based on blockchain provided in one embodiment of the present application;
[0021] Figure 2 A flowchart of a cross-domain data sharing method based on blockchain provided in one embodiment of the present application;
[0022] Figure 3 A schematic diagram of a cross-domain data sharing method based on blockchain provided in one embodiment of the present application;
[0023] Figure 4 A flowchart of another cross-domain data sharing method based on blockchain provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0026] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] To facilitate understanding, some concepts involved in the embodiments of the present application are first explained.
[0032] InterPlanetary File System (IPFS) is a distributed file system that aims to change the way files are stored and transmitted through content addressing and decentralization. It uses unique identifiers to identify and access files without relying on the location of the file. When a user adds a file to IPFS, the system hashes the file content and generates a unique hash value as the file identifier. When a user retrieves a file, IPFS can quickly find the node that stores the file block in the distributed hash table based on the file's hash value. At the same time, IPFS has a deduplication function that can effectively reduce storage redundancy.
[0033] Elliptic Curve Cryptography (ECC) key exchange is an encryption technology based on elliptic curve mathematics. By selecting a base point on the elliptic curve and performing a point multiplication operation, the two parties can negotiate a shared key without directly exchanging keys. ECC key exchange has high security and small key size, and is suitable for resource-constrained environments such as mobile devices and IoT devices. Its core idea is to ensure the security of key exchange through the discrete logarithm problem on the elliptic curve, making it extremely difficult to crack, thereby providing strong encryption protection.
[0034] Security sandbox technology is a security mechanism used to isolate applications or processes. It can create a restricted environment in a computer system to prevent applications or processes from causing potential security threats to the system. In a security sandbox, applications or processes are restricted to run in a virtual environment, which is usually called a sandbox. The sandbox can provide some virtual hardware and software resources, such as file systems, networks, operating systems, etc., so that applications or processes can run in this virtual environment without causing any adverse effects on the computer system.
[0035] A key-value store (KVS) is a data structure that is generated by an encoding algorithm (Encode) and queried by a decoding algorithm (Decode).
[0036] (1) Encode algorithm: input a set of key values , output a data structure .
[0037] (2) Decode algorithm: Input a data structure , a keyword , get a value .
[0038] The correctness of the Oblivious Key-Value Stores (OKVS) can be guaranteed for all ,in The different values are:
[0039] (1) The probability of is negligible (i.e. the probability of construction failure is negligible);
[0040] (2) When and ,have .
[0041] If the two groups are different Data structures for value generation are indistinguishable, then the KVS is called OKVS.
[0042] The OKVS data structure constructed based on the Garbled Bloom Filter (GBF) can be regarded as encoding the elements in a length of The array includes a set of encoding and decoding algorithms (Encode, Decode) as follows:
[0043] (1) Encode algorithm: exists A hash function, input a set of key values ,pass The hash function converts the elements Map to positions and Fill the positions with random strings so that the XOR result of them is equal to the corresponding Value, that is .
[0044] (2) Decode algorithm: exists A hash function, a Confusing Bloom Filter, and an element to be verified pass A hash function finds the string at the corresponding position of GBF for calculation As a result.
[0045] The technical solution of the present application will be described in detail below with reference to the accompanying drawings.
[0046] Figure 1 A schematic diagram of the architecture of a cross-domain data sharing system based on blockchain provided in one embodiment of the present application is shown in FIG. Figure 1As shown, it includes domain A, domain B and domain C. The blockchain network is composed of blockchain nodes in each domain. The data owner is located in domain A, and the data requester is located in domain B.
[0047] Specifically, the data owner is used to classify the local data based on the security level of the local data and the preset data category, the data categories including unconditionally shared data, conditionally shared data and non-shared data; receive the cross-domain data sharing request sent by the data requester, the cross-domain data sharing request carries the identification information of the target data; determine the data category of the target data based on the identification information of the target data; when the data category of the target data is conditionally shared data, perform cross-domain identity authentication on the data requester, and after the cross-domain identity authentication is passed, share the target data with the data requester; when the data category of the target data is non-shared data, build a security sandbox locally, obtain the calculation result based on the security sandbox and the target data, and send the calculation result to the data requester.
[0048] Specifically, the data requester sends a cross-domain data sharing request to the data owner; when the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data owner, and after the cross-domain identity authentication is passed, the target data is obtained; when the data category of the target data is non-shared data, the calculation result sent by the data owner is received.
[0049] As an example, when the target data that the data requester requests to share across domains from the data owner belongs to conditional shared data, the steps for the data owner to perform cross-domain identity authentication on the data requester include: the data requester in domain B sends a registration request to the blockchain node in domain A, and the registration request includes the signature of the data requester. After receiving the registration request, the blockchain node in domain A verifies the validity of the signature therein, and the signature verification indicates that the identity registration is successful; after the identity registration is successful, the data requester in domain B sends verification information to the certificate issuer in its own domain to apply for a trusted certificate, and the verification information includes the signature of the data requester and information that can prove the authenticity of the data requester's identity. The certificate issuer in domain B obtains the public key of the data requester through the blockchain node in domain B to verify the signature of the data requester in the verification information. If the signature verification passes, the verification information that can prove the data requester is further verified. The authenticity of the data requester's identity is verified. If the verification is successful, the certificate issuer in domain B issues a trusted certificate to the data requester. After obtaining the trusted certificate, the data requester in domain B generates verification information, obtains the public key of the data owner through the blockchain node in domain B, encrypts the verification information with the public key of the data owner to obtain encrypted verification information and sends it to the data owner in domain A, where the verification information includes the trusted certificate, the signature of the data requester and the signature of the certificate issuer in domain B. The data owner decrypts the encrypted verification information based on its own private key to obtain the verification information, and obtains the public key of the data requester and the public key of the certificate issuer in domain B based on the blockchain node in domain A, and verifies the signature of the data requester and the signature of the certificate issuer based on the public key of the data requester and the public key of the certificate issuer in domain B. If both are verified successfully, the cross-domain identity authentication of the data requester is successful.
[0050] Understandably, Figure 1 The architecture diagram shown is only an example of a cross-domain data sharing system based on blockchain provided by this application. In other embodiments of this application, the cross-domain data sharing system based on blockchain may include more or fewer components than shown in the diagram, or combine certain components, or split certain components, or arrange components differently. The components shown in the diagram may be implemented in hardware, software, or a combination of software and hardware, and this application does not limit this.
[0051] Figure 2 A flowchart of a cross-domain data sharing method based on blockchain provided in one embodiment of the present application is provided. Figure 3 A schematic diagram of a cross-domain data sharing method based on blockchain provided in an embodiment of the present application. For the sake of convenience, only the part related to the present embodiment is shown. The method provided in the present embodiment is applied to the data owner and specifically includes the following steps:
[0052] S210, classifying the local data based on the security level of the local data and the preset data categories, the data categories including unconditionally shared data, conditionally shared data and unshared data.
[0053] Specifically, the data owner first divides the local data into three categories according to the security level of the data, including three preset data categories: unconditionally shared data, conditionally shared data, and unshared data. The security level of the data mainly considers the sensitivity of the data and the requirements for security protection.
[0054] As an example, unconditionally shared data is basic data that does not contain confidential information. Data requesters can access and view this data unconditionally, and it has the lowest security level. Conditionally shared data is data that can be shared outside the domain and is only shared within a certain range. Data requesters need to pass identity authentication before they can access it. Unshared data is data that cannot be shared outside the domain. Data requesters can only perform statistical analysis on this type of data but cannot obtain the original data of this type of data. It has the highest security level.
[0055] S220, receiving a cross-domain data sharing request sent by a data requester, the cross-domain data sharing request carries identification information of the target data, and the data requester and the data owner are in different domains.
[0056] Specifically, the target data is the data that the data requester wants to apply for cross-domain access from the data owner. The identification information of the target data can be the name or number of the target data, etc. The data requester carries the identification information of the target data in the cross-domain data sharing request so that the data owner can determine the target data in the local data based on the identification information.
[0057] S230: Determine the data category of the target data based on the identification information of the target data.
[0058] In a specific implementation, the data owner first searches for the target data in the local data based on the identification information of the target data carried in the received cross-domain data sharing request, and then determines the data category corresponding to the target data based on the pre-set mapping relationship between the local data and the data category.
[0059] S240, when the data category of the target data is conditionally shared data, a cross-domain identity authentication is performed on the data requester. After the cross-domain identity authentication is passed, the target data is shared with the data requester.
[0060] In one possible implementation, after the cross-domain identity authentication of the data requester is passed, the data owner locally encrypts the target data using the target key to obtain first encrypted target data; uploads the first encrypted target data to the InterPlanetary File System, and receives the target hash value returned by the InterPlanetary File System; encrypts the target hash value and the target key based on the session key negotiated with the data requester to obtain an encrypted file, and sends the encrypted file to the data requester, so that the data requester decrypts the encrypted file based on the session key to obtain the target hash value and the target key, obtains the first encrypted target data from the InterPlanetary File System based on the target hash value, and then decrypts the first encrypted target data based on the target key to obtain the target data.
[0061] Furthermore, after uploading the first encrypted target data to the InterPlanetary File System and receiving the target hash value returned by the InterPlanetary File System, determine the target keyword of the target data; form a target key-value pair with the target keyword and the target hash value; construct a target key-value pair structure based on the target key-value pair; construct a target oblivious key-value pair storage structure based on the target key-value pair structure; upload the target oblivious key-value pair storage structure to the smart contract of the blockchain, so that the data requester obtains the target hash value from the smart contract through the target keyword, and obtains the first encrypted target data from the InterPlanetary File System based on the target hash value.
[0062] In the specific implementation, Figure 3 As shown in the figure, the data owner uses the Advanced Encryption Standard (AES) encryption algorithm locally for the target data, using the target key as Encrypt the target data to obtain the first encrypted target data ,in The first encrypted target data is uploaded to IPFS, and IPFS returns the target hash value corresponding to the first encrypted target data. , according to the target hash value, the first encrypted target data can be found on IPFS; at the same time, the first encrypted target data is locally The target keyword and the target hash value form a key-value pair, for example, any first encrypted target data The target keywords may be , then for the first encrypted target data The target key-value pair constructed is Similarly, target key-value pairs are constructed for target keywords and target hash values of other first encrypted target data, and then merged into a target key-value pair structure. ,Will Execute the OKVS Encode algorithm as input to obtain a target OKVS data structure , the data owner will generate the data structure Upload to the smart contract on the blockchain.
[0063] As an example, according to the nature of OKVS, when the keyword provided by the data requester is one of the target keywords, the corresponding target hash value can be obtained from the smart contract based on the target keyword, and the data requester can obtain the first encrypted target data by accessing IPFS through the target hash value.
[0064] In the specific implementation, the data owner and the data requester negotiate the session key using the ECC-DH algorithm , the data owner uses the session key The target hash value and the target key are encrypted to obtain an encrypted file, and the encrypted file is sent to the data requester.
[0065] S250, when the data category of the target data is non-shared data, a security sandbox is constructed locally, a calculation result is obtained based on the security sandbox and the target data, and the calculation result is sent to the data requester.
[0066] In one possible implementation, after a security sandbox is built locally, a homomorphic encryption public key and a homomorphic encryption private key are generated based on a homomorphic encryption algorithm, and the homomorphic encryption public key is sent to a data requester, so that the data requester encrypts the data to be calculated based on the homomorphic encryption public key to obtain encrypted data to be calculated, and sends the encrypted data to be calculated to the security sandbox; encrypts the target data based on the homomorphic encryption public key to obtain second encrypted target data, and sends the second encrypted target data to the security sandbox; in the security sandbox, the encrypted data to be calculated and the second encrypted target data are calculated based on the homomorphic encryption algorithm to obtain an encrypted calculation result; the encrypted calculation result is decrypted using the homomorphic encryption private key to obtain a calculation result, and the calculation result is sent to the data requester.
[0067] Furthermore, after the calculation result is sent to the data requester, the security sandbox is destroyed, and the homomorphic encryption public key, the homomorphic encryption private key, the encrypted data to be calculated, the second encrypted target data, the encrypted calculation result, and the calculation result are cleared.
[0068] In the specific implementation, Figure 3 As shown in Figure 1, the data owner builds a secure sandbox locally and generates the public-private key pair required for homomorphic encryption. , the generated homomorphic encryption public key Sent to the data requester, who uses the homomorphic encryption public key The data to be calculated is encrypted, and the encrypted data to be calculated is sent to the secure sandbox; the data owner uses the homomorphic encryption public key Encrypt the target data, obtain the second encrypted target data and send it to the security sandbox; in the security sandbox, according to the computing tasks of both parties, use the homomorphic encryption algorithm to calculate the encrypted data to be calculated and the second encrypted target data to obtain the encrypted calculation result; the data owner uses the homomorphic encryption private key The encrypted calculation result is decrypted to obtain the calculation result and send it to the data requester. During this process, the data requester can only obtain the final calculation result but cannot obtain any other private data. This application migrates the data calculation to a trusted execution environment based on a security sandbox to ensure that the data involved in the calculation will not be accessed externally, forming a relatively safe isolation mechanism. After the calculation is completed, the security sandbox is destroyed to clear the data ciphertext, result ciphertext, result plaintext and public and private key pairs of the homomorphic encryption algorithm involved in the calculation, thereby fully ensuring the security of data sharing.
[0069] In the technical solution provided by this embodiment, the data owner divides the local data into unconditionally shared data, conditionally shared data or unshared data based on the security level of the local data and the preset data category, introduces data security level classification, fully considers the data sharing needs of different privacy protection levels, and adopts different cross-domain data sharing strategies for data of different security levels, thereby improving the flexibility of cross-domain data sharing; for conditionally shared data, the data requester is first cross-domain authenticated, and the target data is shared with the data requester only after the cross-domain authentication is passed, thereby ensuring that only authenticated data requesters can access the conditionally shared data, thereby improving the trust and transparency in the cross-domain data sharing process, and effectively reducing the risk of data leakage and abuse; for unshared data, data calculation is performed on the target data by building a security sandbox, and only the calculation results are sent to the data requester, thereby realizing the safe sharing and utilization of data without leaving the domain, ensuring data sharing without leaking the original data, and improving the security of cross-domain data sharing.
[0070] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, when the data category of the target data is conditionally shared data, a cross-domain identity authentication is performed on the data requester, including:
[0071] Receive the encrypted verification information sent by the data requester. The encrypted verification information is obtained by the data requester by encrypting the verification information based on the public key of the data owner. The verification information includes the trusted certificate, the signature of the data requester, and the signature of the certificate issuer;
[0072] Decrypt the encrypted verification information based on the private key of the data owner to obtain the verification information;
[0073] Obtain the public key of the data requester and the public key of the certificate issuer;
[0074] The signature of the data requester and the signature of the certificate issuer are verified based on the public key of the data requester and the public key of the certificate issuer respectively. If both the signature of the data requester and the signature of the certificate issuer are verified, the cross-domain identity authentication of the data requester is successful.
[0075] In the specific implementation, Figure 3 As shown, reference Figure 1 In the cross-domain data sharing system based on blockchain shown in the figure, the specific steps of cross-domain identity authentication of the data owner in domain A to the data requester in domain B include:
[0076] 1) Identity registration
[0077] The data requester first generates an identity ID and a pair of public and private keys and timestamp , then send a registration request The registration request contains the signature of the data requester. After receiving the registration request, the blockchain node in domain A verifies the validity of the signature. If the verification is successful, The information is written into the blockchain ledger and identity registration is completed.
[0078] 2) Issue a trusted certificate
[0079] The issuance process of a trusted certificate is the process in which a data requester applies for a trusted certificate from a certificate issuer in his or her domain. The data requester first obtains the identity of the certificate issuer in the same domain through the blockchain node in the domain. and the public key , and then verify the information Sent to the certificate issuer in the same domain, where is a new timestamp, It is information that can prove the authenticity of the data requester's identity. The verification information contains the data requester's signature. After that, the certificate issuer in domain B obtains the public key of the data requester through the blockchain node in the same domain. ,verify If the signature verification passes, use your own secret key right Decrypt and verify Information, if If the information is also verified, the certificate issuer generates a corresponding trusted certificate for the data requester and uses the data requester's public key Encrypt the generated trusted certificate , then Sent to the data requester; if the verification fails, no trusted certificate will be issued to the data requester; the data requester receives Then, use your own private key Decryption will give you a trusted certificate.
[0080] 3) Cross-domain identity authentication
[0081] The data requester first generates verification information , verification information includes the trusted certificate, the signature of the data requester and the signature of the certificate issuer, and then obtains the identity of the data owner through the blockchain node in the domain and the public key ,use Encrypt the verification information to obtain encrypted verification information ; The data owner receives encrypted verification information After that, first use your own private key Decrypt and get the verification message Then, by connecting to the blockchain node in your own domain, you can get the public key of the data requester in domain B. and the public key of the certificate issuer , using the obtained and Verify the signature of the data requester and the signature of the certificate issuer respectively. If both verifications pass, the data owner agrees to share data with the data requester; otherwise, the verification fails.
[0082] The technical solution provided by this embodiment is that when the data category of the target data is conditionally shared data, the data owner first performs cross-domain identity authentication on the data requester, and only shares the target data with the data requester after the authentication is passed, ensuring that only verified data requesters can access the conditionally shared data, thereby improving the trust and transparency in the data sharing process and effectively reducing the risk of data leakage and abuse.
[0083] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, when the data category of the target data is conditionally shared data, a cross-domain identity authentication is performed on the data requester. After the cross-domain identity authentication is passed, the target data is shared with the data requester, and the following is also included:
[0084] After the cross-domain identity authentication is passed, the transaction information is confirmed with the data requester, including the transaction fee and transaction time;
[0085] Upload transaction information to the transaction verification contract on the blockchain;
[0086] When the transaction verification contract passes the verification based on the transaction information uploaded by the data owner and the transaction information uploaded by the data requester, the step of sharing the target data with the data requester is executed.
[0087] In the specific implementation, Figure 3 As shown in the figure, after the data owner authenticates the data requester and agrees to share data with the data requester, the two parties use the ECC-DH algorithm to negotiate the session key. ,exist After the construction is successful, the data owner and the data requester negotiate the transaction information, which includes transaction fees and transaction time. After the negotiation is completed, the data owner will call the transaction verification contract on the blockchain to generate parameters based on the negotiated transaction information. And upload it to the transaction verification contract. Similarly, the data requester also generates parameters based on the negotiated transaction information. And upload it to the transaction verification smart contract; the transaction verification contract uses a pre-set algorithm to verify the transaction information of both parties; after the verification is passed, the data owner executes the steps to share the target data with the data requester.
[0088] As an example, the steps for the transaction verification contract to verify the transaction information of both parties may include: the transaction verification contract verifies whether the transaction time and transaction fee given by the two parties are consistent. If they are consistent, it proves that the two parties have reached a consensus on the transaction, otherwise, the smart contract will interrupt the execution of the contract; then, the smart contract will verify whether the balance of the data requester's address can cover the cost of this data transaction. If the balance is sufficient, the verification is passed.
[0089] The technical solution provided in this embodiment is that when the data category of the target data is conditionally shared data, after the data owner passes the cross-domain identity authentication of the data requester, the transaction information of both parties is verified based on the smart contract. Only after the transaction information verification is passed, the target data is shared with the data requester, which further ensures the security of cross-domain data sharing.
[0090] Figure 4 A flowchart of another cross-domain data sharing method based on blockchain provided in one embodiment of the present application is provided. For the sake of convenience, only the part related to the present embodiment is shown. The method provided in the present embodiment specifically includes the following steps:
[0091] Data owners divide local data into unconditionally shared data, conditionally shared data, and unshared data;
[0092] After receiving the cross-domain data sharing request sent by the data requester, determining whether the target data requested by the data requester is non-shared data;
[0093] If the target data is not unshared data, the data owner performs cross-domain identity authentication on the data requester. If the cross-domain identity authentication fails, the process ends. If the cross-domain identity authentication passes, the transaction information of both parties is verified based on the smart contract. If the verification fails, the process ends. If the verification succeeds, the ciphertext address is sent to the data requester. The data requester obtains the ciphertext through the ciphertext address and decrypts the ciphertext to obtain the target data.
[0094] If the target data is not to be shared, the data owner builds a trusted execution environment locally, such as a security sandbox. In the security sandbox, secure calculations are performed based on the target data to obtain calculation results, and the calculation results are shared with the data requester.
[0095] In summary, the cross-domain data sharing method based on blockchain proposed in this application mainly includes the following key innovations:
[0096] (1) This application introduces data security level classification, which fully considers the data sharing needs with different degrees of privacy protection. For conditional shared data, the data owner uploads the encrypted data to IPFS, and only the data requester who has passed the identity authentication can obtain the data; for data that is not shared, a security sandbox is built locally, and data calculation is performed through homomorphic encryption. The original data is retained locally, and only the statistical analysis results of the data are shared, ensuring that safe sharing and utilization are achieved without leaking the original data, and forming a "use-and-burn" security mechanism.
[0097] (2) This application builds a cross-domain identity authentication mechanism based on blockchain technology. The data requester must first complete the identity registration and authentication process, and then the certificate issuer will issue a trusted certificate. Only after obtaining the trusted certificate can the data requester initiate a cross-domain data sharing request to the data owner. This not only strengthens the identity authentication and access control of the data requester, ensuring that only verified data requesters can access sensitive data, but also improves the trust and transparency of the data sharing process, effectively reducing the risk of data leakage and abuse.
[0098] (3) This application designs a data retrieval and matching method based on the OKVS algorithm, which can realize retrieval and matching of encrypted data while protecting privacy. The data owner uploads the generated data structure to the smart contract of the blockchain. When the data requester retrieves the data, he enters the corresponding keywords to trigger the smart contract to match the keywords, thereby realizing retrieval and matching of the encrypted data. This algorithm does not involve a large amount of encryption and decryption, but uses a more computationally efficient hash algorithm, which has a higher query efficiency.
[0099] Based on the above key innovations, the technical solution provided by this application has the following beneficial effects:
[0100] (1) This application classifies and encrypts data so that in conditional sharing scenarios, data owners can securely control access rights to sensitive data and protect data privacy. By building a secure sandbox and homomorphic encryption technology, this application enables secure sharing and utilization of data without leaving the domain, thereby improving the security and reliability of data sharing.
[0101] (2) This application uses a blockchain-based identity authentication mechanism to ensure that only verified data requesters can access sensitive data, thereby enhancing the trust in the data sharing process and reducing the risk of data leakage.
[0102] (3) This application uses the OKVS algorithm to construct a data retrieval query method, which can improve the efficiency of data retrieval while protecting data privacy. Compared with traditional encryption and decryption methods, the OKVS algorithm does not require a large number of encryption and decryption operations when performing ciphertext retrieval, which reduces the computational burden and improves the speed of ciphertext data query.
[0103] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: at least one processor 50 ( Figure 5 Only one is shown in the figure), a memory 51, and a computer program 52 stored in the memory 51 and executable on at least one processor 50, the processor 50 executes the computer program 52 to implement the above Figure 2 , Figure 3 or Figure 4 Steps in a method embodiment.
[0104] The electronic device 5 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 5 may include but is not limited to a processor 50 and a memory 51. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 5 and does not constitute a limitation on the electronic device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0105] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0106] In some embodiments, the memory 51 may be an internal storage unit of the electronic device 5, such as a hard disk or memory of the electronic device 5. In other embodiments, the memory 51 may also be an external storage device of the electronic device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. Further, the memory 51 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0107] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0109] A computer-readable storage medium provided in an embodiment of the present application has the same beneficial effects as the above-mentioned blockchain-based cross-domain data sharing method.
[0110] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0111] A computer program product provided in an embodiment of the present application has the same beneficial effects as the above-mentioned blockchain-based cross-domain data sharing method.
[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such 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 application, and should be included in the protection scope of the present application.
Claims
1. A cross-domain data sharing method based on blockchain, characterized in that: Applied to the data owner, the method comprises: Classifying the local data based on the security level of the local data and the preset data categories, wherein the data categories include unconditionally shared data, conditionally shared data, and unshared data; Receiving a cross-domain data sharing request sent by a data requester, wherein the cross-domain data sharing request carries identification information of target data, and the data requester and the data owner are in different domains; Determining a data category of the target data based on identification information of the target data; When the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data requester. After the cross-domain identity authentication is passed, the target data is shared with the data requester; When the data category of the target data is non-shared data, a security sandbox is constructed locally, a calculation result is obtained based on the security sandbox and the target data, and the calculation result is sent to the data requester; Wherein, after the cross-domain identity authentication is passed, the target data is shared with the data requester, including: encrypting the target data locally using the target key to obtain first encrypted target data; uploading the first encrypted target data to the InterPlanetary File System, and receiving the target hash value returned by the InterPlanetary File System; encrypting the target hash value and the target key based on the session key negotiated with the data requester to obtain an encrypted file, and sending the encrypted file to the data requester, so that the data requester decrypts the encrypted file based on the session key to obtain the target hash value and the target key, obtains the first encrypted target data from the InterPlanetary File System based on the target hash value, and then decrypts the first encrypted target data based on the target key to obtain the target data; After uploading the first encrypted target data to the InterPlanetary File System and receiving the target hash value returned by the InterPlanetary File System, the method further includes: determining a target keyword of the target data; forming a target key-value pair with the target keyword and the target hash value; constructing a target key-value pair structure based on the target key-value pair; constructing a target oblivious key-value pair storage structure based on the target key-value pair structure; uploading the target oblivious key-value pair storage structure to a smart contract of the blockchain, so that the data requester obtains the target hash value from the smart contract through the target keyword, and obtains the first encrypted target data from the InterPlanetary File System based on the target hash value.
2. The method according to claim 1, characterized in that: When the data category of the target data is conditionally shared data, performing cross-domain identity authentication on the data requester includes: Receiving encrypted verification information sent by the data requester, wherein the encrypted verification information is obtained by the data requester by encrypting the verification information based on the public key of the data owner, and the verification information includes a trusted certificate, a signature of the data requester, and a signature of a certificate issuer; Decrypting the encrypted verification information based on the private key of the data owner to obtain the verification information; Obtaining the public key of the data requester and the public key of the certificate issuer; The signature of the data requester and the signature of the certificate issuer are verified based on the public key of the data requester and the public key of the certificate issuer respectively. If both the signature of the data requester and the signature of the certificate issuer are verified, the cross-domain identity authentication of the data requester is passed.
3. The method according to claim 1, characterized in that When the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data requester, and after the cross-domain identity authentication is passed, the target data is shared with the data requester, further comprising: When the cross-domain identity authentication is passed, the transaction information is determined with the data requester, and the transaction information includes the transaction fee and transaction time; Uploading the transaction information to the transaction verification contract on the blockchain; When the transaction verification contract is verified based on the transaction information uploaded by the data owner and the transaction information uploaded by the data requester, the step of sharing the target data with the data requester is performed.
4. The method according to claim 1, characterized in that The obtaining a calculation result based on the security sandbox and the target data, and sending the calculation result to the data requester, comprises: Generate a homomorphic encryption public key and a homomorphic encryption private key based on a homomorphic encryption algorithm, and send the homomorphic encryption public key to the data requester, so that the data requester encrypts the data to be calculated based on the homomorphic encryption public key to obtain encrypted data to be calculated, and sends the encrypted data to be calculated to the security sandbox; Encrypting the target data based on the homomorphic encryption public key to obtain second encrypted target data, and sending the second encrypted target data to the security sandbox; In the security sandbox, the encrypted data to be calculated and the second encrypted target data are calculated based on a homomorphic encryption algorithm to obtain an encrypted calculation result; The encrypted calculation result is decrypted using the homomorphic encryption private key to obtain the calculation result, and the calculation result is sent to the data requester.
5. The method according to claim 4, characterized in that After decrypting the encrypted calculation result using the homomorphic encryption private key to obtain the calculation result, and sending the calculation result to the data requester, the method further includes: Destroy the security sandbox, and clear the homomorphic encryption public key, the homomorphic encryption private key, the encrypted data to be calculated, the second encrypted target data, the encrypted calculation result, and the calculation result.
6. A cross-domain data sharing system based on blockchain, characterized in that: Used to execute the method described in any one of claims 1 to 5; the system includes a data requester and a data owner, the data requester and the data owner are in different domains; The data owner is used to classify the local data based on the security level of the local data and the preset data category, wherein the data category includes unconditionally shared data, conditionally shared data, and unshared data; receive a cross-domain data sharing request sent by a data requester, wherein the cross-domain data sharing request carries identification information of the target data; and determine the data category of the target data based on the identification information of the target data; When the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data requester. After the cross-domain identity authentication is passed, the target data is shared with the data requester; When the data category of the target data is non-shared data, a security sandbox is constructed locally, a calculation result is obtained based on the security sandbox and the target data, and the calculation result is sent to the data requester; The data requester is used to send the cross-domain data sharing request to the data owner; When the data category of the target data is conditionally shared data, cross-domain identity authentication is performed on the data owner. After the cross-domain identity authentication is passed, the target data is obtained; when the data category of the target data is non-shared data, the calculation result sent by the data owner is received.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data sharing method and device, digital gateway and computer readable storage medium
CN109413087A
Data sharing method based on block chain
CN117879820A
Cross-domain Internet of Things equipment identity authentication method and system based on block chain
CN118214563A
Cross-medical domain identity authentication method based on alliance chain
CN119071040A