Secure storage methods, devices, equipment and storage media for data files

By employing multiple cryptographic nodes in the open consortium blockchain system to perform homomorphic projection encryption calculations and backups of user files, the vulnerability of the encryption process to network attacks is solved, achieving higher data file storage security and integrity.

CN117094039BActive Publication Date: 2026-11-17中移信息技术有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311051212.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2026-11-17
Estimated Expiration
2043-08-18

AI Technical Summary

Technical Problem

In existing technologies, data file storage systems based on open consortium blockchains are vulnerable to cyberattacks during encrypted computation, resulting in low storage security.

Method used

Multiple encryption nodes are used to perform homomorphic projection encryption calculations on the user files to be stored, and homomorphic projection encryption verification is added to the symmetric encryption method. The encrypted user files are backed up by multiple encryption nodes to improve storage security.

Benefits of technology

It improves the storage security of user data files, prevents interruptions during the encryption process due to network attacks, and ensures the integrity and privacy of data files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117094039B_ABST
    Figure CN117094039B_ABST
Patent Text Reader

Abstract

This application discloses a secure storage method, apparatus, device, and storage medium for data files. The secure storage method includes: receiving a user storage request; selecting a target consensus node based on the user storage request; selecting a first encryption node based on the target consensus node and the user storage request, and sending the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node based on the target identifier; and performing a homomorphic projection encryption calculation on the user file to be stored based on the first and second encryption nodes and the user key, to obtain an encrypted user file and a file homomorphic projection of the encrypted user file. This application performs a homomorphic projection encryption calculation on the user file to be stored, adding homomorphic projection encryption verification to the symmetric encryption method, thereby improving the security of data file storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device and storage medium for secure storage of data files. Background Technology

[0002] Currently, with the development of communication technology, the amount of communication data is surging, and users have a need for security in storing sensitive data. Therefore, blockchain technology has been proposed and widely applied. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. In a blockchain system, data blocks are sequentially linked in a chain-like data structure according to time sequence, and a distributed ledger, guaranteed by cryptography to be immutable and unforgeable, is used to store user data files.

[0003] In related technologies, an open consortium blockchain storage system is used to store user data files. The open consortium blockchain is a cloud management system based on blockchain. Specifically, this technology uses a storage system based on an open consortium blockchain, employs the zero-knowledge proof ZK-SNARK algorithm, and is programmed in Rust to perform data file encryption, storage, decryption, and retrieval within a software environment. However, this method results in large intermediate files for encryption computation, and the encryption process is vulnerable to network attacks and interruptions, leading to low security for the storage of user data files. Summary of the Invention

[0004] The main objective of this application is to provide a secure storage method, apparatus, device, and storage medium for data files, aiming to solve the technical problem of low security in the storage of user data files in the prior art.

[0005] To achieve the above objectives, this application provides a secure data file storage method, which includes:

[0006] Receive a user storage request, wherein the user storage request includes a user file to be stored and a user key;

[0007] Based on the user storage request, a target consensus node is selected; based on the target consensus node, a first encryption node is selected according to the user storage request, and the target identifier of the first encryption node is sent to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier;

[0008] Based on the first and second encryption nodes, and according to the user key, the homomorphic projection encryption calculation is performed on the user file to be stored to obtain the encrypted user file and the file homomorphic projection of the encrypted user file. The file homomorphic projection is then sent to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network.

[0009] Optionally, the step of performing homomorphic projection encryption calculations on the user file to be stored based on the first encryption node and the second encryption node, according to the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, includes:

[0010] Based on the first and second encryption nodes, the user file to be stored is split into multiple file fragments.

[0011] Based on the user key, the file fragments are encrypted to generate an encrypted user file corresponding to the number of file fragments.

[0012] A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the file from the encrypted user file.

[0013] Optionally, the step of extracting the homomorphic projection of a file from the encrypted user file using a homomorphic projection extraction algorithm includes:

[0014] Calculate the hash value of each of the encrypted user files to obtain the string of each of the encrypted user files;

[0015] The strings of the encrypted user files are concatenated to obtain the homomorphic projection of the files.

[0016] Optionally, each consensus node corresponds to multiple encryption nodes, each encryption node has a preset identifier, and the initial storage space of encryption nodes with the same identifier under different consensus nodes is equal.

[0017] Optionally, after the step of performing a homomorphic projection encryption calculation on the user file to be stored based on the first and second encryption nodes and the user key to obtain an encrypted user file and a file homomorphic projection of the encrypted user file, and sending the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network, the method includes:

[0018] Receive a user read request, wherein the user read request includes a target file identifier and a user key;

[0019] Based on the preset decryption node, according to the target file identifier, the corresponding target file homomorphic projection is read from the blockchain network, and the corresponding encrypted file is read from the first encryption node or the second encryption node;

[0020] The homomorphic projection verification algorithm is used to verify the homomorphic projection of the target file and the encrypted file, and the verification result is obtained.

[0021] If the verification result is successful, the user key is used to decrypt the homomorphic projection of the target file to obtain the target user file.

[0022] Optionally, the step of verifying the homomorphic projection of the target file and the encrypted file using a homomorphic projection verification algorithm to obtain the verification result includes:

[0023] A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the comparison file from the encrypted user file;

[0024] The isomorphic projections of the comparison file and the target file are compared. If the isomorphic projections of the comparison file and the target file are consistent, the verification result is that the verification is successful.

[0025] Optionally, user files are encrypted, decrypted, and consensus is achieved within a trusted hardware execution environment (TEE). The trusted hardware execution environment is a separately allocated memory within the hardware used for computation of sensitive data.

[0026] This application also provides a secure storage device for data files, the secure storage device for data files comprising:

[0027] A receiving module is used to receive a user storage request, wherein the user storage request includes a user file to be stored and a user key;

[0028] The consensus module is used to select a target consensus node based on the user storage request; based on the target consensus node, select a first encryption node according to the user storage request, and send the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier;

[0029] The encryption module is used to perform homomorphic projection encryption calculation on the user file to be stored based on the first encryption node and the second encryption node, according to the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, and send the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network.

[0030] This application also provides a secure storage device for data files, the secure storage device for data files comprising: a memory, a processor, and a program stored on the memory for implementing the secure storage method for the data files.

[0031] The memory is used to store programs that implement secure storage methods for data files;

[0032] The processor is used to execute a program that implements the secure storage method for the data file, thereby implementing the steps of the secure storage method for the data file.

[0033] This application also provides a storage medium storing a program for implementing a secure storage method for data files, wherein the program for implementing the secure storage method for data files is executed by a processor to implement the steps of the secure storage method for data files.

[0034] This application provides a secure storage method, apparatus, device, and storage medium for data files. Compared to related technologies where the intermediate files for encrypted computation are large and the encryption process is vulnerable to network attacks and interruptions, resulting in low security for user data file storage, this application involves receiving a user storage request, wherein the user storage request includes the user file to be stored and a user key; selecting a target consensus node based on the user storage request; selecting a first encryption node based on the target consensus node and the user storage request, and sending the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node based on the target identifier; and performing homomorphic projection encryption computation on the user file to be stored based on the first and second encryption nodes and the user key, obtaining an encrypted user file and a file homomorphic projection of the encrypted user file, and sending the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network. In this application, multiple encryption nodes are used to perform homomorphic projection encryption calculations on the user files to be stored. The encrypted user files are backed up on multiple encryption nodes, and homomorphic projection encryption verification is added to the symmetric encryption method to improve the security of user data file storage. Attached Figure Description

[0035] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0036] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application;

[0037] Figure 2 This is a flowchart illustrating the first embodiment of the secure storage method for data files in this application;

[0038] Figure 3 This is a schematic diagram of a module for a secure storage device for the data files of this application;

[0039] Figure 4 This is a schematic diagram of an open consortium blockchain system based on the storage of data files on a trusted execution environment file homomorphic projection chain, which is part of the secure storage method for data files in this application.

[0040] Figure 5 This is a schematic diagram of the encryption process in the secure storage method for data files in this application;

[0041] Figure 6 This is a schematic diagram of the decryption process in the secure storage method for data files in this application;

[0042] Figure 7 This is a schematic diagram of a blockchain network used in the secure storage method for data files in this application.

[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0044] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0045] like Figure 1 As shown, Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of this application.

[0046] The terminal in this application embodiment can be a PC, or a smartphone, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, portable computer, or other portable terminal devices with display functions.

[0047] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0048] Optionally, the terminal may also include a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, and so on. Sensors may include light sensors, motion sensors, and other sensors. Specifically, light sensors may include ambient light sensors and proximity sensors. The ambient light sensor can adjust the display brightness according to the ambient light level, while the proximity sensor can turn off the display and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, a gravity accelerometer can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that identify the mobile terminal's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition functions (such as pedometers, taps), etc. Of course, the mobile terminal may also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, which will not be elaborated here.

[0049] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0050] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating device, a network communication module, a user interface module, and a secure storage program for data files.

[0051] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the client (user terminal) and communicate with the client; and the processor 1001 can be used to call the secure storage program of the data file stored in the memory 1005.

[0052] Reference Figure 2 This application provides a method for securely storing data files, the method comprising:

[0053] Step S100: Receive a user storage request, wherein the user storage request includes the user file to be stored and the user key;

[0054] Step S200: Based on the user storage request, select a target consensus node; based on the target consensus node, select a first encryption node according to the user storage request, and send the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier;

[0055] Step S300: Based on the first encryption node and the second encryption node, and according to the user key, perform homomorphic projection encryption calculation on the user file to be stored to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, and send the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network.

[0056] In this embodiment, the application scenario is:

[0057] As an example, a scenario for secure data file storage could be where a user needs to save sensitive data to a computer. Related technologies propose secure data file storage algorithms to address the distortion problem in compressed videos. These algorithms are data-driven, performing enhancement tasks by learning the mapping between compressed and source videos. Related technologies utilize open consortium blockchain-based storage systems, employing the zero-knowledge proof-based ZK-SNARK algorithm and programming in Rust to perform encrypted storage and decryption of data files in a software environment. However, this method results in large intermediate files for encryption computation, making the encryption process vulnerable to network attacks and interruptions, leading to low security for user data file storage. To address this scenario, this embodiment's secure data file storage method employs multiple encryption nodes to perform homomorphic projection encryption computation on the user file to be stored. The encrypted user file is backed up at multiple encryption nodes, and homomorphic projection encryption verification is added to the symmetric encryption method to improve the security of user data file storage.

[0058] As an example, the application scenarios for secure storage of data files are not limited to saving sensitive data to a computer as mentioned above, but also include various other secure storage scenarios for data files, without specific limitations here.

[0059] This embodiment aims to improve the security of storing user data files.

[0060] In this embodiment, the secure storage method for data files is applied to a secure storage device for data files.

[0061] The specific steps are as follows:

[0062] Step S100: Receive a user storage request, wherein the user storage request includes the user file to be stored and the user key;

[0063] In this embodiment, the user storage request refers to the storage instruction issued by the user to the computer when storing sensitive data. The user storage request includes the user file to be stored and the user key. The user file to be stored is a data file containing sensitive data, and the user key is a parameter, specifically a parameter input in the algorithm for converting plaintext to ciphertext or ciphertext to plaintext.

[0064] Step S200: Based on the user storage request, select a target consensus node; based on the target consensus node, select a first encryption node according to the user storage request, and send the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier;

[0065] In this embodiment, refer to Figure 4 The device utilizes an open consortium blockchain system and a Trusted Execution Environment (TEE). It deploys encryption nodes, decryption nodes, and consensus nodes using Docker. User files are encrypted, decrypted, and consensus is reached based on these nodes. The TEE is a separately allocated memory within the hardware used for computation of sensitive data. Specifically, a TEE is an independent processing environment with computation and storage capabilities, providing security and integrity protection. Its basic idea is to allocate a separate, isolated memory block within the hardware for sensitive data. All computations of sensitive data are performed within this memory block, and other parts of the hardware cannot access the information in this isolated memory block except through authorized interfaces, thus achieving privacy-preserving computation of sensitive data. Encryption, decryption, and consensus are performed based on the TEE, achieving isolation protection between data and computation, and ensuring that sensitive data is processed within an isolated and trusted environment. This protects against software attacks from rich execution environments (REEs), enabling the secure and efficient operation of the blockchain-based data center.

[0066] In this embodiment, the Open Consortium Chain is a cloud management system based on blockchain that supports any authorized access. The Open Consortium Chain is located in a large cloud or data center, which is divided into several virtual machines to build a blockchain operating environment. In the operating environment, virtual machines, containers, gateway access, CA certificates, and all nodes are managed, and the fully automated deployment of the blockchain-based data center is completed, forming a series of component tools such as cloud APIs, virtual machines, container orchestration, gateway load balancing, distributed traceability, encrypted data storage, zero-knowledge proof verification, decentralized identity (DID), and application scenario plug-in kits.

[0067] In this embodiment, the device selects a target consensus node based on the user storage request. Specifically, when the device receives a new file storage task (i.e., the file storage task corresponding to the user storage request), the device sends the file storage task to multiple consensus nodes. The multiple consensus nodes select one consensus node to perform the node selection operation in a round-robin manner.

[0068] In this embodiment, each consensus node corresponds to multiple encryption nodes. Each encryption node has a preset identifier, and the initial storage space of encryption nodes with the same identifier under different consensus nodes is equal. Specifically, refer to... Figure 7A blockchain network comprises multiple consensus nodes, each corresponding to multiple cryptographic nodes. Cryptographic nodes with the same identifier under different consensus nodes have the same initial storage space. For example, consensus node A corresponds to cryptographic node A-001, whose identifier is 001; consensus node B corresponds to cryptographic node B-001, whose identifier is also 001; and consensus node C corresponds to cryptographic node C-001, whose identifier is also 001. Therefore, the initial storage space of cryptographic nodes A-001, B-001, and C-001 is equal, for example, all equal to 100GB.

[0069] In this embodiment, each consensus node and each encryption node may act as a decryption node in a specific usage environment. For example, if user A's computer is an encryption node in the blockchain network, when user A needs to use the original file, user A's computer will act as a decryption node to read the encrypted file from other encryption nodes and perform a series of verification and decryption operations to finally obtain the original file.

[0070] In this embodiment, the device selects a first encrypted node based on the target consensus node and the user's storage request, and sends the target identifier of the first encrypted node to other consensus nodes in the blockchain network. This allows the other consensus nodes to select a corresponding second encrypted node based on the target identifier. Specifically, when performing the node selection operation, the target consensus node selects an encrypted node from among multiple encrypted nodes corresponding to it to perform the file storage task, based on the storage space required for the file storage task and the remaining storage space of each encrypted node. Furthermore, the target consensus node sends the number of the selected encrypted node to the other consensus nodes, ensuring that each node selects an encrypted node with the same number to perform the file storage task. Selecting encryption nodes in the above manner ensures that the remaining storage space of encryption nodes with the same ID corresponding to each consensus node is consistent. This avoids the following situation: Inconsistent remaining storage space among encryption nodes with the same ID corresponding to each consensus node leads to a situation where, upon receiving a new file storage task, each encryption node corresponding to consensus node X has remaining storage space, but each node's remaining storage space is too small to handle the task. Conversely, some encryption nodes corresponding to consensus node Y may have no remaining storage space, while others have a significant amount of remaining storage space, sufficient to handle the task. In summary, selecting encryption nodes in this way ensures that each consensus node has a consistent response capability to the same file storage task, which helps ensure the normal execution of consensus operations and thus improves the security of user data file storage.

[0071] Step S300: Based on the first encryption node and the second encryption node, and according to the user key, perform homomorphic projection encryption calculation on the user file to be stored to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, and send the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network.

[0072] In this embodiment, the device, based on the first and second encryption nodes and according to the user key, performs homomorphic projection encryption calculations on the user file to be stored, obtaining the encrypted user file and its homomorphic projection. The homomorphic projection is then sent to the corresponding consensus node, which saves it to the blockchain network. Specifically, refer to... Figure 5The encryption node is responsible for receiving the user's original file (i.e., the user file to be stored) and invoking the TEE's encryption algorithm via message calls to perform encrypted computation of the file's homomorphic projection. In the file homomorphic projection encryption process based on the Trusted Execution Environment (TEE), after receiving the user key and the user file (plaintext), the user file is encrypted using AES within the TEE chip, generating several encrypted sectors. The homomorphic projection is extracted from the encrypted sectors using a homomorphic projection extraction algorithm and sent to the consensus node. The consensus node stores the homomorphic projection in the blockchain system, and then the encryption node destroys the user's original file, saving the encrypted sectors. This application employs multiple encryption nodes to perform encrypted computation of the homomorphic projection on the user file to be stored, backs up the encrypted user file on multiple encryption nodes, and adds encrypted verification of the homomorphic projection to the symmetric encryption method, thereby improving the security of user data file storage.

[0073] Specifically, step S300 includes the following steps S310-S330:

[0074] Step S310: Based on the first encryption node and the second encryption node, the user file to be stored is split into multiple file fragments.

[0075] In this embodiment, the device splits the user file to be stored into multiple file fragments based on the first encryption node and the second encryption node. Specifically, the encryption node (including the first encryption node and the second encryption node) is responsible for receiving the user's original file (i.e., the user file to be stored) and splitting the user's original file into multiple file fragments, where each file fragment is 256M in size. File fragments smaller than 256M are padded with random numbers.

[0076] Step S320: Based on the user key, perform encryption calculation on the file segmentation fragments to generate an encrypted user file corresponding to the number of file segmentation fragments;

[0077] In this embodiment, the encryption nodes (including the first encryption node and the second encryption node) perform encryption calculations on the file fragments according to the user key, generating encrypted user files corresponding to the number of file fragments. The device invokes the encryption algorithm of the TEE through message calls to realize the encryption calculation of file homomorphic projection. Specifically, in the file homomorphic projection encryption process based on the Trusted Execution Environment, after receiving the user key and the user file (plaintext), the device performs AES encryption on the user file inside the TEE chip to generate several encrypted sectors, which are the encrypted user files corresponding to the number of file fragments.

[0078] Step S330: Use the homomorphic projection extraction algorithm to extract the homomorphic projection of the file from the encrypted user file.

[0079] In this embodiment, the encryption node employs a homomorphic projection extraction algorithm to extract the homomorphic projection of the encrypted user files. Specifically, the encryption node calculates the hash value of each encrypted user file, concatenates the hash values ​​to obtain the homomorphic projection, and then sends the homomorphic projection to the consensus node. The consensus node generates a Merkle tree corresponding to the homomorphic projection and writes the root of the Merkle tree, each homomorphic projection, and the storage path of each homomorphic projection into the next block. Specifically, the consensus node is responsible for receiving the homomorphic projections generated by the encryption node within 30 seconds, performing SHA256 calculations on each homomorphic projection to generate 256-bit data elements, constructing a Merkle tree from these 256-bit data elements, writing the root of the Merkle tree as the consensus string into the next block of the blockchain, and simultaneously writing each homomorphic projection and its corresponding storage path (machine name: encrypted sector storage path: encrypted sector ID) into the block.

[0080] Specifically, step S330 includes the following steps S331-S332:

[0081] Step S331: Calculate the hash value of each of the encrypted user files to obtain the string of each of the encrypted user files;

[0082] Step S332: Concatenate the strings of each of the encrypted user files to obtain a file homomorphic projection.

[0083] In this embodiment, the encryption node performs hash value calculations on each of the encrypted user files to obtain the strings of each encrypted user file, and concatenates the strings of each encrypted user file to obtain a file homomorphic projection. Specifically, the encryption node divides the AES-encrypted file (i.e., the encrypted user file) into 8 parts from the beginning, performs SHA256 calculations on each part of the data to obtain a 256-bit string, and concatenates these 8 256-bit strings together to obtain 2k data. This 2k data is the file homomorphic projection, that is, the string is a 256-bit hash value string. The number of encrypted user files is 8. The encryption node concatenates the 256-bit hash values ​​of the 8 encrypted user files to obtain the file homomorphic projection, wherein the file size of the file homomorphic projection is 2k.

[0084] It should be noted that encrypted files stored in the encrypted sectors of the encryption nodes have a certain lifespan. Some encrypted files are one-time use files; once these are decrypted by a decryption node, their lifespan ends, and they are deleted from the encryption sector of the encryption node, thus freeing up storage space. Other encrypted files have a fixed lifespan; when their lifespan expires, they are also deleted from the encryption sector of the encryption node, freeing up storage space. Each consensus node records the remaining storage space of its corresponding encryption nodes. When an encryption node stores a new encrypted file, the consensus node updates its remaining storage space information; similarly, when an encryption node deletes an encrypted file, the consensus node also updates its remaining storage space information.

[0085] This application provides a secure data file storage method that, compared to related technologies where the intermediate files for encrypted computation are large and the encryption process is vulnerable to network attacks and interruptions, resulting in low security for user data file storage, addresses this issue by: receiving a user storage request, wherein the user storage request includes the user file to be stored and a user key; selecting a target consensus node based on the user storage request; selecting a first encryption node based on the target consensus node and the user storage request, and sending the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node based on the target identifier; and performing homomorphic projection encryption computation on the user file to be stored based on the first and second encryption nodes and the user key, obtaining an encrypted user file and a file homomorphic projection of the encrypted user file, and sending the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network. In this application, multiple encryption nodes are used to perform homomorphic projection encryption calculations on the user files to be stored. The encrypted user files are backed up on multiple encryption nodes, and homomorphic projection encryption verification is added to the symmetric encryption method to improve the security of user data file storage.

[0086] Based on the first embodiment described above, this application also provides another embodiment, wherein the secure storage method for the data file includes:

[0087] In step S300, based on the first and second encryption nodes and according to the user key, a homomorphic projection encryption calculation is performed on the user file to be stored to obtain the encrypted user file and the file homomorphic projection of the encrypted user file. The file homomorphic projection is then sent to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network. Following this step, the method includes the following steps A100-A400:

[0088] Step A100: Receive a user read request, wherein the user read request includes a target file identifier and a user key;

[0089] In this embodiment, after the data file storage scenario, there is also a data file reading scenario. The device receives a user reading request. The user reading request refers to the reading instruction issued by the user to the computer when reading sensitive data. The user reading request includes a target file identifier and a user key. The target file identifier refers to the identifier of the file to be read by the user, which may be an identifier such as a name or number.

[0090] Step A200: Based on the preset decryption node, according to the target file identifier, read the corresponding target file homomorphic projection from the blockchain network, and read the corresponding encrypted file from the first encryption node or the second encryption node;

[0091] In this embodiment, the device, based on a preset decryption node, reads the corresponding target file homomorphic projection from the blockchain network according to the target file identifier, and reads the corresponding encrypted file from the first encryption node or the second encryption node. Specifically, the decryption node is responsible for reading the user's encrypted file from the encryption node according to the homomorphic projection of each file on the blockchain and its corresponding storage path (machine name: encrypted sector storage path: encrypted sector ID).

[0092] Step A300: The homomorphic projection verification algorithm is used to verify the homomorphic projection of the target file and the encrypted file to obtain the verification result;

[0093] In this embodiment, the decryption node uses a homomorphic projection verification algorithm to verify the homomorphic projection of the target file and the encrypted file, and obtains the verification result. Specifically, refer to... Figure 6 The decryption node invokes the TEE's decryption algorithm via message calls. Inside the TEE chip, the encrypted file and its homomorphic projection are verified using a homomorphic projection verification algorithm. Once the verification is successful, the encrypted file is decrypted using the user's key to obtain the user's original file (plaintext).

[0094] Specifically, step A300 includes the following steps A310-A320:

[0095] Step A310: Use the homomorphic projection extraction algorithm to extract the homomorphic projection of the comparison file from the encrypted user file;

[0096] Step A320: Compare the isomorphic projection of the comparison file with the isomorphic projection of the target file. If the isomorphic projection of the comparison file and the isomorphic projection of the target file are consistent, the verification result is that the verification is successful.

[0097] In this embodiment, the decryption node employs a homomorphic projection extraction algorithm to extract a comparison file homomorphic projection from the encrypted user file. This comparison file homomorphic projection is then compared to the target file homomorphic projection. If the comparison file homomorphic projection and the target file homomorphic projection match, the verification result is considered successful; otherwise, the verification result is considered unsuccessful. Specifically, the decryption node verifies the file homomorphic projection as follows: it extracts a 2KB file homomorphic projection A from the encrypted file and compares it with a 2KB file homomorphic projection B stored in the blockchain system. If they match, the verification is successful.

[0098] Step A400: If the verification result is successful, the user key is used to decrypt the homomorphic projection of the target file to obtain the target user file.

[0099] In this embodiment, if the verification result is successful, the decryption node uses the user key to decrypt the target file using homomorphic projection to obtain the target user file. Specifically, after the verification result is successful, multiple encrypted sectors (i.e., encrypted files) are decrypted using the AES decryption algorithm to obtain multiple 256M plaintext data. Finally, the multiple 256M plaintext data are concatenated and aggregated to obtain the user's original file (i.e., the target user file).

[0100] This application also provides a secure storage device for data files, as described above. Figure 3 The secure storage device for the data file includes:

[0101] The receiving module 10 is used to receive a user storage request, wherein the user storage request includes a user file to be stored and a user key;

[0102] The consensus module 20 is used to select a target consensus node based on the user storage request; based on the target consensus node, select a first encryption node according to the user storage request, and send the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier;

[0103] The encryption module 30 is used to perform homomorphic projection encryption calculation on the user file to be stored based on the first encryption node and the second encryption node and according to the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, and send the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network.

[0104] Optionally, the encryption module 30 includes:

[0105] The file splitting module is used to split the user file to be stored into multiple file fragments based on the first encryption node and the second encryption node.

[0106] The file encryption module is used to perform encryption calculations on the file fragments according to the user key, and generate an encrypted user file corresponding to the number of file fragments.

[0107] The extraction module is used to extract the file homomorphic projection from the encrypted user file using a homomorphic projection extraction algorithm.

[0108] Optionally, the extraction module includes:

[0109] The calculation module is used to calculate the hash value of each of the encrypted user files to obtain the string of each of the encrypted user files;

[0110] The concatenation module is used to concatenate the strings of the encrypted user files to obtain a homomorphic projection of the files.

[0111] Optionally, the secure storage device for the data file further includes:

[0112] A read request receiving module is used to receive user read requests, wherein the user read request includes a target file identifier and a user key;

[0113] The file reading module is used to read the corresponding target file homomorphic projection from the blockchain network based on the preset decryption node and the target file identifier, and to read the corresponding encrypted file from the first encryption node or the second encryption node.

[0114] The verification module is used to verify the homomorphic projection of the target file and the encrypted file using a homomorphic projection verification algorithm, and obtain the verification result;

[0115] The decryption module is used to decrypt the target file homomorphically by using the user key if the verification result is successful, so as to obtain the target user file.

[0116] Optionally, the verification module includes:

[0117] The homomorphic projection extraction module is used to extract the homomorphic projection of the comparison file from the encrypted user file using a homomorphic projection extraction algorithm.

[0118] The comparison module is used to compare the isomorphic projection of the comparison file with the isomorphic projection of the target file. If the isomorphic projection of the comparison file and the isomorphic projection of the target file are consistent, the verification result is that the verification is successful.

[0119] The specific implementation of the secure storage device for data files in this application is basically the same as the embodiments of the secure storage method for data files described above, and will not be repeated here.

[0120] Reference Figure 1 , Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of this application.

[0121] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0122] Optionally, the secure storage device for the data file may also include a rectangular user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, etc. The rectangular user interface may include a display screen and an input submodule such as a keyboard. Optionally, the rectangular user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0123] Those skilled in the art will understand that Figure 1 The secure storage device structure for data files shown does not constitute a limitation on the secure storage device for data files. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0124] like Figure 1 As shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, and a secure storage program for data files. The operating system is a program that manages and controls the hardware and software resources of the secure storage device for data files, supporting the operation of the secure storage program for data files and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the secure storage system for data files.

[0125] exist Figure 1 In the secure storage device for the data file shown, the processor 1001 is used to execute the secure storage program for the data file stored in the memory 1005, and to implement the steps of the secure storage method for the data file described in any of the above claims.

[0126] The specific implementation of the secure storage device for data files in this application is basically the same as the embodiments of the secure storage method for data files described above, and will not be repeated here.

[0127] This application also provides a storage medium storing a program implementing a secure data file storage method, wherein the program implementing the secure data file storage method is executed by a processor to implement the secure data file storage method as described below:

[0128] Receive a user storage request, wherein the user storage request includes a user file to be stored and a user key;

[0129] Based on the user storage request, a target consensus node is selected; based on the target consensus node, a first encryption node is selected according to the user storage request, and the target identifier of the first encryption node is sent to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier;

[0130] Based on the first and second encryption nodes, and according to the user key, the homomorphic projection encryption calculation is performed on the user file to be stored to obtain the encrypted user file and the file homomorphic projection of the encrypted user file. The file homomorphic projection is then sent to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network.

[0131] Optionally, the step of performing homomorphic projection encryption calculations on the user file to be stored based on the first encryption node and the second encryption node, according to the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, includes:

[0132] Based on the first and second encryption nodes, the user file to be stored is split into multiple file fragments.

[0133] Based on the user key, the file fragments are encrypted to generate an encrypted user file corresponding to the number of file fragments.

[0134] A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the file from the encrypted user file.

[0135] Optionally, the step of extracting the homomorphic projection of a file from the encrypted user file using a homomorphic projection extraction algorithm includes:

[0136] Calculate the hash value of each of the encrypted user files to obtain the string of each of the encrypted user files;

[0137] The strings of the encrypted user files are concatenated to obtain the homomorphic projection of the files.

[0138] Optionally, each consensus node corresponds to multiple encryption nodes, each encryption node has a preset identifier, and the initial storage space of encryption nodes with the same identifier under different consensus nodes is equal.

[0139] Optionally, after the step of performing a homomorphic projection encryption calculation on the user file to be stored based on the first and second encryption nodes and the user key to obtain an encrypted user file and a file homomorphic projection of the encrypted user file, and sending the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network, the method includes:

[0140] Receive a user read request, wherein the user read request includes a target file identifier and a user key;

[0141] Based on the preset decryption node, according to the target file identifier, the corresponding target file homomorphic projection is read from the blockchain network, and the corresponding encrypted file is read from the first encryption node or the second encryption node;

[0142] The homomorphic projection verification algorithm is used to verify the homomorphic projection of the target file and the encrypted file, and the verification result is obtained.

[0143] If the verification result is successful, the user key is used to decrypt the homomorphic projection of the target file to obtain the target user file.

[0144] Optionally, the step of verifying the homomorphic projection of the target file and the encrypted file using a homomorphic projection verification algorithm to obtain the verification result includes:

[0145] A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the comparison file from the encrypted user file;

[0146] The isomorphic projections of the comparison file and the target file are compared. If the isomorphic projections of the comparison file and the target file are consistent, the verification result is that the verification is successful.

[0147] Optionally, user files are encrypted, decrypted, and consensus is achieved within a trusted hardware execution environment (TEE). The trusted hardware execution environment is a separately allocated memory within the hardware used for computation of sensitive data.

[0148] The specific implementation of the storage medium in this application is basically the same as the embodiments of the secure storage method for data files described above, and will not be repeated here.

[0149] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described secure storage method for data files.

[0150] The specific implementation of the computer program product of this application is basically the same as the embodiments of the above-mentioned secure storage method for data files, and will not be repeated here.

[0151] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0152] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0154] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method of secure storage of a data file, characterized by, The secure storage method for the data file includes: Receive a user storage request, wherein the user storage request includes a user file to be stored and a user key; Based on the user storage request, a target consensus node is selected; based on the target consensus node, a first encryption node is selected according to the user storage request, and the target identifier of the first encryption node is sent to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier; Based on the first encryption node and the second encryption node, according to the user key, the homomorphic projection encryption calculation is performed on the user file to be stored to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, and the file homomorphic projection is sent to the consensus node so that the consensus node can save the file homomorphic projection to the blockchain network. The step of performing homomorphic projection encryption calculation on the user file to be stored based on the first encryption node and the second encryption node, according to the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, includes: Based on the first and second encryption nodes, the user file to be stored is split into multiple file fragments. Based on the user key, the file fragments are encrypted to generate an encrypted user file corresponding to the number of file fragments. A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the file from the encrypted user file; The method further includes the following steps after the steps of performing homomorphic projection encryption calculations on the user file to be stored based on the first and second encryption nodes and the user key, obtaining the encrypted user file and the file homomorphic projection of the encrypted user file, and sending the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network: Receive a user read request, wherein the user read request includes a target file identifier and a user key; Based on the preset decryption node, according to the target file identifier, the corresponding target file homomorphic projection is read from the blockchain network, and the corresponding encrypted file is read from the first encryption node or the second encryption node; The homomorphic projection verification algorithm is used to verify the homomorphic projection of the target file and the encrypted file, and the verification result is obtained. If the verification result is successful, the user key is used to decrypt the homomorphic projection of the target file to obtain the target user file; The step of verifying the homomorphic projection of the target file and the encrypted file using a homomorphic projection verification algorithm to obtain the verification result includes: A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the comparison file from the encrypted user file; The isomorphic projections of the comparison file and the target file are compared. If the isomorphic projections of the comparison file and the target file are consistent, the verification result is that the verification is successful.

2. The method of claim 1, wherein the data file is stored in the secure storage area when the data file is received from the external device. The step of extracting the homomorphic projection of a file from the encrypted user file using the homomorphic projection extraction algorithm includes: Calculate the hash value of each of the encrypted user files to obtain the string of each of the encrypted user files; The strings of the encrypted user files are concatenated to obtain the homomorphic projection of the files.

3. The method of claim 1, wherein the data file is stored in the secure storage area when the data file is received from the external device. Each consensus node corresponds to multiple encryption nodes. Each encryption node has a preset identifier, and the initial storage space of encryption nodes with the same identifier under different consensus nodes is equal.

4. The method of securely storing a data file according to any one of claims 1 to 3, wherein, In a trusted hardware execution environment (TEE), user files are encrypted, decrypted, and consensus is reached. The trusted hardware execution environment is a separately allocated memory in the hardware used for the computation of sensitive data.

5. A secure storage apparatus of a data file, characterized by, The secure storage device for the data file includes: A receiving module is used to receive a user storage request, wherein the user storage request includes a user file to be stored and a user key; The consensus module is used to select a target consensus node based on the user storage request; based on the target consensus node, select a first encryption node according to the user storage request, and send the target identifier of the first encryption node to other consensus nodes in the blockchain network, so that the other consensus nodes select a corresponding second encryption node according to the target identifier; An encryption module is used to perform homomorphic projection encryption calculation on the user file to be stored based on the first encryption node and the second encryption node, according to the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, and send the file homomorphic projection to the consensus node so that the consensus node can save the file homomorphic projection to the blockchain network. The step of performing homomorphic projection encryption calculations on the user file to be stored based on the first and second encryption nodes and the user key, to obtain the encrypted user file and the file homomorphic projection of the encrypted user file, includes: Based on the first and second encryption nodes, the user file to be stored is split into multiple file fragments. Based on the user key, the file fragments are encrypted to generate an encrypted user file corresponding to the number of file fragments. A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the file from the encrypted user file; The step of performing a homomorphic projection encryption calculation on the user file to be stored based on the first and second encryption nodes and the user key, to obtain an encrypted user file and a file homomorphic projection of the encrypted user file, and sending the file homomorphic projection to the corresponding consensus node so that the consensus node can save the file homomorphic projection to the blockchain network, includes: Receive a user read request, wherein the user read request includes a target file identifier and a user key; Based on the preset decryption node, according to the target file identifier, the corresponding target file homomorphic projection is read from the blockchain network, and the corresponding encrypted file is read from the first encryption node or the second encryption node; The homomorphic projection verification algorithm is used to verify the homomorphic projection of the target file and the encrypted file, and the verification result is obtained. If the verification result is successful, the user key is used to decrypt the homomorphic projection of the target file to obtain the target user file; The step of using a homomorphic projection verification algorithm to verify the homomorphic projection of the target file and the encrypted file, and obtaining the verification result, includes: A homomorphic projection extraction algorithm is used to extract the homomorphic projection of the comparison file from the encrypted user file; The isomorphic projections of the comparison file and the target file are compared. If the isomorphic projections of the comparison file and the target file are consistent, the verification result is that the verification is successful.

6. A secure storage device for data files, characterized by The secure storage device for the data file includes: a memory, a processor, and a program stored on the memory for implementing the secure storage method for the data file. The memory is used to store programs that implement secure storage methods for data files; The processor is configured to execute a program that implements the secure storage method for the data file, thereby implementing the steps of the secure storage method for the data file as described in any one of claims 1 to 4.

7. A storage medium, characterized by The storage medium stores a program that implements a secure storage method for data files, and the program that implements the secure storage method for data files is executed by a processor to implement the steps of the secure storage method for data files as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Block chain data storage method and device, block chain node and storage medium

    CN109165221A

  • Distributed file system storage optimization method, computer equipment and storage medium

    CN113806298A