A cloud chain combined with data privacy protection re-encryption method
By combining cloud computing with data privacy protection and re-encryption methods, and utilizing blockchain and smart contracts, secure data sharing and efficient access control are achieved. This solves the performance bottlenecks and data privacy issues of centralized systems, and improves data security and sharing efficiency.
Patent Information
- Application Number
- CN202411231908.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-09-04
AI Technical Summary
Existing technologies struggle to simultaneously guarantee data security and privacy in large-scale data sharing scenarios, and centralized systems suffer from significant performance bottlenecks, making it difficult to meet complex access control requirements.
By combining cloud and blockchain with a data privacy protection re-encryption method, a blockchain network is built, smart contracts are deployed, attribute-based encryption algorithms and re-encryption key mechanisms are used, data is stored in the IPFS network, and keys are managed through a semi-trusted proxy to achieve secure data sharing and efficient access control.
It improves data security and privacy, ensures that data is only accessed by users with specific attribute sets, simplifies key management, improves data sharing and retrieval efficiency, and leverages the immutability and distributed nature of blockchain to guarantee data integrity.
Smart Images

Figure CN119051954B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of encryption technology, and in particular to a cloud-chain combined data privacy protection re-encryption method. Background Technology
[0002] With the acceleration of digital transformation, an increasing amount of credential data needs to be stored and processed in the cloud. Traditional data protection methods, such as symmetric and asymmetric encryption, are proving inadequate when faced with large-scale data sharing and complex access control requirements. Especially in scenarios where multiple parties need to share sensitive data, how to ensure data security and privacy while also meeting the needs of efficient data sharing and access control has become an urgent problem to be solved.
[0003] Currently, most data sharing platforms use centralized servers to manage data access permissions. This approach is vulnerable to single point-of-failure attacks, and data privacy protection relies on the trust of the centralized institution. Furthermore, as data volumes grow, the performance bottlenecks of centralized systems become increasingly apparent, making it difficult to meet the demands of large-scale data sharing.
[0004] Therefore, there is an urgent need for a new method of data privacy protection that can achieve efficient data sharing and access control while ensuring data security. Summary of the Invention
[0005] In view of the above-mentioned prior art, the present invention provides a cloud-chain combined data privacy protection re-encryption method, which mainly solves the technical problems existing in the background art.
[0006] To achieve the above objectives, the technical solution of this invention is implemented as follows:
[0007] A cloud-chain combined data privacy protection re-encryption method, the method comprising the following steps:
[0008] A blockchain containing multiple nodes is constructed, and smart contracts C1 and C2 are deployed on the blockchain. Node users include data owners, data users, and semi-trusted agents. The smart contract C1 is used to authenticate the data owners, data users, and semi-trusted agents.
[0009] Data owners and data users upload their own attribute sets to smart contract C2, generating the first public-private key pair and the second public-private key pair;
[0010] The data owner converts paper vouchers into electronic voucher data, encrypts the electronic voucher data using a symmetric encryption algorithm, and encrypts the symmetric key using an asymmetric encryption algorithm to obtain asymmetric ciphertext;
[0011] The encrypted electronic credential data is uploaded to the IPFS network, and a CID representing each data block is obtained from the IPFS network. Based on multiple CIDs, a set A is formed. i ;
[0012] Use the first public-private key pair on the set A i Encrypt to obtain the first ciphertext;
[0013] Send the first public-private key pair and the second public-private key pair to the semi-trusted agent, and the semi-trusted agent will obtain the re-encryption key;
[0014] Store the first ciphertext, the asymmetric ciphertext, and the re-encryption key on the blockchain.
[0015] Optionally, deploying smart contracts C1 and C2 on the blockchain specifically includes the following steps:
[0016] All nodes jointly formulate and / or confirm the content of smart contracts C1 and C2, and the node that completes the confirmation of the content of smart contracts C1 and C2 signs the content of smart contracts C1 and C2.
[0017] The signatures of smart contracts C1 and C2 are verified. If smart contract C1 or C2 has the signatures of all nodes and the signatures are correct, then smart contract C1 or C2 is deployed to the blockchain. If smart contract C1 or C2 does not have the signatures of all nodes or has an incorrect signature, then the information of the smart contract that failed the signature verification is broadcast to all nodes.
[0018] Optionally, the data owner and data user upload their own attribute sets to the smart contract C2 to generate a first public-private key pair and a second public-private key pair, specifically including:
[0019] The data owner determines its attribute set S owner Data users determine their attribute set S uer ;
[0020] attribute set S owner With S uer Uploaded to smart contract C2, which verifies the validity and legality of the attribute set;
[0021] After successful verification, based on attribute set S ownr Generate public key PK owner and private key SK owner Based on attribute set S uer Generate public key PK uer and private key SK uer Its public key PK owner and private key SK owner The first public-private key pair is formed, and its public key PK...uer and private key SK uer This constitutes a second public-private key pair;
[0022] The first public-private key pair is sent back to the data owner, and the second public-private key pair is sent back to the data user.
[0023] Optional, based on attribute set S ownr Generate public key PK owner and private key SK owner Based on attribute set S uer Generate public key PK uer and private key SK uer Specifically, it includes:
[0024] Its smart contract contains multiple initial keys and attribute-based encryption algorithms, which combine any initial key and attribute set S ownr Input attribute-based encryption algorithm to generate private key SK owner ;
[0025] Given any initial key and attribute set S uer Input attribute-based encryption algorithm to generate private key SK uer .
[0026] Optional, obtain the private key SK owner The initial key and the private key SK uer The initial keys are different.
[0027] Optionally, the IPFS network stores the encrypted electronic credential data in multiple data blocks, each of which has a unique CID, and the multiple CIDs form a set A. i .
[0028] Optionally, the first public-private key pair and the second public-private key pair are sent to a semi-trusted proxy, which obtains the re-encryption key, specifically including:
[0029] PK the public key owner Public key PK uer Private key SK owner Private key SK uer The key is sent to a semi-trusted proxy, which calculates the re-encryption key using the following formula:
[0030]
[0031] RK = RK1 mod RK2
[0032] Where p is a prime number, mod is the modulo operation, and RK represents the re-encryption key;
[0033] The first ciphertext is converted into a form that can be decrypted by the data user using the re-encryption key.
[0034] Optionally, nodes in the blockchain network verify the user's identity and access permissions through smart contract C1. If the verification fails, the access request is rejected. If the verification succeeds, the data owner uploads the first ciphertext; or responds to the data user's request and obtains the first ciphertext; or responds to the data user's request and sends the first ciphertext to a semi-trusted agent, which then uses the re-encryption key to convert the first ciphertext into a form that the data user can decrypt.
[0035] Optionally, if the verification is successful, a broadcast request for successful verification is executed, uploading the relevant information of the verified identity to the blockchain.
[0036] The beneficial effects of this invention are as follows: by using attribute-based encryption algorithms in conjunction with smart contracts, data can only be accessed by users with specific attribute sets, thereby effectively preventing unauthorized data access; data security is improved by utilizing the immutability and distributed nature of blockchain technology to ensure the security and integrity of data throughout its entire lifecycle; data sharing efficiency is enhanced by using the IPFS network to store encrypted data and using CID to identify data blocks, thereby improving the efficiency of data retrieval and sharing; and by using a re-encryption key mechanism, data can be securely transferred between different users, while simplifying the key management and distribution process. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating a cloud-chain combined data privacy protection re-encryption method in an embodiment of this application. Detailed Implementation
[0038] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. In the following description, the expression "some embodiments" refers to a subset of all possible embodiments; however, it should be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0039] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.
[0040] It should be understood that the present invention can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein. Rather, providing these embodiments will make the disclosure thorough and complete, and will fully convey the scope of the invention to those skilled in the art. Furthermore, the terminology used herein is intended only to describe particular embodiments and is not intended to limit the invention. When used herein, the singular forms “a,” “an,” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “compose” and / or “comprising,” when used in this specification, identify the presence of the stated features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups. When used herein, the term “and / or” includes any and all combinations of the associated listed items.
[0041] It should also be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "inner," "outer," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementation.
[0042] To fully understand this invention, a detailed structure will be presented in the following description to illustrate the technical solution proposed by this invention. Optional embodiments of the invention are described in detail below; however, in addition to these detailed descriptions, the invention may have other embodiments.
[0043] Please refer to the attached document. Figure 1 This application provides a cloud-chain combined data privacy protection re-encryption method, the method comprising the following steps:
[0044] S1. Construct a blockchain containing multiple nodes, and deploy smart contract C1 and smart contract C2 on the blockchain. Node users include data owners, data users, and semi-trusted agents. The smart contract C1 is used to authenticate the data owners, data users, and semi-trusted agents.
[0045] S2. Data owners and data users upload their own attribute sets to smart contract C2 to generate the first public-private key pair and the second public-private key pair.
[0046] S3. The data owner converts the paper voucher into electronic voucher data, encrypts the electronic voucher data using a symmetric encryption algorithm, and encrypts the symmetric key using an asymmetric encryption algorithm to obtain asymmetric ciphertext.
[0047] S4. Upload the encrypted electronic credential data to the IPFS network, obtain the CID representing each data block from the IPFS network, and form a set A based on multiple CIDs. i ;
[0048] S5. Use the first public / private key pair on the set A. i Encrypt to obtain the first ciphertext;
[0049] S6. Send the first public-private key pair and the second public-private key pair to the semi-trusted agent, and the semi-trusted agent will obtain the re-encryption key;
[0050] S7. Store the first ciphertext, the asymmetric ciphertext, and the re-encryption key on the blockchain.
[0051] In one possible implementation, deploying smart contracts C1 and C2 on the blockchain specifically includes the following steps:
[0052] All nodes jointly formulate and / or confirm the content of smart contracts C1 and C2, and the node that completes the confirmation of the content of smart contracts C1 and C2 signs the content of smart contracts C1 and C2.
[0053] The signatures of smart contracts C1 and C2 are verified. If smart contract C1 or C2 has the signatures of all nodes and the signatures are correct, then smart contract C1 or C2 is deployed to the blockchain. If smart contract C1 or C2 does not have the signatures of all nodes or has an incorrect signature, then the information of the smart contract that failed the signature verification is broadcast to all nodes.
[0054] For example, as a preferred embodiment, after verifying that smart contracts C1 or C2 have signatures from all nodes and that the signatures are correct, an aggregated signature algorithm is used to aggregate the signatures of all nodes on the smart contract to obtain a corresponding aggregated signature. This aggregated signature replaces the signatures of all nodes on the smart contract, and the smart contract with the aggregated signature is deployed to the blockchain. In this embodiment, by aggregating the signatures of all nodes on the smart contract, the system only needs to verify the aggregated signature when verifying node signatures. This is equivalent to verifying each node signature individually, with higher verification efficiency and less storage space required by the aggregated signature.
[0055] In an optional implementation, the data owner and data user upload their own attribute sets to the smart contract C2, generating a first public-private key pair and a second public-private key pair, specifically including:
[0056] The data owner determines its attribute set S owner Data users determine their attribute set S uer The set of attributes is related to the nature of the data itself. For example, when the data owner is financial, the set of attributes is financial-related attributes. Similarly, the same applies to the data user.
[0057] attribute set S owner With S uer Uploaded to smart contract C2, which verifies the validity and legality of the attribute set;
[0058] After successful verification, based on attribute set S ownr Generate public key PK owner and private key SK owner Based on attribute set S uer Generate public key PK uer and private key SK uer Its public key PK owner and private key SK owner The first public-private key pair is formed, and its public key PK... uer and private key SK uer This constitutes a second public-private key pair;
[0059] The first public-private key pair is sent back to the data owner, and the second public-private key pair is sent back to the data user. The data owner uses the public key to encrypt and the private key to decrypt. Similarly, the data user does the same.
[0060] In an alternative implementation, based on attribute set S ownr Generate public key PK owner and private key SK owner Based on attribute set S uer Generate public key PK uer and private key SK uer Specifically, it includes:
[0061] Its smart contract contains multiple initial keys and attribute-based encryption algorithms, which combine any initial key and attribute set S ownr Input attribute-based encryption algorithm to generate private key SK owner ;
[0062] Given any initial key and attribute set S uer Input attribute-based encryption algorithm to generate private key SK uer .
[0063] Furthermore, obtain the private key SK.owner The initial key and the private key SK uer The initial keys are different.
[0064] For example, multiple initial keys and a unique attribute-based encryption algorithm are set in smart contract C2. After obtaining the attribute sets from the data owner and data user, any initial key and attribute set are randomly selected and input into the attribute-based encryption algorithm to obtain the corresponding private key.
[0065] Furthermore, the IPFS network stores the encrypted electronic credential data in multiple data blocks, each of which has a unique CID, and these multiple CIDs form a set A. i .
[0066] In an optional implementation, the first public-private key pair and the second public-private key pair are sent to a semi-trusted proxy, which obtains the re-encryption key. Specifically, this includes:
[0067] PK the public key owner Public key PK uer Private key SK owner Private key SK uer The key is sent to a semi-trusted proxy, which calculates the re-encryption key using the following formula:
[0068]
[0069] RK = RK1 mod RK2
[0070] Where p is a prime number, mod is the modulo operation, and RK represents the re-encryption key;
[0071] The first ciphertext is converted into a form that can be decrypted by the data user using the re-encryption key.
[0072] Furthermore, nodes in the blockchain network verify the user's identity and access permissions through smart contract C1. If the verification fails, the access request is rejected. If the verification succeeds, the data owner uploads the first ciphertext; or responds to the data user's request to obtain the first ciphertext; or responds to the data user's request to send the first ciphertext to a semi-trusted agent, which then uses the re-encryption key to convert the first ciphertext into a form that the data user can decrypt.
[0073] Furthermore, if the verification is successful, a broadcast request for successful verification is executed, and the relevant information for identity verification is uploaded to the blockchain.
[0074] Specifically, when encryption is required, the data owner converts paper vouchers into electronic voucher data and encrypts the electronic voucher data using a symmetric encryption algorithm. For the key of the symmetric encryption algorithm, an asymmetric encryption algorithm is further used to encrypt the symmetric key, resulting in asymmetric ciphertext. The encrypted electronic voucher data is then uploaded to the IPFS network. From the IPFS network, a CID representing each data block is obtained, and based on multiple CIDs, a set A is formed. i Then, the data owner and data user upload their own attribute sets to the smart contract C2, generating a first public-private key pair and a second public-private key pair. The data owner then uses the first public key pair set A. i Encryption is performed, decryption is performed using the first private key, and the first public-private key pair and the second public-private key pair are sent to a semi-trusted agent. The semi-trusted agent obtains the re-encryption key, and finally the first ciphertext, the asymmetric ciphertext, and the re-encryption key are stored on the blockchain.
[0075] When decryption is required, based on the data user's request, the first ciphertext and asymmetric ciphertext are obtained from the blockchain. The data user sends the first ciphertext to a semi-trusted proxy. The semi-trusted proxy, based on the re-encryption key on the blockchain, converts the first ciphertext into a form that can be decrypted by the data user. For example, the first ciphertext, which was originally decrypted using the first private key, becomes a form that can be decrypted using the second private key after conversion. The data user uses the second private key to decrypt the first ciphertext and, based on the decryption result, obtains the encrypted electronic credential data from the IPFS network. The user then uses an asymmetric encryption algorithm to decrypt the asymmetric ciphertext to obtain the symmetric key, and uses the symmetric key to decrypt the encrypted electronic credential data, thereby obtaining the required result.
[0076] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A cloud-chain combined data privacy protection re-encryption method, characterized in that, The method includes the following steps: A blockchain containing multiple nodes is constructed, and smart contracts C1 and C2 are deployed on the blockchain. Node users include data owners, data users, and semi-trusted agents. The smart contract C1 is used to authenticate the data owners, data users, and semi-trusted agents. Data owners and data users upload their own attribute sets to smart contract C2, generating the first public-private key pair and the second public-private key pair; The data owner converts paper vouchers into electronic voucher data, encrypts the electronic voucher data using a symmetric encryption algorithm, and encrypts the symmetric key using an asymmetric encryption algorithm to obtain asymmetric ciphertext; The encrypted electronic credential data is uploaded to the IPFS network, and a CID representing each data block is obtained from the IPFS network. Based on multiple CIDs, a set A is formed. i ; Use the first public-private key pair on the set A i Encrypt to obtain the first ciphertext; Send the first public-private key pair and the second public-private key pair to the semi-trusted agent, and the semi-trusted agent will obtain the re-encryption key; Store the first ciphertext, the asymmetric ciphertext, and the re-encryption key on the blockchain; Data owners and data users upload their attribute sets to smart contract C2, generating a first public-private key pair and a second public-private key pair, specifically including: The data owner determines its attribute set S owner Data users determine their attribute set S uer ; attribute set S owner With S uer Uploaded to smart contract C2, which verifies the validity and legality of the attribute set; After successful verification, based on attribute set S ownr Generate public key PK owner and private key SK owner Based on attribute set S uer Generate public key PK uer and private key SK uer Its public key PK owner and private key SK owner The first public-private key pair is formed, and its public key PK... uer and private key SK uer This constitutes a second public-private key pair; The first public-private key pair is sent back to the data owner, and the second public-private key pair is sent back to the data user. Based on attribute set S ownr Generate public key PK owner and private key SK owner Based on attribute set S uer Generate public key PK uer and private key SK uer Specifically, it includes: Its smart contract contains multiple initial keys and attribute-based encryption algorithms, which combine any initial key and attribute set S ownr Input attribute-based encryption algorithm to generate private key SK owner ; Given any initial key and attribute set S uer Input attribute-based encryption algorithm to generate private key SK uer ; The first public-private key pair and the second public-private key pair are sent to the semi-trusted proxy, which then obtains the re-encryption key, specifically including: PK the public key owner Public key PK uer Private key SK owner Private key SK uer The key is sent to a semi-trusted proxy, which calculates the re-encryption key using the following formula: RK = RK1 mod RK2 Where p is a prime number, mod is the modulo operation, and RK represents the re-encryption key; The first ciphertext is converted into a form that can be decrypted by the data user using the re-encryption key.
2. The cloud-chain combined data privacy protection re-encryption method according to claim 1, characterized in that, Deploying smart contracts C1 and C2 on the blockchain specifically includes the following steps: All nodes jointly formulate and / or confirm the content of smart contracts C1 and C2, and the node that completes the confirmation of the content of smart contracts C1 and C2 signs the content of smart contracts C1 and C2. The signatures of smart contracts C1 and C2 are verified. If smart contract C1 or C2 has the signatures of all nodes and the signatures are correct, then smart contract C1 or C2 is deployed to the blockchain. If smart contract C1 or C2 does not have the signatures of all nodes or has an incorrect signature, then the information of the smart contract that failed the signature verification is broadcast to all nodes.
3. The cloud-chain combined data privacy protection re-encryption method according to claim 2, characterized in that, Obtain the private key SK owner The initial key and the private key SK uer The initial keys are different.
4. The cloud-chain combined data privacy protection re-encryption method according to claim 3, characterized in that, The IPFS network stores the encrypted electronic credential data in multiple data blocks, each of which has a unique CID. These CIDs form a set A. i .
5. The cloud-chain combined data privacy protection re-encryption method according to claim 4, characterized in that, In the blockchain network, nodes verify the user's identity and access permissions through smart contract C1. If the verification fails, the access request is rejected. If the verification succeeds, the data owner uploads the first ciphertext; or responds to the data user's request and obtains the first ciphertext; or responds to the data user's request and sends the first ciphertext to a semi-trusted agent, which uses the re-encryption key to convert the first ciphertext into a form that the data user can decrypt.
6. The cloud-chain combined data privacy protection re-encryption method according to claim 5, characterized in that, If the verification is successful, a broadcast request for successful verification is executed, and the relevant information for identity verification is uploaded to the blockchain.
Citation Information
Patent Citations
Electronic document collaborative co-signing method and related equipment thereof
CN117541247A
Data management method, system and device based on attribute-based proxy re-encryption
CN118264437A