Blockchain-based electronic archive security storage method and system

By dynamically updating the subkey set and optimizing node selection, the blockchain storage method solves the problems of low storage efficiency and insufficient security in blockchain electronic archive storage, achieving more efficient electronic archive storage and encryption, and enhancing security and flexibility.

CN120822236BActive Publication Date: 2025-11-18JIANGSU ELECTRIC POWER INFORMATION TECH
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing blockchain applications in electronic archive storage 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 nk clustering tree generation algorithm is used to select the optimal node for data upload, thereby achieving dynamic adaptation to block size and encryption flexibility.

Benefits of technology

It improves the efficiency and security of secure electronic record storage, enhances the flexibility and resistance to attacks of encryption, reduces trust costs, and adapts to the needs of different security environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822236B_ABST
    Figure CN120822236B_ABST
Patent Text Reader

Abstract

The application discloses a kind of electronic archive security storage method and system based on block chain, it is related to security storage technical field;Initial key is generated by key generation algorithm, and sub-key set is obtained by segmenting initial key with preset length;Target block size is determined according to sub-key set;Target sub-key set is obtained by dynamically updating sub-key set according to target block size;Electronic archive data is acquired, and sub-ciphertext data set is obtained by encrypting electronic archive data according to target sub-key set;The hash value of each sub-ciphertext data in sub-ciphertext data set is calculated to obtain sub-hash upload value set;Sub-hash upload value set is stored by block chain by preset algorithm.It is determined that target block size is enhanced by sub-key set, and then sub-key set is dynamically updated according to target block size, and the flexibility and security of encryption are enhanced, and electronic archive security storage efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of secure storage technology, specifically relating to a blockchain-based method and system for secure storage of electronic archives. Background Technology

[0002] In the construction of paperless electronic accounting records, data security is improved by synchronously storing complete sets of accounting documents (invoices, forms, and certificates) on the blockchain. During archiving, the data of each invoice, business document, and accounting voucher is simultaneously sent to the blockchain for storage and regularly compared with the archival system, allowing for timely detection of any tampering. However, existing blockchain applications have significant shortcomings. The fixed block size of the blockchain is incompatible with the large variations in the volume of electronic archival data, resulting in fragmented or redundant storage. The lack of a scientific mechanism for node selection, failing to consider differences in communication latency and computing resources, leads to low read / write efficiency. The static encryption mechanism is ill-equipped to withstand complex attacks, and the simple key management method lacks sufficient security, resulting in inefficient secure storage of electronic archives.

[0003] Patent CN112329029A discloses a method and system for secure storage of electronic archives based on blockchain, including a smart contract, a production node, a remote backup node, and a synchronization node. The smart contract performs hash calculations on the electronic archive file package, extracts archive metadata, and submits it to the production node. After receiving the archive metadata and the archive file package, the production node verifies the data and assembles it into a new block. Then, it broadcasts the new block within the consortium blockchain and synchronizes it to the remote backup node and the synchronization node. The remote backup node synchronizes the new block data, verifies, and confirms that the new block has been added to the blockchain. The synchronization node verifies and saves the archive metadata and archive files in the received new block. The synchronization node stores the archive metadata and archive files off-chain and provides open service interfaces. However, this solution is still inefficient in terms of secure storage of electronic archives. Summary of the Invention

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

[0005] In a first aspect of this invention, a method for secure storage of electronic archives based on blockchain is first proposed, the method comprising:

[0006] An initial key is generated using a key generation algorithm, and a subkey set is obtained by segmenting the initial key into segments of a preset length;

[0007] The target block size is determined based on the subkey set;

[0008] The target subkey set is obtained by dynamically updating the subkey set according to the target block size;

[0009] Obtain electronic archive data, and encrypt the electronic archive data according to the target subkey set to obtain a subciphertext dataset;

[0010] Calculate the hash value of each sub-ciphertext data in the sub-ciphertext dataset to obtain the sub-hash upload value set;

[0011] The sub-hash upload value set is stored on the blockchain using a preset algorithm.

[0012] Optionally, determining the target block size based on the subkey set includes:

[0013] Perform a two's complement operation on each subkey in the subkey set to obtain a two's complement subkey set;

[0014] The first and second complement key groups are obtained by selecting the complement key groups from the complement key set through a preset window.

[0015] The first block parameter value and the second block parameter value are obtained by performing an XOR operation on the first complement subkey group and the second complement subkey group respectively;

[0016] The third block parameter value is obtained by performing an XOR operation on the first block parameter value and the second block parameter value;

[0017] The target block size is obtained by substituting the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula.

[0018] Optionally, dynamically updating the subkey set according to the target block size to obtain the target subkey set includes:

[0019] Determine whether the size of the subkey in the subkey set is the same as the size of the target block;

[0020] 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 size of the target block to obtain the target subkey set.

[0021] Optionally, encrypting the electronic archive data according to the target subkey set to obtain a subciphertext dataset includes:

[0022] The electronic archive data is divided into sub-electronic archive datasets according to the target block size;

[0023] The target sub-key is obtained by determining the key of the target sub-electronic file based on the target sub-key set; the target sub-electronic file is any one of the sub-electronic file datasets;

[0024] The target sub-electronic file is dynamically arranged to obtain the first modified sub-block;

[0025] The first modified sub-block is subjected to a Toffoli gate transform to obtain the second modified sub-block;

[0026] The target sub-ciphertext data is obtained by performing an XOR operation on the second modified sub-block and the target sub-key, and the sub-ciphertext dataset is obtained based on the target sub-ciphertext data of all sub-electronic archive data.

[0027] Optionally, storing the sub-hash upload value set on the blockchain using a preset algorithm includes:

[0028] The upload data packet is constructed using the current timestamp, sender information, data verification code, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload values ​​in the set.

[0029] The optimal node is obtained by prioritizing nodes in the blockchain network using the nk clustering tree generation algorithm; the priority calculation is determined by inter-node communication time, CPU resources, and available memory.

[0030] The data packet is uploaded to the optimal node.

[0031] In a second aspect of this invention, a blockchain-based secure electronic archive storage system is proposed, comprising:

[0032] The key segmentation module is used to generate an initial key through a key generation algorithm, and to segment the initial key into subkey sets by a preset length;

[0033] The target block size determination module is used to determine the target block size based on the subkey set;

[0034] The 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;

[0035] The sub-ciphertext dataset determination module is used to acquire electronic archive data and encrypt the electronic archive data according to the target sub-key set to obtain a sub-ciphertext dataset.

[0036] The sub-hash upload value set determination module is used to calculate the hash value of each sub-ciphertext data in the sub-ciphertext dataset to obtain the sub-hash upload value set;

[0037] The hash upload value set on-chain module is used to store the sub-hash upload value set on the blockchain using a preset algorithm.

[0038] Optionally, the target block size determination module includes:

[0039] The two's complement operation module is used to perform two's complement operation on each subkey in the subkey set to obtain a two's complement subkey set;

[0040] The complement subkey group determination module is used to select the complement subkeys from the complement subkey set through a preset window to obtain the first complement subkey group and the second complement subkey group.

[0041] The first XOR operation module is used to perform XOR operations on the first complement subkey group and the second complement subkey group respectively to obtain the first block parameter value and the second block parameter value;

[0042] The second XOR operation module is used to perform an XOR operation on the first block parameter value and the second block parameter value to obtain the third block parameter value;

[0043] 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 the target block size.

[0044] Optionally, the target subkey set determination module includes:

[0045] The size determination module is used to determine whether the size of the subkey in the subkey set is the same as the target block size;

[0046] The subkey concatenation module is used to concatenate 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 size of the target block to obtain the target subkey set.

[0047] Optionally, the sub-ciphertext dataset determination module includes:

[0048] The sub-electronic archive dataset determination module is used to segment the electronic archive data according to the target block size to obtain a sub-electronic archive dataset;

[0049] The target subkey determination module is used to determine the key of the target sub-electronic file based on the target subkey set to obtain the target subkey; the target sub-electronic file is any one of the sub-electronic file datasets;

[0050] The first modification sub-block determination module is used to dynamically arrange the target sub-electronic file to obtain the first modification sub-block;

[0051] The second modified sub-block determination module is used to perform a Toffoli gate transformation on the first modified sub-block to obtain the second modified sub-block.

[0052] The target sub-ciphertext data determination module is used to perform an XOR operation on the second modified sub-block and the target sub-key to obtain the target sub-ciphertext data, and to obtain the sub-ciphertext dataset based on the target sub-ciphertext data of all sub-electronic archive data.

[0053] Optionally, the hash upload value set on-chain module includes:

[0054] The upload data packet construction module is used to construct an upload data packet using the current timestamp, sender information, data verification code, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value sets.

[0055] 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 inter-node communication time, CPU resources and available memory.

[0056] The data packet upload module is used to upload the data packet to the optimal node.

[0057] The beneficial effects of this invention are:

[0058] This invention proposes a blockchain-based secure storage method for electronic archives. 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 the target subkey set. This associates the block size with the subkey information, changing 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. Attached Figure Description

[0059] The invention will now be further described with reference to the accompanying drawings.

[0060] Figure 1 A flowchart illustrating a blockchain-based secure storage method for electronic archives, provided as an embodiment of the present invention.

[0061] Figure 2 This is a framework diagram of a blockchain-based secure electronic archive storage system provided for an embodiment of the present invention. Detailed Implementation

[0062] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0063] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] This invention provides a blockchain-based method for secure storage of electronic records. See also... Figure 1 , Figure 1 A flowchart illustrating a blockchain-based secure storage method for electronic records, provided as an embodiment of the present invention. The method includes the following steps:

[0065] S101, an initial key is generated through a key generation algorithm, and a subkey set is obtained by segmenting the initial key into segments of a preset length;

[0066] S102, Determine the target block size based on the subkey set;

[0067] S103, dynamically update the subkey set according to the target block size to obtain the target subkey set;

[0068] S104, Obtain electronic archive data, and encrypt the electronic archive data according to the target subkey set to obtain a subciphertext dataset;

[0069] S105, calculate the hash value of each sub-ciphertext data in the sub-ciphertext dataset to obtain the sub-hash upload value set;

[0070] S106, the sub-hash upload value set is stored on the blockchain using a preset algorithm.

[0071] The present invention provides a blockchain-based secure storage method for electronic archives. By determining the target block size through a subkey set and then dynamically updating the subkey set according to the target block size, the block size is associated with the subkey information. This changes the fixed block size of traditional blockchains, better adapts 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.

[0072] 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 avoids the risk of total leakage if a single key is compromised. Even if some subkeys are leaked, attackers will find it difficult to obtain the complete key or reverse engineer the original algorithm, significantly raising the attack resistance threshold of the encryption system.

[0073] In one implementation, the hash value of the sub-ciphertext is stored on the blockchain. The immutability of the blockchain ensures the uniqueness and stability of the hash value. During subsequent verification, it is only necessary to recalculate the hash value of the sub-ciphertext and compare it with the record on the chain to quickly determine whether the data has been tampered with, without relying on a third-party institution, thus reducing trust costs.

[0074] In one implementation, the initial key and electronic file are segmented for parallel encryption and uploading, avoiding the performance bottleneck of encrypting a single large file. The target block size is dynamically determined based on the subkey set, and the segmentation granularity can be adjusted according to the data type or storage requirements of the electronic file, balancing encryption security and processing efficiency.

[0075] In one embodiment, determining the target block size based on the subkey set includes:

[0076] Perform two's complement operations on each subkey in the subkey set to obtain the two's complement subkey set;

[0077] The first and second complement key groups are obtained by selecting the complement key groups from the complement key set through a preset window.

[0078] The first block parameter value and the second block parameter value are obtained by performing an XOR operation on the first complement subkey group and the second complement subkey group respectively;

[0079] The parameter value of the third block is obtained by performing an XOR operation on the parameter values ​​of the first block and the second block.

[0080] Substitute the parameter values ​​of the first block, the second block, and the third block into the preset block calculation formula to obtain the target block size.

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

[0082] In one implementation, the two's complement subkeys are grouped and XORed multiple times through a preset window, so that the final parameter values ​​(parameter values ​​of the first, second, and third blocks) depend on the contributions of multiple subkeys simultaneously. This many-to-one mapping relationship further diffuses the key influence and reduces the risk of leakage of a single subkey; the grouped XOR and multi-layer parameter passing mechanism effectively disperse the differential characteristics of the subkeys, making it difficult for attackers to infer the key structure by analyzing the differences between input and output; when the subkey set is dynamically updated, the target block size will be automatically adjusted accordingly, and it can continuously adapt to different security environments without manual intervention.

[0083] In one implementation, the key generation algorithm is a commonly used symmetric encryption algorithm. The symmetric encryption algorithm generates an initial key of length 128, which is then truncated to obtain an initial key of length 64. The preset length is 16. The initial key is then split to obtain a subkey set (A1, A2, A3, A4). A two's complement operation is then performed on the subkey set to obtain a two's complement subkey set (B1, B2, B3, B4). A two's complement subkey set is selected through a preset window (here, window 2) to obtain a two's complement subkey group {[B1, B2], [B3, B4]}. An XOR operation is performed on the two's complement subkey groups [B1, B2] and [B3, B4] respectively to obtain the first block parameter value C and the second block parameter value D. Then, an XOR operation is also performed on C and D to obtain the third block parameter value E. Substituting C, D, and E into the formula... The target block size Z is obtained, where mod is the modulo operation.

[0084] In one embodiment, dynamically updating the subkey set according to the target block size to obtain the target subkey set includes:

[0085] Determine whether the size of the subkey in the subkey set is the same as the target block size;

[0086] If they are not the same, the subkeys in the subkey set are concatenated according to the parameter values ​​of the first block, the second block, and the third block, so that the size of the subkeys in the subkey set is the same as the size of the target block to obtain the target subkey set.

[0087] In one implementation, no operation is performed if the values ​​are 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, respectively; the first, second, and third block parameter values ​​are used to guide the subkey concatenation, so that the final key not only depends on the original subkey set, but also incorporates the dynamic parameters in the block calculation process; attackers cannot crack the encryption by pre-compiling the subkey set alone, but must master both the block parameter generation algorithm and the concatenation rules, which greatly increases the attack cost.

[0088] In one embodiment, encrypting electronic archive data according to a target subkey set to obtain a subciphertext dataset includes:

[0089] The electronic archive data is divided into sub-electronic archive datasets based on the target block size;

[0090] The target subkey is obtained by determining the key of the target sub-electronic file based on the target subkey set; the target sub-electronic file is any one of the sub-electronic file datasets.

[0091] The first modification sub-block is obtained by dynamically arranging the target sub-electronic files.

[0092] The second modified subblock is obtained by performing a Toffoli gate transform on the first modified subblock.

[0093] The target sub-ciphertext data is obtained by performing an XOR operation on the second modified sub-block and the target sub-key. The sub-ciphertext dataset is obtained based on the target sub-ciphertext data of all sub-electronic archive data.

[0094] 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 reverse-engineer the original content by analyzing the data patterns. The Toffoli gate, as a reversible logic gate, can perform complex nonlinear transformations on the data. Its output depends on the state of multiple input bits, 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.

[0095] In one implementation, if there is insufficient sub-electronic archive data in the segmented sub-electronic archive dataset, it is supplemented from the beginning using the initial key; the target sub-electronic archive key is determined based on the target sub-key set, specifically by assigning a corresponding key to each sub-electronic archive for the target sub-key set.

[0096] In one implementation, the row dynamic arrangement process involves calculating the number of rotations of the target sub-electronic file based on the first 8 bits of the target sub-key and the first 8 bits of the first block parameter value, then shifting the target sub-electronic file according to the calculated number of rotations to obtain the shifted target sub-electronic file, and performing an XOR operation between the target sub-electronic file and the target sub-electronic file to obtain the first modified sub-block.

[0097] In one embodiment, storing the sub-hash upload value set on the blockchain using a preset algorithm includes:

[0098] The upload data packet is constructed using the current timestamp, sender information, data verification code, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload values ​​in the set.

[0099] The optimal node is obtained by prioritizing nodes in the blockchain network using the nk clustering tree generation algorithm. The priority is determined by inter-node communication time, CPU resources, and available memory.

[0100] Upload the data packet to the optimal node.

[0101] In one implementation, the uploaded data packet integrates a timestamp, sender information, data verification code, and target sub-hash value. The sender information identifies the operating entity, the data verification code verifies the integrity of the data packet transmission process, and the target sub-hash value is associated with the original encrypted data. During subsequent auditing, the data packet can be used to quickly trace the data source, generation time, and operating entity.

[0102] In one implementation, the nk clustering tree generation algorithm calculates priority based on node communication time, CPU resources, and available memory, prioritizing nodes with low latency, high computing power, and sufficient memory. This selection logic avoids uploading data to nodes with insufficient performance, reducing issues such as data packet retransmission and timeouts. Especially when the load on blockchain network nodes is uneven, it can significantly shorten the response time for data to be uploaded to the chain.

[0103] In one implementation, each uploaded data packet corresponds to a single sub-hash value in the sub-hash upload value set. Combined with the selection of the optimal node, 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 significantly improve the overall on-chain efficiency and avoid delays caused by single data packet blocking.

[0104] Based on the same inventive concept, this invention also provides a blockchain-based secure electronic archive storage system. See also Figure 2 , Figure 2 A framework diagram of a blockchain-based secure electronic archive storage system provided for embodiments of the present invention includes:

[0105] The key segmentation module is used to generate an initial key through a key generation algorithm, and to segment the initial key into subkey sets by a preset length;

[0106] The target block size determination module is used to determine the target block size based on the subkey set;

[0107] The 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;

[0108] The sub-ciphertext dataset determination module is used to acquire electronic archive data and encrypt the electronic archive data according to the target sub-key set to obtain the sub-ciphertext dataset;

[0109] The sub-hash upload value set determination module is used to calculate the hash value of each sub-ciphertext data in the sub-ciphertext dataset to obtain the sub-hash upload value set.

[0110] The hash upload value set on-chain module is used to store sub-hash upload value sets as blocks on the blockchain using a preset algorithm.

[0111] The blockchain-based secure storage system for electronic archives provided by this invention determines the target block size through a subkey set, and then dynamically updates the subkey set according to the target block size to obtain the target subkey set. This associates the block size with the subkey information, changing 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, enhancing the flexibility and security of encryption and improving the efficiency of secure storage of electronic archives.

[0112] In one embodiment, the target block size determination module includes:

[0113] The two's complement operation module is used to perform two's complement operation on each subkey in the subkey set to obtain the two's complement subkey set;

[0114] The complement subkey group determination module is used to select the complement subkeys from the complement subkey set through a preset window to obtain the first complement subkey group and the second complement subkey group.

[0115] The first XOR operation module is used to perform XOR operations on the first complement subkey group and the second complement subkey group respectively to obtain the first block parameter value and the second block parameter value;

[0116] The second XOR operation module is used to perform an XOR operation on the first block parameter value and the second block parameter value to obtain the third block parameter value;

[0117] 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 the preset block calculation formula to obtain the target block size.

[0118] In one embodiment, the target subkey set determination module includes:

[0119] The size determination module is used to determine whether the size of the subkey in the subkey set is the same as the target block size;

[0120] The subkey concatenation module is used to concatenate 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 different, so that the size of the subkeys in the subkey set is the same as the size of the target block to obtain the target subkey set.

[0121] In one embodiment, the sub-ciphertext dataset determination module includes:

[0122] The sub-electronic archive dataset determination module is used to segment electronic archive data according to the target block size to obtain sub-electronic archive datasets;

[0123] The target subkey determination module is used to determine the key of the target sub-electronic file based on the target subkey set to obtain the target subkey; the target sub-electronic file is any one of the sub-electronic file datasets;

[0124] The first modification sub-block determination module is used to dynamically arrange the target sub-electronic files to obtain the first modification sub-block.

[0125] The second modified sub-block determination module is used to perform a Toffoli gate transformation on the first modified sub-block to obtain the second modified sub-block;

[0126] The target sub-ciphertext data determination module is used to perform an XOR operation on the second modified sub-block and the target sub-key to obtain the target sub-ciphertext data, and to obtain the sub-ciphertext dataset based on the target sub-ciphertext data of all sub-electronic archive data.

[0127] In one embodiment, the hash upload value set on-chain module includes:

[0128] The upload data packet construction module is used to construct the upload data packet using the current timestamp, sender information, data verification code, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload values ​​in the set.

[0129] 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 inter-node communication time, CPU resources, and available memory.

[0130] The data packet upload module is used to upload data packets to the optimal node.

[0131] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A method for secure storage of electronic archives based on blockchain, characterized in that, The method includes: An initial key is generated using a key generation algorithm, and a subkey set is obtained by segmenting the initial key into segments of a preset length; The target block size is determined based on the subkey set; The target subkey set is obtained by dynamically updating the subkey set according to the target block size; Obtain electronic archive data, and encrypt the electronic archive data according to the target subkey set to obtain a subciphertext dataset; Calculate the hash value of each sub-ciphertext data in the sub-ciphertext dataset to obtain the sub-hash upload value set; The sub-hash upload value set is stored on the blockchain using a preset algorithm; Determining the target block size based on the subkey set includes: Perform a two's complement operation on each subkey in the subkey set to obtain a two's complement subkey set; The first and second complement key groups are obtained by selecting the complement key groups from the complement key set through a preset window. The first block parameter value and the second block parameter value are obtained by performing an XOR operation on the first complement subkey group and the second complement subkey group respectively; The third block parameter value is obtained by performing an XOR operation on the first block parameter value and the second block parameter value; The target block size is obtained by substituting the first block parameter value, the second block parameter value, and the third block parameter value into a preset block calculation formula.

2. The method for secure storage of electronic archives based on blockchain according to claim 1, characterized in that, The target subkey set is obtained by dynamically updating the subkey set according to the target block size, including: Determine whether the size of the subkey in the subkey set is the same as the size of the target block; 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 size of the target block to obtain the target subkey set.

3. The method for secure storage of electronic archives based on blockchain according to claim 1, characterized in that, The electronic archive data is encrypted using the target subkey set to obtain a subciphertext dataset, which includes: The electronic archive data is divided into sub-electronic archive datasets according to the target block size; The target sub-key is obtained by determining the key of the target sub-electronic file based on the target sub-key set; the target sub-electronic file is any one of the sub-electronic file datasets; The target sub-electronic file is dynamically arranged to obtain the first modified sub-block; The first modified sub-block is subjected to a Toffoli gate transform to obtain the second modified sub-block; The target sub-ciphertext data is obtained by performing an XOR operation on the second modified sub-block and the target sub-key, and the sub-ciphertext dataset is obtained based on the target sub-ciphertext data of all sub-electronic archive data.

4. The method for secure storage of electronic archives based on blockchain according to claim 1, characterized in that, The on-chain storage of the sub-hash upload value set through a preset algorithm includes: The upload data packet is constructed using the current timestamp, sender information, data verification code, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload values ​​in the set. The optimal node is obtained by prioritizing nodes in the blockchain network using the nk clustering tree generation algorithm; the priority calculation is determined by inter-node communication time, CPU resources, and available memory. The data packet is uploaded to the optimal node.

5. A blockchain-based secure electronic archive storage system, characterized in that, The system includes: The key segmentation module is used to generate an initial key through a key generation algorithm, and to segment the initial key into subkey sets by a preset length; The target block size determination module is used to determine the target block size based on the subkey set; The 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; The sub-ciphertext dataset determination module is used to acquire electronic archive data and encrypt the electronic archive data according to the target sub-key set to obtain a sub-ciphertext dataset. The sub-hash upload value set determination module is used to calculate the hash value of each sub-ciphertext data in the sub-ciphertext dataset to obtain the sub-hash upload value set; The hash upload value set on-chain module is used to store the sub-hash upload value set on the blockchain using a preset algorithm; The target block size determination module includes: The two's complement operation module is used to perform two's complement operation on each subkey in the subkey set to obtain a two's complement subkey set; The complement subkey group determination module is used to select the complement subkeys from the complement subkey set through a preset window to obtain the first complement subkey group and the second complement subkey group. The first XOR operation module is used to perform XOR operations on the first complement subkey group and the second complement subkey group respectively to obtain the first block parameter value and the second block parameter value; The second XOR operation module is used to perform an XOR operation on the first block parameter value and the second block parameter value to obtain the 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 the target block size.

6. A blockchain-based secure electronic archive storage system according to claim 5, characterized in that, The target subkey set determination module includes: The size determination module is used to determine whether the size of the subkey in the subkey set is the same as the target block size; The subkey concatenation module is used to concatenate 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 size of the target block to obtain the target subkey set.

7. A blockchain-based secure electronic archive storage system according to claim 5, characterized in that, The sub-ciphertext dataset determination module includes: The sub-electronic archive dataset determination module is used to segment the electronic archive data according to the target block size to obtain a sub-electronic archive dataset; The target subkey determination module is used to determine the key of the target sub-electronic file based on the target subkey set to obtain the target subkey; the target sub-electronic file is any one of the sub-electronic file datasets; The first modification sub-block determination module is used to dynamically arrange the target sub-electronic file to obtain the first modification sub-block; The second modified sub-block determination module is used to perform a Toffoli gate transformation on the first modified sub-block to obtain the second modified sub-block. The target sub-ciphertext data determination module is used to perform an XOR operation on the second modified sub-block and the target sub-key to obtain the target sub-ciphertext data, and to obtain the sub-ciphertext dataset based on the target sub-ciphertext data of all sub-electronic archive data.

8. A blockchain-based secure electronic archive storage system according to claim 5, characterized in that, The hash upload value set on-chain module includes: The upload data packet construction module is used to construct an upload data packet using the current timestamp, sender information, data verification code, and target sub-hash upload value; the target sub-hash upload value is any one of the sub-hash upload value sets. 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 inter-node communication time, CPU resources and available memory. The data packet upload module is used to upload the data packet to the optimal node.

Citation Information

Patent Citations

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

    CN112329029A

  • Intelligent archive storage method and system based on block chain

    CN118394991A

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

    CN119088783A