File encryption method and device, equipment and storage medium
By automatically calling the encryption algorithm in electronic devices to encrypt new files in virtual disks, the problem of cumbersome and inconvenient data encryption in the existing technology is solved, timely and efficient data encryption is achieved, and data storage security is enhanced.
Patent Information
- Application Number
- CN202411142429.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-12
AI Technical Summary
In the prior art, data encryption methods are cumbersome and inconvenient, and data cannot be encrypted in time, resulting in data storage security risks. Especially when users lack security awareness or lack of technical knowledge, the risk of information leakage is increased.
When new files are detected in the target virtual disk, the target encryption algorithm (such as Fourier coefficient encryption algorithm or stream encryption algorithm) is automatically called to encrypt the file, and the encrypted file is stored in the virtual disk, supporting full disk encryption and Partition encryption policy, configuring encryption policies based on user information, and monitoring and managing storage partitions through multi-threading to improve encryption efficiency and security.
The automated data encryption process is realized, user operations are simplified, encryption efficiency and convenience are improved, data is timely and efficiently encrypted, data storage is enhanced, and data storage is adapted to different user needs through flexible encryption strategies.
Smart Images

Figure CN118940298A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of information security technology, and relate to but are not limited to a file encryption method and apparatus, device, and storage medium. Background Art
[0002] In today's information society, more and more people rely on electronic devices such as mobile phones and computers for data storage. However, since much data is not encrypted, some important information can be easily obtained after being stored in electronic devices, which poses a great threat to data storage security.
[0003] At present, the main way to improve data security is to manually encrypt important data according to users' own data security protection needs. This encryption method not only fails to encrypt data in time, but also has problems such as cumbersome and inconvenient. Therefore, how to improve the convenience and timeliness of data encryption has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a file encryption method, device, equipment, and storage medium. The embodiments of the present application provide a file encryption method, device, equipment, and storage medium as follows:
[0005] An embodiment of the present application provides a file encryption method, which is applied to an electronic device, and the method includes:
[0006] In the case of detecting a newly added file in the target virtual disk, calling a target encryption algorithm corresponding to the target virtual disk, encrypting the newly added file to obtain a target encrypted file corresponding to the newly added file, wherein the target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm;
[0007] The newly added file is deleted, and the target encrypted file is stored in the target virtual disk.
[0008] In the embodiment of the present application, when a new file is detected, the new file will be automatically encrypted in time, without the need for manual encryption by the user, which effectively simplifies the cumbersome encryption operation process and improves encryption efficiency and convenience.
[0009] In some embodiments, calling a target encryption algorithm corresponding to the target virtual disk to encrypt the newly added file includes:
[0010] Acquire a target encryption policy of the target virtual disk, wherein the target encryption policy includes full disk encryption or partition encryption, and the target encryption policy is determined according to user information of the user;
[0011] The encryption module corresponding to the target encryption strategy is called by a preset main program to encrypt the newly added file, and the encryption module includes the Fourier coefficient encryption algorithm or the stream encryption algorithm.
[0012] In this embodiment, different encryption policies are configured for the virtual disk according to user information, which can meet the encryption requirements of different users and realize a flexible and personalized encryption policy setting method.
[0013] In some embodiments, when the target encryption policy is the partition encryption, the calling of the encryption module corresponding to the target encryption policy by the preset main program to encrypt the newly added file includes:
[0014] Determine the target storage partition where the newly added file is located, where different storage partitions correspond to different encryption algorithms;
[0015] The preset main program calls the encryption module corresponding to the target storage partition to encrypt the newly added file.
[0016] In this embodiment, by setting partition encryption strategies with different encryption algorithms for different storage partitions, a more fine-grained security protection mechanism for data is implemented.
[0017] In some embodiments, an encryption identifier is added to a specific location of the target encrypted file.
[0018] In this embodiment, adding a specific encryption identifier at a specific location in the encrypted file helps to facilitate identification and management of the encrypted file.
[0019] In some embodiments, the electronic device is installed with a target client, and before detecting that a new file is added to the target virtual disk, the method further includes:
[0020] Acquiring the user information through the target client;
[0021] Obtaining the target encryption policy corresponding to the user information from the server through the preset main program;
[0022] The preset main program calls a command tool, and the target virtual disk corresponding to the user information is created in the electronic device according to the target encryption policy.
[0023] In this embodiment, by acquiring the encryption policy corresponding to the user information from the server, the efficiency and convenience of creating the virtual disk are improved, and the operation process of the user creating the virtual disk is simplified.
[0024] In some embodiments, after the target virtual disk corresponding to the user information is created in the electronic device according to the target encryption policy, the method further includes:
[0025] Detecting the target virtual disk through the preset main program;
[0026] Alternatively, different storage partitions of the target virtual disk are detected through a plurality of threads created by the preset main program, and the plurality of threads correspond one-to-one to the different storage partitions.
[0027] In this embodiment, different storage partitions are detected simultaneously by multiple threads, thereby improving the virtual disk monitoring efficiency and response speed, so as to quickly detect whether there are new files in each storage partition, and further improve the comprehensiveness and accuracy of data encryption.
[0028] In some embodiments, after storing the target encrypted file in the target virtual disk, the method further comprises:
[0029] In the case of detecting a click operation on the target encrypted file, the preset main program calls a target decryption algorithm to decrypt the target encrypted file to obtain a decrypted file, and the type of the target decryption algorithm corresponds to the type of the target encryption algorithm;
[0030] Storing the decrypted file in a preset temporary storage area of the electronic device;
[0031] When a closing operation for the decrypted file is detected, or when a closing operation for the target client is detected, the decrypted file is deleted.
[0032] In this embodiment, authorized users can decrypt and view encrypted files in a timely manner, which simplifies the user's decryption process. Setting a preset temporary storage area effectively avoids the impact on the virtual disk encryption process, and automatically deleting decrypted files ensures the continued security of data.
[0033] An embodiment of the present application provides a file encryption device, which is applied to an electronic device. The device includes an encryption module, a deletion module, and a storage module, wherein:
[0034] The encryption module is used to call a target encryption algorithm corresponding to the target virtual disk to encrypt the newly added file and obtain a target encrypted file corresponding to the newly added file when a newly added file is detected in the target virtual disk, wherein the target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm;
[0035] The deleting module is used to delete the newly added file;
[0036] The storage module is used to store the target encrypted file in the target virtual disk.
[0037] The computer device provided in the embodiment of the present application includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the method described in the embodiment of the present application is implemented.
[0038] The computer-readable storage medium provided in the embodiment of the present application stores a computer program thereon, and when the computer program is executed by a processor, the method described in the embodiment of the present application is implemented.
[0039] The computer program product provided in the embodiments of the present application includes a computer program, and when the computer program is executed by a processor, the method described in the embodiments of the present application is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0041] Figure 1 It is a flowchart of a file encryption method disclosed in an embodiment of the present application;
[0042] Figure 2 is a schematic diagram of the system architecture of the electronic device disclosed in the embodiment of the present application;
[0043] Figure 3 It is a flowchart of another file encryption method disclosed in an embodiment of the present application;
[0044] Figure 4A is a schematic diagram of a full disk encryption virtual disk disclosed in an embodiment of the present application;
[0045] Figure 4B It is a schematic diagram of a partitioned encrypted virtual disk disclosed in an embodiment of the present application;
[0046] Figure 5 It is a flowchart of another file encryption method disclosed in an embodiment of the present application;
[0047] Figure 6 is a schematic diagram of creating a target virtual disk disclosed in an embodiment of the present application;
[0048] Figure 7 It is a logical schematic diagram of encrypting a newly added file in a partition encrypted virtual disk disclosed in an embodiment of the present application;
[0049] Figure 8 It is a flowchart of a file decryption method disclosed in an embodiment of the present application;
[0050] Fig. 9 It is a structural schematic diagram of a file encryption device disclosed in an embodiment of the present application;
[0051] Fig.10 It is a structural schematic diagram of a computer device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0054] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0055] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0056] In today's information society, more and more people rely on electronic devices such as mobile phones and computers for data storage. For example, when users can download some important data from a browser or application and save it in an electronic device. However, since much data is not encrypted, this information is often exposed when stored, which means that some important information can be easily obtained after being stored in an electronic device, which poses a great threat to data storage security.
[0057] Based on this, in order to improve data security, currently the main method is for users to manually encrypt important data according to their own data security protection needs to improve data security. However, if this encryption method encounters users with insufficient security awareness and insufficient understanding of the importance of data security, they may not encrypt important data regularly, or users may not use complex passwords, etc., which will lead to many important data not being encrypted in time, increasing the risk of information leakage. In addition, the manual encryption process is cumbersome and easy to be overlooked, especially when users are busy or lack technical knowledge.
[0058] It can be seen that the above data encryption methods rely on the user's own habits and information security awareness to protect data. Not only can they not encrypt data in a timely manner, but the manual encryption method is cumbersome and inconvenient. Therefore, how to improve the convenience and timeliness of data encryption has become an urgent problem to be solved.
[0059] In view of this, the embodiment of the present application provides a file encryption method and device, equipment, and storage medium. When a new file is detected in a target virtual disk, a target encryption algorithm corresponding to the target virtual disk is automatically called to encrypt the new file, and the target encrypted file is stored in the target virtual disk. The target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm. With the embodiment of the present application, when a new file is detected, the new file will be automatically encrypted in time, without the need for manual encryption by the user, which effectively simplifies the cumbersome encryption operation process and improves encryption efficiency and convenience.
[0060] In order to make the purpose and technical solution of the present application clearer and more intuitive, a file encryption method disclosed in the present application is described in detail below with reference to the accompanying drawings.
[0061] See also Figure 1 , Figure 1 Schematic diagram of a file encryption method disclosed in the embodiment of the present application. Figure 1 The method shown is applied to an electronic device.
[0062] It should be understood that the electronic devices involved in the present application may be mobile phones, tablet computers, laptop computers, mobile Internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, headphones, terminals in industrial control, terminals in self-driving, personal digital assistants (PDA), etc., and the embodiments of the present application are not limited to this.
[0063] For example, Figure 2 Schematic diagram of the system architecture of the electronic device disclosed in the embodiment of this application. Figure 2 As shown, the electronic device includes components such as a processor 201, a transceiver 202, an encryption module 203, a memory 204, an input unit 205, a display unit 206, a sensor 207, and a power module 208.
[0064] Among them, the memory 204 is used to store software programs and modules, and the processor 201 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 204. The memory 204 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a main program module required for at least one function (for example, a preset main program for an encryption function), an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (for example, audio data, file data, etc. downloaded from a browser or preset application of the electronic device), etc. In addition, the memory 204 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The encryption module 203 is used for encryption and decryption of data, wherein a Fourier coefficient encryption algorithm, a stream encryption algorithm, an Elgamal algorithm, an ECC algorithm, etc. are configured.
[0065] Understandably, Figure 1 The system architecture illustrated in the figure does not constitute a specific limitation on the electronic device. The system architecture of the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0066] like Figure 1 The method shown may include the following steps:
[0067] Step 101, when a new file is detected in the target virtual disk, the target encryption algorithm corresponding to the target virtual disk is called to encrypt the new file to obtain a target encrypted file corresponding to the new file, and the target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm.
[0068] The memory 204 of the electronic device includes a target virtual disk, which is a preset storage partition for storing files. In one embodiment, the user can set the download directory of the browser or preset application of the electronic device as the target virtual disk, so that the files downloaded through the browser or the preset application can be stored in the target virtual disk. It can be understood that when the memory 204 of the electronic device detects that there are new files in the target virtual disk, the new files can be stored in the target virtual disk.
[0069] In the embodiments of the present application, the format of the newly added file may include files in txt, word, pdf, ppt, excel and other formats, which is not limited in the present application.
[0070] In an embodiment of the present application, in order to ensure the data security of the file in the target virtual disk, a corresponding target encryption algorithm can be pre-configured for the target virtual disk. The target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm. When a new file is detected in the target virtual disk, the target encryption algorithm corresponding to the target virtual disk can be called to encrypt the new file to obtain a target encrypted file corresponding to the new file.
[0071] The principle of the Fourier coefficient encryption algorithm is an encryption technology based on Fourier transform. The basic idea is to use Fourier transform to convert data from time domain to frequency domain, then perform encryption operations in the frequency domain, and then inverse transform the encrypted data back to the time domain to complete the encryption process. The basic idea of Fourier transform is to represent a periodic function as a superposition of a series of sine and cosine functions, and the Fourier coefficients are the weights of these sine and cosine functions. The Fourier coefficient encryption algorithm is usually used for data with a high confidentiality level and has a certain ability to resist frequency domain attacks to improve data security.
[0072] In one implementation, when the target encryption algorithm is a Fourier coefficient encryption algorithm, the step of encrypting the newly added file using the Fourier coefficient encryption algorithm may include S11 to S16:
[0073] S11. Read the target data of the newly added file in the form of a binary byte stream: use the open function to read the content of the newly added file in binary mode, and refer to the following table for the binary byte stream of the target data obtained.
[0074]
[0075] S12. Preprocess the target data, the preprocessing includes splitting the target data according to a preset data length to obtain a number of data blocks: converting the read binary byte stream into a format suitable for Fourier transform, usually splitting the binary byte stream into blocks of a fixed length (such as 1024 bytes) to obtain a number of data blocks, and then treating each block as a vector.
[0076] S13. Perform Fourier transform processing on a number of data blocks: Perform Fourier transform on each data block, and convert each data block from the time domain to the frequency domain.
[0077] S14. Encrypting a number of data blocks processed by Fourier transform according to a preset encryption operation to obtain a number of encrypted data blocks, where the preset encryption operation includes any one of perturbing, scrambling, and performing mathematical operations on the Fourier coefficients with a key: encrypting the Fourier coefficients in the frequency domain according to a preset encryption operation, where the preset encryption operation includes perturbing, scrambling, or performing mathematical operations on the Fourier coefficients with a key.
[0078] S15, performing inverse Fourier transform processing on the encrypted data blocks: performing inverse Fourier transform on the encrypted Fourier coefficients, that is, converting the encrypted data blocks from the frequency domain back to the time domain.
[0079] S16. Perform data post-processing on the encrypted data blocks after the inverse Fourier transform processing to obtain a target encrypted file. The data post-processing includes combining the encrypted data blocks into a binary byte stream form: recombining the data after the inverse Fourier transform processing into a binary byte stream and saving it as a new encrypted file.
[0080] The principle of stream encryption algorithm is to use a key generated by a pseudo-random number generator to perform bit-by-bit or byte-by-byte XOR operation with plaintext data to complete the encryption process. Among them, the key includes symmetric key or asymmetric key. Symmetric key means using the same key for encryption and decryption, and asymmetric key means using different public keys and private keys for encryption or decryption respectively. Stream encryption algorithm is usually used in scenarios with real-time processing of large data streams and low latency requirements, and can be used for data with a higher confidentiality level to improve data security.
[0081] In one implementation, when the target encryption algorithm is a stream encryption algorithm, the step of encrypting the newly added file using the stream encryption algorithm may include S21 to S24:
[0082] S21. Obtain an initial key: obtain an initial key from a server, or generate an initial key through a pseudo-random number generator.
[0083] S22. Read target data of the newly added file: use a file reading function to read the content of the newly added file in binary mode to obtain the target data of the newly added file.
[0084] S23. Convert the initial key into a target key having the same length as the target data: Use a pseudo-random number generator to convert the initial key into a target key having the same length as the target data.
[0085] S24. Encrypt the target data and the target key according to a preset encryption operation. The preset encryption operation includes performing a bit-by-bit or byte-by-byte XOR operation on the target key and the target data to obtain a target encrypted file.
[0086] The use of Fourier coefficient encryption algorithm or stream encryption algorithm can provide efficient encryption processing for newly added files, ensuring the security and integrity of data while maintaining simplicity and efficiency of operation.
[0087] It should be noted that the above-mentioned Fourier coefficient encryption algorithm or stream encryption algorithm is only a preferred example of the present application. Those skilled in the art can adopt other encryption algorithms according to actual needs, and the present application does not limit this.
[0088] Step 102, delete the newly added file, and store the target encrypted file in the target virtual disk.
[0089] In an embodiment of the present application, after the newly added file is encrypted to obtain the target encrypted file, the original newly added file is deleted and the target encrypted file is stored in the target virtual disk.
[0090] Optionally, the target virtual disk includes a target storage location, and storing the target encrypted file in the target virtual disk includes: obtaining a target storage address of the target storage location, storing the target encrypted file in the target storage location according to the target storage address, and the target storage location is used to store encrypted files.
[0091] It can be seen that the implementation of the embodiment of the present application can realize automatic encryption of new files in a timely manner when new files are detected, without the need for manual encryption by the user, which effectively simplifies the cumbersome encryption operation process and improves encryption efficiency and convenience.
[0092] Through the above steps, we can understand the general framework of the execution steps of the embodiment of the present application. The following is a detailed description of the steps of the file encryption method of the embodiment of the present application. Figure 3 , Figure 3 A flowchart of another file encryption method provided in an embodiment of the present application. Figure 3 The method shown may include the following steps:
[0093] Step 301, when a new file is detected in the target virtual disk, a target encryption policy of the target virtual disk is obtained, the target encryption policy includes full disk encryption or partition encryption, and the target encryption policy is determined according to user information of the user.
[0094] In the embodiment of the present application, the types of the target virtual disk include a full disk encryption virtual disk and a partition encryption virtual disk, that is, the target encryption policy of the target virtual disk includes full disk encryption and partition encryption.
[0095] In one embodiment, if the target virtual disk is a full disk encryption virtual disk, all files in the full disk encryption virtual disk need to be encrypted using the target encryption strategy, that is, encrypted using the same encryption algorithm. Preferably, the encryption algorithm corresponding to the full disk encryption virtual disk is the Fourier coefficient encryption algorithm.
[0096] Exemplarily, the user can set the download directory of the browser or preset application of the electronic device to a full disk encryption virtual disk, so that the files downloaded through the browser or the preset application can be stored in the full disk encryption virtual disk. It is understandable that when a new file is detected in the full disk encryption virtual disk, the new file can be encrypted using the Fourier coefficient encryption algorithm corresponding to the full disk encryption virtual disk, and the encrypted file is stored in the full disk encryption virtual disk.
[0097] See also Figure 4A , Figure 4A Schematic diagram of a full disk encryption virtual disk disclosed in an embodiment of the present application. Figure 4A The full disk encryption virtual disk shown includes encrypted file A1, encrypted file A2 and newly added file 1. When it is detected that the newly added file 1 exists in the full disk encryption virtual disk, the newly added file 1 can be encrypted using the Fourier coefficient encryption algorithm.
[0098] In one embodiment, if the target virtual disk is a partitioned encrypted virtual disk, the partitioned encrypted virtual disk includes at least one storage partition, different storage partitions store files with different confidentiality levels, and each storage partition uses a different encryption algorithm, that is, the encryption algorithm used for the newly added files in each storage partition is related to the confidentiality level of the newly added files. Preferably, the encryption algorithms corresponding to the full disk encrypted virtual disk are the Fourier coefficient encryption algorithm and the stream encryption algorithm. Optionally, the partitioned encrypted virtual disk includes a high-level encryption area and a common encryption area, the encryption algorithm of the high-level encryption area is the Fourier coefficient encryption algorithm, and the encryption algorithm of the common encryption area is the stream encryption algorithm.
[0099] Exemplarily, the user can set the download directories of different browsers or different preset applications as different storage partitions of the partitioned encrypted virtual disk according to the confidentiality level of the browser or preset application of the electronic device, so that files downloaded through different browsers or different preset applications can be stored in different storage partitions of the partitioned encrypted virtual disk. It is understandable that when it is detected that there are new files in the target storage partition of the partitioned encrypted virtual disk, the target encryption policy corresponding to the target storage partition can be used to encrypt the new files in the target storage partition, and the encrypted files are stored in the target storage partition corresponding to the partitioned encrypted virtual disk.
[0100] See also Figure 4B , Figure 4B Schematic diagram of a partitioned encrypted virtual disk disclosed in an embodiment of the present application. Figure 4B The partitioned encrypted virtual disk shown includes a high-level encryption area, a common encryption area, and an unencrypted area. The high-level encryption area includes encrypted files A1, encrypted files A2, and newly added files 1. When a newly added file 1 is detected in the high-level encryption area, the Fourier coefficient encryption algorithm can be used to encrypt the newly added file 1. The common encryption area includes encrypted files B1 and encrypted files B2. When a newly added file is detected in the high-level encryption area, the stream encryption algorithm can be used to encrypt the newly added file. The unencrypted area includes unencrypted files C1, which are used to directly store newly added files without encryption.
[0101] By setting up partition encrypted virtual disks and setting up partitions with different encryption levels in the partition encrypted virtual disks, it is convenient to use encryption algorithms with different encryption levels for different files according to the user's encryption requirements. The Fourier coefficient encryption algorithm or stream encryption algorithm improves the efficiency and security of the encryption process, especially the Fourier coefficient algorithm increases the complexity of encryption and improves the anti-cracking ability.
[0102] In an embodiment of the present application, the target encryption policy is determined based on the user information of the user. Since each user has different permissions, different types of target virtual disks can be created in advance for each user in the electronic device based on the user information of the user for use by different users. Therefore, when a new file is detected in the target virtual disk, the target encryption policy of the target virtual disk can be obtained to determine the type of the target virtual disk, so as to determine the corresponding target encryption policy according to the type of the target virtual disk, so as to determine the target encryption algorithm according to the target encryption policy. It can be seen that different encryption policies are configured for virtual disks based on user information, which can meet the encryption needs of different users and realize a flexible and personalized encryption policy setting method.
[0103] Optionally, the target encryption policy is determined based on the file confidentiality level. Before detecting the addition of a new file in the target virtual disk, the target confidentiality level of the new file can be obtained, the target virtual disk corresponding to the target confidentiality level can be determined, and the new file can be stored in the target virtual disk. Furthermore, after detecting the addition of a new file in the target virtual disk, the target encryption policy corresponding to the target virtual disk is obtained, and the target encryption policy corresponds to the target confidentiality level. Therefore, this method can store the new file in the corresponding virtual disk according to the file confidentiality level, and the virtual disk is pre-configured with an encryption policy corresponding to the file confidentiality level, which can adapt to the encryption requirements of files of different encryption levels.
[0104] Step 302, calling an encryption module corresponding to the target encryption strategy through a preset main program to encrypt the newly added file, the encryption module includes a Fourier coefficient encryption algorithm or a stream encryption algorithm.
[0105] In the embodiment of the present application, before detecting the addition of new files in the target virtual disk, a preset main program encryptMain can be written, and the preset main program detects whether there are new files in the target virtual disk through a loop event.
[0106] In an embodiment of the present application, before detecting a new file in the target virtual disk, an encryption module encryptModel.dll corresponding to the target encryption strategy can be written, and the encryption module can be compiled into a dynamic library to facilitate the preset main program call.
[0107] It should be understood that the present application can monitor the target virtual disk to be encrypted in real time through a preset main program. When there are new files to be encrypted in the target virtual disk, the encryption module corresponding to the target encryption strategy can be called in time through the preset main program for encryption processing.
[0108] In the embodiment of the present application, the target encryption strategy of the target virtual disk includes full disk encryption or partition encryption. The encryption processing of the newly added files under these two different encryption strategies includes the following two situations:
[0109] Case 1: When the target encryption policy is full disk encryption, the encryption module corresponding to the target encryption policy is called by the preset main program to encrypt the newly added files, including: the encryption module corresponding to full disk encryption is called by the preset main program to encrypt the newly added files.
[0110] It should be noted that, when the target virtual disk is a full disk encryption virtual disk, since the full disk encryption virtual disk has only one target storage partition, the encryption module corresponding to the target storage partition can be directly called to encrypt the newly added file.
[0111] In the above situation 1, the encryption efficiency can be improved by calling the encryption module corresponding to the full disk encryption.
[0112] Case 2: When the target encryption strategy is partition encryption, the encryption module corresponding to the target encryption strategy is called by the preset main program to encrypt the newly added files, including: determining the target storage partition where the newly added files are located, different storage partitions correspond to different encryption algorithms; calling the encryption module corresponding to the target storage partition by the preset main program to encrypt the newly added files.
[0113] It should be noted that when the target virtual disk is a partitioned encrypted virtual disk, since the partitioned encrypted virtual disk includes different storage partitions, each storage partition corresponds to a different encryption module, and the newly added files can be encrypted by calling the encryption module corresponding to the target storage partition.
[0114] In the above situation 2, by setting partition encryption strategies with different encryption algorithms for different storage partitions, a more fine-grained security protection mechanism for data is implemented.
[0115] It can be seen that by adopting step 302, the encryption module corresponding to the target encryption strategy can be called by the preset main program, which effectively improves the encryption efficiency.
[0116] Step 303, obtaining the target encrypted file corresponding to the newly added file.
[0117] Optionally, an encryption mark is added to a specific location of the target encrypted file. Adding a specific encryption mark to a specific location of the encrypted file helps to easily identify and manage the encrypted file. For example, the encryption mark *******the ciphertext******** can be added to the end of the file.
[0118] Step 304: delete the newly added file and store the target encrypted file in the target virtual disk.
[0119] For other implementations of steps 303 to 304 , reference may be made to the contents of steps 101 to 102 , which will not be described in detail here.
[0120] It can be seen that the implementation of the embodiment of the present application can realize automatic encryption of new files in a timely manner when new files are detected, without the need for manual encryption by the user, which effectively simplifies the cumbersome encryption operation process and improves encryption efficiency and convenience.
[0121] Based on the above steps, before checking whether there are new files in the target virtual disk, you need to create the target virtual disk first. The following will introduce the steps to create the target virtual disk in detail. Figure 5 , Figure 5A flowchart of another file encryption method provided in an embodiment of the present application is shown below. Figure 5 The method shown may include the following steps:
[0122] Step 501: Acquire user information through a target client of an electronic device.
[0123] In the embodiment of the present application, the electronic device is installed with a target client. Exemplarily, the target client decodeClient can be obtained in advance by using qt to write.
[0124] In one embodiment, the target client includes a login interface. When a user uses the target client, he can enter user information through the login interface, and the user information at least includes an account number, a password, and a verification code.
[0125] Step 502: Obtain a target encryption policy corresponding to the user information from a server through a preset main program.
[0126] The embodiment of the present application also relates to a server, which is used to store user information of at least one user and an encryption policy corresponding to the user information. The encryption policy corresponding to each user information is determined according to the permission level of the user information, wherein the encryption policy corresponding to the user information includes a target encryption policy. For example, the permission level of the user information includes a super administrator user admin, a common user user, and a trial user test. The super administrator user admin has the highest permission level, and a partition encryption policy can be configured for the super administrator user admin. The permission levels of the common user user and the trial user test are lower, and a full disk encryption policy can be configured, that is, different encryption policies can be created according to the permission levels of different user information.
[0127] Optionally, the server may be a web policy server. By pre-storing the encryption policy corresponding to at least one user information in the server, the efficiency of creating the target virtual encrypted disk can be improved, and the operation process of the user creating the target encrypted disk can be simplified.
[0128] In an embodiment of the present application, after the electronic device obtains user information through the target client, it can send an encryption policy acquisition instruction to the server through a preset main program, and the encryption policy acquisition instruction includes the user information; the server responds to the encryption policy acquisition instruction, obtains the target encryption policy based on the user information, and sends the target encryption policy to the electronic device; the electronic device receives the target encryption policy.
[0129] Step 503: calling a command tool through a preset main program, and creating a target virtual disk corresponding to the user information in the electronic device according to the target encryption policy.
[0130] In an embodiment of the present application, after the electronic device obtains the target encryption policy corresponding to the user information from the server, the command tool is called through the preset main program to create a target virtual disk corresponding to the user information in the electronic device according to the target encryption policy, wherein the command tool can be the Windows command subst.
[0131] For a detailed description of the process of creating a target virtual disk, see Figure 6 , Figure 6 Schematic diagram of creating a target virtual disk disclosed in the embodiment of the present application. Figure 6 The system shown includes an electronic device 601 and a server 602, wherein the electronic device includes a target client, a preset main program and a target virtual disk; the server includes two encryption strategies, namely, full disk encryption and partition encryption.
[0132] Exemplarily, if the permission level of the user information is a common user user, the process of creating a target virtual disk may include: the electronic device obtains the user information through the target client; when running the preset main program, the electronic device obtains the target encryption policy obtained from the server through the preset main program as a full disk encryption policy; the electronic device calls the command tool through the preset main program to create a new target virtual disk, and the target virtual disk created according to the partition encryption policy is a full disk encryption virtual disk. For example, the specific steps of creating a full disk encryption virtual disk may include S31 to S32:
[0133] S31, create a virtual disk.
[0134] The preset main program first obtains an unused disk drive letter, then calls the Windows command subst and executes the command, for example: subst Z:D:\encryptSpaceDisk, where Z is the drive letter of the new virtual disk and D:\encryptSpaceDisk is the real disk directory linked to the virtual disk.
[0135] S32. Configure the encryption algorithm to create a full disk encrypted virtual disk.
[0136] The encryption algorithm of the virtual disk Z is configured as the Fourier coefficient encryption algorithm to complete the creation of the full disk encryption virtual disk.
[0137] Exemplarily, if the authority level of the user information is the super administrator user admin, the process of creating a target virtual disk may include: the electronic device obtains the user information through the target client; when running the preset main program, the electronic device obtains the target encryption policy obtained from the server through the preset main program as the partition encryption policy; the electronic device calls the command tool through the preset main program to create a new target virtual disk, and the target virtual disk created according to the partition encryption policy is a partition encrypted virtual disk, wherein the partition encrypted virtual disk includes a high-level encryption area, a common encryption area, and an unencrypted area. For example, the specific steps of creating a partition encrypted virtual disk may include S41 to S45:
[0138] S41. Create a virtual disk.
[0139] The preset main program first obtains an unused disk drive letter, then calls the Windows command subst and executes the command, for example: subst Z:D:\SpaceDisk, where Z is the drive letter in the new virtual disk and D:\SpaceDisk is the real disk directory linked to the virtual disk.
[0140] S42. Create a non-encrypted area on the virtual disk.
[0141] Create an unencrypted disk space on the virtual disk Z disk through the preset main program, such as: D:\SpaceDisk\FreeSpaceDisk, to complete the creation of the unencrypted area.
[0142] S43. Create a common encryption area on the virtual disk and configure an encryption algorithm.
[0143] Create a general encrypted disk space on the virtual disk Z disk through the preset main program, such as: D:\SpaceDisk\GeneralEncryptSpaceDisk, configure the encryption algorithm of the general encryption area as the stream encryption algorithm, and complete the creation of the general encryption area.
[0144] S44. Create a high-level encryption area on the virtual disk and configure an encryption algorithm.
[0145] Create a high-level encrypted disk space on the virtual disk Z disk through the preset main program, such as: D:\SpaceDisk\HighEncryptSpaceDisk, configure the encryption algorithm of the high-level encryption area to the Fourier coefficient encryption algorithm, and complete the creation of the high-level encryption area.
[0146] S45. Complete the creation of the partition encrypted virtual disk.
[0147] It can be seen that the above steps 501 to 503 improve the efficiency and convenience of creating a virtual disk and simplify the operation process of creating a virtual disk by obtaining the encryption policy corresponding to the user information from the server.
[0148] Step 504 , detecting the target virtual disk through a preset main program, or detecting different storage partitions of the target virtual disk through a plurality of threads created by the preset main program, wherein the plurality of threads correspond to different storage partitions one by one.
[0149] In the embodiment of the present application, after the target virtual disk is created, when the target virtual disk is a full disk encrypted virtual disk, the target virtual disk is detected by a preset main program. Alternatively, when the target virtual disk is a partition encrypted virtual disk, different storage partitions of the target virtual disk are detected by multiple threads created by the preset main program, and the multiple threads correspond to different storage partitions one by one.
[0150] Step 505, when a new file is detected in the target virtual disk, the target encryption algorithm corresponding to the target virtual disk is called to encrypt the new file to obtain a target encrypted file corresponding to the new file. The target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm.
[0151] In the embodiment of the present application, after the target virtual disk is created and before new files are detected in the target virtual disk, a download directory for the new files may be set so that the new files are stored in the target virtual disk.
[0152] Exemplarily, when the target virtual disk is a full disk encrypted virtual disk, the specific steps of setting a download directory for newly added files, detecting whether a newly added file is added in the target virtual disk, and encrypting the file may include S51 to S52:
[0153] S51. Set the download directory for the newly added files.
[0154] After the full-disk encrypted virtual disk Z is created successfully, users can set the download directory of the browser or other applications to Z:D:\encryptSpaceDisk so that the download address of the newly added files is the full-disk encrypted virtual disk Z.
[0155] S52, real-time detection and encryption through a preset main program.
[0156] The preset main program scans and detects the full disk encryption virtual disk Z in real time. When it detects that a new file is saved in the full disk encryption virtual disk Z, the preset main program will automatically call the Fourier coefficient encryption algorithm to encrypt the new file. After encryption, the encryption mark **********the allciphertext******** is added to the end of the new file.
[0157] Exemplarily, when the target virtual disk is a partitioned encrypted virtual disk, the specific steps of setting a download directory for newly added files, detecting whether a newly added file is added in the target virtual disk, and encrypting the file may include S61 to S62:
[0158] S61. Set a download directory for newly added files.
[0159] After the partitioned encrypted virtual disk Z is created successfully, the user can set the download directory of the browser or other applications to different storage partitions (non-encrypted area, normal encryption area, high-level encryption area) of the partitioned encrypted virtual disk Z.
[0160] S62, real-time detection and encryption through multiple threads created by a preset main program.
[0161] Multiple threads (such as thread 1, thread 2 and thread 3) are created by the preset main program to scan and detect different storage partitions of the partition encrypted virtual disk Z in real time. Including: Thread 1 detects the non-encrypted area in real time. When a new file is saved in the non-encrypted area, the preset main program does not encrypt the new file and records the properties of the new file. The properties of the file include the file size, file path, file type and file name of the new file. Thread 2 detects the general encryption area in real time. When a new file is saved in the general encryption area, the preset main program will automatically call the stream encryption algorithm to encrypt the new file. After the encryption is completed, the encryption mark **********the General ciphertext******** is added to the end of the file. Thread 3 detects the high-level encryption area in real time. When a new file is saved in the high-level encryption area, the preset main program will automatically call the Fourier coefficient encryption algorithm to encrypt the new file. After the encryption is completed, the encryption mark **********the high ciphertext******** is added to the end of the file.
[0162] To further clarify the steps to encrypt new files in a partitioned encrypted virtual disk, see Figure 7 , Figure 7 FIG. 1 is a logical diagram of encrypting a newly added file in a partitioned encrypted virtual disk disclosed in an embodiment of the present application. Figure 7 The steps shown include:
[0163] Step 701 , detecting different storage partitions of a target virtual disk through a plurality of threads created by a preset main program.
[0164] Step 702, detect the high-level encryption area, non-encrypted area, and ordinary encryption area in the partition encrypted virtual disk. When the storage partition is a high-level encryption area, execute step 7031; when the storage partition is a common encryption area, execute step 7032; when the storage partition is an unencrypted area, execute step 7033.
[0165] Step 7031, detect whether there are new files in the high-level encryption area. When new files are detected, step 7041 is formulated.
[0166] Step 7032, detect whether there are new files in the common encryption area. When new files are detected, formulate step 7042.
[0167] Step 7033: do not process the unencrypted area.
[0168] Step 7041, call the Fourier coefficient encryption algorithm to encrypt the newly added file.
[0169] Step 7042, call the stream encryption algorithm to encrypt the newly added file.
[0170] Steps 701 to 7042 are only used to illustrate the processing logic of encrypting newly added files in the partition encrypted virtual disk. The specific implementation methods may refer to the contents of the aforementioned embodiments, and will not be described in detail here.
[0171] It can be seen that the above steps 504-505 detect different storage partitions simultaneously through multiple threads, which improves the virtual disk monitoring efficiency and response speed, so as to quickly detect whether there are new files in each storage partition and encrypt them, further improving the comprehensiveness and accuracy of data encryption.
[0172] Step 506, delete the newly added file, and store the target encrypted file in the target virtual disk.
[0173] For other implementations of step 506 , reference may be made to the contents of the aforementioned steps 102 and 304 , which will not be described in detail here.
[0174] It can be seen that the implementation of the embodiment of the present application can realize automatic encryption of new files in a timely manner when new files are detected, without the need for manual encryption by the user, which effectively simplifies the cumbersome encryption operation process and improves encryption efficiency and convenience.
[0175] Based on the above steps, after the encryption of the newly added files is completed, users with access rights can access the target encrypted files through the target client. The following will introduce the steps for accessing the target encrypted files through the target client. Figure 8 , Figure 8 Schematic diagram of a file decryption method disclosed in the embodiment of the present application. Figure 8 As shown, Figure 8 The method shown may include the following steps:
[0176] Step 801, when a click operation on a target encrypted file is detected, a target decryption algorithm is called by a preset main program to decrypt the target encrypted file to obtain a decrypted file, and the type of the target decryption algorithm corresponds to the type of the target encryption algorithm.
[0177] In an embodiment of the present application, the target client includes a target virtual disk, and the newly added file is deleted and the target encrypted file is stored in the target virtual disk, that is, the target encrypted file is stored in the target client.
[0178] Furthermore, the encrypted files in the target client have a file access restriction function. When the user directly opens the files in the full disk encryption virtual disk or the files in the common encryption area and high-level encryption area of the partition encryption virtual disk, the file content is garbled. Even if the file is dragged out of the full disk encryption virtual disk, the common encryption area and the high-level encryption area to open, it is still garbled. Only after decryption through the target client can the file be opened correctly. It can be seen that the target virtual disk created in the target client can effectively improve the security of the file.
[0179] In an embodiment of the present application, when a user clicks on an encrypted file through a client interface, the target client may decrypt the encrypted file and open it.
[0180] Exemplarily, when a user clicks on a target encrypted file on a display interface of a target client, the preset main program will call a target decryption algorithm to decrypt the file.
[0181] In an embodiment of the present application, the target decryption algorithm includes a Fourier coefficient decryption algorithm or a stream decryption algorithm. If the type of the target decryption algorithm is a Fourier coefficient encryption algorithm, the preset main program calls the Fourier coefficient decryption algorithm; if the type of the target decryption algorithm is a stream encryption algorithm, the preset main program calls the stream decryption algorithm, thereby ensuring that the original data of the newly added file can be correctly restored. It should be noted that the decryption process of the Fourier coefficient decryption algorithm and the stream decryption algorithm can refer to the specific implementation process in step 101, and this application will not be repeated here.
[0182] Step 802: Store the decrypted file in a preset temporary storage area of the electronic device.
[0183] In an embodiment of the present application, the electronic device includes a preset temporary storage area, and the preset temporary storage area is used to temporarily store the decrypted files.
[0184] Exemplarily, the preset temporary storage area can be a temporary folder (e.g., tempDir), which does not participate in file encryption, that is, it will not be monitored by the detection process of the target virtual disk. It should be noted that those skilled in the art can set multiple preset temporary storage areas according to actual needs, each preset temporary storage area is used to store different files decrypted from different target virtual disks, and this application does not limit this.
[0185] Step 803: When a close operation on the decrypted file is detected, or when a close operation on the target client is detected, the decrypted file is deleted.
[0186] In the embodiment of the present application, after the user has viewed or modified the decrypted file, the user can close the decrypted file on the target client or directly close the target client. Further, when a closing operation for the decrypted file is detected, or, when a closing operation for the target client is detected, the decrypted file is deleted.
[0187] It should be noted that when the user closes the target client, all decrypted files in the preset temporary storage area will be cleared to prevent other decrypted files in the preset temporary storage area from being stolen, effectively ensuring the storage security of the files.
[0188] It can be seen that the implementation of the embodiments of the present application facilitates authorized users to decrypt and view encrypted files in a timely manner, simplifies the user's decryption process, and sets a preset temporary storage area to effectively avoid the impact on the virtual disk encryption process, and automatically deletes decrypted files to ensure the continued security of data.
[0189] It should be understood that, although the steps in the above-mentioned flowcharts are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps. In addition, the above-mentioned multiple embodiments can be implemented independently, and can also be combined with each other, which is not limited here.
[0190] Based on the foregoing embodiments, an embodiment of the present application provides a file encryption device, which includes the modules included and the units included in the modules, which can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0191] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a file encryption device provided in an embodiment of the present application is shown in FIG. Fig. 9 The file encryption device shown is applied to an electronic device, and the file encryption device includes an encryption module 901, a deletion module 902 and a storage module 903, wherein:
[0192] The encryption module 901 is used to call the target encryption algorithm corresponding to the target virtual disk to encrypt the newly added file when a new file is detected in the target virtual disk, so as to obtain a target encrypted file corresponding to the newly added file, wherein the target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm;
[0193] Deletion module 902, used to delete the newly added file;
[0194] The storage module 903 is used to store the target encrypted file in the target virtual disk.
[0195] In some embodiments, the encryption module 901 is specifically used to:
[0196] Obtain the target encryption policy of the target virtual disk, the target encryption policy includes full disk encryption or partition encryption, and the target encryption policy is determined based on the user information of the user; call the encryption module corresponding to the target encryption policy through the preset main program to encrypt the newly added files, the encryption module includes a Fourier coefficient encryption algorithm or a stream encryption algorithm.
[0197] In some embodiments, when the target encryption strategy is the partition encryption, the encryption module 901 is further specifically configured to:
[0198] Determine the target storage partition where the newly added file is located, and different storage partitions correspond to different encryption algorithms; call the encryption module corresponding to the target storage partition through the preset main program to encrypt the newly added file.
[0199] In some embodiments, an encryption identifier is added to a specific location of the target encrypted file.
[0200] In some embodiments, the electronic device is installed with a target client, and the file encryption device further includes an acquisition module and a creation module, wherein:
[0201] The acquisition module is used to obtain user information through the target client; through the preset main program, the target encryption policy corresponding to the user information is obtained from the server;
[0202] The creation module is used to call a command tool through a preset main program, and to create a target virtual disk corresponding to the user information in the electronic device according to a target encryption policy.
[0203] In some embodiments, the file encryption device further includes a detection module, wherein:
[0204] The detection module is used to detect the target virtual disk through a preset main program; or, detect different storage partitions of the target virtual disk through multiple threads created by the preset main program, and the multiple threads correspond to different storage partitions one by one.
[0205] In some embodiments, the file encryption device further includes a decryption module, wherein:
[0206] A decryption module is used to, when a click operation on a target encrypted file is detected, call a target decryption algorithm through a preset main program to decrypt the target encrypted file to obtain a decrypted file, and the type of the target decryption algorithm corresponds to the type of the target encryption algorithm;
[0207] The storage module 903 is further used to store the decrypted file in a preset temporary storage area of the electronic device;
[0208] The deleting module 902 is further configured to delete the decrypted file when a closing operation on the decrypted file is detected, or when a closing operation on the target client is detected.
[0209] It should be noted that in the embodiments of this application Fig. 9 The division of modules in the file encryption device shown is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0210] Please refer to Fig.10 , Fig.10 Schematic diagram of the structure of a computer device disclosed in the embodiment of the present application. Fig.10 As shown, the computer device includes:
[0211] A memory 1001 storing executable program codes;
[0212] A processor 1002 coupled to the memory 1001;
[0213] The processor 1002 calls the executable program code stored in the memory 1001 to execute any one of the file encryption methods in the above method embodiments.
[0214] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the file encryption methods provided in the above embodiments are implemented.
[0215] An embodiment of the present application provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps of any one of the file encryption methods provided in the above method embodiments.
[0216] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0217] In one embodiment, a file encryption device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.10 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the above-mentioned device. The computer program composed of various program modules enables the processor to execute the steps in the method of each embodiment of the present application described in this specification.
[0218] It should be noted here that the description of the above device, storage medium and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device, system, storage medium and computer program product embodiments of this application, please refer to the description of the method embodiment of this application for understanding.
[0219] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between the various embodiments, and the same or similarities can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0220] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0221] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0222] In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0223] Those skilled in the art will appreciate that all or part of the steps of the above method embodiments may be implemented by hardware associated with program instructions, and the aforementioned program may be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROM), magnetic disks or optical disks.
[0224] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0225] The features disclosed in several device embodiments provided in this application can be arbitrarily combined without conflict to obtain new device embodiments.
[0226] The above is only an implementation method 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.
Claims
1. A file encryption method, characterized in that: Applied to electronic equipment, the method comprises: In the case of detecting a newly added file in the target virtual disk, calling a target encryption algorithm corresponding to the target virtual disk, encrypting the newly added file to obtain a target encrypted file corresponding to the newly added file, wherein the target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm; The newly added file is deleted, and the target encrypted file is stored in the target virtual disk.
2. The method according to claim 1, characterized in that The calling of the target encryption algorithm corresponding to the target virtual disk to encrypt the newly added file includes: Acquire a target encryption policy of the target virtual disk, wherein the target encryption policy includes full disk encryption or partition encryption, and the target encryption policy is determined according to user information of the user; The encryption module corresponding to the target encryption strategy is called by a preset main program to encrypt the newly added file, and the encryption module includes the Fourier coefficient encryption algorithm or the stream encryption algorithm.
3. The method according to claim 2, characterized in that In the case where the target encryption strategy is the partition encryption, the calling of the encryption module corresponding to the target encryption strategy by the preset main program to encrypt the newly added file includes: Determine the target storage partition where the newly added file is located, where different storage partitions correspond to different encryption algorithms; The preset main program calls the encryption module corresponding to the target storage partition to encrypt the newly added file.
4. The method according to any one of claims 1 to 3, characterized in that: An encryption mark is added to a specific position of the target encrypted file.
5. The method according to claim 2, characterized in that: The electronic device is installed with a target client, and before detecting that a new file is added to the target virtual disk, the method further includes: Acquiring the user information through the target client; Obtaining the target encryption policy corresponding to the user information from the server through the preset main program; The preset main program calls a command tool, and the target virtual disk corresponding to the user information is created in the electronic device according to the target encryption policy.
6. The method according to claim 5, characterized in that After the target virtual disk corresponding to the user information is created in the electronic device according to the target encryption policy, the method further includes: Detecting the target virtual disk through the preset main program; Alternatively, different storage partitions of the target virtual disk are detected through a plurality of threads created by the preset main program, and the plurality of threads correspond one-to-one to the different storage partitions.
7. The method according to claim 5, characterized in that After storing the target encrypted file in the target virtual disk, the method further includes: In the case of detecting a click operation on the target encrypted file, the preset main program calls a target decryption algorithm to decrypt the target encrypted file to obtain a decrypted file, and the type of the target decryption algorithm corresponds to the type of the target encryption algorithm; Storing the decrypted file in a preset temporary storage area of the electronic device; When a closing operation for the decrypted file is detected, or when a closing operation for the target client is detected, the decrypted file is deleted.
8. A file encryption device, characterized in that: Applied to electronic equipment, the device includes an encryption module, a deletion module and a storage module, wherein: The encryption module is used to call a target encryption algorithm corresponding to the target virtual disk to encrypt the newly added file and obtain a target encrypted file corresponding to the newly added file when a newly added file is detected in the target virtual disk, wherein the target encryption algorithm includes a Fourier coefficient encryption algorithm or a stream encryption algorithm; The deleting module is used to delete the newly added file; The storage module is used to store the target encrypted file in the target virtual disk.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
