Electronic file secure storage method and system based on block chain

By dynamically updating the subkey set and optimizing node selection, the problem of inefficiency in blockchain electronic archive storage is solved, achieving flexible encryption and efficient secure storage.

CN120822236AActive Publication Date: 2025-10-21JIANGSU ELECTRIC POWER INFORMATION TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511335037.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-10-21
Estimated Expiration
2045-09-18

AI Technical Summary

Technical Problem

Existing blockchain applications for secure storage of electronic records suffer from problems such as fixed block size mismatch with varying data volumes, lack of scientific mechanisms for node selection, static encryption mechanisms, and simplistic key management methods, resulting in low storage efficiency and insufficient security.

Method used

An initial key is generated through a key generation algorithm, and subkey sets are obtained by segmentation. The subkey sets are dynamically updated according to the target block size. Encryption is performed by combining Toffoli gate transformation and XOR operation. The optimal node is selected for data upload using an nk clustering tree to ensure the uniqueness and stability of the hash value.

Benefits of technology

This approach establishes a link between block size and subkey information, enhancing the flexibility and security of encryption, improving the storage efficiency and security of electronic archives, and reducing trust costs and attack risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822236A_ABST
    Figure CN120822236A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic file secure storage method and system based on a block chain, and relates to the technical field of secure storage. Generating an initial key through a key generation algorithm, and segmenting the initial key through a preset length to obtain a sub-key set; determining the size of a target block according to the sub-key set; dynamically updating the sub-key set according to the size of the target block to obtain a target sub-key set; acquiring electronic archive data, and encrypting the electronic archive data according to the target sub-key set to obtain a sub-ciphertext data set; calculating a hash value of each piece of sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash uploading value set; and performing block uplink storage on the sub-hash upload value set through a preset algorithm. The size of the target block is determined through the sub-key set, and then the sub-key set is dynamically updated according to the size of the target block, so that the encryption flexibility and security are enhanced, and the security storage efficiency of electronic archives is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of secure storage technology, and specifically relates to a blockchain-based electronic archive secure storage method and system. Background Art

[0002] In the paperless construction of electronic accounting data, data security is improved by synchronizing and storing complete sets of "tickets, bills, and certificates" accounting data on the blockchain. While archiving, the data of each invoice, business document, and accounting voucher is synchronously sent to the blockchain for storage and regularly compared with the archive system to detect any tampering in a timely manner. However, existing blockchain applications have obvious shortcomings. The fixed size of blockchain blocks does not match the large difference in the amount of data in electronic archives, resulting in storage fragmentation or redundancy; the node selection lacks a scientific mechanism and does not take into account differences in communication delays, computing resources, etc., resulting in low reading and writing efficiency; the encryption mechanism is static and difficult to deal with complex attacks, and the key management method is simple and lacks security, making the secure storage of electronic archives inefficient.

[0003] Patent CN112329029A discloses a method and system for secure storage of electronic archive files based on blockchain, including a smart contract, a production node, an off-site backup node and a synchronization node. The smart contract performs a hash algorithm calculation on the electronic archive file package, extracts the archive metadata and submits it to the production node; after receiving the archive metadata and archive file package, the production node performs data verification and assembles it into a new block, and then broadcasts the new block within the alliance chain and synchronizes it to the off-site backup node and synchronization node; the off-site backup node synchronizes the new block data, verifies and confirms that the new block is added to the blockchain; the synchronization node verifies the archive metadata and archive files in the received new block and saves them; the synchronization node stores the archive metadata and archive files off-chain and opens a service interface. However, the efficiency of this solution in secure storage of electronic archives is still low. Summary of the Invention

[0004] The purpose of the present invention is to solve the problem of low efficiency in the secure storage of electronic files and to propose a blockchain-based method and system for secure storage of electronic files.

[0005] In a first aspect of the present invention, a blockchain-based electronic archive secure storage method is proposed, the method comprising: Generate an initial key using a key generation algorithm, and segment the initial key into segments of a preset length to obtain a subkey set; determining a target block size based on the subkey set; Dynamically updating the subkey set according to the target block size to obtain a target subkey set; Acquiring electronic archive data, and encrypting the electronic archive data according to the target subkey set to obtain a sub-ciphertext data set; Calculating the hash value of each sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash upload value set; The sub-hash upload value set is stored on the block chain through a preset algorithm.

[0006] Optionally, determining the target block size according to the subkey set includes: Performing a complement operation on each subkey in the subkey set to obtain a complement subkey set; Selecting the complementary subkeys in the complementary subkey set through a preset window to obtain a first complementary subkey group and a second complementary subkey group; performing an exclusive OR operation on the first complement subkey group and the second complement subkey group respectively to obtain a first block parameter value and a second block parameter value; performing an XOR operation on the first block parameter value and the second block parameter value to obtain a third block parameter value; Substituting the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula to obtain a target block size.

[0007] Optionally, dynamically updating the subkey set according to the target block size to obtain a target subkey set includes: Determining whether the subkey size in the subkey set is the same as the target block size; If they are not the same, the subkeys in the subkey set are spliced ​​according to the first block parameter value, the second block parameter value and the third block parameter value so that the size of the subkeys in the subkey set is the same as the target block size to obtain a target subkey set.

[0008] Optionally, encrypting the electronic archive data according to the target subkey set to obtain a sub-ciphertext data set includes: Segmenting the electronic archive data according to the target block size to obtain sub-electronic archive data sets; Determine the key of the target sub-electronic archive according to the target sub-key set to obtain the target sub-key; the target sub-electronic archive is any one of the sub-electronic archive data sets; Dynamically arranging the target electronic sub-file to obtain a first modified sub-block; Performing a Toffoli gate transformation on the first modified sub-block to obtain a second modified sub-block; An exclusive OR operation is performed on the second modification sub-block and the target sub-key to obtain target sub-ciphertext data, and a sub-ciphertext data set is obtained based on the target sub-ciphertext data of all sub-electronic archive data.

[0009] Optionally, storing the sub-hash upload value set on a block chain using a preset algorithm includes: Construct an upload data packet using the current timestamp, sender information, data checksum, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value set; The optimal node is obtained by calculating the priority of nodes in the blockchain network through the nk clustering tree generation algorithm; the priority calculation is determined by the communication time between nodes, CPU resources and available memory; Upload the upload data packet to the optimal node.

[0010] In a second aspect of the present invention, a blockchain-based electronic archive security storage system is proposed, comprising: A key segmentation module is used to generate an initial key using a key generation algorithm, and to segment the initial key into subkey sets according to preset lengths; a target block size determination module, configured to determine a target block size according to the subkey set; a target subkey set determining module, configured to dynamically update the subkey set according to the target block size to obtain a target subkey set; a sub-ciphertext data set determining module, configured to obtain electronic archive data and encrypt the electronic archive data according to the target sub-key set to obtain a sub-ciphertext data set; a sub-hash upload value set determination module, configured to calculate a hash value of each sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash upload value set; The hash upload value set chain module is used to store the sub-hash upload value set on the chain through a preset algorithm.

[0011] Optionally, the target block size determination module includes: a complement operation module, configured to perform a complement operation on each subkey in the subkey set to obtain a complement subkey set; a complement subkey group determination module, configured to select the complement subkeys in the complement subkey set through a preset window to obtain a first complement subkey group and a second complement subkey group; a first XOR operation module, configured to perform an XOR operation on the first complement subkey group and the second complement subkey group to obtain a first block parameter value and a second block parameter value; A second XOR operation module, configured to perform an XOR operation on the first block parameter value and the second block parameter value to obtain a third block parameter value; The target block size calculation module is configured to substitute the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula to obtain a target block size.

[0012] Optionally, the target subkey set determination module includes: A size determination module, configured to determine whether the subkey size in the subkey set is the same as the target block size; The subkey splicing module is used to splice the subkeys in the subkey set according to the first block parameter value, the second block parameter value and the third block parameter value if they are not the same, so that the size of the subkeys in the subkey set is the same as the target block size to obtain a target subkey set.

[0013] Optionally, the sub-ciphertext data set determination module includes: a sub-electronic archive data set determining module, configured to segment the electronic archive data according to the target block size to obtain sub-electronic archive data sets; a target subkey determination module, configured to determine the key of a target sub-electronic archive according to the target subkey set to obtain a target subkey; the target sub-electronic archive is any one of the sub-electronic archive data sets; A first modified sub-block determining module, configured to dynamically arrange the target electronic sub-profile to obtain a first modified sub-block; a second modified sub-block determining module, configured to perform a Toffoli gate transform on the first modified sub-block to obtain a second modified sub-block; The target sub-ciphertext data determination module is used to perform an XOR operation on the second modification sub-block and the target sub-key to obtain target sub-ciphertext data, and obtain a sub-ciphertext data set based on the target sub-ciphertext data of all sub-electronic archive data.

[0014] Optionally, the hash upload value set chain module includes: An upload data packet construction module is used to construct an upload data packet using a current timestamp, sender information, a data check code, and a target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value set; The optimal node determination module is used to calculate the priority of nodes in the blockchain network using the nk clustering tree generation algorithm to obtain the optimal node; the priority calculation is determined by the communication time between nodes, CPU resources and available memory; The data packet uploading module is used to upload the uploaded data packet to the optimal node.

[0015] Beneficial effects of the present invention: The present invention proposes a blockchain-based electronic archive security storage method, which determines the target block size through a subkey set, and then dynamically updates the subkey set according to the target block size to obtain a target subkey set, so that the block size is associated with the subkey information. This changes the situation of the fixed block size of traditional blockchain, can better adapt to the difference in the amount of electronic archive data, and allows the key to adapt to the block size, thereby enhancing the flexibility and security of encryption and improving the efficiency of electronic archive security storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The present invention will be further described below with reference to the accompanying drawings.

[0017] Figure 1 A flowchart of a blockchain-based electronic archive security storage method provided by an embodiment of the present invention; Figure 2 A framework diagram of a blockchain-based electronic archive security storage system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0019] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.

[0020] The embodiment of the present invention provides a method for secure storage of electronic files based on blockchain. Figure 1 , Figure 1 A flowchart of a blockchain-based electronic archive security storage method provided in an embodiment of the present invention. The method includes the following steps: S101, generating an initial key using a key generation algorithm, and segmenting the initial key into segments of a preset length to obtain a subkey set; S102, determining a target block size according to the subkey set; S103, dynamically updating the subkey set according to the target block size to obtain a target subkey set; S104, obtaining electronic archive data, and encrypting the electronic archive data according to the target subkey set to obtain a sub-ciphertext data set; S105, calculating the hash value of each sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash upload value set; S106: The sub-hash uploaded value set is stored on the block chain using a preset algorithm.

[0021] According to an embodiment of the present invention, a blockchain-based electronic archive secure storage method is provided. The target block size is determined by a subkey set, and the subkey set is dynamically updated according to the target block size to obtain a target subkey set. The block size is associated with the subkey information, which changes the fixed block size of traditional blockchains. It can better adapt to the differences in the amount of electronic archive data and allows the key to adapt to the block size, thereby enhancing the flexibility and security of encryption and improving the efficiency of secure storage of electronic archives.

[0022] In one implementation, the initial key is segmented to generate a set of subkeys, which are then dynamically updated based on the target block size. This reduces the risk of a complete compromise of the entire key if a single subkey is compromised. Even if some subkeys are compromised, it is difficult for an attacker to obtain the complete key or reverse engineer the original algorithm, significantly increasing the encryption system's resistance to attack.

[0023] In one implementation, the hash value of the sub-ciphertext is stored on-chain. The blockchain's immutability ensures the uniqueness and stability of the hash value. Subsequent verification simply requires recalculating the sub-ciphertext's hash value and comparing it with the on-chain record to quickly determine if the data has been tampered with, eliminating the need for third-party organizations and reducing trust costs.

[0024] In one implementation, the initial key and electronic file are segmented, which can achieve parallel encryption and parallel upload, avoiding the performance bottleneck when encrypting a single large file; the target block size is dynamically determined based on the sub-key set, and the segmentation granularity can be adjusted according to the data type or storage requirements of the electronic file, taking into account both encryption security and processing efficiency.

[0025] In one embodiment, determining the target block size based on the subkey set includes: Performing a complement operation on each subkey in the subkey set to obtain a complement subkey set; Selecting the complementary subkeys in the complementary subkey set through a preset window to obtain a first complementary subkey group and a second complementary subkey group; Performing an exclusive OR operation on the first complement subkey group and the second complement subkey group respectively to obtain a first block parameter value and a second block parameter value; Performing an XOR operation on the first block parameter value and the second block parameter value to obtain a third block parameter value; Substituting the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula to obtain a target block size.

[0026] In one implementation, a two's complement operation (such as bitwise inversion) is performed on each subkey, mapping the original key space into a complementary space, significantly changing the key's statistical properties. Even if an attacker obtains part of the subkey, the two's complement operation can effectively mask the original key distribution, making cryptanalysis more difficult.

[0027] In one implementation, the complement subkeys are grouped within a preset window and XORed multiple times, making the final parameter value (the parameter values ​​for the first, second, and third blocks) depend on the contributions of multiple subkeys. This many-to-one mapping further diffuses the influence of the key and reduces the risk of a single subkey leak. The grouped XOR and multi-layer parameter transfer mechanism effectively disperses the differential characteristics of the subkeys, making it difficult for attackers to infer the key structure by analyzing input and output differences. When the subkey set is dynamically updated, the target block size automatically adjusts accordingly, allowing continuous adaptation to different security environments without manual intervention.

[0028] In one implementation, the key generation algorithm is an existing commonly used symmetric encryption algorithm; the symmetric encryption algorithm generates an initial key length of 128, then cuts half of the length to obtain an initial key (length of 64), the preset length is 16, and the initial key is split to obtain a subkey set (A1, A2, A3, A4); then a 2's complement operation is performed on the subkey set to obtain a complement subkey set (B1, B2, B3, B4); the complement subkey set is selected through a preset window (here the window is 2) to obtain a complement subkey group {[B1, B2], [B3, B4]}, and an exclusive OR operation is performed on the complement subkey group [B1, B2], [B3, B4] to obtain a first block parameter value C and a second block parameter value D; then an exclusive OR operation is performed on C and D to obtain a third block parameter value E, and C, D, and E are substituted into the formula Get the target block size Z, where mod is the modular operation.

[0029] In one embodiment, dynamically updating the subkey set according to the target block size to obtain the target subkey set includes: Determine whether the subkey size in the subkey set is the same as the target block size; If they are not the same, the subkeys in the subkey set are concatenated according to the first block parameter value, the second block parameter value and the third block parameter value so that the size of the subkeys in the subkey set is the same as the target block size to obtain the target subkey set.

[0030] In one implementation, if they are the same, no operation is performed; the subkeys in the subkey set are spliced ​​according to the first block parameter value, the second block parameter value and the third block parameter value, in sequence from the first block parameter value, the second block parameter value and the third block parameter value; the first, second and third block parameter values ​​are used to guide the subkey splicing, so that the final key not only depends on the original subkey set, but also incorporates the dynamic parameters in the block calculation process; the attacker cannot crack the encryption only by pre-calculating the subkey set, and must master the block parameter generation algorithm and the splicing rules at the same time, which greatly increases the cost of the attack.

[0031] In one embodiment, encrypting the electronic archive data according to the target sub-key set to obtain a sub-ciphertext data set includes: The electronic archive data is segmented according to the target block size to obtain sub-electronic archive data sets; Determine the key of the target sub-electronic archive according to the target sub-key set to obtain the target sub-key; the target sub-electronic archive is any one in the sub-electronic archive data set; Dynamically arranging the target electronic sub-file to obtain a first modified sub-block; Performing a Toffoli gate transformation on the first modified sub-block to obtain a second modified sub-block; An XOR operation is performed on the second modified sub-block and the target sub-key to obtain target sub-ciphertext data, and a sub-ciphertext data set is obtained based on the target sub-ciphertext data of all sub-electronic file data.

[0032] In one implementation, the target sub-electronic archives are dynamically arranged to break the inherent structure and statistical characteristics of the original data. Even if an attacker obtains part of the ciphertext, it is difficult to reversely deduce the original content by analyzing the data patterns. The Toffoli gate, as a reversible logic gate, can perform complex nonlinear transformations on data. Its output depends on the states of multiple input bits at the same time, and the transformation process is irreversible, effectively resisting traditional attack methods such as linear cryptanalysis and differential cryptanalysis. The electronic archive data will be converted into binary form.

[0033] In one implementation, if there is insufficient sub-electronic archive data in the sub-electronic archive data set obtained by segmentation, it is supplemented from the beginning using the initial key; the key of the target sub-electronic archive is determined according to the target sub-key set to obtain the target sub-key, specifically for the target sub-key set, a corresponding key is assigned to each sub-electronic archive.

[0034] In one implementation, the dynamic permutation processing is as follows: the target sub-electronic file is based on the first 8 bits of the target sub-key and the first 8 bits of the first block parameter value, the number of rotations is calculated, and then the target sub-electronic file is shifted according to the calculated number of rotations to obtain the shifted target sub-electronic file; the target sub-electronic file is XORed with the target sub-electronic file to obtain the first modified sub-block.

[0035] In one embodiment, storing the sub-hash upload value set on-chain using a preset algorithm includes: Construct an upload data packet using the current timestamp, sender information, data checksum, and target sub-hash upload value; the target sub-hash upload value is any one in the sub-hash upload value set; The optimal node is obtained by calculating the priority of nodes in the blockchain network through the nk clustering tree generation algorithm; the priority calculation is determined by the communication time between nodes, CPU resources and available memory; Upload the upload data packet to the optimal node.

[0036] In one implementation, the uploaded data packet integrates the timestamp, sender information, data check code and target sub-hash value. The sender information locates the operating subject, the data check code verifies whether the data packet transmission process is complete, and the target sub-hash value is associated with the original encrypted data. During subsequent audits, the data packet can be used to quickly trace the data source, generation time and operating subject.

[0037] In one implementation, the NK clustering tree generation algorithm calculates priority through the node's communication time, CPU resources, and available memory, giving priority to nodes with low latency, high computing power, and sufficient memory. The selection logic avoids uploading data to nodes with insufficient performance, reducing problems such as data packet retransmission and timeouts. Especially when the blockchain network nodes are unevenly loaded, it can significantly shorten the response time for data on the chain.

[0038] In one implementation, each uploaded data packet corresponds to a single sub-hash value in the sub-hash upload value set. Combined with the optimal node selection, multiple data packets can be uploaded in parallel (different sub-hash values ​​correspond to different optimal nodes). For electronic archives containing a large number of sub-hash values, this parallel processing can greatly improve the overall chain efficiency and avoid delays caused by blocking of a single data packet.

[0039] Based on the same inventive concept, the present invention also provides a blockchain-based electronic archive security storage system. Figure 2 , Figure 2 A framework diagram of a blockchain-based electronic archive security storage system provided in an embodiment of the present invention includes: A key segmentation module is used to generate an initial key using a key generation algorithm and segment the initial key by a preset length to obtain a subkey set; A target block size determination module, configured to determine a target block size based on a subkey set; A target subkey set determination module is used to dynamically update the subkey set according to the target block size to obtain the target subkey set; A sub-ciphertext data set determination module is used to obtain electronic archive data and encrypt the electronic archive data according to the target sub-key set to obtain a sub-ciphertext data set; A sub-hash upload value set determination module is used to calculate the hash value of each sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash upload value set; The hash upload value set chain module is used to store the sub-hash upload value set on the chain through a preset algorithm.

[0040] According to an embodiment of the present invention, a blockchain-based electronic archive secure storage system is provided. The target block size is determined by a subkey set, and the subkey set is dynamically updated according to the target block size to obtain a target subkey set. The block size is associated with the subkey information, which changes the fixed block size of traditional blockchains. It can better adapt to differences in the amount of electronic archive data and allows keys to adapt to the block size, thereby enhancing the flexibility and security of encryption and improving the efficiency of electronic archive secure storage.

[0041] In one embodiment, the target block size determination module includes: A complement operation module, used for performing a complement operation on each subkey in the subkey set to obtain a complement subkey set; a complement subkey group determination module, configured to select the complement subkeys in the complement subkey set through a preset window to obtain a first complement subkey group and a second complement subkey group; A first XOR operation module is used to perform an XOR operation on the first complement subkey group and the second complement subkey group to obtain a first block parameter value and a second block parameter value; A second XOR operation module, configured to perform an XOR operation on the first block parameter value and the second block parameter value to obtain a third block parameter value; The target block size calculation module is used to substitute the first block parameter value, the second block parameter value and the third block parameter value into a preset block calculation formula to obtain a target block size.

[0042] In one embodiment, the target subkey set determination module includes: A size determination module, used to determine whether the subkey size in the subkey set is the same as the target block size; The subkey splicing module is used to splice the subkeys in the subkey set according to the first block parameter value, the second block parameter value and the third block parameter value if they are not the same, so that the size of the subkeys in the subkey set is the same as the target block size to obtain the target subkey set.

[0043] In one embodiment, the sub-ciphertext data set determination module includes: A sub-electronic archive data set determination module is used to segment the electronic archive data according to the target block size to obtain sub-electronic archive data sets; A target subkey determination module is used to determine the key of a target sub-electronic archive according to the target subkey set to obtain a target subkey; the target sub-electronic archive is any one of the sub-electronic archive data sets; A first modified sub-block determining module is configured to dynamically arrange the target electronic sub-file to obtain a first modified sub-block; A second modified sub-block determining module, configured to perform a Toffoli gate transformation on the first modified sub-block to obtain a second modified sub-block; The target sub-ciphertext data determination module is used to perform an XOR operation on the second modification sub-block and the target sub-key to obtain the target sub-ciphertext data, and obtain the sub-ciphertext data set based on the target sub-ciphertext data of all sub-electronic file data.

[0044] In one embodiment, the hash upload value set chain module includes: The upload data packet construction module is used to construct the upload data packet through the current timestamp, sender information, data check code and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value set; The optimal node determination module is used to calculate the priority of nodes in the blockchain network using the nk clustering tree generation algorithm to obtain the optimal node; the priority calculation is determined by the communication time between nodes, CPU resources and available memory; The data packet upload module is used to upload the upload data packet to the optimal node.

[0045] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

Claims

1. A blockchain-based electronic archive security storage method, characterized in that: The method comprises: Generate an initial key using a key generation algorithm, and segment the initial key into segments of a preset length to obtain a subkey set; determining a target block size based on the subkey set; Dynamically updating the subkey set according to the target block size to obtain a target subkey set; Acquiring electronic archive data, and encrypting the electronic archive data according to the target subkey set to obtain a sub-ciphertext data set; Calculating the hash value of each sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash upload value set; The sub-hash upload value set is stored on the block chain through a preset algorithm.

2. A blockchain-based electronic archive security storage method according to claim 1, characterized in that: Determining the target block size according to the subkey set includes: Performing a complement operation on each subkey in the subkey set to obtain a complement subkey set; Selecting the complementary subkeys in the complementary subkey set through a preset window to obtain a first complementary subkey group and a second complementary subkey group; performing an exclusive OR operation on the first complement subkey group and the second complement subkey group respectively to obtain a first block parameter value and a second block parameter value; performing an XOR operation on the first block parameter value and the second block parameter value to obtain a third block parameter value; Substituting the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula to obtain a target block size.

3. A blockchain-based electronic archive security storage method according to claim 2, characterized in that: Dynamically updating the subkey set according to the target block size to obtain a target subkey set includes: Determining whether the subkey size in the subkey set is the same as the target block size; If they are not the same, the subkeys in the subkey set are spliced ​​according to the first block parameter value, the second block parameter value and the third block parameter value so that the size of the subkeys in the subkey set is the same as the target block size to obtain a target subkey set.

4. The method for secure storage of electronic archives based on blockchain according to claim 1, characterized in that: Encrypting the electronic archive data according to the target sub-key set to obtain a sub-ciphertext data set includes: Segmenting the electronic archive data according to the target block size to obtain sub-electronic archive data sets; Determine the key of the target sub-electronic archive according to the target sub-key set to obtain the target sub-key; the target sub-electronic archive is any one of the sub-electronic archive data sets; Dynamically arranging the target electronic sub-file to obtain a first modified sub-block; Performing a Toffoli gate transformation on the first modified sub-block to obtain a second modified sub-block; An exclusive OR operation is performed on the second modification sub-block and the target sub-key to obtain target sub-ciphertext data, and a sub-ciphertext data set is obtained based on the target sub-ciphertext data of all sub-electronic archive data.

5. The method for secure storage of electronic archives based on blockchain according to claim 1, characterized in that: Storing the sub-hash upload value set on the blockchain using a preset algorithm includes: Construct an upload data packet using the current timestamp, sender information, data checksum, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value set; The optimal node is obtained by calculating the priority of nodes in the blockchain network through the nk clustering tree generation algorithm; the priority calculation is determined by the communication time between nodes, CPU resources and available memory; Upload the upload data packet to the optimal node.

6. A blockchain-based electronic archive security storage system, characterized by: The system comprises: A key segmentation module is used to generate an initial key using a key generation algorithm, and to segment the initial key into subkey sets according to preset lengths; a target block size determination module, configured to determine a target block size according to the subkey set; a target subkey set determining module, configured to dynamically update the subkey set according to the target block size to obtain a target subkey set; a sub-ciphertext data set determining module, configured to obtain electronic archive data and encrypt the electronic archive data according to the target sub-key set to obtain a sub-ciphertext data set; a sub-hash upload value set determination module, configured to calculate a hash value of each sub-ciphertext data in the sub-ciphertext data set to obtain a sub-hash upload value set; The hash upload value set chain module is used to store the sub-hash upload value set on the chain through a preset algorithm.

7. The blockchain-based electronic archive security storage system according to claim 6 is characterized in that: The target block size determination module includes: a complement operation module, configured to perform a complement operation on each subkey in the subkey set to obtain a complement subkey set; a complement subkey group determination module, configured to select the complement subkeys in the complement subkey set through a preset window to obtain a first complement subkey group and a second complement subkey group; a first XOR operation module, configured to perform an XOR operation on the first complement subkey group and the second complement subkey group to obtain a first block parameter value and a second block parameter value; A second XOR operation module, configured to perform an XOR operation on the first block parameter value and the second block parameter value to obtain a third block parameter value; The target block size calculation module is configured to substitute the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula to obtain a target block size.

8. The blockchain-based electronic archive security storage system according to claim 7 is characterized in that: The target subkey set determination module includes: A size determination module, configured to determine whether the subkey size in the subkey set is the same as the target block size; The subkey splicing module is used to splice the subkeys in the subkey set according to the first block parameter value, the second block parameter value and the third block parameter value if they are not the same, so that the size of the subkeys in the subkey set is the same as the target block size to obtain a target subkey set.

9. The blockchain-based electronic archive security storage system according to claim 6 is characterized in that: The sub-ciphertext data set determination module includes: a sub-electronic archive data set determining module, configured to segment the electronic archive data according to the target block size to obtain sub-electronic archive data sets; a target subkey determination module, configured to determine the key of a target sub-electronic archive according to the target subkey set to obtain a target subkey; the target sub-electronic archive is any one of the sub-electronic archive data sets; A first modified sub-block determining module, configured to dynamically arrange the target electronic sub-profile to obtain a first modified sub-block; a second modified sub-block determining module, configured to perform a Toffoli gate transform on the first modified sub-block to obtain a second modified sub-block; The target sub-ciphertext data determination module is used to perform an XOR operation on the second modification sub-block and the target sub-key to obtain target sub-ciphertext data, and obtain a sub-ciphertext data set based on the target sub-ciphertext data of all sub-electronic archive data.

10. The blockchain-based electronic archive security storage system according to claim 6, characterized in that: The hash upload value set chain module includes: An upload data packet construction module is used to construct an upload data packet using a current timestamp, sender information, a data check code, and a target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value set; The optimal node determination module is used to calculate the priority of nodes in the blockchain network using the nk clustering tree generation algorithm to obtain the optimal node; the priority calculation is determined by the communication time between nodes, CPU resources and available memory; The data packet uploading module is used to upload the uploaded data packet to the optimal node.

Citation Information

Patent Citations

  • Method and system for safely storing electronic archive files based on block chain

    CN112329029A

  • Block chain-based achievement archive management method

    CN118171306A

  • Block chain key generation method and device, equipment, medium and product

    CN118316601A

  • Intelligent archive storage method and system based on block chain

    CN118394991A

  • Data hierarchical dynamic storage method and system based on block chain

    CN119088783A