File security processing method and device, storage medium and electronic equipment

Through compression and segmentation and encryption processing the files in cloud storage, the problem of excessive loads in the upload mode of traditional file uploading mode and waste space in the storage space are solved, and efficient and secure document storage and recovery have been achieved.

CN119336262AInactive Publication Date: 2025-01-21BEIJING BIG DATA CENT
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411418284.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When using cloud storage services, the traditional file upload mode can easily lead to excessive load on the server when uploading large files, low transmission efficiency, and the parameters required for file encryption and decryption occupy the user's local storage space and waste resources.

Method used

By compressing and dividing the original file, multiple compressed file blocks are generated, and a file block serial number is generated for each file block for encryption, and the file block ciphertext is obtained. Then, the compressed file blocks and the file block ciphertext are connected, scattered and stored in different paths on the cloud server, and the path ciphertext is obtained.

Benefits of technology

On the premise of ensuring safe storage of files, it improves the efficiency of file storage, reduces the amount of data stored locally by users, improves the efficiency of file encryption storage, and enhances the security of file storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336262A_ABST
    Figure CN119336262A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of file processing, and particularly provides a file security processing method and device, a storage medium and electronic equipment, and the method can comprise the steps: generating each file block serial number corresponding to each compressed file block in a plurality of compressed file blocks, the plurality of compressed file blocks are obtained by segmenting a compressed file of an original file; encrypting each file block serial number to obtain each file block ciphertext; connecting each compressed file block with each file block ciphertext to obtain a plurality of pieces of file block data; and storing the multiple pieces of file block data to different paths in at least one cloud server, and obtaining and storing path ciphertexts corresponding to the different paths. Some embodiments of the present application can improve secure storage of files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of file processing, and in particular to a method, device, storage medium and electronic device for secure file processing. Background Art

[0002] With the continuous development of cloud storage services, more and more users choose to use storage services provided by third-party service providers. On the one hand, cloud storage services greatly reduce the user's local file storage consumption, and on the other hand, they realize the separation of ownership and management rights of file data.

[0003] Currently, when using cloud storage services to store files, the traditional file upload mode is prone to causing excessive server load and low transmission efficiency when encountering large file uploads; and the parameters required for file encryption and decryption, the ciphertext information formed will occupy the user's local storage space, which is prone to wasting unnecessary resources.

[0004] Therefore, how to provide a technical solution for an efficient method for secure file processing has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of some embodiments of the present application is to provide a method, device, storage medium and electronic device for secure file processing. Through the technical solutions of the embodiments of the present application, the efficiency of file storage can be improved and the amount of data stored locally by users can be reduced while ensuring the secure storage of files.

[0006] In a first aspect, some embodiments of the present application provide a method for secure file processing, including: generating respective file block serial numbers corresponding to respective compressed file blocks in a plurality of compressed file blocks, wherein the plurality of compressed file blocks are obtained by segmenting compressed files of an original file; encrypting the respective file block serial numbers to obtain respective file block ciphertexts; connecting the respective compressed file blocks with the respective file block ciphertexts to obtain a plurality of file block data; storing the plurality of file block data in different paths in at least one cloud service end, and obtaining and storing path ciphertexts corresponding to the different paths.

[0007] Some embodiments of the present application generate corresponding file block serial numbers for each compressed file block after the original file is compressed and split, and then encrypt them to obtain each file block ciphertext, and finally combine each compressed file block to obtain multiple file block data and store them in different paths of the cloud service end to generate path ciphertext. The embodiments of the present application can reduce the amount of encrypted data and improve the efficiency of file encryption storage by encrypting only the file block serial number after the compressed file is split; finally, the compressed file block and the file block ciphertext are connected and stored in a dispersed manner, and the corresponding path ciphertext is obtained, which can ensure the security of file storage and reduce the amount of data storage.

[0008] In some embodiments, generating each file block sequence number corresponding to each compressed file block in a plurality of compressed file blocks includes: generating an i-th file block sequence number for an i-th compressed file block, wherein the i-th compressed file block is one of the plurality of compressed file blocks and i is a positive integer; and calculating an i+1-th file block sequence number corresponding to an i+1-th compressed file block based on the i-th file block sequence number.

[0009] Some embodiments of the present application calculate the sequence number of a subsequent file block by the sequence number of a previous file block, so that there is an association between the sequence numbers, identifying the specific location of the compressed file block, and facilitating file recovery.

[0010] In some embodiments, when i=1, generating the i-th file block sequence number of the i-th compressed file block includes: performing a hash calculation on the first compressed file block and a timestamp to obtain the first file block sequence number.

[0011] Some embodiments of the present application obtain a first file block sequence number by performing a hash calculation on the first compressed file block and a timestamp, thereby providing a basis for generating subsequent file block sequence numbers.

[0012] In some embodiments, the obtaining and storing of path ciphertexts corresponding to the different paths includes: obtaining the file block storage path of each file block data piece among the multiple file block data pieces, and marking the file block storage path of the first compressed file block among the multiple compressed file blocks; encrypting the file block storage path of each file block data piece to obtain the path ciphertext.

[0013] Some embodiments of the present application obtain path ciphertext by dispersing and storing multiple file block data and then encrypting the path, which can encrypt and record the storage location of the file block and improve the security of file block storage.

[0014] In a second aspect, some embodiments of the present application provide a method for secure file processing, including: decrypting the path ciphertext of the original file obtained by any method embodiment in the first aspect, and obtaining the file block storage path of each file block data among multiple file block data of the original file; determining each file block ciphertext corresponding to each compressed file block among the multiple compressed file blocks through the file block storage path of each file block data; decrypting each file block ciphertext to obtain each file block sequence number of each compressed file block; sorting, merging and decompressing each compressed file block according to the each file block sequence number to obtain the original file.

[0015] Some embodiments of the present application determine the file block storage path by decrypting the path ciphertext, and then obtain the ciphertext of each file block from the file block storage path, and then obtain the file block sequence number, so that each compressed file block can be sorted, merged and decompressed to obtain the original file, thereby achieving accurate decryption of encrypted data and efficient recovery of original files with high security.

[0016] In some embodiments, before sorting, merging and decompressing the compressed file blocks according to the file block sequence numbers, the steps include: obtaining a file block storage path of a first compressed file block among the multiple compressed file blocks; obtaining a first file block sequence number through the file block storage path of the first compressed file block; generating each file block sequence number of other compressed file blocks except the first compressed file block based on the first file block sequence number; and confirming that the first file block sequence number and each file block sequence number are consistent with the file block sequence numbers.

[0017] Some embodiments of the present application require consistency comparison of file blocks to ensure whether the file has been tampered with, thereby improving the security of file storage.

[0018] In a third aspect, some embodiments of the present application provide a device for secure file processing, including: a sequence number generation module, used to generate each file block sequence number corresponding to each compressed file block in a plurality of compressed file blocks, wherein the plurality of compressed file blocks are obtained by segmenting the compressed files of the original file; an encryption module, used to encrypt the each file block sequence number to obtain each file block ciphertext; a data connection module, used to connect the each compressed file block with the each file block ciphertext to obtain multiple file block data; a file storage module, used to store the multiple file block data in different paths in at least one cloud service end, and obtain and store path ciphertexts corresponding to the different paths.

[0019] In a fourth aspect, some embodiments of the present application provide a device for file security processing, comprising: a path decryption module, used to decrypt the path ciphertext of the original file obtained by the method described in any one of claims 1 to 4, and obtain the file block storage path of each file block data of the multiple file block data of the original file; a ciphertext acquisition module, used to determine the file block ciphertexts corresponding to each compressed file block in the multiple compressed file blocks through the file block storage paths of the each file block data; a sequence number acquisition module, used to decrypt the each file block ciphertext, and obtain the each file block sequence number of the each compressed file block; a file recovery module, used to sort, merge and decompress the each compressed file block according to the each file block sequence number, and obtain the original file.

[0020] In a fifth aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.

[0021] In a sixth aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement a method as described in any embodiment of the first aspect.

[0022] In a seventh aspect, some embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program, wherein the computer program, when executed by a processor, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A system diagram of secure file processing provided for some embodiments of the present application;

[0025] Figure 2 One of the flowcharts of the method for secure file processing provided in some embodiments of the present application;

[0026] Figure 3 A schematic diagram of generating file block sequence numbers provided for some embodiments of the present application;

[0027] Figure 4A schematic diagram of generating ciphertext of a file block provided for some embodiments of the present application;

[0028] Figure 5 A schematic diagram of file block data connection provided for some embodiments of the present application;

[0029] Figure 6 A schematic diagram of file block data storage provided for some embodiments of the present application;

[0030] Figure 7 A schematic diagram of file block storage path processing provided for some embodiments of the present application;

[0031] Figure 8 A second flowchart of a method for securely processing files provided in some embodiments of the present application;

[0032] Fig. 9 A flowchart of a method for file encryption and decryption provided for some embodiments of the present application;

[0033] Fig.10 One of the block diagrams of the device for secure file processing provided in some embodiments of the present application;

[0034] Fig.11 A second block diagram of a device for secure file processing provided in some embodiments of the present application;

[0035] Fig.12 A schematic diagram of an electronic device is provided for some embodiments of the present application. DETAILED DESCRIPTION

[0036] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.

[0037] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0038] In the related art, as cloud storage applications become more and more widespread, traditional file storage solutions are prone to overloading cloud servers when uploading large files. Moreover, in terms of storage security, the attacks on cloud storage data are mainly divided into two categories: one is malicious users who are not authorized to access the data, who use illegal means to attack to obtain data; the other is cloud server administrators, who can access the data of all users stored in the server and may also threaten the data security of users. In order to ensure the security of file data in cloud storage, the security of file data is protected by file encryption. File owners generally take measures to encrypt before uploading, that is, encrypt file data locally and upload the obtained ciphertext to the cloud storage environment. However, the parameters required for encryption and decryption, and the ciphertext information formed will occupy the user's local storage space and waste unnecessary resources. If the existing various cloud storage platform files are stored in plain text, or simply encrypted and stored and uploaded to the cloud server, once the cloud server is attacked by hackers or the key is leaked, all file information will be illegally stolen or leaked.

[0039] It can be seen from the above-mentioned related technologies that the efficiency and storage security of the cloud storage file method in the existing technology need to be improved.

[0040] In view of this, some embodiments of the present application provide a method for file security processing, in which the client of the method can compress the original file, and then divide the compressed file into multiple sub-file blocks (or multiple compressed file blocks) according to relevant strategies. Each compressed file block uses hash chain technology to generate a file block sequence number, so as to identify the block number of the sub-file block in the entire file. Then, the file block sequence number is encrypted using an encryption algorithm to generate a ciphertext, and after connecting the corresponding compressed file blocks, it is dispersed and stored in different cloud service storages (or cloud service ends). When the user wants to access the file data, all the compressed file blocks and ciphertext sequence numbers are first downloaded from the dispersed cloud service ends, the file block sequence numbers are decrypted to obtain the file block sequence numbers and merged in order to generate a compressed file, and then the original file is decompressed. Some embodiments of the present application upload the encrypted and segmented files to the cloud service end for storage respectively by file segmentation, which can effectively solve the problem that the current third-party service provider is not completely trustworthy, and the file storage security is relatively high. Moreover, by uploading the file after segmentation, the transmission efficiency is effectively improved.

[0041] The following is combined with Figure 1 The overall composition structure of the system for secure file processing provided by some embodiments of the present application is exemplified.

[0042] like Figure 1As shown in the figure, some embodiments of the present application provide a system for file security processing. The system for file security processing may include a client 100 and a cloud server 200. The client 100 may compress, split, encrypt, and concatenate the original file to obtain multiple pieces of file block data; then disperse and store the multiple pieces of file block data under different paths of the cloud server 200. At the same time, the client 100 stores the path ciphertext of the paths where these multiple pieces of file block data are stored, so that the original file can be accurately obtained during subsequent user access through the path ciphertext. Among them, the encryption algorithm used for the above encryption can either adopt a symmetric encryption algorithm or an asymmetric encryption algorithm. If a symmetric encryption algorithm is adopted, the file encryption key is a symmetric key, and security protection needs to be carried out on it. If an asymmetric encryption algorithm is adopted, the file encryption key is a public key, and no security protection needs to be carried out on it.

[0043] In some other embodiments of the present application, multiple cloud servers 200 may be provided, and multiple pieces of file block data may be dispersed and stored on multiple different cloud servers. For example, the number of multiple pieces of file block data is N. At this time, the N pieces of data can be stored under N paths of a cloud server, or the N pieces of data can be dispersed and stored on N cloud servers, or the N pieces of data can be dispersed and stored at different positions of n cloud servers, where n < N. Specifically, the way of dispersed storage can be selected according to the actual situation, and the embodiments of the present application are not limited thereto.

[0044] In some embodiments of the present application, the client 100 may be a mobile terminal or a non-portable computer terminal, and the embodiments of the present application do not make specific limitations here.

[0045] First, the implementation process of file encryption storage will be introduced below.

[0046] The following combines the attached Figure 2 Exemplarily expounds the implementation process of file security processing executed by the client 100 provided by some embodiments of the present application.

[0047] Please refer to the attached Figure 2 , Figure 2 which is a flowchart of a file security processing method provided by some embodiments of the present application.

[0048] Overall, the file security processing method may include: key generation, key security protection, file compression and splitting, generating and encrypting file block numbers, and encrypted and dispersed storage processes. First, the implementation processes of key generation and key security protection will be elaborated below, and then the implementation processes of subsequent file security processing will be elaborated.

[0049] Taking the encryption algorithm as a symmetric key as an example, specifically, a random number is generated according to the key generation algorithm as the symmetric key, that is, the file encryption key key enc, the key enc It is used to encrypt the file block sequence number to obtain the file block ciphertext. Among them, the key generation algorithm can be selected as needed, and the embodiment of the present application is not specifically limited here.

[0050] On the key enc When performing security protection, an asymmetric encryption algorithm can be used. Specifically, read the user's public key PK, use an asymmetric encryption algorithm, such as the domestic cryptographic algorithm SM2 public key encryption algorithm, to encrypt the symmetric key key enc The ciphertext A is obtained and stored in the secure folder. The secure folder is set up in a secure manner using at least one of hiding, encryption or account login. Among them, the ciphertext A can be decrypted by the private key SK, and the private key is saved by the user. Among them, the secure folder is a file storage structure generated by the computer's file system. Each folder has its corresponding path, which stores encrypted files and digital signatures. The secure folder sets up certain security mechanisms to ensure that only authorized users can access the contents of the secure folder, including but not limited to hiding, passwords, fingerprints and other methods. The asymmetric encryption algorithm can be selected according to actual needs, and the embodiments of the present application are not limited to this.

[0051] The following is an example of how to implement file security processing.

[0052] In some embodiments of the present application, the method for secure file processing may include:

[0053] S210, generating file block serial numbers corresponding to respective compressed file blocks in a plurality of compressed file blocks, wherein the plurality of compressed file blocks are obtained by segmenting compressed files of an original file.

[0054] For example, in some embodiments of the present application, the original file is compressed to generate a compressed file. The size of the segmented block is determined by comprehensively considering factors such as the size of the compressed file, the number of segments, the network speed, and the system configuration. The compressed file is segmented according to the size of the segmented block to obtain N compressed file blocks (as a specific example of multiple compressed file blocks). Then, based on the hash chain technology, the sequence number of each file block is generated. The file block sequence number indicates which block the compressed file block belongs to in the complete compressed file block, and is used to merge the compressed file blocks in order when the file download is resumed.

[0055] In some embodiments of the present application, S210 may include: generating an i-th file block sequence number of an i-th compressed file block, wherein the i-th compressed file block is one of the multiple compressed file blocks, and i is a positive integer; and calculating an i+1-th file block sequence number corresponding to an i+1-th compressed file block based on the i-th file block sequence number. When i=1, performing a hash calculation on the first compressed file block and the timestamp to obtain the first file block sequence number.

[0056] For example, in some embodiments of the present application, Figure 3 As shown, the first compressed file block is connected to the timestamp of the upload time, and then a hash operation is performed on it to generate the first file block sequence number S1, that is, S1 = Hash (compressed file block 1 || timestamp), and S1 is used as the initial value of the hash chain. Then the first file block sequence number S1 is continued to be hashed to generate the second file block sequence number S2, that is, S2 = Hash (S1). Similarly, the last file block sequence number SN is generated by hashing the previous file block sequence number SN-1, that is, SN = Hash (SN-1). Among them, compressed file block 1 is also the first compressed file block.

[0057] S220, encrypt the sequence numbers of the respective file blocks to obtain ciphertexts of the respective file blocks.

[0058] For example, in some embodiments of the present application, Figure 4 As shown, use key enc The file block numbers S1-SN are encrypted by a symmetric encryption algorithm to generate ciphertexts C1, C2, ..., CN (as a specific example of the ciphertext of each file block). For example, the symmetric encryption algorithm adopts the domestic block cipher algorithm SM4.

[0059] S230, connecting each compressed file block with each file block ciphertext to obtain multiple file block data.

[0060] For example, in some embodiments of the present application, Figure 5 As shown, the compressed file block and the corresponding encrypted file block sequence number are connected to obtain multiple file block data.

[0061] S240: Store the plurality of file block data in different paths in at least one cloud server, and obtain and store path ciphertexts corresponding to the different paths.

[0062] For example, in some embodiments of the present application, Figure 6 As shown, Figure 5 The file block data in is stored in N cloud service storages in a distributed manner. Figure 5 The file block data in the same device (i.e., cloud service storage) can be stored in a distributed manner, or in multiple storage devices (i.e., N, or less than N). The number of devices can be flexibly set according to specific business needs. After the storage is completed, the different paths of the storage are encrypted to obtain ciphertext B (as a specific example of path ciphertext).

[0063] In some embodiments of the present application, S240 may include: obtaining the file block storage path of each file block data among the multiple file block data, and marking the file block storage path of the first compressed file block among the multiple compressed file blocks; encrypting the file block storage path of each file block data to obtain the path ciphertext.

[0064] For example, in some embodiments of the present application, Figure 5 After the file block data in is stored, the file block storage path of each file block data is obtained, that is, Figure 7 The file block storage paths 1 to N are shown. The public key PK is used to execute an asymmetric encryption algorithm to encrypt the decentralized file block storage paths 1 to N, obtain the ciphertext B, and store the ciphertext B in the local database of the client 100. Among them, the local database only needs to store the ciphertext B of the decentralized file block path, and specially mark the path of the first compressed file block, without encrypting and storing information related to the file block sequence number. The ciphertext B can be decrypted by the private key SK, and the private key SK is saved by the user.

[0065] After completing the encrypted storage of the file through the above embodiment, the implementation process of file decryption and recovery is described below.

[0066] The following is combined with Figure 8 The specific process of file security processing provided by some embodiments of the present application is exemplified. Specifically, the decryption recovery based on file segmentation includes inputting a private key, decrypting a symmetric key, decrypting a file block storage path, decrypting and merging file blocks, and a file output process. An exemplary description is given below.

[0067] Please see attached Figure 8 , Figure 8 A flow chart of a method for secure file processing provided in some embodiments of the present application.

[0068] The following first explains the implementation process of inputting the private key and decrypting the symmetric key, and then explains the implementation process of subsequent file decryption and recovery.

[0069] Specifically, the user can enter the private key SK on the client 100 for subsequent decryption operations. The user accesses the secure folder to read the ciphertext A, and uses the private key SK to decrypt the ciphertext A to obtain the symmetric key key enc .

[0070] The following is an example of how to implement file security processing.

[0071] In some embodiments of the present application, the method for securely processing a file during file decryption and recovery may include:

[0072] S810, decrypt the path ciphertext of the original file to obtain a file block storage path of each file block data of multiple file block data of the original file.

[0073] For example, in some embodiments of the present application, the user accesses the local database to read the ciphertext B, uses the private key SK to decrypt the ciphertext B to obtain the decentralized file block storage paths 1 to N. At the same time, the path of the first compressed file block is found according to the special mark.

[0074] S820: Determine, through the file block storage path of each piece of file block data, each file block ciphertext corresponding to each compressed file block in the plurality of compressed file blocks.

[0075] For example, in some embodiments of the present application, all compressed file blocks 1 to N and corresponding file block ciphertexts C1 to CN may be obtained according to the file block storage paths 1 to N obtained by the above decryption.

[0076] S830, decrypt the ciphertext of each file block to obtain the file block sequence number of each compressed file block.

[0077] For example, in some embodiments of the present application, a symmetric key key is used. enc Decrypt the file block ciphertexts C1-CN to obtain the file block sequence numbers S1, S2, ..., SN.

[0078] In some embodiments of the present application, before executing S840, the file security processing method may also include: S831: obtaining a file block storage path of a first compressed file block among the multiple compressed file blocks; obtaining a first file block sequence number through the file block storage path of the first compressed file block; based on the first file block sequence number, generating each file block sequence number of other compressed file blocks except the first compressed file block; confirming that the first file block sequence number and each file block sequence number are consistent with the individual file block sequence numbers.

[0079] For example, in some embodiments of the present application, according to the path of the first compressed file block obtained in S810, its file block ciphertext C1 can be obtained, and the first file block sequence number S1 can be obtained by decrypting C1. Figure 3 The method shown performs a hash chain operation to obtain all file block serial numbers S2-SN. Compare the S1-SN generated in this step with the S1-SN obtained by decryption in S830 to confirm whether the two are consistent. If they are consistent, it is confirmed that the compressed file block has not been tampered with, and subsequent operations can be performed. If they are inconsistent, it is confirmed that the compressed file block has been tampered with, the operation ends and the corresponding prompt information is output.

[0080] S840, sorting, merging and decompressing the compressed file blocks according to the sequence numbers of the file blocks to obtain the original file.

[0081] For example, in some embodiments of the present application, compressed file blocks are merged according to file block serial numbers S1 to SN to obtain a complete compressed file. Then, the compressed file is decompressed to obtain a complete original file. The original file can be output in blocks in the form of a binary file stream.

[0082] The following is combined with Fig. 9 The specific process of file encryption and decryption provided by some embodiments of the present application is exemplified.

[0083] Please see attached Fig. 9 , Fig. 9 A flow chart of a method for file encryption and decryption provided for some embodiments of the present application.

[0084] S901, compressing the original file to obtain a compressed file.

[0085] S902: Split the compressed file into multiple compressed file blocks.

[0086] S903, based on the hash chain operation, generate each file block sequence number corresponding to each compressed file block in the plurality of compressed file blocks.

[0087] S904, encrypting the sequence number of each file block using a symmetric encryption algorithm to obtain the ciphertext of each file block.

[0088] S905, connecting each compressed file block with each file block ciphertext to obtain multiple file block data; storing the multiple file block data in different paths in at least one cloud server.

[0089] S906: Obtain a file block storage path of each file block data piece among the multiple file block data pieces, and mark the file block storage path of the first compressed file block among the multiple compressed file blocks.

[0090] S907, encrypt the file block storage path of each file block data to obtain a path ciphertext.

[0091] S908, reading the path ciphertext, and using the private key to decrypt the path ciphertext to obtain the file block storage path of each file block data.

[0092] S909, determining each file block ciphertext corresponding to each compressed file block in the plurality of compressed file blocks through the file block storage path of each file block data.

[0093] S910, decrypt each file block ciphertext to obtain each file block serial number of each compressed file block; obtain the first file block serial number based on the file block storage path of the first compressed file block, and then obtain all file block serial numbers through hash chain operation.

[0094] S911, confirming that the file block serial numbers generated by the above two methods are consistent.

[0095] S912, merging and decompressing the compressed file blocks according to the sequence numbers of the file blocks to obtain the original file.

[0096] It can be understood that the specific implementation process of S901 to S912 can refer to the method embodiment provided above, and in order to avoid repetition, the detailed description is appropriately omitted here.

[0097] Through some embodiments of the present application, it can be seen that compared with the traditional encrypted plaintext file block scheme, the present application only needs to encrypt the file block sequence number, which reduces the amount of encrypted data and greatly improves the efficiency of file encryption storage; the file is compressed and stored in segments, which increases the difficulty of illegally obtaining all data block information, and the plaintext is chaotic after the file is compressed. The sequence number is generated by hash chain and encrypted and dispersedly stored on the cloud server side, making it difficult for attackers to determine the location of the file block. Even if unauthorized users and cloud server administrators obtain certain data blocks, they cannot obtain complete data metadata, which prevents data from being stolen and tampered with, and ensures the privacy security of data in the cloud server; file segmentation upload reduces the user's local file storage consumption, reduces the cost of user construction and maintenance of storage devices, and the file is segmented before data upload, which also reduces the server-side load during the upload process; through key security protection, the storage security of the encryption key is improved, and the risk of encryption key leakage is reduced. Each time a file is encrypted, a file encryption key is randomly generated, so the encryption key of each file is different. Compared with encrypting all files with the same key, when a single file is cracked, the security of other files can still be guaranteed, which greatly increases the difficulty of cracking. Combining the advantages of symmetric key algorithms and asymmetric encryption algorithms, the system is both secure and efficient. In addition, binary file streams are output in blocks, which reduces the server load.

[0098] Please refer to Fig.10 , Fig.10 The following is a block diagram of the composition of the device for secure file processing provided by some embodiments of the present application. It should be understood that the device for secure file processing corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the device for secure file processing can be found in the above description. To avoid repetition, the detailed description is appropriately omitted here.

[0099] Fig.10The file security processing device includes at least one software function module that can be stored in a memory in the form of software or firmware or fixed in the file security processing device, and the file security processing device includes: a sequence number generation module 1010, used to generate each file block sequence number corresponding to each compressed file block in a plurality of compressed file blocks, wherein the plurality of compressed file blocks are obtained by segmenting the compressed files of the original file; an encryption module 1020, used to encrypt the each file block sequence number to obtain each file block ciphertext; a data connection module 1030, used to connect the each compressed file block with the each file block ciphertext to obtain multiple file block data; a file storage module 1040, used to store the multiple file block data in different paths in at least one cloud service end, and obtain and store the path ciphertext corresponding to the different paths.

[0100] Please refer to Fig.11 , Fig.11 The following is a block diagram of the composition of the device for secure file processing provided by some embodiments of the present application. It should be understood that the device for secure file processing corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the device for secure file processing can be found in the above description. To avoid repetition, the detailed description is appropriately omitted here.

[0101] Fig.11 The file security processing device includes at least one software function module that can be stored in a memory in the form of software or firmware or fixed in the file security processing device, and the file security processing device includes: a path decryption module 1110, used to decrypt the path ciphertext of the original file, and obtain the file block storage path of each file block data in multiple file block data of the original file; a ciphertext acquisition module 1120, used to determine each file block ciphertext corresponding to each compressed file block in the multiple compressed file blocks through the file block storage path of each file block data; a sequence number acquisition module 1130, used to decrypt each file block ciphertext, and obtain each file block sequence number of each compressed file block; a file recovery module 1140, used to sort, merge and decompress each compressed file block according to the each file block sequence number to obtain the original file.

[0102] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.

[0103] Some embodiments of the present application further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the operations of the method corresponding to any of the above methods provided in the above embodiments.

[0104] Some embodiments of the present application further provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operations corresponding to any of the above methods provided in the above embodiments.

[0105] like Fig.12 As shown, some embodiments of the present application provide an electronic device 1200, which includes: a memory 1210, a processor 1220, and a computer program stored in the memory 1210 and executable on the processor 1220, wherein the processor 1220 can implement a method as described in any of the above embodiments when reading the program from the memory 1210 through a bus 1230 and executing the program.

[0106] Processor 1220 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 1220 can be a microprocessor.

[0107] The memory 1210 may be used to store instructions executed by the processor 1220 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 1220 of the disclosed embodiment may be used to execute instructions in the memory 1210 to implement the method shown above. The memory 1210 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.

[0108] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0110] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for secure file processing, characterized in that: include: Generating a file block sequence number corresponding to each compressed file block in a plurality of compressed file blocks, wherein the plurality of compressed file blocks are obtained by segmenting the compressed files of the original file; Encrypting the serial numbers of each file block to obtain ciphertext of each file block; Connecting each compressed file block with each file block ciphertext to obtain multiple file block data; The plurality of file block data are stored in different paths in at least one cloud service end, and path ciphertexts corresponding to the different paths are obtained and stored.

2. The method according to claim 1, characterized in that The generating of each file block sequence number corresponding to each compressed file block in the plurality of compressed file blocks comprises: Generate an i-th file block sequence number of an i-th compressed file block, wherein the i-th compressed file block is one of the plurality of compressed file blocks, and i is a positive integer; Based on the i-th file block sequence number, the i+1-th file block sequence number corresponding to the i+1-th compressed file block is calculated.

3. The method according to claim 2, characterized in that When i=1, generating the i-th file block sequence number of the i-th compressed file block includes: Perform hash calculation on the first compressed file block and the timestamp to obtain the first file block sequence number.

4. The method according to any one of claims 1 to 3, characterized in that The obtaining and storing the path ciphertexts corresponding to the different paths includes: Acquire a file block storage path of each file block data piece among the plurality of file block data pieces, and mark the file block storage path of a first compressed file block among the plurality of compressed file blocks; The file block storage path of each piece of file block data is encrypted to obtain the path ciphertext.

5. A method for secure file processing, characterized in that: include: Decrypting the path ciphertext of the original file obtained by the method of any one of claims 1 to 4 to obtain a file block storage path of each file block data of the multiple file block data of the original file; Determining, through the file block storage path of each piece of file block data, each file block ciphertext corresponding to each compressed file block in the plurality of compressed file blocks; Decrypting the ciphertext of each file block to obtain the file block sequence number of each compressed file block; The compressed file blocks are sorted, merged and decompressed according to the sequence numbers of the file blocks to obtain the original file.

6. The method according to claim 5, characterized in that Before sorting, merging and decompressing the compressed file blocks according to the sequence numbers of the file blocks, the method includes: Obtaining a file block storage path of a first compressed file block among the multiple compressed file blocks; Obtaining a first file block sequence number through a file block storage path of the first compressed file block; Based on the first file block sequence number, generate each file block sequence number of other compressed file blocks except the first compressed file block; Confirm that the first file block sequence number and each file block sequence number are consistent with the respective file block sequence numbers.

7. A device for securely processing files, characterized in that: include: A sequence number generating module, used to generate a sequence number of each file block corresponding to each compressed file block in a plurality of compressed file blocks, wherein the plurality of compressed file blocks are obtained by segmenting the compressed files of the original file; An encryption module, used for encrypting the serial numbers of the respective file blocks to obtain ciphertexts of the respective file blocks; A data connection module, used to connect the compressed file blocks with the ciphertext of the file blocks to obtain multiple pieces of file block data; The file storage module is used to store the plurality of file block data in different paths in at least one cloud service end, and obtain and store path ciphertexts corresponding to the different paths.

8. A device for securely processing files, characterized in that: include: A path decryption module, used to decrypt the path ciphertext of the original file obtained by the method of any one of claims 1 to 4, and obtain the file block storage path of each file block data of the multiple file block data of the original file; A ciphertext acquisition module, configured to determine, through the file block storage path of each piece of file block data, each file block ciphertext corresponding to each compressed file block in the plurality of compressed file blocks; A sequence number acquisition module, used for decrypting the ciphertext of each file block to obtain the sequence number of each file block of each compressed file block; The file recovery module is used to sort, merge and decompress the compressed file blocks according to the sequence numbers of the file blocks to obtain the original file.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program executes the method according to any one of claims 1 to 6 when executed by a processor.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program executes the method according to any one of claims 1 to 6 when being run by the processor.

11. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program executes the method according to any one of claims 1 to 6 when executed by a processor.

Citation Information

Patent Citations

  • Data storage method and system

    CN106156653A

  • Method, device, computer storage medium and terminal for realizing data storage

    CN108667917A

  • File transmission method, system and device and medium

    CN112291350A

  • Block chain mass big data storage method and system

    CN116360683A

  • File encryption and decryption method and device, electronic equipment and storage medium

    CN117786718A