Cloud link and data privacy protection combined re-encryption method
By deploying smart contracts on the cloud chain and using encryption algorithms, combined with IPFS network storage, the problem of security and performance bottlenecks in large-scale data sharing is solved, and efficient data privacy protection and access control are achieved to ensure that Data security and sharing efficiency.
Patent Information
- Application Number
- CN202411231908.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-04
AI Technical Summary
Traditional data protection methods are difficult to ensure data security and privacy when facing the needs of large-scale data sharing and complex access control. Especially in the scenario where multiple parties share sensitive data, centralized servers are vulnerable to single point of failure attacks. Moreover, the performance bottleneck is prominent, making it difficult to meet the needs of efficient data sharing.
Using cloud chain combined with data privacy protection re-encryption method, by building multi-node blockchains, deploying smart contracts for authentication, encrypting data using symmetric and asymmetric encryption algorithms, and using IPFS network storage to encrypt data blocks, and using attribute-based encryption algorithms and re-encryption key mechanism ensures data security and access control.
Effectively prevent unauthorized data access, improve data security and sharing efficiency, simplify the key management and distribution process, and ensure data integrity and security by leveraging the immutable and distributed characteristics of blockchain.
Smart Images

Figure CN119051954A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of protection encryption technology, and in particular to a cloud chain combined with data privacy protection re-encryption method. Background Art
[0002] With the acceleration of digital transformation, more and more credential data needs to be stored and processed in the cloud. Traditional data protection methods such as symmetric encryption and asymmetric encryption are powerless 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 meeting 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 rights, which is vulnerable to single-point-of-failure attacks, and the privacy protection of data relies on the trust of centralized institutions. In addition, as the amount of data grows, the performance bottleneck of centralized systems becomes increasingly prominent, making it difficult to meet the needs of large-scale data sharing.
[0004] Therefore, there is an urgent need for a new data privacy protection method 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 with data privacy protection re-encryption method, which mainly solves the technical problems existing in the above-mentioned background technology.
[0006] To achieve the above object, the technical solution of the embodiment of the present invention is implemented as follows:
[0007] A cloud chain combined with data privacy protection re-encryption method, the method comprising the following steps:
[0008] Construct a blockchain including multiple nodes, and deploy smart contracts C1 and 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.
[0009] 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;
[0010] The data owner converts the paper credential into electronic credential data, and encrypts the electronic credential data using a symmetric encryption algorithm and encrypts the symmetric key using an asymmetric encryption algorithm to obtain an asymmetric ciphertext;
[0011] 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 ;
[0012] Use the first public-private key pair to i Encrypt to obtain the first ciphertext;
[0013] Sending the first public-private key pair and the second public-private key pair to the semi-trusted agent, which obtains the re-encryption key;
[0014] The first ciphertext, the asymmetric ciphertext and the re-encryption key are stored 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 contents of smart contracts C1 and C2, and the nodes that complete the confirmation of the contents of smart contracts C1 and C2 sign the contents of smart contracts C1 and C2;
[0017] The signatures of smart contracts C1 and C2 are verified. If the smart contract C1 or C2 is verified to have the signatures of all nodes and the signatures are correct, the smart contract C1 or C2 is deployed to the blockchain. If the smart contract C1 or C2 is verified to not have the signatures of all nodes or has an incorrect signature, the smart contract information that has not passed the signature verification is broadcast to all nodes.
[0018] Optionally, the data owner and data user upload their own attribute set 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 , the data user determines its attribute set S uer ;
[0020] The attribute set S owner With S uer Upload to smart contract C2, which verifies the validity and legality of the attribute set;
[0021] After verification, based on the attribute set S ownr Generate public key PK owner And the private key SK owner , based on the attribute set S uer Generate public key PK uer And the private key SK uer , whose public key PK owner And the private key SK owner Constitute the first public-private key pair, whose public key PKuer And the private key SK uer Constitute 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 the private key SK owner , based on the attribute set S uer Generate public key PK uer And the private key SK uer , including:
[0024] Its smart contract contains a variety of initial secret keys and attribute-based encryption algorithms, which convert any initial secret key and attribute set S ownr Input attribute-based encryption algorithm to generate private key SK owner ;
[0025] Take any initial secret key and attribute set S uer Input attribute-based encryption algorithm to generate private key SK uer .
[0026] Optionally, obtain the private key SK owner The initial secret key and the private key SK uer The initial secret key is different.
[0027] Optionally, the IPFS network stores the encrypted electronic credential data in multiple data blocks, each of which has a unique CID, and multiple CIDs form a set A. i .
[0028] Optionally, sending the first public-private key pair and the second public-private key pair to a semi-trusted agent, and obtaining the re-encryption key by the semi-trusted agent, specifically includes:
[0029] The public key PK owner , Public Key PK uer 、Private key SK owner 、Private key SK uer Sent to the semi-trusted proxy, the semi-trusted proxy calculates the re-encryption key using the following formula:
[0030]
[0031] RK=RK1modRK2
[0032] Where p is a prime number, mod is a modular 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, the nodes in the blockchain network verify the identity and access rights of the user through the smart contract C1. If the verification fails, the access request is rejected. If the verification passes, the data owner uploads the first ciphertext; or responds to the request of the data user to obtain the first ciphertext; or responds to the request of the data user to send the first ciphertext to the semi-trusted agent, and the semi-trusted agent converts the first ciphertext into a form that can be decrypted by the data user through the re-encryption key.
[0035] Optionally, if the verification is successful, a broadcast request for successful verification is executed, and relevant information on the identity verification is uploaded to the blockchain.
[0036] The beneficial effects of the present invention are as follows: by using an attribute-based encryption algorithm in combination with a smart contract, it is ensured that data can only be accessed by users with a specific set of attributes, thereby effectively preventing unauthorized data access; data security is improved, and the immutability and distributed characteristics of blockchain technology are utilized to ensure the security and integrity of data throughout its entire life cycle; data sharing efficiency is improved, encrypted data is stored with the help of the IPFS network, and data blocks are identified using C IDs, thereby improving the efficiency of data retrieval and sharing; by using a re-encryption key mechanism, data can be securely transferred between different users, while simplifying the key management and distribution process. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a flow chart of a cloud chain combined with a data privacy protection re-encryption method in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solution of the present invention is further elaborated in detail below in conjunction with the drawings and specific embodiments of the specification. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. In the following description, the expression "some embodiments" is related to a subset of all possible embodiments, but 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, a large number of specific details are provided to provide a more thorough understanding of the present invention. However, it is apparent to those skilled in the art that the present invention can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present invention, some technical features well known in the art are not described.
[0040] It should be understood that the present invention can be implemented in different forms and should not be interpreted as being limited to the embodiments proposed herein. On the contrary, providing these embodiments will make the disclosure thorough and complete, and the scope of the present invention will be fully conveyed to those skilled in the art. And the purpose of the terms used herein is only to describe specific embodiments and is not intended to be a limitation of the present invention. When used herein, the singular forms of "one", "one" and "said / the" are also intended to include plural forms, unless the context clearly indicates another way. It should also be understood that the terms "compose" and / or "include" when used in this specification determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0041] It should also be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "inside", "outside", "left", "right" and similar expressions used herein are for illustrative purposes only and are not intended to be the only implementation method.
[0042] In order to fully understand the present invention, a detailed structure will be proposed in the following description to illustrate the technical solution proposed by the present invention. The optional embodiments of the present invention are described in detail as follows, but in addition to these detailed descriptions, the present invention may also have other implementations.
[0043] Please refer to the attached Figure 1 , the present application provides a cloud chain combined with data privacy protection re-encryption method, the method comprising the following steps:
[0044] S1. Build a blockchain including multiple nodes, and deploy smart contracts C1 and 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 an 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 to 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 obtains the re-encryption key;
[0050] S7. Store the first ciphertext, the asymmetric ciphertext and the re-encryption key on the blockchain.
[0051] In a 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 contents of smart contracts C1 and C2, and the nodes that complete the confirmation of the contents of smart contracts C1 and C2 sign the contents of smart contracts C1 and C2;
[0053] The signatures of smart contracts C1 and C2 are verified. If the smart contract C1 or C2 is verified to have the signatures of all nodes and the signatures are correct, the smart contract C1 or C2 is deployed to the blockchain. If the smart contract C1 or C2 is verified to not have the signatures of all nodes or has an incorrect signature, the smart contract information that has not passed the signature verification is broadcast to all nodes.
[0054] Exemplarily, as a preferred example, after verifying that the smart contract C1 or C2 has the signatures of all nodes and the signatures are correct, the signatures of all nodes on the smart contract are aggregated through the aggregate signature algorithm to obtain the corresponding aggregate signature, and the signatures of all nodes on the smart contract are replaced with the aggregate signature, and the smart contract with the aggregate 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 aggregate signature when verifying the node signature, which is equivalent to verifying the node signatures one by one, and the verification efficiency is higher, and the storage space occupied by the aggregate signature is less.
[0055] In an optional implementation, the data owner and data user upload their own attribute set to the smart contract C2 to generate 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 , the data user determines its attribute set S uer , its attribute set is related to its own nature. For example, when the data owner is financial, its attribute set is financial-related attributes. Similarly, the same is true for data users;
[0057] The attribute set S owner With S uer Upload to smart contract C2, which verifies the validity and legality of the attribute set;
[0058] After verification, based on the attribute set S ownr Generate public key PK owner And the private key SK owner , based on the attribute set S uer Generate public key PK uer And the private key SK uer , whose public key PK owner And the private key SK owner Constitute the first public-private key pair, whose public key PK uer And the private key SK uer Constitute 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. The same applies to the data user.
[0060] In an optional implementation, based on the attribute set S ownr Generate public key PK owner And the private key SK owner , based on the attribute set S uer Generate public key PK uer And the private key SK uer , including:
[0061] Its smart contract contains a variety of initial secret keys and attribute-based encryption algorithms, which convert any initial secret key and attribute set S ownr Input attribute-based encryption algorithm to generate private key SK owner ;
[0062] Take any initial secret key and attribute set S uer Input attribute-based encryption algorithm to generate private key SK uer .
[0063] Further, obtain the private key SKowner The initial secret key and the private key SK uer The initial secret key is different.
[0064] Exemplarily, multiple initial secret keys and a unique attribute-based encryption algorithm are set in the smart contract C2. After obtaining the attribute sets from the data owner and the data user, any initial secret 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 multiple CIDs form a set A. i .
[0066] In an optional implementation, sending the first public-private key pair and the second public-private key pair to a semi-trusted agent, and obtaining the re-encryption key by the semi-trusted agent, specifically includes:
[0067] The public key PK owner , Public Key PK uer 、Private key SK owner 、Private key SK uer Sent to the semi-trusted proxy, the semi-trusted proxy calculates the re-encryption key using the following formula:
[0068]
[0069] RK=RK1mod RK2
[0070] Where p is a prime number, mod is a modular 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, the nodes in the blockchain network verify the identity and access rights of the user through the smart contract C1. If the verification fails, the access request is rejected. If the verification passes, the data owner uploads the first ciphertext; or responds to the request of the data user to obtain the first ciphertext; or responds to the request of the data user to send the first ciphertext to the semi-trusted agent, and the semi-trusted agent converts the first ciphertext into a form that can be decrypted by the data user through the re-encryption key.
[0073] Furthermore, if the verification is successful, a broadcast request for successful verification is executed, and relevant information of the identity verification is uploaded to the blockchain.
[0074] Specifically, when encryption is required, the data owner converts the paper credential into electronic credential data, and uses a symmetric encryption algorithm to encrypt the electronic credential data. For the key of the symmetric encryption algorithm, the symmetric key is further encrypted using an asymmetric encryption algorithm to obtain an asymmetric ciphertext, and the encrypted electronic credential data is uploaded to the IPFS network. The CID representing each data block is obtained from the IPFS network, and based on multiple CIDs, a set A is formed. i Then the data owner and data user upload their own attribute set to the smart contract C2 to generate the first public-private key pair and the second public-private key pair. The data owner uses the first public key set A i Encrypt, use the first private key to decrypt, send the first public-private key pair and the second public-private key pair to the semi-trusted agent, obtain the re-encryption key from the semi-trusted agent, and finally store the first ciphertext, asymmetric ciphertext and re-encryption key on the blockchain.
[0075] When decryption is required, based on the data user's request, the first ciphertext and the asymmetric ciphertext are obtained from the blockchain. The data user sends the first ciphertext to the semi-trusted agent. The semi-trusted agent converts the first ciphertext into a form that can be decrypted by the data user based on the re-encryption key on the blockchain. For example, the first ciphertext was originally decrypted using the first private key. After the conversion, it becomes a form that can be decrypted by the second private key. 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, uses an asymmetric encryption algorithm to decrypt the asymmetric ciphertext, obtains the symmetric key, and uses the symmetric key to decrypt the encrypted electronic credential data to obtain the required result.
[0076] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A cloud chain combined with data privacy protection re-encryption method, characterized in that: The method comprises the following steps: Construct a blockchain including multiple nodes, and deploy smart contracts C1 and 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. 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; The data owner converts the paper credential into electronic credential data, and encrypts the electronic credential data using a symmetric encryption algorithm and encrypts the symmetric key using an asymmetric encryption algorithm to obtain an asymmetric ciphertext; 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 ; Use the first public-private key pair to i Encrypt to obtain the first ciphertext; Sending the first public-private key pair and the second public-private key pair to the semi-trusted agent, which obtains the re-encryption key; The first ciphertext, the asymmetric ciphertext and the re-encryption key are stored on the blockchain.
2. A cloud chain combined with data privacy protection re-encryption method according to claim 1, characterized in that: Deploy smart contracts C1 and C2 on the blockchain, specifically including the following steps: All nodes jointly formulate and / or confirm the contents of smart contracts C1 and C2, and the nodes that complete the confirmation of the contents of smart contracts C1 and C2 sign the contents of smart contracts C1 and C2; The signatures of smart contracts C1 and C2 are verified. If the smart contract C1 or C2 is verified to have the signatures of all nodes and the signatures are correct, the smart contract C1 or C2 is deployed to the blockchain. If the smart contract C1 or C2 is verified to not have the signatures of all nodes or has an incorrect signature, the smart contract information that has not passed the signature verification is broadcast to all nodes.
3. A cloud chain combined with data privacy protection re-encryption method according to claim 2, characterized in that: Data owners and data users upload their own attribute sets to the smart contract C2 to generate the first public-private key pair and the second public-private key pair, which specifically include: The data owner determines its attribute set S owner , the data user determines its attribute set S uer ; The attribute set S owner With S uer Upload to smart contract C2, which verifies the validity and legality of the attribute set; After verification, based on the attribute set S ownr Generate public key PK owner And the private key SK owner , based on the attribute set S uer Generate public key PK uer And the private key SK uer , whose public key PK owner And the private key SK owner Constitute the first public-private key pair, whose public key PK uer And the private key SK uer Constitute 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.
4. A cloud chain combined with data privacy protection re-encryption method according to claim 3, characterized in that: Based on the attribute set S ownr Generate public key PK owner And the private key SK owner , based on the attribute set S uer Generate public key PK uer And the private key SK uer , including: Its smart contract contains a variety of initial secret keys and attribute-based encryption algorithms, which convert any initial secret key and attribute set S ownr Input attribute-based encryption algorithm to generate private key SK owner ; Take any initial secret key and attribute set S uer Input attribute-based encryption algorithm to generate private key SK uer .
5. A cloud chain combined with data privacy protection re-encryption method according to claim 4, characterized in that: Get the private key SK owner The initial secret key and the private key SK uer The initial secret key is different.
6. A cloud chain combined with data privacy protection re-encryption method according to claim 5, characterized in that: The IPFS network stores the encrypted electronic credential data in multiple data blocks, each of which has a unique CID. Multiple CIDs form a set A. i .
7. A cloud chain combined with data privacy protection re-encryption method according to claim 4, characterized in that: The first public-private key pair and the second public-private key pair are sent to the semi-trusted proxy, and the semi-trusted proxy obtains the re-encryption key, specifically including: The public key PK owner , Public Key PK uer 、Private key SK owner 、Private key SK uer Sent to the semi-trusted proxy, the semi-trusted proxy calculates the re-encryption key using the following formula: RK=RK1mod RK2 Where p is a prime number, mod is a modular 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.
8. A cloud chain combined with data privacy protection re-encryption method according to claim 7, characterized in that: The nodes in the blockchain network verify the identity and access rights of the user through the smart contract C1. If the verification fails, the access request is rejected. If the verification passes, the data owner uploads the first ciphertext; or responds to the request of the data user to obtain the first ciphertext; or responds to the request of the data user to send the first ciphertext to the semi-trusted agent, and the semi-trusted agent converts the first ciphertext into a form that can be decrypted by the data user through the re-encryption key.
9. A cloud chain combined with data privacy protection re-encryption method according to claim 8, characterized in that: If the verification is successful, the broadcast request of the verification is executed, and the relevant information of the identity verification is uploaded to the blockchain.
Citation Information
Patent Citations
Blockchain encryption ledger based on secret sharing
CN108809652A
Load-balanced privacy data sharing method
CN113301042A
Data management method and device based on alliance chain and federal learning, and equipment
CN113570065A
Fragmented block chain supply chain financial system based on attribute encryption
CN116188010A
Data calculation containerization trusted execution method based on block chain
CN116248279A
