Data encryption method and computing device
By embedding encrypted file system in the operating system file manager, and storing and encrypting data blocks using a predetermined tree structure, the problem of cumbersome and low security in the existing technology is solved, and convenient and efficient data encryption and Automatic encryption function.
Patent Information
- Application Number
- CN202110520721.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-13
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-05-13
AI Technical Summary
The existing operating system lacks data encryption function, and users need to install third-party encryption tools. The process is cumbersome, low security, and high learning cost.
Embed encrypted file system in the operating system's file manager, store and encrypt data blocks through a predetermined tree structure, realize data encryption, occupy a single process, and automatically encrypt it when the screen is locked or timed out, improving security.
It reduces user learning costs, simplifies the encryption process, improves the convenience and security of data encryption, ensures that data is automatically encrypted when shut down, and prevents data leakage.
Smart Images

Figure CN113094756B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of encryption technology, and in particular to a data encryption method, a computing device and a storage medium. Background Art
[0002] With the continuous development of information technology, the data security of individuals and enterprises has become increasingly important, and how to ensure data security has become a hot topic.
[0003] The existing mainstream operating systems, such as Windows and Linux operating systems, do not provide encryption functions in the file managers of the operating systems. Therefore, in order to achieve data encryption, third-party encryption tools must be installed, such as compression tools with encryption functions such as winrar and 7zip, or encryption tools such as encfs, gocryptfs, and veracrypt. The implementation process is cumbersome. In addition, the encryption methods, encryption parameters, and encryption operations of third-party tools are different, which has a high learning cost for ordinary users, and the security of data encryption through third-party encryption tools is low.
[0004] To this end, the present invention provides a data encryption method which can reduce learning costs, simplify the encryption process and improve the security of data encryption. Summary of the invention
[0005] To this end, the present invention provides a data storage method in an effort to solve or at least alleviate the above problems.
[0006] According to one aspect of the present invention, a data encryption method is provided, which is suitable for being executed in a file manager of an operating system, wherein an encrypted file system is embedded in the file manager of the operating system, the encrypted file system is a file system of the operating system, the encrypted file system occupies a non-resident process alone, and a predetermined tree structure is stored in the encrypted file system, the method comprising the steps of:
[0007] Obtain the data to be encrypted;
[0008] The encrypted data is stored in a predetermined tree structure through an encryption file system, wherein the maximum storage capacity of each node in the predetermined tree structure is the same, and all leaf nodes except the rightmost leaf node store data of the maximum capacity;
[0009] Each node in the predetermined tree structure is encrypted by an encryption file system, thereby realizing data encryption based on a file manager.
[0010] Optionally, embed an encrypted file system in the file manager as follows:
[0011] Create a mount directory, where the mount directory is a directory that users can directly access and the current mount directory is empty;
[0012] Mount the encrypted file system to the mount directory.
[0013] Optionally, the encryption file system stores the data to be encrypted in a predetermined tree structure in the following manner:
[0014] Splitting the data to be encrypted into multiple data blocks;
[0015] The split multiple data blocks are stored in a predetermined tree structure to obtain a basic directory;
[0016] The step of encrypting each node in the predetermined tree structure by the encrypted file system in the following manner includes:
[0017] Each node in the predetermined tree structure is encrypted based on a data encryption algorithm to obtain an encrypted basic directory.
[0018] Optionally, the method further comprises the steps of:
[0019] Decrypt the encrypted base directory and get the base directory
[0020] Mount the base directory to the mount directory;
[0021] In response to a user accessing a data block of a base directory in the mounted directory, when the access time exceeds a first preset time, a node corresponding to the currently accessed data block is encrypted.
[0022] Optionally, after mounting the base directory to the mount directory, the following steps are further included:
[0023] Replace the path to the base directory in the mount directory with the preset virtual path.
[0024] Optionally, the step of the encryption file system splitting the data to be encrypted into multiple data blocks includes:
[0025] Determine the current offset of the data pointer of the data object to be encrypted;
[0026] Taking the determined current offset of the data pointer as the starting position, reading data of a first preset value from the data to be encrypted as a data block;
[0027] The current offset of the data pointer is updated to be the sum of the determined current offset of the data pointer and the first preset value.
[0028] Optionally, the encryption file system uses the determined current offset of the data pointer as the starting position and reads data of a first preset value from the data to be encrypted as a data block, including the following steps:
[0029] Determine whether the product of the current number of times the data to be encrypted is read and the first preset value is less than the size of the data to be encrypted. If so, read the data of the first preset value with the determined current offset of the data pointer as the starting position. If not, determine the number of data to be encrypted as the second value according to the following formula, and read the data of the second value with the determined current offset of the data pointer as the starting position:
[0030] L=m-(a-1)*b
[0031] Wherein, L is the number of data to be encrypted, m is the size of the storage space occupied by the data to be encrypted, a is the number of times the data to be encrypted is currently read, and b is a first preset value;
[0032] The read data is regarded as a data block.
[0033] Optionally, the step of storing the split multiple data blocks in a predetermined tree structure by the encryption file system includes:
[0034] Determine whether the current node has a child node. If so, save its child node ID in the current node. If not, save the current node ID and data block in the current node.
[0035] Optionally, the step of storing the split multiple data blocks in a predetermined tree structure by the encryption file system further includes:
[0036] Assigning a unique data block ID to each data block and setting version information for each data block, wherein the data blocks are distinguished by the data block ID and the versions of the data blocks are distinguished by the data block version information;
[0037] The step of determining whether the current node has a child node includes:
[0038] Determine whether the current node has a child node. If so, save its child node ID in the current node. If not, save the current node ID, data block version information, data block and data block ID in the current node.
[0039] Optionally, the step of the encrypted file system saving the current node ID, data block version information, data block and data block ID in the current node includes:
[0040] Determine whether there is an unfilled node in the predetermined tree structure, if not, save the current node ID, data block version information, data block and data block ID in the current node, if yes, determine whether the sum of the data block size corresponding to the read second numerical data and the data block size in the node that is not filled with data exceeds the maximum storage capacity of the node;
[0041] If the maximum storage capacity of the node is exceeded, the current node ID, data block version information, data block and data block ID are saved in the current node;
[0042] If the maximum storage capacity of the node is not exceeded, the data block corresponding to the read second numerical data, the version information of the data block and the data block ID are merged into the found node that is not filled with data.
[0043] Optionally, the step of storing the split multiple data blocks in a predetermined tree structure by the encryption file system further includes:
[0044] In response to an operation of replacing a data block in a leaf node of a predetermined tree structure with a target data block, determining whether a data block ID of the target data block is the same as a data block ID in a current node, if not, not performing replacement, and if so, determining whether data block version information of the target data block is the same as data block version information in the current node;
[0045] If the data block version information of the target data block is the same as the data block version information in the current node, the data block in the current node is replaced with the target data block; if they are not the same, no replacement is performed.
[0046] Optionally, the step of encrypting each node in the predetermined tree structure to obtain an encrypted basic directory comprises:
[0047] Encrypting multiple nodes in a predetermined tree structure in parallel at a time through a data encryption algorithm;
[0048] The encryption key of each node is saved in the parent node of the node to obtain the encryption base directory;
[0049] The step of determining whether the current node has a child node includes:
[0050] Determine whether the current node has a child node. If so, save its child node ID and child node encryption key in the current node. If not, save the current node ID, data block version information, data block and data block ID in the current node.
[0051] Optionally, in response to a user accessing a data block of a base directory in the mounted directory, when the access time exceeds a first preset time, the step of encrypting a node corresponding to the currently accessed data block includes:
[0052] Encrypting the acquired data to be encrypted by using a data encryption algorithm to obtain a first key;
[0053] decrypting the data to be encrypted using the first key;
[0054] Decrypting the nodes of the predetermined tree structure corresponding to the data to be encrypted by using the child node encryption key;
[0055] In response to a user accessing a data block of a base directory in the mounted directory, timing starts from when the user accesses the data block. When the access time exceeds a preset first threshold, a node corresponding to the currently accessed data block is encrypted using a data encryption algorithm.
[0056] Optionally, the method further comprises the steps of:
[0057] The first key is encrypted by a data encryption algorithm to obtain a recovery key, wherein when the first key is forgotten, the first key is obtained by the recovery key.
[0058] Optionally, the method further comprises the steps of:
[0059] In response to the lock screen operation, the currently accessed data block is encrypted using a data encryption algorithm.
[0060] Optionally, the method further comprises the steps of:
[0061] Special functions of encrypted data are shielded, wherein the special functions include one or more of a data sharing function, a bookmarking function, and a tagging function.
[0062] Optionally, the maximum storage capacity of each node in the predetermined tree structure is equal to a first preset value, and the first preset value is 512 KB.
[0063] Optionally, the encrypted file system is a fuse file system.
[0064] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for being executed by the at least one processor, and the program instructions include instructions for executing the method as described above.
[0065] According to one aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the method described above.
[0066] According to the technical solution of the present invention, a data encryption method is provided, in which a data encryption module is embedded in a file manager, so that the file manager implements data encryption through the data encryption module, thereby eliminating the need to install third-party encryption software, and users do not need to learn how to use third-party encryption software, thereby reducing learning costs and enhancing the convenience of data encryption. The data encryption module occupies a separate process (non-resident process) and is not in the same process as the file manager. When the operating system is shut down, the process of the encrypted file system will automatically exit, and the mounted data directory to be encrypted will be automatically unloaded, thereby achieving automatic encryption upon shutdown and improving the security of data encryption.
[0067] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0069] Figure 1 A schematic diagram of a computing device 100 according to one embodiment of the present invention is shown;
[0070] Figure 2 A flow chart of a data encryption method 200 according to an embodiment of the present invention is shown;
[0071] Figure 3 A flow chart of a method for storing a plurality of split data blocks in a predetermined tree structure through an encryption file system according to an embodiment of the present invention is shown;
[0072] Figure 4 A schematic diagram showing a predetermined storage structure according to an embodiment of the present invention; and
[0073] Figure 5 A schematic diagram showing a mapping table corresponding to a predetermined storage structure according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0074] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0075] The file manager is a component of the operating system and a file management tool that can manage files or folders, including operations such as copying, cutting, moving, deleting, creating, and searching for files. However, the file manager in the current operating system does not include data encryption function.
[0076] With the continuous development of information technology, the data security of individuals and enterprises has become increasingly important, and how to ensure data security has become a hot topic. The existing mainstream operating systems, such as the Linux operating system, do not provide encryption functions in the file manager of the operating system. Therefore, in order to achieve data encryption, you can only install third-party encryption tools, such as compression tools with encryption functions such as winrar and 7zip, or encryption tools such as encfs, gocryptfs, and veracrypt, which is a cumbersome process.
[0077] When encrypting or decrypting files with a third-party encryption tool, you only need to enter the password, which can well protect the user's private data. However, different encryption tools require different operations and encryption settings, and the user's learning cost is high. In addition, when using an encryption tool, after the encrypted data is decrypted, and the user locks the screen and leaves the computer until the user returns to the computer, people who know the computer password can directly access the unlocked private data after unlocking the computer, which can easily cause data leakage.
[0078] Compression tools provide encryption functions, but when the encrypted data is decompressed, the encrypted file exists in the form of an ordinary folder. At this time, the folder will not be automatically relocked regardless of the operating system status. When the user leaves the computer, data leakage is likely to occur.
[0079] To this end, the present invention defines a tree structure, which is defined as follows: the maximum storage capacity of each node in the tree structure is the same, all leaf nodes except the rightmost leaf node in the tree structure store data of the maximum capacity, and each node in the tree structure stores the current node ID, child node ID, child node encryption key, or stores the current node ID, data block version information (to distinguish different versions of data blocks), data block and data block ID (to distinguish data blocks).
[0080] Based on the definition of the tree structure, the present invention provides a data encryption method, which embeds a data encryption module in the file manager of the operating system, so that the file manager implements data encryption through the data encryption module, thereby eliminating the need to install third-party encryption software, and users do not need to learn how to use the third-party encryption software, thereby reducing learning costs and enhancing the convenience of data encryption.
[0081] The data encryption module is an encrypted file system (file system), that is, an encrypted file system is embedded in the file manager. The encrypted file system occupies a separate process (non-resident process), that is, it is not in the same process as the file manager (in the resident process). When the operating system is shut down, the encrypted file system process will automatically exit. At this time, the mounted data directory to be encrypted will be automatically unmounted, thereby realizing automatic encryption at shutdown and improving the security of data encryption.
[0082] In addition, by storing data in a predetermined tree structure and encrypting each node in the tree structure, encryption of metadata (file metadata is data that describes data, mainly describing data attribute information, such as file size, number, directory structure, etc.) is achieved, thereby improving the security of data encryption.
[0083] The file manager will also respond to the lock screen operation, encrypt the currently accessed data block, and automatically encrypt when the access data exceeds the preset time. Therefore, when the user accesses the decrypted data, if the computing device is locked or the access time of the data block exceeds the preset time, the currently accessed data can be automatically encrypted, further improving the security of data encryption.
[0084] Since all leaf nodes except the rightmost leaf node in the tree structure store data of maximum capacity (compared to each leaf node storing only part of the data but not the data of maximum capacity), the number of nodes will be reduced, thereby reducing the waste of storage space. Since the maximum capacity of data stored in leaf nodes is the same, when determining the size of encrypted data, it is not necessary to obtain the size of data stored in each node. It is only necessary to access the data size of the rightmost leaf node to calculate the size of the encrypted data, which can quickly determine the size of the encrypted data and reduce time consumption. In addition, the node also stores the version information of the encrypted data block, so that the attacker cannot replace the data block with different versions of the same data block, ensuring the integrity of the data, thereby improving the security of data encryption. It should also be noted that the node stores the encryption key of its child node, so that only after obtaining the encryption key of the upper node and decrypting it, can its child node be decrypted, further improving the security of data encryption.
[0085] The data encryption method of the present invention is executed in a file manager of an operating system, and the operating system is configured in a computing device. In one embodiment, Figure 1 FIG. 1 is a block diagram of a computing device 100 according to an embodiment of the present invention. Figure 1 As shown, in a basic configuration 102, computing device 100 typically includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.
[0086] Depending on the desired configuration, the processor 104 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a first-level cache 110 and a second-level cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.
[0087] Depending on the desired configuration, the system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, the application 122 may be arranged to operate on the operating system using the program data 124. The program data 124 includes instructions, and in the computing device 100 according to the present invention, the program data 124 includes instructions for executing the data encryption method 200.
[0088] The computing device 100 further includes a storage device 132, which includes a removable storage 136 and a non-removable storage 138, and both the removable storage 136 and the non-removable storage 138 are connected to the storage interface bus 134. In the present invention, data related to each event occurring during program execution and time information indicating the occurrence of each event can be stored in the storage device 132, and the operating system 120 is suitable for managing the storage device 132. The storage device 132 can be a disk.
[0089] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.
[0090] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0091] The computing device 100 can be implemented as a server, such as a file server, a database server, an application server, and a WEB server, etc., and can also be implemented as a part of a small-sized portable (or mobile) electronic device, such as a cellular phone, a personal digital assistant (PDA), a personal media player device, a wireless network browsing device, a personal head-mounted device, an application-specific device, or a hybrid device that can include any of the above functions. The computing device 100 can also be implemented as a personal computer including a desktop computer and a notebook computer configuration. In some embodiments, the file manager in the operating system 120 of the computing device 100 is configured to execute a data encryption method 200 according to the present invention.
[0092] Figure 21 shows a flow chart of a data encryption method 200 according to an embodiment of the present invention. The method 200 is suitable for being executed in a file manager of an operating system 120 of a computing device 100. The data encryption method of the present invention is applied to a file manager of a Linux operating system. Figure 2 As shown, the data storage method 200 begins with step S210 .
[0093] Before executing step S210, a data encryption module needs to be embedded in the file manager, and the data is stored, encrypted and decrypted through the data encryption module. The data encryption module is an encrypted file system (i.e., a file system), that is, an encrypted file system is embedded in the file manager, and a predetermined tree structure is stored in the encrypted file system. The encrypted file system occupies a non-resident process alone, that is, it is not in the same process as the file manager. Among them, the file system is a system that organizes and allocates the space of the file storage device, is responsible for file storage, and protects and retrieves the stored files.
[0094] In one embodiment, the method of embedding an encrypted file system in a file manager is as follows: create a mount directory, wherein the mount directory is a directory that can be directly accessed by the user, the current mount directory is empty, and the encrypted file system is mounted to the mount directory. At this time, the content of the mount directory is the data to be encrypted, thereby embedding the encrypted file system in the file manager. The data to be encrypted in the mount directory can be directly accessed and modified, and any modification to the file in the mount directory will be synchronized to the corresponding content of the data to be encrypted through the file system. Among them, the file system is such as a fuse file system. The present invention does not limit the file system, and all file systems are within the protection scope of the present invention.
[0095] It should be noted that since the encrypted file system occupies a separate non-resident process and is not in the same process as the file manager, when the operating system is shut down, the non-resident process of the encrypted file system will automatically exit. At this time, the data to be encrypted mounted to the mount directory will be automatically unmounted, thereby achieving automatic encryption at shutdown and improving the security of data encryption.
[0096] After the encrypted file system is embedded in the file manager, in step S210, the data to be encrypted is obtained, and the obtained data to be encrypted is mounted to the mount directory through the encrypted file system. Specifically: the data to be encrypted is obtained, the mount point of the mount directory is searched, and the data to be encrypted is mounted to the mount point.
[0097] After obtaining the data to be encrypted, the first layer of encryption is performed on the obtained data to be encrypted by the data encryption algorithm to obtain the first key. The first key is the password set by the user, and the first key is the first layer encryption key of the data to be encrypted. The encrypted data will be encrypted twice later. The encryption algorithm includes but is not limited to SAR, AES-256-GCM, TWOFISH-256-GCM. The present invention does not limit this, and all encryption algorithms are within the protection scope of the present invention.
[0098] In order to prevent the user from forgetting the first key and being unable to perform the first-layer decryption of the encrypted data, in one embodiment, the first key is encrypted by a data encryption algorithm (such as a SAR data encryption algorithm) to obtain a recovery key, including the following steps:
[0099] A public key and a private key are generated through a data encryption algorithm, and the public key is combined with the first key to obtain a recovery key. Furthermore, in order to facilitate the user to save the recovery key, the recovery key is obtained through the QR code technology to obtain a corresponding QR code, so that the user can save the recovery key in the mobile device by scanning the QR code. When the user forgets the first key, the private key and the recovery key are simultaneously input into the data encryption algorithm, and the first key can be obtained by decrypting the data encryption algorithm.
[0100] Then in step S220, the data to be encrypted is stored in a predetermined tree structure through the encryption file system. In one embodiment, the data to be encrypted is split into multiple data blocks through the encryption file system, and the multiple split data blocks are stored in a predetermined tree structure to obtain a basic directory. Among them, the maximum storage capacity of each node in the predetermined tree structure is the same, and all leaf nodes except the rightmost leaf node store data with the maximum capacity. Each node in the predetermined tree structure is assigned a unique node ID. The node ID can be a random number, random characters, a random combination of numbers and characters, etc. The present invention does not limit this. For example, the node ID is rootID (according to the point ID), ID_A, ID_A_1, etc.
[0101] In one embodiment, the step of splitting the data to be encrypted into multiple data blocks by the encryption file system includes: determining the current offset of the data pointer of the data object to be encrypted, taking the determined current offset of the data pointer as the starting position, reading data of a first preset value from the data to be encrypted as a data block, and updating the current offset of the data pointer to be the sum of the determined current offset of the data pointer and the first preset value.
[0102] Next, take the encryption file system splitting a data block as an example, the process is as follows: determine the current offset of the data pointer of the data to be encrypted, judge whether the product of the current number of times the data to be encrypted is read and the first preset value is less than the size of the data to be encrypted, if so, read the data of the first preset value with the determined current offset of the data pointer as the starting position, if not, determine the number of data to be encrypted to be read according to the following formula as the second value, and read the data of the second value with the determined current offset of the data pointer as the starting position:
[0103] L=m-(a-1)*b
[0104] Among them, L is the number of data to be encrypted read, m is the memory size occupied by the data to be encrypted, a is the current number of times the data to be encrypted is read, and b is a first preset value, which is the same as the maximum storage capacity of each node in the predetermined tree structure, that is, the maximum capacity of storing data in the leaf nodes corresponding to the data to be encrypted in the tree structure is the same.
[0105] Since the leaf nodes corresponding to the data to be encrypted in the tree structure have the same maximum data storage capacity, and data blocks are stored in the leaf nodes, when obtaining the encrypted data size after using the above tree structure to store the data to be encrypted, there is no need to obtain the size of the data stored in each node and then sum it up. Instead, the number of nodes is subtracted by 1 and then multiplied by the maximum capacity of the node, and then the data size of the rightmost leaf node is added to determine the size of the data to be encrypted. This is equivalent to only accessing the data size of the rightmost leaf node to calculate the encrypted data size, which can quickly obtain the data size and reduce time consumption.
[0106] In one implementation, a test is performed with 2 GB of data to be encrypted and the encryption algorithm is AES-256-GCM, and the copying time and deletion time corresponding to data blocks of different sizes are recorded, as shown in Table 1:
[0107] Table 1
[0108]
[0109]
[0110] As can be seen from Table 1, when the data block size is 512MB, it takes 21s to copy the data block and 4s to delete the data block. Compared with the data block size of 256MB, it takes 22s to copy the data block and 6s to delete the data block. When the data block size is 512MB, it takes 1s less to copy the data block and 2s less to delete the data block. When the data block size is 1024KB, it takes 20s to copy the data block and 3s to delete the data block. Compared with the data block size of 512MB, the data block size of 1024MB reduces the time taken to copy the data block by 1s and reduces the time taken to delete the data block by 1s. It can be seen that when the data block size is 1024MB, the performance gain is already very small, and as the data block size increases, the encryption time-consuming problem will also be serious. Therefore, the present invention sets the first value to 512KB, and the maximum storage capacity of each node in the predetermined tree structure is also 512KB.
[0111] Then, the read data is used as a data block, and the current offset of the data pointer is updated to be the sum of the determined current offset of the data pointer and the first preset value. The above process is repeated to divide the data to be encrypted into multiple data blocks.
[0112] In the process of splitting the data to be encrypted into multiple data blocks, all leaf nodes except the rightmost leaf node store data of the maximum capacity. Since all other leaf nodes store data of the maximum capacity, the number of nodes will be reduced when storing data of the same size, thereby reducing the storage space occupied during the data encryption process, improving the operating efficiency of the file manager, and thus improving the data encryption efficiency.
[0113] After the data to be encrypted is split into multiple data blocks by the encryption file system, in one embodiment, Figure 3 As shown, Figure 3 is a flow chart of a method for storing multiple split data blocks in a predetermined tree structure through an encrypted file system in the present invention, Figure 3 Includes steps S310 to S370.
[0114] In step S310, a unique data block ID is assigned to each data block and version information is set for each data block, wherein the data block is distinguished by the data block ID, and the data block ID can be a random number, random characters, a random combination of numbers and characters, etc., which is not limited in the present invention, for example, the data block ID is file A1. The data block version information can distinguish the version of the data block, and the version information can be a random number, random characters, a random combination of numbers and characters, etc., which is not limited in the present invention, as long as the set version information is unique, for example, the version (version) is 1.
[0115] Then in step S320, it is determined whether the current node has a child node. If so (indicating that the node is not a leaf node), step S330 is executed to save the current node ID and child node ID in the current node. If not (indicating that the node is a leaf node), step S340 is executed to determine whether there is an unfilled node in the predetermined tree structure. If not, step S350 is executed to save the current node ID, data block version information, data block and data block ID in the current node. If there is an unfilled node in the predetermined tree structure, step S360 is executed to determine whether the sum of the data block size corresponding to the read second numerical data and the data block size in the node that is not filled with data exceeds the maximum storage capacity of the node. If so, step S350 is executed. If not, step S370 is executed to merge the data block corresponding to the read second numerical data into the found node that is not filled with data. Since the data blocks to be stored in the unfilled nodes in different subtrees in the tree structure can be merged, the storage space occupation is further reduced during the data encryption process, thereby reducing the waste of storage space and improving the utilization rate of storage space.
[0116] In one embodiment, in response to an operation of replacing a data block stored in a leaf node of a predetermined tree structure with a target data block, the encrypted file system determines whether the data block ID of the target data block is the same as the data block ID in the current node. If not, no replacement is performed. If yes, whether the data block version information of the target data block is the same as the data block version information in the current node is determined. If the data block version information of the target data block is the same as the data block version information in the current node, the data block in the current node is replaced with the target data block. If they are not the same, no replacement is performed.
[0117] By saving the data block ID and version information of the data in the node, it is equivalent to standardizing the node format for storing data, which can prevent attackers from using data blocks with different IDs to replace or delete data blocks with the current ID, and also prevent attackers from using data blocks with previous versions to replace or delete data blocks with the current version, thereby improving the security of data encryption.
[0118] Then in step S230, each node in the predetermined tree structure is encrypted through the encryption file system. Specifically, multiple nodes in the predetermined tree structure are encrypted in parallel at a time through the data encryption algorithm. That is, multiple data blocks can be encrypted at the same time, thereby improving data encryption efficiency, and the encryption key of each node is saved in the parent node of the node to obtain an encrypted basic directory.
[0119] In one embodiment, the encryption key of each node is saved in the parent node of the node through an encrypted file system, wherein the encryption key is the password for encrypting data blocks and decrypting each node in a predetermined tree structure. Therefore, in this embodiment, the above step S330 is: saving the current node ID, child node ID and child node encryption key in the current node. Since the encryption key of each node is saved in the parent node of the node, if you want to decrypt a data block, you need to iterate the decryption from top to bottom, that is, you need the above-mentioned first key to perform the first-level decryption on the encrypted data, and then decrypt each node step by step from top to bottom according to the predetermined tree structure (equivalent to the second-level decryption) to obtain the encryption key of the node, the difficulty of decryption is increased, and the security of data encryption is further improved.
[0120] Take a file to be encrypted (data to be encrypted) split into 4 data blocks as an example. Figure 4 A schematic diagram of a predetermined storage structure according to an embodiment. Figure 4 The storage structure in includes nodes rootID, ID_A, ID_B, ID_C, ID_A_1, ID_B_1 and ID_B_2. Node rootID is the root node of the storage structure. Nodes ID_A, ID_B and ID_C are child nodes of node rootID. Node ID_A_1 is a child node of node ID_A. Nodes ID_B_1 and ID_B_2 are child nodes of node ID_B. Figure 4 In the storage structure shown, nodes ID_C, ID_A_1, ID_B_1 and ID_B_2 are leaf nodes, and data blocks are stored in these four nodes. Since ID_B_2 is the rightmost leaf node, nodes ID_C, ID_A_1, and ID_B_1 can all store data of the maximum capacity, while node ID_B_2 may not store data of the maximum capacity, and there may be some free storage space in this node.
[0121] In this embodiment, the node rootID is the root node, and the current node ID, child node ID and child node encryption key are stored in the node. Since nodes ID_A and ID_B have child nodes, nodes ID_A and ID_B store the current node ID, child node ID and child node encryption key. Since node ID_C has no child nodes, node ID_C stores the current node ID, data block version information, data block and data block ID. Node ID_A_1 is the child node of node ID_A, and the node has no child nodes, so node ID_A_1 stores the current node ID, data block version information, data block and data block ID. Node ID_B_1 and ID_B_2 are the child nodes of node ID_B, and have no child nodes, so nodes ID_B_1 and ID_B_2 store the current node ID, data block version information, data block and data block ID respectively.
[0122] According to the storage structure, it can be mapped into a mapping table. Then, after the data to be stored is stored in the predetermined storage structure, it will also be mapped into a mapping table. Figure 4 Taking the storage structure shown in as an example, the corresponding mapping table is as follows Figure 5 As shown, Figure 5 Schematic diagram of a mapping table corresponding to a storage structure of a file to be encrypted, taking the case where the file to be encrypted is split into four data blocks (the data block names are file A1, file B1, file B2 and file C respectively) as an example.
[0123] Figure 5 The node rootID in is the root node of the storage structure, which stores the current node ID (rootID), child node IDs (ID_A, ID_B, and ID_C), and child node encryption keys (ID_A_pw, ID_B_pw, and ID_C_pw). Nodes ID_A and ID_B are child nodes of the node rootID, and these two nodes have child nodes, so the current node ID, child node ID, and child node encryption key are stored in nodes ID_A and ID_B respectively. Specifically, nodes ID_A and ID_B store the current node ID (ID_A, ID_B), child node IDs (ID_A_1, ID_B_1, ID_B_2), and child node encryption keys (ID_A_1_pw, ID_B_1_pw, ID_B_2_pw), respectively. Node ID_C is a child node of node rootID, and the node has no child nodes, so node ID_C stores the current node ID, data block version information, data block and data block ID, specifically, the current node ID (ID_C), data block version information (version), data block (conrent) and data block ID (file C). Node ID_A_1 is a child node of node ID_A, and the node has no child nodes, so node ID_A_1 stores the current node ID, data block version information, data block and data block ID, specifically, the current node ID (ID_A_1), data block version information (version), data block (conrent) and data block ID (file A). Nodes ID_B_1 and ID_B_2 are child nodes of node ID_B respectively, and the two nodes have no child nodes, so nodes ID_B_1 and ID_B_2 store the current node ID (ID_B_1, ID_B_2 respectively), data block version information (version, version), data block (conrent, conrent) and data block ID (file B1, file B2) respectively.
[0124] Through the above content, it is realized that an encrypted file system is embedded in the file manager, so that the file manager realizes data encryption based on the encrypted file system, so there is no need to install third-party encryption software, and users do not need to learn how to use third-party encryption software, which reduces the learning cost and enhances the convenience of data encryption. Since the encrypted file system occupies a separate process (non-resident process) and is not in the same process as the file manager (the process where the file manager is located is a resident process), when the operating system is shut down, the process of the encrypted file system will automatically exit, and the mounted data directory to be encrypted will be automatically unloaded at this time, thereby realizing automatic encryption at shutdown and improving the security of data encryption. In addition, the encrypted file system saves the encryption key of the child node to its parent node during the data encryption process, thereby increasing the difficulty of decryption and improving the security of data encryption.
[0125] In order to prevent users from modifying data based on the real path of the data to be encrypted, in one embodiment, the encrypted data is first decrypted using the first key and the encryption key to obtain the decrypted data, the decrypted data corresponding to the file is searched through the encrypted file system, and the decrypted data sent through the encrypted file system is received, and the root path of the decrypted data is replaced by a virtual path (such as dfmvault). For example, under normal circumstances, the following data path will be displayed: / local / share / applications / vault_unlocked / Folder A / test / , but after the virtual path replacement, the front part of the path is replaced by the virtual path, for example: dfmvault: / / / Folder A / test / . Through the above method, the user cannot see the real path of the data to be encrypted, thereby preventing the user from deleting, modifying, and other operations on the encrypted data, thereby improving the security of data encryption.
[0126] After the encrypted data is decrypted, and during the time period from when the user locks the screen and leaves the computer to when the user returns to the computer, a person who knows the computer password can directly access the unlocked private data after unlocking the computer, which can easily lead to data leakage. In order to solve this problem, the file manager of the present invention responds to the lock screen operation and encrypts the currently accessed data block using a data encryption algorithm. Through the above method, after the encrypted data is decrypted, and during the time period from when the user locks the screen and leaves the computer to when the user returns to the computer, since the data has been automatically encrypted, a person who knows the computer password cannot see the data after unlocking the computer, thereby preventing data leakage, realizing automatic encryption on the lock screen, and further improving the security of data encryption.
[0127] In one embodiment, an access time is preset, and when the access time exceeds the preset time, the data is automatically encrypted. Specifically, in response to a user accessing a data block in a mounted directory, when the access time exceeds a first preset time, the node corresponding to the currently accessed data block is encrypted by the encrypted file system. The first preset time can be set according to the actual application scenario, and the present invention does not limit this. For example, the first preset time is 5 minutes, 10 minutes or 20 minutes. The encrypted file system encrypts the node corresponding to the currently accessed data block through a data encryption algorithm, further improving the security of data encryption.
[0128] Existing file managers add functions such as file sharing, bookmarks, and marking for convenience, but the data in encrypted files has a higher level of privacy, so the present invention will shield special functions. In one embodiment, shielding special functions is performed in the following manner: in response to a user selecting data in a mounted directory, obtaining the path of the data, determining whether the path header of the obtained path is a virtual path, if so, not displaying menu items for special functions, if not, displaying menu items for special functions. Among them, special functions include but are not limited to data sharing functions, bookmarking functions, and marking functions.
[0129] According to the above content, a data encryption module is embedded in the file manager, so that the file manager can realize data encryption through the data encryption module, so there is no need to install third-party encryption software, and users do not need to learn how to use third-party encryption software, which reduces the learning cost and enhances the convenience of data encryption. The data encryption module is an encrypted file system, and the encrypted file system occupies a process (non-resident process) alone, that is, it is not in the same process as the file manager. When the operating system is shut down, the process of the encrypted file system will automatically exit, and the mounted data directory to be encrypted will be automatically unloaded at this time, thereby realizing automatic encryption at shutdown and improving the security of data encryption. The file manager will also respond to the lock screen operation, encrypt the currently accessed data block, and automatically encrypt when the access data exceeds the preset time, so that in the process of the user accessing the decrypted data, if the computing device locks the screen or the access time of the data block exceeds the preset time, the currently accessed data can be automatically encrypted, further improving the security of data encryption.
[0130] A9: As described in A8, the step of storing the split multiple data blocks in a predetermined tree structure by the encryption file system further includes:
[0131] Assigning a unique data block ID to each data block and setting version information for each data block, wherein the data blocks are distinguished by the data block ID and the versions of the data blocks are distinguished by the data block version information;
[0132] The step of determining whether the current node has a child node includes:
[0133] Determine whether the current node has a child node. If so, save its child node ID in the current node. If not, save the current node ID, data block version information, data block and the data block ID in the current node.
[0134] A10: The method as described in A9, wherein the step of the encrypted file system storing the current node ID, the data block version information, the data block and the data block ID in the current node comprises:
[0135] Determine whether there is an unfilled node in the predetermined tree structure, if not, save the current node ID, data block version information, data block and the data block ID in the current node, if yes, determine whether the sum of the data block size corresponding to the read second numerical data and the data block size in the node that is not filled with data exceeds the maximum storage capacity of the node;
[0136] If the maximum storage capacity of the node is exceeded, the current node ID, data block version information, data block and the data block ID are saved in the current node;
[0137] If the maximum storage capacity of the node is not exceeded, the data block corresponding to the read second numerical data, the version information of the data block and the data block ID are merged into the found node that is not filled with data.
[0138] A11: As described in A9 or A10, the step of storing the split multiple data blocks in a predetermined tree structure by the encryption file system further includes:
[0139] In response to an operation of replacing a data block in a leaf node of the predetermined tree structure with a target data block, determining whether a data block ID of the target data block is the same as a data block ID in a current node, if not, not performing replacement, and if so, determining whether data block version information of the target data block is the same as data block version information in the current node;
[0140] If the data block version information of the target data block is the same as the data block version information in the current node, the data block in the current node is replaced with the target data block; if they are not the same, no replacement is performed.
[0141] A12: The method as described in any one of A9 to A11, wherein the step of the encrypted file system encrypting each node in the predetermined tree structure to obtain an encrypted basic directory comprises:
[0142] Encrypting multiple nodes in the predetermined tree structure in parallel at a single time using the data encryption algorithm;
[0143] The encryption key of each node is saved in the parent node of the node to obtain the encryption basic directory;
[0144] The step of determining whether the current node has a child node includes:
[0145] Determine whether the current node has a child node. If so, save its child node ID and child node encryption key in the current node. If not, save the current node ID, data block version information, data block and the data block ID in the current node.
[0146] A13 is the method as described in A12, wherein in response to the user accessing the data block of the base directory in the mounted directory, when the access time exceeds a first preset time, the step of encrypting the node corresponding to the currently accessed data block comprises:
[0147] Encrypting the acquired data to be encrypted by using the data encryption algorithm to obtain a first key;
[0148] decrypting the data to be encrypted using the first key;
[0149] Decrypting the node of the predetermined tree structure corresponding to the data to be encrypted by using the sub-node encryption key;
[0150] In response to a user accessing a data block of a base directory in the mounted directory, timing starts from when the user accesses the data block. When the access time exceeds a preset first threshold, the node corresponding to the currently accessed data block is encrypted using the data encryption algorithm.
[0151] A14 The method as described in A13 further includes the steps of:
[0152] The first key is encrypted by the data encryption algorithm to obtain a recovery key, wherein when the first key is forgotten, the first key is obtained by using the recovery key.
[0153] A15 The method as described in any one of A1 to A14, further comprising the steps of:
[0154] In response to the lock screen operation, the currently accessed data block is encrypted using a data encryption algorithm.
[0155] A16 The method as described in any one of A1 to A15, further comprising the steps of:
[0156] Shielding special functions of encrypted data, wherein the special functions include one or more of a data sharing function, a bookmarking function, and a marking function.
[0157] A17 A method as described in any one of A6 to A16, wherein the maximum storage capacity of each node in the predetermined tree structure is equal to the first preset value, and the first preset value is 512KB.
[0158] A18 A method as described in any one of A1 to A17, wherein the encrypted file system is a fuse file system.
[0159] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0160] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the data encryption method of the present invention according to the instructions in the program code stored in the memory.
[0161] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0162] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0163] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0164] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0165] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0166] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0167] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0168] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0169] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0170] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A data encryption method, suitable for being executed in a file manager of an operating system, wherein an encrypted file system is embedded in the file manager of the operating system, wherein the encrypted file system is a file system of the operating system, wherein the encrypted file system occupies a non-resident process alone, wherein a predetermined tree structure is stored in the encrypted file system, wherein the method comprises the steps of: Obtain the data to be encrypted; The encrypted data is stored in the predetermined tree structure through the encryption file system, wherein: The maximum storage capacity of each node in the predetermined tree structure is the same, and all leaf nodes except the rightmost leaf node store data of the maximum capacity; Encrypting each node in the predetermined tree structure through the encryption file system, thereby realizing data encryption based on the file manager; The encrypted file system is embedded in the file manager in the following manner: Create a mount directory, wherein the mount directory is a directory that the user can directly access and the current mount directory is empty; Mounting the encrypted file system to the mount directory; The encryption file system stores the data to be encrypted in the predetermined tree structure in the following manner: Splitting the data to be encrypted into multiple data blocks; The split multiple data blocks are stored in the predetermined tree structure to obtain a basic directory; The step of encrypting each node in the predetermined tree structure by the encryption file system in the following manner includes: Encrypting each node in the predetermined tree structure based on a data encryption algorithm to obtain an encrypted basic directory; The step of the encryption file system splitting the data to be encrypted into multiple data blocks includes: Determine the current offset of the data pointer of the data to be encrypted; Taking the determined current offset of the data pointer as the starting position, reading data of a first preset value from the data to be encrypted as a data block; Updating the current offset of the data pointer to the sum of the determined current offset of the data pointer and the first preset value; The encryption file system uses the determined current offset of the data pointer as the starting position and reads data of a first preset value from the data to be encrypted as a data block, including the following steps: Determine whether the product of the current number of times the data to be encrypted is read and the first preset value is less than the size of the data to be encrypted. If so, read the data of the first preset value with the determined current offset of the data pointer as the starting position. If not, determine the number of data to be encrypted as the second value according to the following formula, and read the data of the second value with the determined current offset of the data pointer as the starting position: L=m-(a-1)*b Wherein, L is the number of data to be encrypted, m is the size of the storage space occupied by the data to be encrypted, a is the number of times the data to be encrypted is currently read, and b is the first preset value; The read data is regarded as a data block.
2. The method of claim 1, wherein: Also includes the steps: Decrypt the encrypted base directory to obtain the base directory Mount the base directory to the mount directory; In response to a user accessing a data block of a base directory in the mount directory, when the access time exceeds a first preset time, encrypting a node corresponding to the currently accessed data block.
3. The method according to claim 2, after mounting the base directory to the mount directory, further comprises the steps of: Replace the path of the base directory in the mount directory with the preset virtual path.
4. The method according to claim 2, wherein the step of storing the split data blocks in the predetermined tree structure comprises: Determine whether the current node has a child node. If so, save its child node ID in the current node. If not, save the current node ID and data block in the current node.
5. The method according to claim 4, wherein the step of storing the split data blocks in a predetermined tree structure further comprises: Assigning a unique data block ID to each data block and setting version information for each data block, wherein the data blocks are distinguished by the data block ID and the versions of the data blocks are distinguished by the data block version information; The step of determining whether the current node has a child node also includes: Determine whether the current node has a child node. If so, save its child node ID in the current node. If not, save the current node ID, data block version information, data block and the data block ID in the current node.
6. The method of claim 5, wherein: The step of storing the current node ID, data block version information, data block and the data block ID in the current node of the encrypted file system comprises: Determine whether there is an unfilled node in the predetermined tree structure, if not, save the current node ID, data block version information, data block and the data block ID in the current node, if yes, determine whether the sum of the data block size corresponding to the read second numerical data and the data block size in the node that is not filled with data exceeds the maximum storage capacity of the node; If the maximum storage capacity of the node is exceeded, the current node ID, data block version information, data block and the data block ID are saved in the current node; If the maximum storage capacity of the node is not exceeded, the data block corresponding to the read second numerical data, the version information of the data block and the data block ID are merged into the found node that is not filled with data.
7. The method according to claim 6, wherein the step of storing the split data blocks in a predetermined tree structure further comprises: In response to an operation of replacing a data block in a leaf node of the predetermined tree structure with a target data block, determining whether a data block ID of the target data block is the same as a data block ID in a current node, if not, not performing replacement, and if so, determining whether data block version information of the target data block is the same as data block version information in the current node; If the data block version information of the target data block is the same as the data block version information in the current node, the data block in the current node is replaced with the target data block; if they are not the same, no replacement is performed.
8. The method of claim 7, wherein: The step of encrypting each node in the predetermined tree structure by the encryption file system to obtain an encrypted basic directory comprises: Encrypting multiple nodes in the predetermined tree structure in parallel at a single time using the data encryption algorithm; The encryption key of each node is saved in the parent node of the node to obtain the encryption basic directory; The step of determining whether the current node has a child node also includes: Determine whether the current node has a child node. If so, save its child node ID and child node encryption key in the current node. If not, save the current node ID, data block version information, data block and the data block ID in the current node.
9. The method of claim 8, wherein: In response to a user accessing a data block of a base directory in the mount directory, when the access time exceeds a first preset time, encrypting a node corresponding to the currently accessed data block includes: Encrypting the acquired data to be encrypted by using the data encryption algorithm to obtain a first key; decrypting the data to be encrypted using the first key; Decrypting the node of the predetermined tree structure corresponding to the data to be encrypted by using the sub-node encryption key; In response to a user accessing a data block of a base directory in the mounted directory, timing starts from when the user accesses the data block. When the access time exceeds a preset first threshold, the node corresponding to the currently accessed data block is encrypted using the data encryption algorithm.
10. The method according to claim 9, further comprising the steps of: The first key is encrypted by the data encryption algorithm to obtain a recovery key, wherein: When the first key is forgotten, the first key is obtained through the recovery key.
11. The method according to any one of claims 1 to 10, further comprising the steps of: In response to the lock screen operation, the currently accessed data block is encrypted using a data encryption algorithm.
12. The method according to any one of claims 1 to 10, further comprising the steps of: Special functions to mask encrypted data, among which, The special functions include one or more of a data sharing function, a bookmarking function and a marking function.
13. The method according to any one of claims 1 to 10, wherein: The maximum storage capacity of each node in the predetermined tree structure is equal to the first preset value, which is 512 KB.
14. The method according to any one of claims 1 to 10, wherein: The encrypted file system is a fuse file system.
15. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 14.
16. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
File management method and file system
CN106126555A
System, method and computer readable medium for file encryption and memory encryption of secure BYTE-addressable persistent memory and auditing
US20190392166A1
Key-value store tree data block spill with compaction
US20200117728A1
