A file distributed storage and sharing method based on homomorphic hash tree

Through the homomorphic hash tree structure and RSA signature mechanism, the problems of data consistency and network bandwidth limitation in distributed file storage are solved, and high-reliability, high-security and high-performance file storage and sharing are achieved.

CN117201031BActive Publication Date: 2025-09-16CHONGQING UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311155617.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2025-09-16
Estimated Expiration
2043-09-07

AI Technical Summary

Technical Problem

Existing file distributed storage methods have data consistency issues and network bandwidth limitations. Especially when transferring large files and highly concurrently accessing them, it is difficult to ensure data security and transmission speed.

Method used

A homomorphic hash tree structure is used to divide the file into multiple blocks, and each block is hashed and signed using a homomorphic hash function and RSA signature mechanism. A three-level hash tree storage structure is constructed, and data is segmented and broadcasted through edge servers, and end users perform data consistency verification.

Benefits of technology

It achieves high reliability, high security and high performance file storage and sharing, solves data consistency issues, optimizes network bandwidth utilization, and improves large file transfer speed and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117201031B_ABST
    Figure CN117201031B_ABST
Patent Text Reader

Abstract

The present invention relates to a distributed file storage and sharing method based on a homomorphic hash tree, belonging to the field of information security. The method comprises the following steps: S1: when a cloud platform wants to share a data file M with users in the system, the system is first initialized; S2: a homomorphic hash tree is constructed; S3: user collaborative sharing; and S4: data consistency verification. The present invention implements distributed storage of large data files on the cloud platform, resolving the problem of slow and limited transmission of large files on the cloud platform due to network instability, and ensuring data consistency during the data sharing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security and relates to a file distributed storage and sharing method based on a homomorphic hash tree. Background Art

[0002] Distributed file storage and sharing are crucial requirements for cloud services, finding widespread application in scenarios such as the Internet of Things and cloud computing. Traditional file storage and sharing methods typically rely on centralized servers or storage devices, an architecture that carries the risk of single points of failure and performance bottlenecks. To improve system reliability, fault tolerance, and performance, researchers have proposed distributed storage and sharing technologies. These technologies split files and store them across multiple nodes, while providing data redundancy and load balancing to achieve highly available and reliable file storage and sharing. Currently, distributed file storage methods often utilize blockchain technology. Blockchain is a distributed ledger that securely stores and shares data through mechanisms such as decentralization and consensus algorithms. While blockchain itself is not suitable for directly storing large files, it can leverage the characteristics of blockchain and other distributed storage technologies to achieve distributed file storage. However, blockchain-based distributed storage methods may face challenges in terms of storage space and performance. Due to the immutability and consensus mechanisms of blockchain, once stored, files are difficult to delete or modify, resulting in increased storage space.

[0003] Although distributed storage technologies such as location blockchains have been widely researched and applied, they still have many limitations and flaws. The following are some of the main challenges:

[0004] (1) Data consistency: In a distributed environment, distributed stored data still faces the problem of data consistency after sharing, verifying whether the data has been tampered with or lost. It is necessary to ensure data consistency between different nodes, such as through mechanisms such as consistency protocols to maintain data consistency.

[0005] (2) Network bandwidth limitations: In a distributed storage and sharing environment, file transfers require network bandwidth. For large files or high-concurrency access, network bandwidth may become a bottleneck, limiting data transfer speed and system performance. Summary of the Invention

[0006] In view of this, the purpose of the present invention is to combine hash functions and homomorphic encryption technology to provide a data storage structure of a homomorphic hash tree, solve the problems faced by the existing technology, and provide a high-reliability, high-security and high-performance file storage and sharing solution. Homomorphic encryption is an encryption method with a special property, that is, after performing a specific operation on the ciphertext, the result obtained can be used to obtain the operation result of the original data through a decryption operation. Homomorphic hash trees can be applied to distributed storage and sharing of files. By dividing the file into multiple blocks and using homomorphic hash functions to perform hash calculations on these blocks, distributed storage and sharing of files can be achieved, and security verification and data integrity verification can be performed on the file blocks.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A file distributed storage and sharing method based on a homomorphic hash tree comprises the following steps:

[0009] S1: When the cloud platform wants to share the data file M with users in the system, it first initializes the system;

[0010] S2: Build a homomorphic hash tree;

[0011] S3: user collaborative sharing;

[0012] S4: Data consistency verification.

[0013] Furthermore, the system initialization described in step S1 specifically includes:

[0014] S11: The cloud platform executes the key and system parameter generation algorithm KeyGen(1 k ), taking the security parameter k as input, let G1 represent the multiplication cyclic group of prime order p, the cloud platform randomly selects the generator g of G1, and generates a secure additive homomorphic hash function H(m)=g m modp, and make the large prime number p public;

[0015] S12: The cloud platform randomly selects two prime numbers p * =2p'+1 and q * =2q'+1, and satisfies p * and q * Both are large prime numbers, calculate N = p * q * and Randomly select an integer satisfy And calculate the integer d that satisfies Publish its public key (N,e) and securely destroy p * ,q * and And keep d as its private key.

[0016] Furthermore, step S2 of constructing a homomorphic hash tree specifically includes the following steps:

[0017] S21: The cloud platform uses the generated additive homomorphic hash function to hash the M rows of the data file and generate a corresponding large hash value h;

[0018] S22: The platform splits the data file M into n file data blocks {m1,m2,...,m n}; Then, these n blocks are numbered sequentially, and these n numbers are signed, and the generated signature value and number are used as the header of each block;

[0019] S23: The cloud platform performs batch hash operations on n data blocks to generate n partial hash values ​​{h1,h2,...,h n}, these n partial hash values ​​correspond to n sequential file data blocks {m1,m2,...,m n};

[0020] S24: The cloud platform backs up all partial hash values ​​and file blocks, and saves the hash value of the block data h i (1≤i≤n), file data block content m i (1≤i≤n), and the numbered signature value s of the file data block i (1≤i≤n) are sent to the servers {server1,server2,...,server n}, and at the same time, send the large hash value h of the file data through a secure channel to all edge servers, and then send it to the terminal users who need to download the service file data through the edge servers;

[0021] S25: When the edge server i (1≤i≤n) After obtaining the hash value of a certain block of the file data issued by the cloud platform, the block data and number signature information, and the file data hash value, it broadcasts the message to the terminal users in its service area and provides the terminal users with some file data information for download;

[0022] S26: The edge server immediately requests the cloud platform to split the file data blocks again. After the cloud platform agrees to the request, the edge server uses the file data block algorithm to split the file data again. The number of blocks is t, and the multiplication cycle group G1 is used to obtain the generator g1, and a local secure additive hash homomorphic function is created. The homomorphic hash function is used to calculate and record the hash values ​​of the secondary block file data {h i-1 ,h i-2 ,...,hi-t}, and also use the RSA signature mechanism to sign the block number to generate a signature pair {(number n-1 ,s n-1 ),(number n-2 ,s n-2 ),...,(number n-t ,s n-t )};

[0023] S27: Finally, t copies of secondary block file data and secondary block file data hash values ​​are generated, and some hash values ​​of the secondary block files are placed on the third-level nodes of the homomorphic hash tree. Finally, a data storage structure of a homomorphic hash tree with a height of 3 is generated by splitting the original file's large hash value twice.

[0024] Furthermore, in step S22, the cloud platform uses the private key d to sign the numbers of the n file data blocks based on the RSA signature system, and generates a signature pair {(number1,s1),(number2,s2),...,(number n ,s n )}, when the end user receives these signed file data blocks at the receiving end, he uses the corresponding public key to verify the validity of the signature and accurately reassemble the original file data based on the number and signature value.

[0025] Furthermore, the user collaborative sharing described in step S3 specifically includes:

[0026] If the end user User needs to obtain other partial hash values ​​and other block file contents, it broadcasts the data request to the surrounding nodes. Within its communication range, there are w end user nodes with matching data in their local cache and respond. The end user User is requested to use these nodes as cooperative nodes for this transmission based on the shared data of other end users. Each node is only responsible for transmitting the hash value, numbered signature value and part of the block data of the block file data that meets the requirements.

[0027] After the transmission is completed, the end user is requested to provide corresponding evaluation feedback data based on the actual situation;

[0028] The end user User cooperates with other end users to collect data until all data blocks that meet the target file data are collected.

[0029] Furthermore, the data consistency verification in step S4 specifically includes:

[0030] First, perform signature authentication: When the end user User completes the collection of all file data blocks, the end user first verifies the numbered signature values ​​of all block file data. The end user uses the public key pair {(N,e),(N1,e1),...,(N n ,e n )} Verify the signature value and verify the accuracy of all numbers, that is, verify (N,s) =True correctness;

[0031] After the end user verifies that all the file data block numbers and signatures are correct, they verify whether the data has been tampered with during transmission. The end user calculates:

[0032] Case 1: If the file data is hashed only once, calculate:

[0033]

[0034] Verify whether the above equation is true. If so, it proves that the data has not been tampered with and can be used directly. If not, it needs to be downloaded and collected again.

[0035] Case 2: Part of the file data is hashed twice. If h1 is hashed twice, then the calculation is:

[0036]

[0037] in, Verify whether the above equation is true; if it is true, it proves that the data has not been tampered with and can be used directly; if the equation is not true, it needs to be downloaded and collected again.

[0038] The beneficial effects of the present invention are: the present invention realizes the distributed storage of large data files on the cloud platform, solves the problem that the transmission of large files on the cloud platform is slow and limited due to network instability, and ensures data consistency during data sharing.

[0039] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings, in which:

[0041] Figure 1 This is a diagram of the system architecture of the present invention;

[0042] Figure 2 Hash tree structure diagram designed for the present invention. DETAILED DESCRIPTION

[0043] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0044] Among them, the accompanying drawings are only for illustrative purposes and represent only schematic diagrams rather than actual pictures, and should not be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the dimensions of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the accompanying drawings.

[0045] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "back", etc. indicating directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0046] See also Figures 1 and 2, a data storage structure of a homomorphic hash tree, which combines hash functions and homomorphic encryption technology. Homomorphic encryption is an encryption method with a special property, that is, after performing a specific operation on the ciphertext, the result obtained can be used to obtain the operation result of the original data through a decryption operation. Homomorphic hash trees can be applied to distributed storage and sharing of files. By dividing the file into multiple blocks and using homomorphic hash functions to perform hash calculations on these blocks, distributed storage and sharing of files can be achieved, and security verification and data integrity verification can be performed on the file blocks. The file distributed storage and sharing method based on homomorphic hash trees is intended to solve the problems faced by the existing technology and provide a high-reliability, high-security and high-performance file storage and sharing solution. In order to achieve the above-mentioned purpose, the present invention provides the following technical solutions:

[0047] S1 System Initialization: When the cloud platform wants to share the latest large file data with users in the system, let the service file to be shared by the cloud platform be M. The cloud platform first executes the key and system parameter generation algorithm KeyGen(1 k ), taking the security parameter k as input, let G1 represent the multiplication cyclic group of prime order p, the cloud platform randomly selects the generator g of G1, and generates a secure additive homomorphic hash function H(m)=g m modp, and make the large prime number p public.

[0048] Secondly, the cloud platform randomly selects two prime numbers p * =2p'+1 and q * =2q'+1, and satisfies p * and q * Both are large prime numbers, calculate N = p * q * and Randomly select an integer satisfy And calculate the integer d that satisfies Publish its public key (N,e) and securely destroy p * ,q * and And keep d as its private key.

[0049] S2 builds a homomorphic hash tree: First, the cloud platform performs a hash operation on the data file as a whole to generate a large hash value. This process mainly uses the generated additive homomorphic hash function to hash M rows of the data file to produce the corresponding large hash value h.

[0050] Secondly, the cloud platform splits the file data M. If the file data exceeds a certain size, it is split into n file data blocks {m1,m2,...,m n}, then, the first n blocks are numbered sequentially, and these n numbers are signed to prevent the order of the file data from being tampered with during the block process, resulting in the inability to restore the original file data. The signature value and number are generated as the header (additional information) of each block. This information helps the end user to correctly reassemble the file data at the receiving end.

[0051] The signing process uses the RSA signature system to sign the numbers of the file data blocks respectively, generating signature pairs {(number1,s1),(number2,s2),...,(number n ,s n )}. The cloud platform uses the private key to sign all numbers, ensuring that each file data block has a unique digital signature. When the end user receives these signed file data blocks at the receiving end, they can use the corresponding public key to verify the validity of the signature and accurately reassemble the original file data based on the number and signature value. By adopting digital signatures and numbering, the cloud platform ensures the integrity and order of file data blocks, improves the security and reliability of data transmission, and provides an efficient and secure solution for file data sharing between the user's cloud platform and end users. The cloud platform uses the private key d to sign all numbers.

[0052] In addition, the cloud platform also needs to perform batch hash operations on the first n data blocks to generate n partial hash values ​​{h1,h2,...,h n}, these n partial hash values ​​correspond to the first n sequential file data blocks {m1,m2,...,m n}.

[0053] Then, the cloud platform will back up all the partial hash values ​​and file blocks, and the hash value h of the block data will be i (1≤i≤n), file data block content m i (1≤i≤n), and the numbered signature value s of the file data block i (1≤i≤n) are sent to the servers {server1,server2,...,server n At the same time, the large hash value h of the file data is sent to all edge servers through a secure channel, and then sent to the end user who needs to download the service file data through the edge servers. In this way, the n partial hash values ​​generated by this first large hash value split constitute the second-level child nodes of the homomorphic hash tree, and the values ​​of the second-level nodes of the homomorphic hash tree are stored by n edge servers.

[0054] When the edge server i(1≤i≤n) After obtaining the hash value of a certain block of the file data issued by the cloud platform, the block data and number signature information, and the large hash value of the file data, the message is broadcast to the terminal users in its service area, and some file data information is provided to the terminal users for download. However, considering that some terminal users in the area still have limited network carrying capacity during the download process, such as download timeout, interruption and other problems, the edge server still needs to further process some file data.

[0055] The edge server immediately requests the cloud platform to split the file data blocks again. After the cloud platform agrees to the request, the edge server uses the file data block algorithm to split the file data again. The number of blocks is t, and the multiplication cycle group G1 is used to obtain the generator g1, create a local secure additive hash homomorphic function, and use the homomorphic hash function to calculate and record the hash values ​​of the secondary block file data {h i-1 ,h i-2 ,...,h i-t}, and also use the RSA signature mechanism to sign the block number to generate a signature pair {(number n-1 ,s n-1 ),(number n-2 ,s n-2 ),...,(number n-t ,s n-t )}.

[0056] Finally, t copies of secondary block file data and secondary block file data hash values ​​are generated, and some hash values ​​of the secondary block files are placed on the third-level nodes of the homomorphic hash tree. Finally, a data storage structure of a homomorphic hash tree with a height of 3 is generated by splitting the original file's large hash value twice.

[0057] S3 user cooperative sharing: If the end user User needs to obtain other partial hash values ​​and other block file contents, it broadcasts the data request to the surrounding area. Within its communication range, there are w end user nodes with matching data in their local cache and respond. The end user User is requested to use the shared data of other end users and use these nodes as cooperative nodes for this transmission. Each node is only responsible for transmitting the hash value, numbered signature value and partial block data of the block file data that meets the requirements. After the transmission is completed, the end user is requested to provide corresponding evaluation feedback data based on the actual situation. The end user User cooperates with other end users to collect data until all the block data that meets the target file data is collected.

[0058] S4 Data Consistency Verification: Signature Authentication. When the end user User completes the collection of all file data blocks, the end user first needs to verify the numbered signature values ​​of all block file data. The end user uses the public key pair {(N,e),(N1,e1),...,(N n ,e n )} Verify the signature value and verify the accuracy of all numbers. (N,s) =True correctness.

[0059] Data consistency verification. After the end user has verified that all file data block numbers and signatures are correct, they must verify whether the data has been tampered with during transmission. End-user calculation:

[0060] Case 1: If the file data is hashed only once, calculate:

[0061]

[0062] Verify that the above equation is true. If it is true, the data has not been tampered with and can be used directly. If it is not true, you need to download and collect it again.

[0063] Case 2: Part of the file data is hashed twice. If h1 is hashed twice, then the calculation is:

[0064]

[0065] in, Verify that the above equation is true. If it is true, the data has not been tampered with and can be used directly. If it is not true, you need to download and collect it again.

[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.

Claims

1. A file distributed storage and sharing method based on homomorphic hash tree, characterized by: The following steps are involved: S1: When the cloud platform wants to share the data file M with users in the system, it first initializes the system; S2: Constructing a homomorphic hash tree; the construction of the homomorphic hash tree specifically includes the following steps: S21: The cloud platform uses the generated additive homomorphic hash function to hash the M rows of the data file and generate a corresponding large hash value h; S22: The platform splits the data file M into n file data blocks {m1,m2,...,m n }; Then, these n blocks are numbered sequentially, and these n numbers are signed, and the generated signature value and number are used as the header of each block; S23: The cloud platform performs batch hash operations on n data blocks to generate n partial hash values ​​{h1,h2,...,h n }, these n partial hash values ​​correspond to n sequential file data blocks {m1,m2,...,m n }; S24: The cloud platform backs up all partial hash values ​​and file blocks, and saves the hash value of the block data h i (1≤i≤n), file data block content m i (1≤i≤n), and the numbered signature value s of the file data block i (1≤i≤n) are sent to the servers {server1,server2,...,server n }, and at the same time, send the large hash value h of the file data through a secure channel to all edge servers, and then send it to the terminal users who need to download the service file data through the edge servers; S25: When the edge server i (1≤i≤n) After obtaining the hash value of a certain block of the file data issued by the cloud platform, the block data and number signature information, and the file data hash value, it broadcasts the message to the terminal users in its service area and provides the terminal users with some file data information for download; S26: The edge server immediately requests the cloud platform to split the file data blocks again. After the cloud platform agrees to the request, the edge server uses the file data block algorithm to split the file data again. The number of blocks is t, and the multiplication cycle group G1 is used to obtain the generator g1, and a local secure additive hash homomorphic function is created. The homomorphic hash function is used to calculate and record the hash values ​​of the secondary block file data {h i-1 ,h i-2 ,...,h i-t }, and also use the RSA signature mechanism to sign the block number to generate a signature pair {(number n-1 ,s n-1 ),(number n-2 ,s n-2 ),...,(number n-t ,s n-t )}; S27: Finally, t copies of secondary block file data and secondary block file data hash values ​​are generated, and partial hash values ​​of the secondary block files are placed on the third-level nodes of the homomorphic hash tree. Finally, a data storage structure of a homomorphic hash tree with a height of 3 is generated by splitting the original file's large hash value twice. S3: user collaborative sharing; S4: Data consistency verification.

2. The file distributed storage and sharing method based on homomorphic hash tree according to claim 1 is characterized in that: The system initialization described in step S1 specifically includes: S11: The cloud platform executes the key and system parameter generation algorithm KeyGen(1 k ), taking the security parameter k as input, let G1 represent the multiplication cyclic group of prime order p, the cloud platform randomly selects the generator g of G1, and generates a secure additive homomorphic hash function H(m)=g m modp, and make the large prime number p public; S12: The cloud platform randomly selects two prime numbers p * =2p'+1 and q * =2q'+1, and satisfies p * and q * Both are large prime numbers, calculate N = p * q * and Randomly select an integer satisfy And calculate the integer d that satisfies Publish its public key (N,e) and securely destroy p * ,q * and And keep d as its private key.

3. The file distributed storage and sharing method based on homomorphic hash tree according to claim 1 is characterized in that: In step S22, the cloud platform uses the private key d to sign the numbers of the n file data blocks based on the RSA signature system, and generates a signature pair {(number1,s1),(number2,s2),...,(number n ,s n )}, when the end user receives these signed file data blocks at the receiving end, he uses the corresponding public key to verify the validity of the signature and accurately reassemble the original file data based on the number and signature value.

4. The file distributed storage and sharing method based on homomorphic hash tree according to claim 1 is characterized in that: The user collaborative sharing described in step S3 specifically includes: If the end user User needs to obtain other partial hash values ​​and other block file contents, it broadcasts the data request to the surrounding nodes. Within its communication range, there are w end user nodes with matching data in their local cache and respond. The end user User is requested to use these nodes as cooperative nodes for this transmission based on the shared data of other end users. Each node is only responsible for transmitting the hash value, numbered signature value and part of the block data of the block file data that meets the requirements. After the transmission is completed, the end user is requested to provide corresponding evaluation feedback data based on the actual situation; The end user User cooperates with other end users to collect data until all data blocks that meet the target file data are collected.

5. The file distributed storage and sharing method based on homomorphic hash tree according to claim 1 is characterized in that: The data consistency verification in step S4 specifically includes: First, perform signature authentication: When the end user User completes the collection of all file data blocks, the end user first verifies the numbered signature values ​​of all block file data. The end user uses the public key pair {(N,e),(N1,e1),...,(N n ,e n )} Verify the signature value and verify the accuracy of all numbers, that is, verify (N,s) =True correctness; After the end user verifies that all the file data block numbers and signatures are correct, they verify whether the data has been tampered with during transmission. The end user calculates: Case 1: If the file data is hashed only once, calculate: Verify whether the above equation is true. If so, it proves that the data has not been tampered with and can be used directly. If not, it needs to be downloaded and collected again. Case 2: Part of the file data is hashed twice. If h1 is hashed twice, then the calculation is: in, Verify whether the above equation is true; if it is true, it proves that the data has not been tampered with and can be used directly; if the equation is not true, it needs to be downloaded and collected again.

Citation Information

Patent Citations

  • Intelligent Internet of Vehicles credible data encryption method and system based on block chain

    CN110830235A