A blockchain-based key management and duplicate data deletion method and terminal
By adopting blockchain-based key management and Verkle tree structure PoW mechanism in cloud storage, the problems of insufficient security and low storage efficiency in the deduplication process are solved, and efficient key management and fast data verification are achieved.
Patent Information
- Application Number
- CN202411815243.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
In the deduplication process, the prior art has problems such as insufficient security of key management, low storage efficiency, slow verification speed and high bandwidth consumption. In particular, how to ensure the privacy and security of user data in a multi-tenant environment has become particularly important.
Using blockchain-based key management and deduplication methods, the blockchain replaces semi-trusted third-party key servers, and using Verkle tree structure to improve the PoW mechanism based on Merkle tree, improving data storage efficiency and verification speed.
The security guarantee for converging keys is achieved, the storage efficiency and verification speed during deduplication in cloud storage is improved, resource consumption is saved, and user data privacy and security are ensured.
Smart Images

Figure CN119759884A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a blockchain-based key management and duplicate data deletion method and terminal. Background Art
[0002] With the popularity of cloud storage services, a large number of users upload data to cloud storage, which leads to high redundancy of data. The same file or similar files may be uploaded multiple times by different users, resulting in waste of storage space and increased costs. In order to improve storage efficiency, cloud service providers have widely adopted deduplication technology, which detects and removes duplicate files and only stores unique copies of data. This process significantly reduces storage requirements and bandwidth consumption, making cloud storage more economical and efficient. However, during the deduplication process, as the amount of user data increases, the number of convergent keys also grows exponentially, which is a huge storage burden for users. Deduplication technology also brings challenges in data security and privacy protection, especially in multi-tenant environments, how to ensure the privacy and security of user data becomes particularly important.
[0003] In order to protect data privacy while performing data deduplication, the cloud storage system introduces a PoW mechanism based on the Merkle tree, in which users do not need to upload complete data files. They only need to provide the Merkle root corresponding to the challenge block and the hash value of the peer node on the path from the challenge block to the Merkle root to prove their ownership of the data. The cloud storage service calculates the Merkle root by calculating these hash values and verifies whether it is consistent with the data in storage to confirm whether the user owns the data.
[0004] At the same time, most researchers introduce third-party key management servers to manage keys. However, third-party key management servers are vulnerable to single point failures and collusion attacks and cannot guarantee the security of keys. When verifying data ownership, the PoW mechanism based on the Merkle tree has many advantages in improving cloud storage efficiency and security, but it also has some disadvantages and limitations. When processing large-scale data, the PoW mechanism based on the Merkle tree has disadvantages such as low storage efficiency, slow verification speed, and high bandwidth consumption. Each node needs to store the hash value of its child nodes, which causes the height of the tree and the storage overhead to increase as the amount of data increases. The verification process also needs to traverse the path from the leaf node to the root node, which affects the verification speed. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a blockchain-based key management and duplicate data deletion method and terminal, which not only realizes secure key management, but also improves the detection speed of duplicate data, and effectively improves the overall data storage efficiency.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A blockchain-based key management and data deduplication method, comprising the steps of:
[0008] S1. When the data owner uploads data, the data owner first calculates the deduplication tag of the data to be uploaded and sends it to the data verifier, and encrypts the data to be uploaded to obtain the data ciphertext and the convergence key;
[0009] S2, the data verifier performs a duplication check on the file according to the duplicate data deduplication tag, and if it is an initial file, proceeds to step S3, and if it is a duplicate file, proceeds to step S4;
[0010] S3. The data owner encrypts the convergence key and uploads it to the blockchain, and sends the data ciphertext to the data verifier, which is then uploaded to the blockchain for storage after consensus is reached.
[0011] S4. The data verifier initiates an ownership proof challenge to the data owner through the PoW mechanism based on the Verkle tree. After the challenge is passed, the file address corresponding to the cloud storage server is returned to the data owner. The data owner encrypts the convergence key and uploads it to the chain.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A blockchain-based key management and deduplication terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0014] S1. When the data owner uploads data, the data owner first calculates the deduplication tag of the data to be uploaded and sends it to the data verifier, and encrypts the data to be uploaded to obtain the data ciphertext and the convergence key;
[0015] S2, the data verifier performs a duplication check on the file according to the duplicate data deduplication tag, and if it is an initial file, proceeds to step S3, and if it is a duplicate file, proceeds to step S4;
[0016] S3. The data owner encrypts the convergence key and uploads it to the blockchain, and sends the data ciphertext to the data verifier, which is then uploaded to the blockchain for storage after consensus is reached.
[0017] S4. The data verifier initiates an ownership proof challenge to the data owner through the PoW mechanism based on the Verkle tree. After the challenge is passed, the file address corresponding to the cloud storage server is returned to the data owner. The data owner encrypts the convergence key and uploads it to the chain.
[0018] The beneficial effects of the present invention are as follows: a blockchain-based key management and deduplication method and terminal are provided, a semi-trusted third-party key server is replaced by a blockchain, the security of the converged key is ensured by the trusted and tamper-proof characteristics of the blockchain, a PoW mechanism based on a Merkle tree is improved by using a Verkle tree structure, the PoW mechanism based on the Verkle tree stores more information in fewer levels, and the storage efficiency of user ownership verification during deduplication in cloud storage is effectively improved, and when generating a proof, only the proof on the path needs to be provided, and no proof of the brother node of the node on the path needs to be provided, which saves resource consumption and improves the verification speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is an overall flow chart of a blockchain-based key management and duplicate data deletion method according to an embodiment of the present invention;
[0020] Figure 2 is a relationship diagram of various entities in an embodiment of the present invention;
[0021] Figure 3 is a Verkle tree structure in an embodiment of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of a blockchain-based key management and deduplication terminal according to an embodiment of the present invention.
[0023] Description of labels:
[0024] 1. A blockchain-based key management and deduplication terminal; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0025] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0026] Prior to this, the English abbreviations used in this article are explained in Chinese as follows:
[0027] 1. CSP (Cloud Server Provider): Data verifier;
[0028] 2. DO (Data Owner): Data owner;
[0029] 3. BC (BlockChain): Blockchain;
[0030] 4. PoW mechanism (Proof of Ownership): ownership proof mechanism;
[0031] 5. Verkle tree: It is a data structure similar to Merkle tree. Compared with the traditional Merkle tree, Verkle tree uses vector commitment to replace hash function, thus achieving a more efficient storage and verification mechanism.
[0032] Please refer to Figures 1 to 3 , a blockchain-based key management and deduplication method, comprising the steps of:
[0033] S1. When the data owner uploads data, the data owner first calculates the deduplication tag of the data to be uploaded and sends it to the data verifier, and encrypts the data to be uploaded to obtain the data ciphertext and the convergence key;
[0034] S2, the data verifier performs a duplication check on the file according to the duplicate data deduplication tag, and if it is an initial file, proceeds to step S3, and if it is a duplicate file, proceeds to step S4;
[0035] S3. The data owner encrypts the convergence key and uploads it to the blockchain, and sends the data ciphertext to the data verifier, which is then uploaded to the blockchain for storage after consensus is reached.
[0036] S4. The data verifier initiates an ownership proof challenge to the data owner through the PoW mechanism based on the Verkle tree. After the challenge is passed, the file address corresponding to the cloud storage server is returned to the data owner. The data owner encrypts the convergence key and uploads it to the chain.
[0037] From the above description, it can be seen that the beneficial effects of the present invention are: providing a blockchain-based key management and deduplication method, replacing a semi-trusted third-party key server with a blockchain, ensuring the security of the converged key based on the trusted and tamper-proof characteristics of the blockchain, and at the same time using the Verkle tree structure to improve the Merkle tree-based PoW mechanism. The Verkle tree-based PoW mechanism stores more information in fewer levels, effectively improving the storage efficiency of user ownership verification during deduplication in cloud storage, and only requiring proof on the path to be provided when generating proof, without the need to provide proof of the sibling nodes of the nodes on the path, thereby saving resource consumption and improving the verification speed.
[0038] Furthermore, in step S1, the deduplication tag of the data to be uploaded is first calculated to the data verifier, and the data to be uploaded is encrypted to obtain the data ciphertext and the convergence key, specifically:
[0039] Given security parameter 1 λ , use the system parameter generation algorithm Setup(1 λ ) Generate a key pair (pk, sk) of the system parameter P and the data owner, where pk is the public key and sk is the private key;
[0040] Assume that H1 is a hash function for generating a convergence key, H2 is a hash function for generating a deduplication tag, and define the data to be uploaded as F;
[0041] The data owner first uses the key generation algorithm MLE.KeyGen() to generate the convergence key K MLE =H1(F||P), and then use the encryption algorithm MLE.Encrypt() to calculate the data ciphertext C of the data F to be uploaded = Encrypt(F,K MLE ), and finally use the tag generation algorithm MLE.TagGen() to calculate the duplicate data deletion tag T of the data to be uploaded F r =H2(C) and sent to the data verifier.
[0042] From the above description, it can be seen that the method of implementing encryption and generating tags through hash functions effectively protects the privacy of data and ensures the integrity of data, which is conducive to the secure transmission and verification of data during the upload process.
[0043] Furthermore, before step S3, the following steps are also included:
[0044] The data owner splits the data ciphertext C into N data block sets of the same size C = {c1, c2, c3, c4, .., c N}, then for each data block c i (1≤i≤N) Calculate data labels:
[0045]
[0046] Where g represents a generator of the multiplication cyclic group, e is a number that is relatively prime to n, n is the product of two large prime numbers, and (e,n) represents the public key pk;
[0047] And use each data label to construct a Verkle tree.
[0048] From the above description, we can see that by building the application of Verkle tree, a more efficient data storage and ownership proof verification mechanism can be provided for the subsequent use.
[0049] Furthermore, the step S3 is specifically as follows:
[0050] S31, the data verifier determines that the data owner is the initial file uploader, and sends an "initial file" message to the data owner;
[0051] S32: The data owner sends the data ciphertext C and the duplicate data deletion tag T r Send to the data verifier;
[0052] S33, the data verifier determines T r =H2(C), save the data ciphertext C and Verkle root, and the identity ID of the data owner DO Insert the deduplication tag T r and returns "true" to the data owner;
[0053] Otherwise, judge T r ≠H2(C), the upload of the data ciphertext C is terminated, and "false" is returned to the data owner;
[0054] S34: If the data owner receives “true”, he uses the public key pk to encrypt the convergence key K MLE Encrypt to get C k =K MLE e mod n, and use the private key sk to k After signing, [pk,C k ,sign(C k )] is sent to the node of the blockchain;
[0055] If the data owner receives "false", the data owner re-executes the upload operation;
[0056] S35, the node verification signature sign of the blockchain (C k ) and then C k Wind up.
[0057] From the above description, it can be seen that for the initially uploaded data, the blockchain saves the convergence key used by the uploader to encrypt the data ciphertext, uses secondary encryption and stores the secondary encrypted convergence key and the convergence key for signing based on the blockchain, effectively ensuring the security of the convergence key.
[0058] Furthermore, the step S4 is specifically as follows:
[0059] S41. The data verifier randomly selects a set of data block numbers It is sent as a challenge message to the data owner, and the ownership proof challenge is initiated to the data owner through the PoW.chal algorithm in the PoW mechanism;
[0060] S42, the data owner calculates the proof of commitment of all data blocks on the path in the Verkle tree corresponding to the data block number selected by the data verifier, and the proof of commitment of all data blocks on the path relative to their parent nodes and the proof of commitment of their parent nodes relative to their grandparent nodes, until the proof of commitment relative to the root node, and returns the corresponding proofs to the data verifier;
[0061] S43, the data verifier verifies whether the proofs promised by the root node, the parent node and its grandparent node are consistent with the stored ones through the PoW.Verify algorithm in the PoW mechanism. If they are inconsistent, the upload of the data ciphertext C is terminated and "false" is returned to the data owner. If they are consistent, the identity ID of the data owner is returned. DO Insert the deduplication tag T r and returns the file address of the cloud storage server corresponding to the data F to be uploaded and “true” to the data owner;
[0062] S44: If the data owner receives “true”, the convergence key K is queried using the public key pk. MLE Encrypt to get C k =K MLE e After mod n, it is sent to the nodes of the blockchain;
[0063] If the data owner receives "false", the data owner re-executes the upload operation.
[0064] From the above description, we can see that for repeated uploaders, the PoW mechanism is used to verify the ownership of the data blocks in the Verkle tree structure, which improves the data verification speed. During verification, only the proof on the path needs to be verified. The Verkle tree has fewer levels and less data is verified during verification, which reduces the computational overhead during verification and improves the verification speed.
[0065] Please refer to Figure 4 , a blockchain-based key management and deduplication terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0066] S1. When the data owner uploads data, the data owner first calculates the deduplication tag of the data to be uploaded and sends it to the data verifier, and encrypts the data to be uploaded to obtain the data ciphertext and the convergence key;
[0067] S2, the data verifier performs a duplication check on the file according to the duplicate data deduplication tag, and if it is an initial file, proceeds to step S3, and if it is a duplicate file, proceeds to step S4;
[0068] S3. The data owner encrypts the convergence key and uploads it to the blockchain, and sends the data ciphertext to the data verifier, which is then uploaded to the blockchain for storage after consensus is reached.
[0069] S4. The data verifier initiates an ownership proof challenge to the data owner through the PoW mechanism based on the Verkle tree. After the challenge is passed, the file address corresponding to the cloud storage server is returned to the data owner. The data owner encrypts the convergence key and uploads it to the chain.
[0070] From the above description, it can be seen that the beneficial effects of the present invention are: based on the same technical concept, in conjunction with the above-mentioned blockchain-based key management and deduplication method, a blockchain-based key management and deduplication terminal is provided, and the semi-trusted third-party key server is replaced by the blockchain. The security of the converged key is guaranteed based on the trusted and tamper-proof characteristics of the blockchain. At the same time, the PoW mechanism based on the Merkle tree is improved by using the Verkle tree structure. The PoW mechanism based on the Verkle tree stores more information in fewer levels, which effectively improves the storage efficiency of users performing ownership verification during deduplication in cloud storage. When generating a proof, only the proof on the path needs to be provided, and there is no need to provide the proof of the brother nodes of the nodes on the path, which saves resource consumption and improves the verification speed.
[0071] Furthermore, in step S1, the deduplication tag of the data to be uploaded is first calculated to the data verifier, and the data to be uploaded is encrypted to obtain the data ciphertext and the convergence key, specifically:
[0072] Given security parameter 1 λ , use the system parameter generation algorithm Setup(1 λ ) Generate a key pair (pk, sk) of the system parameter P and the data owner, where pk is the public key and sk is the private key;
[0073] Assume that H1 is a hash function for generating a convergence key, H2 is a hash function for generating a deduplication tag, and define the data to be uploaded as F;
[0074] The data owner first uses the key generation algorithm MLE.KeyGen() to generate the convergence key K MLE =H1(F||P), and then use the encryption algorithm MLE.Encrypt() to calculate the data ciphertext C of the data F to be uploaded = Encrypt(F,K MLE ), and finally use the tag generation algorithm MLE.TagGen() to calculate the duplicate data deletion tag T of the data to be uploaded F r =H2(C) and sent to the data verifier.
[0075] From the above description, it can be seen that the method of implementing encryption and generating tags through hash functions effectively protects the privacy of data and ensures the integrity of data, which is conducive to the secure transmission and verification of data during the upload process.
[0076] Furthermore, before step S3, the following steps are also included:
[0077] The data owner splits the data ciphertext C into N data block sets of the same size C = {c1, c2, c3, c4, .., c N}, then for each data block c i (1≤i≤N) Calculate data labels:
[0078]
[0079] Where g represents a generator of the multiplication cyclic group, e is a number that is relatively prime to n, n is the product of two large prime numbers, and (e,n) represents the public key pk;
[0080] And use each data label to construct a Verkle tree.
[0081] From the above description, we can see that by building the application of Verkle tree, a more efficient data storage and ownership proof verification mechanism can be provided for the subsequent use.
[0082] Furthermore, the step S3 is specifically as follows:
[0083] S31, the data verifier determines that the data owner is the initial file uploader, and sends an "initial file" message to the data owner;
[0084] S32: The data owner sends the data ciphertext C and the duplicate data deletion tag T r Send to the data verifier;
[0085] S33, the data verifier determines T r =H2(C), save the data ciphertext C and Verkle root, and the identity ID of the data ownerDO Insert the deduplication tag T r and returns "true" to the data owner;
[0086] Otherwise, judge T r ≠H2(C), the upload of the data ciphertext C is terminated, and "false" is returned to the data owner;
[0087] S34: If the data owner receives “true”, he uses the public key pk to encrypt the convergence key K MLE Encrypt to get C k =K MLE e mod n, and use the private key sk to k After signing, [pk,C k ,sign(C k )] is sent to the node of the blockchain;
[0088] If the data owner receives "false", the data owner re-executes the upload operation;
[0089] S35, the node verification signature sign of the blockchain (C k ) and then C k Wind up.
[0090] From the above description, it can be seen that for the initially uploaded data, the blockchain saves the convergence key used by the uploader to encrypt the data ciphertext, uses secondary encryption and stores the secondary encrypted convergence key and the convergence key for signing based on the blockchain, effectively ensuring the security of the convergence key.
[0091] Furthermore, the step S4 is specifically as follows:
[0092] S41. The data verifier randomly selects a set of data block numbers It is sent as a challenge message to the data owner, and the ownership proof challenge is initiated to the data owner through the PoW.chal algorithm in the PoW mechanism;
[0093] S42, the data owner calculates the proof of commitment of all data blocks on the path in the Verkle tree corresponding to the data block number selected by the data verifier, and the proof of commitment of all data blocks on the path relative to their parent nodes and the proof of commitment of their parent nodes relative to their grandparent nodes, until the proof of commitment relative to the root node, and returns the corresponding proofs to the data verifier;
[0094] S43, the data verifier verifies whether the proofs promised by the root node, the parent node and its grandparent node are consistent with the stored ones through the PoW.Verify algorithm in the PoW mechanism. If they are inconsistent, the upload of the data ciphertext C is terminated and "false" is returned to the data owner. If they are consistent, the identity ID of the data owner is returned. DO Insert the deduplication tag T r and returns the file address of the cloud storage server corresponding to the data F to be uploaded and “true” to the data owner;
[0095] S44: If the data owner receives “true”, the convergence key K is queried using the public key pk. MLE Encrypt to get C k =K MLE e After mod n, it is sent to the nodes of the blockchain;
[0096] If the data owner receives "false", the data owner re-executes the upload operation.
[0097] From the above description, we can see that for repeated uploaders, the PoW mechanism is used to verify the ownership of the data blocks in the Verkle tree structure, which improves the data verification speed. During verification, only the proof on the path needs to be verified. The Verkle tree has fewer levels and less data is verified during verification, which reduces the computational overhead during verification and improves the verification speed.
[0098] The present invention provides a blockchain-based key management and duplicate data deleting method and terminal, which are mainly used in cloud storage services to quickly detect duplicate data files and avoid uploading duplicate files. The following is a specific description in conjunction with specific embodiments:
[0099] Please refer to Figure 1 and Figure 2 , Embodiment 1 of the present invention is:
[0100] A blockchain-based key management and data deduplication method, such as Figure 2 As shown, three entities are defined: data owner DO, data verifier CSP and blockchain BC to execute the corresponding methods.
[0101] DO is the individual or organization that uploads the file and outsources the file to the cloud storage server due to insufficient local storage space. Depending on whether the cloud storage server has stored the same file, they are divided into initial file uploaders and duplicate file uploaders.
[0102] CSP has abundant storage space and powerful computing power, providing data storage and management services for users with large amounts of data. CSP deduplicates files uploaded by users to improve storage space utilization.
[0103] BC is a distributed ledger maintained by multiple nodes to achieve secure key management.
[0104] The relationship between entities is as follows Figure 2 shown.
[0105] like Figure 1 As shown, the steps include:
[0106] S1. When the data owner DO uploads data, it first calculates the deduplication label of the data to be uploaded and sends it to the data verifier CSP, and encrypts the data to be uploaded to obtain the data ciphertext and convergence key.
[0107] S2. The data verifier CSP performs a duplication check on the file according to the duplicate data deduplication tag. If it is an initial file, it proceeds to step S3; if it is a duplicate file, it proceeds to step S4.
[0108] S3. The data owner DO encrypts the convergence key and uploads it to the chain, and sends the data ciphertext to the data verifier CSP. After the blockchain BC reaches a consensus, it is uploaded to the chain for storage.
[0109] S4. The data verifier CSP initiates a proof of ownership challenge to the data owner DO through the PoW mechanism based on the Verkle tree. After the challenge is passed, the corresponding file address of the cloud storage server is returned to the data owner DO. The data owner DO encrypts the convergence key and uploads it to the chain.
[0110] That is, in this embodiment, the blockchain replaces the semi-trusted third-party key server, and the security of the converged key is guaranteed based on the trusted and tamper-proof characteristics of the blockchain. At the same time, the Verkle tree structure is used to improve the Merkletree-based PoW mechanism. The Verkle tree-based PoW mechanism stores more information in fewer levels, which effectively improves the storage efficiency of users performing ownership verification during duplicate data deletion in cloud storage. When generating a proof, only the proof on the path needs to be provided, and there is no need to provide the proof of the sibling nodes of the nodes on the path, which saves resource consumption and improves the verification speed.
[0111] Please refer to Figure 2 and Figure 3 , Embodiment 2 of the present invention is:
[0112] A blockchain-based key management and deduplication method, based on the above-mentioned embodiment 1, in this embodiment, in the prior art, it is necessary to protect data privacy while performing deduplication in a cloud storage service, so a PoW mechanism is usually introduced, which allows the user to prove to the cloud service provider that he owns the file without uploading the complete file, and can prevent the user from obtaining the original file without the complete file but with the file hash value. PoW technology protects data privacy and improves storage efficiency while ensuring the security and integrity of data in the cloud storage system, and is currently an important technical means in the cloud storage deduplication scenario.
[0113] PoW is a protocol jointly executed by the data validator (CSP) and the data owner / data certifier (DO). It can prevent users from obtaining the original file without the complete file but with the file hash value, which can effectively improve the security of the source-side deduplication solution.
[0114] The existing PoW protocol is usually based on the "challenge-response" model, which usually has the following three algorithms:
[0115] (1) PoW.chal: CSP randomly selects a challenge block to initiate a challenge and sends the challenge information to DO.
[0116] (2) PoW.Proof: DO generates a response based on the challenge information and sends the response information to CSP.
[0117] (3) PoW.Verify: CSP inputs the response information and outputs the verification result.
[0118] MLE is a convergent encryption algorithm that uses a deterministic function to map messages to encryption keys. Encrypting data with this encryption key allows different users to obtain the same ciphertext when encrypting the same data, so the data tag generated by the ciphertext is also the same. CSP can use this tag to detect whether a copy of the same data has been stored. The standard message locking encryption scheme includes five algorithms: Setup(), KeyGen(), Encrypt(), Decrypt(), and TagGen().
[0119] (1) Setup(1 λ )→P: System parameter generation algorithm. The algorithm inputs security parameter 1 λ , output system parameters P.
[0120] (2) KeyGen(M,P)→K MLE : Key generation algorithm. The algorithm inputs the user's data M and system parameters P, and outputs the convergent key K used to encrypt the dataMLE .
[0121] (3) Encrypt(M,K MLE )→C: Data encryption algorithm. The algorithm inputs the user's data M and the convergence key K MLE , output the data ciphertext C corresponding to M.
[0122] (4) Decrypt(C,K MLE )→M: Data decryption algorithm. The algorithm inputs the data ciphertext C and the convergence key K MLE , output the data plaintext M corresponding to C.
[0123] (5) TagGen(C)→T r : Label generation algorithm. The algorithm inputs the data ciphertext C and outputs the duplicate data deletion label T corresponding to the ciphertext r .
[0124] Based on this, the symbols of the outgoing lines in this embodiment are explained in the following Table 1:
[0125] Table 1: Symbols
[0126] symbol meaning λ Safety parameters P System Parameters G Multiplicative Cyclic Group g A generator of G <![CDATA[q1,q2]]> Two large prime numbers φ(n) Euler function (e, n) Public Key (d, n) Private Key <![CDATA[H1]]> Hash function for generating convergent keys <![CDATA[H2]]> Hash function for generating deduplication tags C File ciphertext <![CDATA[T r ]]> Deduplication Tags "true" Upload Successfully "false" Upload failed <![CDATA[C k ]]> Convergence Key Ciphertext N Number of data blocks <![CDATA[c i ]]> Ciphertext block <![CDATA[C i ]]> promise <![CDATA[chal PoW ]]> PoW Challenge Information <![CDATA[p i ]]> Proof of commitment Sign() sign
[0127] In this embodiment, in step S1, the deduplication tag of the data to be uploaded is first calculated to the data verifier, and the data to be uploaded is encrypted to obtain the data ciphertext and the convergence key, specifically:
[0128] Given security parameter 1 λ , use the system parameter generation algorithm Setup(1 λ ) Generate a key pair (pk, sk) of the system parameter P and the data owner, where pk is the public key and sk is the private key. The specific calculation steps are as follows:
[0129] Let G be a multiplicative cyclic group, and g is a generator of G. DO selects two secret large prime numbers q1 and q2, calculates n = q1*q2, Euler function φ(n) = (q1-1)(q2-1), randomly selects a number e that is relatively prime to n, and calculates d so that de mod n≡1, then DO's public key pk = (e, n), and private key sk = (d, n). Let H1:{0,1}*→Z*q be the hash function used to generate the convergence key, H2:{0,1}*→Z*q be the hash function used to generate the deduplication tag, and define the data to be uploaded as F;
[0130] The data owner first uses the key generation algorithm MLE.KeyGen() to generate the convergence key K MLE=H1(F||P), and then use the encryption algorithm MLE.Encrypt() to calculate the data ciphertext C of the data F to be uploaded = Encrypt(F,K MLE ), and finally use the tag generation algorithm MLE.TagGen() to calculate the duplicate data deletion tag T of the data to be uploaded F r =H2(C) and sent to the data verifier.
[0131] That is, in this embodiment, the encryption and label generation method using a hash function effectively protects the privacy of the data and ensures the integrity of the data, thereby facilitating the secure transmission and verification of the data during the upload process.
[0132] In this embodiment, before step S3, the following steps are also included:
[0133] The data owner splits the ciphertext data C into N data blocks of the same size C = {c1, c2, c3, c4, .., c N}, then for each data block c i (1≤i≤N) Calculate data labels:
[0134]
[0135] Where g represents a generator of the multiplication cyclic group, e is a number that is relatively prime to n, n is the product of two large prime numbers, and (e,n) represents the public key pk;
[0136] And use each data label to construct a Verkle tree.
[0137] That is, by building the application of Verkle tree, a more efficient data storage and ownership proof verification mechanism will be provided for the future.
[0138] Then step S3 is specifically:
[0139] S31. The data verifier determines that the data owner is the initial file uploader and sends an "initial file" message to the data owner.
[0140] S32, the data owner sends the data ciphertext C and the duplicate data deletion tag T r Sent to data validator.
[0141] S33, data verifier judges T r =H2(C), save the data ciphertext C and Verkle root, and the data owner’s identity ID DO Insert deduplication tag T r ownership list, and returns "true" to the data owner; otherwise, judge T r≠H2(C), the upload of data ciphertext C is terminated and "false" is returned to the data owner.
[0142] For the Verkle root, it can be obtained by storing the data block C = {c1, c2, c3, c4, .., c N}, first determine the branching factor k, then group the files into groups, that is, each group of k data blocks, and then calculate the vector commitment of each group of data blocks and each vector commitment membership proof of each data block in the group relative to the commitment, and then calculate the vector commitment of the child nodes and the membership proof of the commitment corresponding to the child nodes upward in sequence until the root vector commitment is calculated. The obtained root vector commitment is the Verkle root.
[0143] S34. If the data owner receives “true”, he uses the public key pk to converge the key K MLE Encrypt to get C k =K MLE e mod n, and use the private key sk to k After signing, [pk,C k ,sign(C k )] is sent to the node of the blockchain; if the data owner receives "false", the upload operation is re-executed.
[0144] S35, blockchain node verification signature sign (C k ) and then C k Wind up.
[0145] That is Figure 2 As shown, for the initially uploaded data, the blockchain saves the convergence key used by the uploader to encrypt the data ciphertext, uses secondary encryption and stores the secondary encrypted convergence key and the signed convergence key based on the blockchain, effectively ensuring the security of the convergence key.
[0146] Then step S4 is specifically as follows:
[0147] S41. The data verifier randomly selects a set of data block numbers It is sent to the data owner as a challenge message, and the PoW.chal algorithm in the PoW mechanism is used to initiate a proof of ownership challenge to the data owner.
[0148] In this embodiment, if Figure 3 As shown, a three-layer Verkle Tree structure of N=9 is provided, assuming that the data verifier randomly selects chalPoW={4,6} as the challenge information.
[0149] S42. The data owner calculates the path of the data block in the Verkle tree corresponding to the data block number selected by the data verifier, and the proof of all data blocks on the path relative to their parent nodes and the proof of their parent nodes' commitment relative to the grandparent node through the PoW.Proof algorithm in the PoW mechanism, until the proof of commitment relative to the root node is obtained, and then returns the corresponding proofs to the data verifier.
[0150] like Figure 3 In the example shown, for the challenge block of chalPoW={4,6}, the data owner needs to provide proof Proof={{(c4,p4),(C2,p 11 ),C4},{(c6,p6),(C2,p 11 ),C4}} to the data verifier.
[0151] S43. The data verifier verifies the root node, the parent node and the grandparent node through the PoW.Verify algorithm in the PoW mechanism in turn to verify whether the proofs promised by the root node, the parent node and the grandparent node are consistent with the stored ones. If they are inconsistent, the upload of the data ciphertext C is terminated and "false" is returned to the data owner. If they are consistent, the data owner's identity ID DO Insert deduplication tag T r The cloud storage server is added to the ownership list and returns the file address of the data F to be uploaded and "true" to the data owner.
[0152] S44. If the data owner receives “true”, he uses the public key pk to converge the key K MLE Encrypt to get C k =K MLE e After mod n, it is sent to the node of the blockchain; if the data owner receives "false", the upload operation is re-executed.
[0153] like Figure 3 In the example shown, the data verifier first determines whether C4 is the same as the stored Verkle root commitment. If not, the upload is terminated. If they are the same, the PoW.Verify algorithm is used to verify p 11 is the proof of commitment C2 relative to commitment C4, p4 is the proof of data block c4 relative to commitment C2, and p6 is the proof of data block c6 relative to commitment C2. If the verification passes, the data owner’s ID DO Insert to deduplication tag T r In the ownership list of the data, the file address and "true" are sent to the data owner, and the data owner sends the ciphertext of the convergence key to the blockchain. If the verification fails, the data upload is terminated and "false" is sent.
[0154] That is Figure 2 As shown, for repeated uploaders, the PoW mechanism is used to verify the ownership of the data blocks in the Verkle tree structure, which improves the data verification speed. During verification, only the proof on the path needs to be verified. The Verkle tree has fewer levels and less data is verified during verification, which reduces the computational overhead during verification and improves the verification speed.
[0155] Please refer to Figure 4 , Embodiment 3 of the present invention is:
[0156] A blockchain-based key management and deduplication terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, the steps of a blockchain-based key management and deduplication method in the above-mentioned embodiment 1 or embodiment 2 are completed.
[0157] In summary, the blockchain-based key management and deduplication method and terminal provided by the present invention have the following beneficial effects:
[0158] 1. Secure key management: Use blockchain to store the user's convergence key, and use the blockchain's trusted and tamper-proof features to ensure the security of the convergence key;
[0159] 2. Improved storage efficiency: The PoW mechanism based on Verkle tree stores more information in fewer layers, improving data storage efficiency;
[0160] 3. Improved data verification speed: During verification, only the proof on the path needs to be verified, the Verkle tree has fewer levels, and less data is verified during verification, which reduces the computational overhead during verification and improves the verification speed.
[0161] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A blockchain-based key management and data deduplication method, characterized in that: Includes steps: S1. When the data owner uploads data, the data owner first calculates the deduplication tag of the data to be uploaded and sends it to the data verifier, and encrypts the data to be uploaded to obtain the data ciphertext and the convergence key; S2, the data verifier performs a duplication check on the file according to the duplicate data deduplication tag, and if it is an initial file, proceeds to step S3, and if it is a duplicate file, proceeds to step S4; S3. The data owner encrypts the convergence key and uploads it to the blockchain, and sends the data ciphertext to the data verifier, which is then uploaded to the blockchain for storage after consensus is reached. S4. The data verifier initiates an ownership proof challenge to the data owner through the PoW mechanism based on the Verkle tree. After the challenge is passed, the file address corresponding to the cloud storage server is returned to the data owner. The data owner encrypts the convergence key and uploads it to the chain.
2. A blockchain-based key management and data deduplication method according to claim 1, characterized in that: In step S1, the deduplication tag of the data to be uploaded is first calculated to the data verifier, and the data to be uploaded is encrypted to obtain the data ciphertext and the convergence key, specifically: Given security parameter 1 λ , use the system parameter generation algorithm Setup(1 λ ) Generate a key pair (pk, sk) of the system parameter P and the data owner, where pk is the public key and sk is the private key; Assume that H1 is a hash function for generating a convergence key, H2 is a hash function for generating a deduplication tag, and define the data to be uploaded as F; The data owner first uses the key generation algorithm MLE.KeyGen() to generate the convergence key K MLE =H1(F||P), and then use the encryption algorithm MLE.Encrypt() to calculate the data ciphertext C of the data F to be uploaded = Encrypt(F,K MLE ), and finally use the tag generation algorithm MLE.TagGen() to calculate the duplicate data deletion tag T of the data to be uploaded F r =H2(C) and sent to the data verifier.
3. A blockchain-based key management and data deduplication method according to claim 2, characterized in that: Before step S3, the following steps are also included: The data owner splits the data ciphertext C into N data block sets of the same size C = {c1, c2, c3, c4, .., c N }, then for each data block c i (1≤i≤N) Calculate data labels: Where g represents a generator of the multiplication cyclic group, e is a number that is relatively prime to n, n is the product of two large prime numbers, and (e,n) represents the public key pk; And use each data label to construct a Verkle tree.
4. A blockchain-based key management and data deduplication method according to claim 3, characterized in that: The step S3 is specifically as follows: S31, the data verifier determines that the data owner is the initial file uploader, and sends an "initial file" message to the data owner; S32, the data owner sends the data ciphertext C to the data verifier; S33, the data verifier determines T r =H2(C), save the data ciphertext C and Verkle root, and the identity ID of the data owner DO Insert the deduplication tag T r and returns "true" to the data owner; Otherwise, judge T r ≠H2(C), the upload of the data ciphertext C is terminated, and "false" is returned to the data owner; S34: If the data owner receives "true", the convergence key K is queried using the public key pk. MLE Encrypt to get C k =K MLE e mod n, and use the private key sk to k After signing, [pk,C k ,sign(C k )] is sent to the node of the blockchain; If the data owner receives "false", the data owner re-executes the upload operation; S35, the node verification signature sign of the blockchain (C k ) and then C k Wind up.
5. A blockchain-based key management and data deduplication method according to claim 3, characterized in that: The step S4 is specifically as follows: S41. The data verifier randomly selects a set of data block numbers It is sent as a challenge message to the data owner, and the ownership proof challenge is initiated to the data owner through the PoW.chal algorithm in the PoW mechanism; S42, the data owner calculates the proof of commitment of all data blocks on the path in the Verkletree corresponding to the data block number selected by the data verifier, and the proof of commitment of all data blocks on the path relative to their parent nodes and the proof of commitment of their parent nodes relative to their grandparent nodes, until the proof of commitment relative to the root node, through the PoW.Proof algorithm in the PoW mechanism, and returns the corresponding proofs to the data verifier; S43, the data verifier verifies whether the proofs promised by the root node, the parent node and its grandparent node are consistent with the stored ones through the PoW.Verify algorithm in the PoW mechanism. If they are inconsistent, the upload of the data ciphertext C is terminated and "false" is returned to the data owner. If they are consistent, the identity ID of the data owner is returned. DO Insert the deduplication tag T r and returns the file address of the cloud storage server corresponding to the data F to be uploaded and "true" to the data owner; S44: If the data owner receives "true", the convergence key K is queried using the public key pk. MLE Encrypt to get C k =K MLE e After mod n, it is sent to the nodes of the blockchain; If the data owner receives "false", the upload operation is re-executed.
6. A blockchain-based key management and data deduplication terminal, characterized in that: The invention comprises 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 following steps are implemented: S1. When the data owner uploads data, the data owner first calculates the deduplication tag of the data to be uploaded and sends it to the data verifier, and encrypts the data to be uploaded to obtain the data ciphertext and the convergence key; S2, the data verifier performs a duplication check on the file according to the duplicate data deduplication tag, and if it is an initial file, proceeds to step S3, and if it is a duplicate file, proceeds to step S4; S3. The data owner encrypts the convergence key and uploads it to the blockchain, and sends the data ciphertext to the data verifier, which is then uploaded to the blockchain for storage after consensus is reached. S4. The data verifier initiates an ownership proof challenge to the data owner through the PoW mechanism based on the Verkle tree. After the challenge is passed, the file address corresponding to the cloud storage server is returned to the data owner. The data owner encrypts the convergence key and uploads it to the chain.
7. A blockchain-based key management and data deduplication terminal according to claim 6, characterized in that: In step S1, the deduplication tag of the data to be uploaded is first calculated to the data verifier, and the data to be uploaded is encrypted to obtain the data ciphertext and the convergence key, specifically: Given security parameter 1 λ , use the system parameter generation algorithm Setup(1 λ ) Generate a key pair (pk, sk) of the system parameter P and the data owner, where pk is the public key and sk is the private key; Assume that H1 is a hash function for generating a convergence key, H2 is a hash function for generating a deduplication tag, and define the data to be uploaded as F; The data owner first uses the key generation algorithm MLE.KeyGen() to generate the convergence key K MLE =H1(F||P), and then use the encryption algorithm MLE.Encrypt() to calculate the data ciphertext C of the data F to be uploaded = Encrypt(F,K MLE ), and finally use the tag generation algorithm MLE.TagGen() to calculate the duplicate data deletion tag T of the data to be uploaded F r =H2(C) and sent to the data verifier.
8. A blockchain-based key management and data deduplication terminal according to claim 7, characterized in that: Before step S3, the following steps are also included: The data owner splits the data ciphertext C into N data block sets of the same size C = {c1, c2, c3, c4, .., c N }, then for each data block c i (1≤i≤N) Calculate data labels: Where g represents a generator of the multiplication cyclic group, e is a number that is relatively prime to n, n is the product of two large prime numbers, and (e,n) represents the public key pk; And use each data label to construct a Verkle tree.
9. A blockchain-based key management and data deduplication terminal according to claim 8, characterized in that: The step S3 is specifically as follows: S31, the data verifier determines that the data owner is the initial file uploader, and sends an "initial file" message to the data owner; S32: The data owner sends the data ciphertext C and the duplicate data deletion tag T r Send to the data verifier; S33, the data verifier determines T r =H2(C), save the data ciphertext C and Verkle root, and the identity ID of the data owner DO Insert the deduplication tag T r and returns "true" to the data owner; Otherwise, judge T r ≠H2(C), the upload of the data ciphertext C is terminated, and "false" is returned to the data owner; S34: If the data owner receives "true", the convergence key K is queried using the public key pk. MLE Encrypt to get C k =K MLE e mod n, and use the private key sk to k After signing, [pk,C k ,sign(C k )] is sent to the node of the blockchain; If the data owner receives "false", the data owner re-executes the upload operation; S35, the node verification signature sign of the blockchain (C k ) and then C k Wind up.
10. A blockchain-based key management and data deduplication terminal according to claim 8, characterized in that: The step S4 is specifically as follows: S41. The data verifier randomly selects a set of data block numbers It is sent as a challenge message to the data owner, and the ownership proof challenge is initiated to the data owner through the PoW.chal algorithm in the PoW mechanism; S42, the data owner calculates the proof of commitment of all data blocks on the path in the Verkletree corresponding to the data block number selected by the data verifier, and the proof of commitment of all data blocks on the path relative to their parent nodes and the proof of commitment of their parent nodes relative to their grandparent nodes, until the proof of commitment relative to the root node, through the PoW.Proof algorithm in the PoW mechanism, and returns the corresponding proofs to the data verifier; S43, the data verifier verifies whether the proofs promised by the root node, the parent node and its grandparent node are consistent with the stored ones through the PoW.Verify algorithm in the PoW mechanism. If they are inconsistent, the upload of the data ciphertext C is terminated and "false" is returned to the data owner. If they are consistent, the identity ID of the data owner is returned. DO Insert the deduplication tag T r and returns the file address of the cloud storage server corresponding to the data F to be uploaded and "true" to the data owner; S44: If the data owner receives "true", the convergence key K is queried using the public key pk. MLE Encrypt to get C k =K MLE e After mod n, it is sent to the nodes of the blockchain; If the data owner receives "false", the upload operation is re-executed.