Data distributed storage method and system based on secret sharing technology
By applying secret sharing technology to secondary encryption of data in distributed storage systems, using Shamir threshold scheme to segment and reconstruct keys and data sharding, the problem of insufficient data privacy in traditional systems during storage node attacks is solved, and the data privacy is achieved. High security and fault tolerance.
Patent Information
- Application Number
- CN202411687177.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-11-25
Smart Images

Figure CN119172077A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a data distributed storage method and system based on secret sharing technology. Background Art
[0002] With the widespread application of distributed storage technology, the security and privacy of data storage are becoming increasingly important. Traditional distributed storage systems usually use block encryption to protect data security, but if some storage nodes are attacked or leaked, there may still be a risk of data privacy exposure. In order to enhance storage security, secret sharing technology can be further used to re-encrypt encrypted data to ensure that even if some storage nodes fail or are attacked, attackers still cannot restore the complete data.
[0003] How to achieve the security and privacy of data in distributed storage based on secret sharing technology is a technical problem that needs to be solved. Summary of the invention
[0004] The technical task of the present invention is to address the above shortcomings and provide a data distributed storage method and system based on secret sharing technology to solve the technical problem of how to achieve the security and privacy of data in distributed storage based on secret sharing technology.
[0005] In a first aspect, the present invention provides a data distributed storage method based on secret sharing technology, comprising the following steps: Data block division: divide the original data into multiple data blocks, and encrypt each data block using a symmetric key to generate an encrypted data block; Secret key sharing: split the symmetric key into multiple key fragments based on Shamir threshold scheme, and store the multiple key fragments in a distributed manner on multiple different nodes; Data secret sharing: For each encrypted data block, the encrypted data block is divided into multiple data slices based on the Shamir threshold scheme, and the multiple data slices are distributed and stored in multiple different nodes, where the data slices and key slices can be distributed on different nodes or on the same node; Data recovery: For symmetric keys, a predetermined number of key shards are collected based on the Shamir threshold scheme, and the symmetric key is reconstructed based on the collected key shards to obtain a reconstructed symmetric key. For each encrypted data block, a predetermined number of data shards are collected based on the Shamir threshold scheme, and the encrypted data block is reconstructed based on the collected data shards to obtain a reconstructed encrypted data block. The reconstructed encrypted data block is decrypted based on the reconstructed symmetric key to restore the original data block.
[0006] As a preferred method, when the key is secretly shared, the symmetric key is divided into key shards, The key shards are distributed and stored in different nodes, and it is required to collect at least Reconstruct and recover the symmetric key using key shards; Correspondingly, when recovering data, the Shamir threshold scheme is used to recover data from at least The key shards are collected on nodes, based on at least The key is sharded and the symmetric key is reconstructed by Lagrange difference method. The calculation formula of symmetric key reconstruction is as follows: ; in, and Both represent the key shard number. Indicates key shards, Represents the reconstructed symmetric key.
[0007] As a preferred method, when sharing data secrets, the encrypted data blocks are divided into data shards, Data is distributed and stored in different nodes, and it is required to collect at least Reconstruct and restore the encrypted data block using key fragments; Correspondingly, when recovering data, the Shamir threshold scheme is used to recover data from at least The data is collected on the nodes, based on at least The encrypted data blocks are reconstructed by Lagrange difference method. The calculation formula for reconstructing the encrypted data blocks is as follows: ; in, and Both represent the data shard number. Indicates Encrypted data blocks The corresponding Data shards, Represents a reconstructed encrypted data block.
[0008] Preferably, when data is divided into blocks, the data blocks are encrypted based on a symmetric key using an AES encryption algorithm to generate encrypted data blocks.
[0009] In a second aspect, the present invention provides a data distributed storage system based on secret sharing technology, which is used to implement data distributed storage through a data distributed storage method based on secret sharing technology as described in any one of the first aspects, wherein the system includes a data block module, a key secret sharing module, a data secret sharing module, and a data recovery module; The data block module is used to perform the following: divide the original data into multiple data blocks, and for each data block, encrypt the data block by using a symmetric key to generate an encrypted data block; The key secret sharing module is used to perform the following: split the symmetric key into multiple key fragments based on the Shamir threshold scheme, and store the multiple key fragments in a distributed manner to multiple different nodes; The data secret sharing module is used to perform the following: for each encrypted data block, split the encrypted data block into multiple data slices based on the Shamir threshold scheme, and store the multiple data slices in a distributed manner to multiple different nodes, wherein the data slices and the key slices can be distributed on different nodes or on the same node; The data recovery module is used to perform the following: for a symmetric key, a predetermined number of key fragments are collected based on the Shamir threshold scheme, and the symmetric key is reconstructed based on the collected key fragments to obtain a reconstructed symmetric key; for each encrypted data block, a predetermined number of data fragments are collected based on the Shamir threshold scheme, and the encrypted data block is reconstructed based on the collected data fragments to obtain a reconstructed encrypted data block; and the reconstructed encrypted data block is decrypted based on the reconstructed symmetric key to recover the original data block.
[0010] Preferably, the key secret sharing module is used to split the symmetric key into key shards, The key shards are distributed and stored in different nodes, and it is required to collect at least Reconstruct and recover the symmetric key using key shards; Correspondingly, the data recovery module is used to recover at least The key shards are collected on nodes, based on at least The key is sharded and the symmetric key is reconstructed by Lagrange difference method. The calculation formula of symmetric key reconstruction is as follows: ; in, and Both represent the key shard number. Indicates key shards, Represents the reconstructed symmetric key.
[0011] As a preferred embodiment, the data secret sharing module is used to divide the encrypted data block into data shards, Data is distributed and stored in different nodes, and it is required to collect at least Reconstruct and restore the encrypted data block using key fragments; Correspondingly, the data recovery module is used to recover at least The data is collected on the nodes, based on at least The encrypted data blocks are reconstructed by Lagrange difference method. The calculation formula for reconstructing the encrypted data blocks is as follows: ; in, and Both represent the data shard number. Indicates Encrypted data blocks The corresponding Data shards, Represents a reconstructed encrypted data block.
[0012] Preferably, the data block module is used to encrypt the data block based on the symmetric key through the AES encryption algorithm to generate an encrypted data block.
[0013] The data distributed storage method and system based on secret sharing technology of the present invention have the following advantages: 1. Enhanced data privacy protection: Through secret sharing technology, secondary encryption is performed. Even if some storage nodes are attacked or leaked, the attacker cannot recover the complete data, which greatly improves storage security; 2. Improve anti-attack capabilities: Even if some storage nodes fail or are attacked, data can still be restored through the remaining valid node fragments, which enhances the fault tolerance of the system; 3. Balance between security and performance: Block encryption and secret sharing technology are used to ensure data security without significantly increasing storage and computing overhead, making it suitable for large-scale distributed storage scenarios; 4. No centralized dependency: It uses distributed storage and secret sharing technology, does not rely on a single centralized service, and prevents centralized nodes from becoming a single point of failure. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0015] The present invention is further described below in conjunction with the accompanying drawings.
[0016] Figure 1 This is a flowchart of a data distributed storage method based on secret sharing technology in Example 1. DETAILED DESCRIPTION
[0017] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0018] The embodiments of the present invention provide a data distributed storage method and system based on secret sharing technology, which are used to solve the technical problem of how to achieve the security and privacy of data in distributed storage based on secret sharing technology.
[0019] Embodiment 1: The invention discloses a data distributed storage method based on secret sharing technology, which comprises four steps of data segmentation, key secret analysis, data secret analysis and data recovery.
[0020] Step S100: Data segmentation: The original data is divided into a plurality of data blocks. For each data block, the data block is encrypted by a symmetric key to generate an encrypted data block.
[0021] As a specific implementation of data segmentation, the data block is encrypted by an AES encryption algorithm based on a symmetric key to generate an encrypted data block.
[0022] Step S200: Secret key sharing: based on the Shamir threshold scheme, the symmetric key is divided into multiple key fragments, and the multiple key fragments are distributed and stored in multiple different nodes.
[0023] As a specific implementation of key secret analysis, when the key secret is shared, the symmetric key is divided into key shards, The key shards are distributed and stored in different nodes, and it is required to collect at least The symmetric key is reconstructed and restored using key shards.
[0024] Step S300: Data secret sharing: For each encrypted data block, the encrypted data block is divided into multiple data slices based on the Shamir threshold scheme, and the multiple data slices are distributed and stored in multiple different nodes, wherein the data slices and key slices can be distributed on different nodes or on the same node.
[0025] As a specific implementation of data secret sharing, the encrypted data block is divided into data shards, Data is distributed and stored in different nodes, and it is required to collect at least The encrypted data block is reconstructed and restored using the key fragments.
[0026] Step S400 data recovery: for the symmetric key, a predetermined number of key fragments are collected based on the Shamir threshold scheme, and the symmetric key is reconstructed based on the collected key fragments to obtain a reconstructed symmetric key. For each encrypted data block, a predetermined number of data fragments are collected based on the Shamir threshold scheme, and the encrypted data block is reconstructed based on the collected data fragments to obtain a reconstructed encrypted data block. The reconstructed encrypted data block is decrypted based on the reconstructed symmetric key to restore the original data block.
[0027] As a specific implementation of data recovery, first, based on the Shamir threshold scheme, from at least The key shards are collected on nodes, based on at least The key is sharded and the symmetric key is reconstructed by Lagrange difference method. The calculation formula of symmetric key reconstruction is as follows: ; in, and Both represent the key shard number. Indicates key shards, Represents the reconstructed symmetric key.
[0028] Secondly, based on Shamir threshold scheme, The data is collected on the nodes, based on at least The encrypted data blocks are reconstructed by Lagrange difference method. The calculation formula for reconstructing the encrypted data blocks is as follows: ; in, and Both represent the data shard number. Indicates Encrypted data blocks The corresponding Data shards, Represents a reconstructed encrypted data block.
[0029] Finally, the reconstructed encrypted data block is decrypted using the reconstructed symmetric key to restore the data block. The calculation formula is as follows: ; Indicates recovery data blocks, Represents the decryption function.
[0030] The method of this embodiment performs secondary encryption on the data by combining the block encryption mechanism of distributed storage with the privacy computing method of secret sharing technology to ensure the security and privacy of the data in distributed storage. This method not only improves the basic storage security by encrypting the data in blocks, but also encrypts the encrypted data blocks again in combination with secret sharing technology to ensure that the data still has a high degree of security and privacy even when some storage nodes fail or are attacked.
[0031] Embodiment 2: The present invention discloses a data distributed storage system based on secret sharing technology, comprising a data block module, a key secret sharing module, a data secret sharing module and a data recovery module.
[0032] The data block module is used to perform the following: divide the original data into multiple data blocks, and for each data block, encrypt the data block by using a symmetric key to generate an encrypted data block.
[0033] As a specific implementation of the data block module, the module is used to encrypt the data block based on the symmetric key through the AES encryption algorithm to generate an encrypted data block.
[0034] The key secret sharing module is used to perform the following: split the symmetric key into multiple key fragments based on the Shamir threshold scheme, and distribute and store the multiple key fragments to multiple different nodes.
[0035] As a specific implementation of the key secret sharing module, when the key secret is shared, the module is used to split the symmetric key into key shards, The key shards are distributed and stored in different nodes, and it is required to collect at least The symmetric key is reconstructed and restored using key fragments.
[0036] The data secret sharing module is used to perform the following: for each encrypted data block, the encrypted data block is divided into multiple data fragments based on the Shamir threshold scheme, and the multiple data fragments are distributed and stored in multiple different nodes, wherein the data fragments and the key fragments can be distributed on different nodes or on the same node.
[0037] As a specific implementation of data secret sharing, this module is used to split the encrypted data block into data shards, Data is distributed and stored in different nodes, and it is required to collect at least The encrypted data block is reconstructed and restored using the key fragments.
[0038] The data recovery module is used to perform the following: for a symmetric key, a predetermined number of key fragments are collected based on the Shamir threshold scheme, and the symmetric key is reconstructed based on the collected key fragments to obtain a reconstructed symmetric key; for each encrypted data block, a predetermined number of data fragments are collected based on the Shamir threshold scheme, and the encrypted data block is reconstructed based on the collected data fragments to obtain a reconstructed encrypted data block; and the reconstructed encrypted data block is decrypted based on the reconstructed symmetric key to recover the original data block.
[0039] As a specific implementation of the data recovery module, first, the module performs the following operations: based on the Shamir threshold scheme, from at least The key shards are collected on nodes, based on at least The key is sharded and the symmetric key is reconstructed by Lagrange difference method. The calculation formula of symmetric key reconstruction is as follows: ; in, and Both represent the key shard number. Indicates key shards, Represents the reconstructed symmetric key.
[0040] Secondly, this module is used to perform the following operations: based on the Shamir threshold scheme from at least The data is collected on the nodes, based on at least The encrypted data blocks are reconstructed by Lagrange difference method. The calculation formula for reconstructing the encrypted data blocks is as follows: ; in, and Both represent the data shard number. Indicates Encrypted data blocks The corresponding Data shards, Represents a reconstructed encrypted data block.
[0041] Finally, this module is used to decrypt the reconstructed encrypted data block using the reconstructed symmetric key to recover the data block. The calculation formula is as follows: ; Indicates recovery data blocks, Represents the decryption function.
[0042] The system of this embodiment can execute the method disclosed in Example 1 to realize data distributed storage.
[0043] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the means in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A data distributed storage method based on secret sharing technology, characterized in that: The steps include: Data block division: divide the original data into multiple data blocks, and encrypt each data block using a symmetric key to generate an encrypted data block; Secret key sharing: split the symmetric key into multiple key fragments based on Shamir threshold scheme, and store the multiple key fragments in a distributed manner on multiple different nodes; Data secret sharing: For each encrypted data block, the encrypted data block is divided into multiple data slices based on the Shamir threshold scheme, and the multiple data slices are distributed and stored in multiple different nodes, where the data slices and key slices can be distributed on different nodes or on the same node; Data recovery: For symmetric keys, a predetermined number of key shards are collected based on the Shamir threshold scheme, and the symmetric key is reconstructed based on the collected key shards to obtain a reconstructed symmetric key. For each encrypted data block, a predetermined number of data shards are collected based on the Shamir threshold scheme, and the encrypted data block is reconstructed based on the collected data shards to obtain a reconstructed encrypted data block. The reconstructed encrypted data block is decrypted based on the reconstructed symmetric key to restore the original data block.
2. The data distributed storage method based on secret sharing technology according to claim 1 is characterized in that: When the key is secretly shared, the symmetric key is divided into key shards, The key shards are distributed and stored in different nodes, and it is required to collect at least Reconstruct and recover the symmetric key using key shards; Correspondingly, when recovering data, the Shamir threshold scheme is used to recover data from at least The key shards are collected on nodes, based on at least The key is sharded and the symmetric key is reconstructed by Lagrange difference method. The calculation formula of symmetric key reconstruction is as follows: ; in, and Both represent the key shard number. Indicates key shards, Represents the reconstructed symmetric key.
3. The data distributed storage method based on secret sharing technology according to claim 1 is characterized in that: When sharing data secrets, the encrypted data block is divided into data shards, Data is distributed and stored in different nodes, and it is required to collect at least Reconstruct and restore the encrypted data block using key fragments; Correspondingly, when recovering data, the Shamir threshold scheme is used to recover data from at least The data is collected on the nodes, based on at least The encrypted data blocks are reconstructed by Lagrange difference method. The calculation formula for reconstructing the encrypted data blocks is as follows: ; in, and Both represent the data shard number. Indicates Encrypted data blocks The corresponding Data shards, Represents a reconstructed encrypted data block.
4. The data distributed storage method based on secret sharing technology according to any one of claims 1 to 3, characterized in that: When data is divided into blocks, the data blocks are encrypted based on the symmetric key using the AES encryption algorithm to generate encrypted data blocks.
5. A data distributed storage system based on secret sharing technology, characterized in that: Used to implement data distributed storage by a data distributed storage method based on secret sharing technology as described in any one of claims 1 to 4, the system comprising a data block module, a key secret sharing module, a data secret sharing module and a data recovery module; The data block module is used to perform the following: divide the original data into multiple data blocks, and for each data block, encrypt the data block by using a symmetric key to generate an encrypted data block; The key secret sharing module is used to perform the following: split the symmetric key into multiple key fragments based on the Shamir threshold scheme, and store the multiple key fragments in a distributed manner to multiple different nodes; The data secret sharing module is used to perform the following: for each encrypted data block, split the encrypted data block into multiple data slices based on the Shamir threshold scheme, and store the multiple data slices in a distributed manner to multiple different nodes, wherein the data slices and the key slices can be distributed on different nodes or on the same node; The data recovery module is used to perform the following: for a symmetric key, a predetermined number of key fragments are collected based on the Shamir threshold scheme, and the symmetric key is reconstructed based on the collected key fragments to obtain a reconstructed symmetric key; for each encrypted data block, a predetermined number of data fragments are collected based on the Shamir threshold scheme, and the encrypted data block is reconstructed based on the collected data fragments to obtain a reconstructed encrypted data block; and the reconstructed encrypted data block is decrypted based on the reconstructed symmetric key to recover the original data block.
6. The data distributed storage system based on secret sharing technology according to claim 5 is characterized in that: The key secret sharing module is used to split the symmetric key into key shards, The key shards are distributed and stored in different nodes, and it is required to collect at least Reconstruct and recover the symmetric key using key shards; Correspondingly, the data recovery module is used to recover at least The key shards are collected on nodes, based on at least The key is sharded and the symmetric key is reconstructed by Lagrange difference method. The calculation formula of symmetric key reconstruction is as follows: ; in, and Both represent the key shard number. Indicates key shards, Represents the reconstructed symmetric key.
7. The data distributed storage system based on secret sharing technology according to claim 5 is characterized in that: The data secret sharing module is used to divide the encrypted data block into data shards, Data is distributed and stored in different nodes, and it is required to collect at least Reconstruct and restore the encrypted data block using key fragments; Correspondingly, the data recovery module is used to recover at least The data is collected on the nodes, based on at least The encrypted data blocks are reconstructed by Lagrange difference method. The calculation formula for reconstructing the encrypted data blocks is as follows: ; in, and Both represent the data shard number. Indicates Encrypted data blocks The corresponding Data shards, Represents a reconstructed encrypted data block.
8. The data distributed storage system based on secret sharing technology according to any one of claims 5 to 7, characterized in that: The data block module is used to encrypt the data block based on the symmetric key and the AES encryption algorithm to generate an encrypted data block.
Citation Information
Patent Citations
Blockchain key management method, multi-person common signature method and electronic device
CN111639361A
Distributed SM9 key generation method and system
CN113079003A
Tax power data security fusion method, tax power node, equipment and medium
CN116933299A
Method for realizing distributed digital certificate, computer equipment and storage medium
CN117118633A
Method, system and node for realizing threshold signature
CN117240467A
Cited By
Key processing method and device, key reconstruction method and device, equipment and medium
CN120017257A
Data sharing method and device and electronic equipment
CN120582778A
Intelligent calculation center network data management method and system
CN120639280A
A method and system for managing network data in a cognitive center
CN120639280B
Block chain data security storage method based on verifiable secret sharing
CN120785533A
