File encryption method, device and file decryption method
Through the target confidentiality level of the file and multiple encryption algorithms, only the corresponding confidentiality level keywords inside the file are encrypted or decrypted, solving the problem of inflexible file encryption in the existing technology, and improving users while ensuring security The effect of flexibility in use.
Patent Information
- Application Number
- CN202111139063.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-09-27
AI Technical Summary
In the prior art, file encryption methods require the entire file to be encrypted or decrypted, and users are not flexible in using it and cannot flexibly obtain information in the file.
By determining the target confidentiality level of the file, only the keyword information of the corresponding confidentiality level is encrypted or decrypted, and the target keyword information resource library and multiple encryption algorithms are used to achieve flexible encryption and decryption of different parts of the file.
While ensuring file security, it improves user flexibility, allowing users to obtain insignificant information when the file is not decrypted, and avoids the need to decrypt the entire file.
Smart Images

Figure CN113836558B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of secure data transmission, and in particular to a file encryption method, device and file decryption method. Background Art
[0002] With the improvement of computer hardware technology and the popularization of network technology, people can quickly obtain the files they want at any time and any place. However, while computer systems and computer networks improve the sharing of data and equipment, they also open the green light for illegal theft of confidential files or confidential data. Once important confidential files are stolen by hackers, the loss is unimaginable. The problem of network security bothers us all the time. In order to prevent data leakage, many companies often spend money to purchase passive network security products such as firewalls, intrusion detection, antivirus, vulnerability scanning, etc. However, information security is far from enough relying solely on the above means.
[0003] File encryption is also an effective means of protecting information security. It processes the original plain text file according to a certain algorithm to make it an unreadable code, usually called "ciphertext", so that it can only display the original content after being decrypted by the corresponding key, so as to achieve the purpose of protecting the file from being illegally stolen and read. The reverse process of this process is decryption, which is the process of converting the encoded information into its original data. However, in the related technology, the mainstream text encryption encrypts the entire file according to the security level of the file. After the encryption is completed, the entire file cannot be viewed. Only by completely decrypting the file can the information in the file be obtained, which is not flexible enough for users to use.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a file encryption method, device and file decryption method to at least solve the technical problem in the related art that the entire file needs to be encrypted or decrypted to ensure file security, which is inflexible for users to use.
[0006] According to one aspect of an embodiment of the present application, a file encryption method is provided, comprising: obtaining a file to be encrypted, and determining a target confidentiality level of the file to be encrypted; performing information matching on a text content of the file to be encrypted according to a target keyword information resource library, and determining target keywords of each confidentiality level in the file to be encrypted corresponding to the target confidentiality level, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels; encrypting the target keywords of each confidentiality level based on multiple encryption algorithms, wherein each target keyword of each confidentiality level corresponds to an encryption algorithm.
[0007] Optionally, the file to be encrypted is obtained through a file security encryption platform, and file information of the file to be encrypted is read, wherein the file information includes the text content of the file to be encrypted and the target confidentiality level of the file to be encrypted; the target confidentiality level of the file to be encrypted is determined based on the file information.
[0008] Optionally, a target application is created based on a client / server architecture, and a labeling tool and an encryption tool are integrated into the target application to obtain the file security encryption platform; wherein the labeling tool includes the target keyword information resource library, the encryption tool includes the multiple encryption algorithms, and the target application is used to match the text content of the file to be encrypted based on the labeling tool, and to encrypt the target keywords of each confidentiality level based on the encryption tool.
[0009] Optionally, a target browser is created based on a browser / server architecture, and the target browser is used as the file security encryption platform; wherein the target browser is used to call a label tool from the server side to match the text content of the file to be encrypted, and call an encryption tool from the server side to encrypt the target keywords of each confidentiality level, wherein the label tool includes the target keyword information resource library, and the encryption tool includes the multiple encryption algorithms.
[0010] Optionally, professional keyword information is collected, and a first keyword information resource library is determined based on the professional keyword information, wherein the professional keyword information type includes at least one of the following: professional terms and term analysis in a preset technical field, and keywords defined by a target object; general keyword information is collected, and a second keyword information resource library is determined based on the general keyword information, wherein the general keyword information type includes at least one of the following: name, email address, telephone number; the target keyword information resource library is determined based on the first keyword information resource library and the second keyword information resource library.
[0011] Optionally, the professional keyword information is collected, and a first form is determined based on the type of the professional keyword information; each professional keyword information in the first form is split and processed to obtain a second form, wherein the length of each professional keyword information in the second form is less than a preset length; the first keyword information resource library is determined based on the first form and the second form.
[0012] Optionally, the general keyword information is collected, and a third form is determined according to the type of the general keyword information; dimensionality reduction processing is performed on each general keyword information in the third form to reduce redundant information in each general keyword information to obtain a fourth form; precision processing is performed on each general keyword information in the third form, and supplementary information is added to each general keyword information to obtain a fifth form; the second keyword information resource library is determined based on the third form, the fourth form and the fifth form.
[0013] Optionally, the confidentiality level includes confidentiality level one, confidentiality level two and confidentiality level three. When the target confidentiality level is confidentiality level one, the text content of the file to be encrypted is matched with information based on the first keyword information resource library, and a third-level target keyword with a confidentiality level of confidentiality level three in the file to be encrypted is determined; when the target confidentiality level is confidentiality level two, the third-level target keyword in the file to be encrypted is determined based on the first keyword information resource library, and the text content of the file to be encrypted is matched with information based on the second keyword information resource library, and a second-level target keyword with a confidentiality level of confidentiality level two in the file to be encrypted is determined; when the target confidentiality level is confidentiality level three, the third-level target keyword in the file to be encrypted is determined based on the first keyword information resource library, and the second-level target keyword in the file to be encrypted is determined based on the second keyword information resource library, and other text content in the file to be encrypted except the third-level target keyword and the second-level target keyword is determined as a first-level target keyword, wherein the confidentiality level of the first-level target keyword is confidentiality level one.
[0014] Optionally, when the target confidentiality level is confidentiality level one, the third-level target keywords in the file to be encrypted are encrypted according to a first encryption algorithm; when the target confidentiality level is confidentiality level two, the third-level target keywords in the file to be encrypted are encrypted according to the first encryption algorithm, and the second-level target keywords in the file to be encrypted are encrypted according to a second encryption algorithm; when the target confidentiality level is confidentiality level three, the third-level target keywords in the file to be encrypted are encrypted according to the first encryption algorithm, the second-level target keywords in the file to be encrypted are encrypted according to the second encryption algorithm, and the first-level target keywords in the file to be encrypted are encrypted according to a third encryption algorithm.
[0015] Optionally, the multiple encryption algorithms include at least one of the following: Data Encryption Standard algorithm, Advanced Encryption Standard algorithm, and public key cryptography algorithm.
[0016] According to another aspect of an embodiment of the present application, a file decryption method is also provided, comprising: obtaining a file to be decrypted, wherein the file to be decrypted includes an encrypted keyword of at least one confidentiality level; obtaining a target key, wherein the target key includes at least one decryption algorithm corresponding to the encrypted keyword of the at least one confidentiality level; and decrypting the encrypted keyword of the at least one confidentiality level in the file to be decrypted based on the target key.
[0017] According to another aspect of an embodiment of the present application, a file encryption device is also provided, including: an acquisition module, used to acquire a file to be encrypted and determine a target confidentiality level of the file to be encrypted; a determination module, used to perform information matching on the text content of the file to be encrypted based on a target keyword information resource library, and determine target keywords of each confidentiality level in the file to be encrypted corresponding to the target confidentiality level, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels; an encryption module, used to encrypt the target keywords of each confidentiality level based on multiple encryption algorithms, wherein the target keyword of each confidentiality level corresponds to an encryption algorithm.
[0018] According to another aspect of an embodiment of the present application, a non-volatile storage medium is also provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned file encryption method or file decryption method.
[0019] In an embodiment of the present application, by determining the target confidentiality level of the file to be encrypted, only the target keyword information of each confidentiality level corresponding to the target confidentiality level is encrypted without encrypting the entire file, so that the user can obtain unimportant information in the file without decrypting the file; in the decryption process, the encrypted keyword of at least one confidentiality level in the file to be decrypted can be decrypted by obtaining the key of the corresponding level, so that the user can obtain the required information without decrypting the entire file, thereby ensuring the security of the file and improving the flexibility of use, thereby solving the technical problem that the entire file needs to be encrypted or decrypted to ensure the security of the file in the related technology, and the user is inflexible in use. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 is a flowchart of a file encryption method according to an embodiment of the present application;
[0022] Figure 2 is a flowchart of a file decryption method according to an embodiment of the present application;
[0023] Figure 3 It is a structural schematic diagram of a file encryption device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. Example
[0026] In the related technology, the mainstream text encryption method is to determine the corresponding encryption algorithm according to the security level of the file, and then encrypt the entire file. After the encryption is completed, the entire file cannot be viewed, and no information can be obtained without decryption. Although this can ensure the security of the file, it is not very convenient for users to use.
[0027] In order to solve the above problems, the present application proposes a new file encryption scheme. After determining the confidentiality level of a file, this scheme only encrypts the key information of the corresponding confidentiality level within the file, and the remaining unimportant information remains public, so that users can obtain some of the information without decrypting the file, thereby ensuring the security of the file while improving the flexibility of use.
[0028] Specifically, an embodiment of the present application provides an embodiment of a file encryption method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a flowchart of a file encryption method according to an embodiment of the present application, such as Figure 1 As shown, the method at least includes steps S102-S106, wherein:
[0030] Step S102, obtaining the file to be encrypted and determining the target confidentiality level of the file to be encrypted.
[0031] In some optional embodiments of the present application, the file to be encrypted can be obtained through a file security encryption platform, and the file information of the file to be encrypted can be read, wherein the file information includes the text content of the file to be encrypted and the target confidentiality level of the file to be encrypted; the target confidentiality level of the file to be encrypted can be determined based on the file information.
[0032] The file security encryption platform can be implemented through the C / S (Client / Server) architecture or the B / S (Browser / Server) architecture. In the C / S architecture, the file security encryption platform is embodied in the form of application software, which is managed by the background and can manage user permissions and usage records for easy backtracking; in the B / S architecture, the file security encryption platform is a web browser. Whether it is software or a web browser, its purpose is the same, which is to encrypt files locally.
[0033] Specifically, a target application can be created based on a C / S architecture, and a labeling tool and an encryption tool can be integrated into the target application to obtain a file security encryption platform; wherein the labeling tool includes a target keyword information resource library, and the encryption tool includes a variety of encryption algorithms. The target application is used to match the text content of the encrypted file according to the labeling tool, and encrypt the target keywords of each confidentiality level according to the encryption tool. Among them, by integrating all encryption algorithms and labeling tools into the target application, the target application encrypts the file, and then transmits the record to the server side, or the target application applies for encryption, and encryption is performed after the server side agrees.
[0034] Optionally, a target browser can be created based on the B / S architecture, and used as a file security encryption platform; the target browser is used to retrieve the labeling tool from the server side to match the text content of the encrypted file, and retrieve the encryption tool from the server side to encrypt the target keywords of each confidentiality level, wherein the labeling tool includes a target keyword information resource library, and the encryption tool includes a variety of encryption algorithms. Similar to the B / S process, this architecture is just to concentrate the encryption tool and labeling tool on the server side, load them to the target browser when in use, and release them back to the server side after processing.
[0035] In some optional embodiments of the present application, when the document is written, the security level of the document is first determined through a specific strategy, such as direct discussion and evaluation by relevant personnel. Usually, files can be divided into fully public files that do not need to be kept confidential or non-fully public files that need to be kept confidential. Non-fully public files can be divided into confidentiality levels from low to high according to the importance of the file, namely confidentiality level 1, confidentiality level 2, and confidentiality level 3. For files to be encrypted (non-fully public files) whose target confidentiality level has been determined, they are uploaded to the file security encryption platform for processing. It should be noted that when uploading a file, file information such as the target confidentiality level and text content of the file needs to be submitted.
[0036] Step S104, matching the text content of the file to be encrypted with the target keyword information resource library to determine target keywords of each confidentiality level in the file to be encrypted corresponding to the target confidentiality level, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels.
[0037] Step S106, encrypting the target keywords of each confidentiality level based on multiple encryption algorithms, wherein each confidentiality level target keyword corresponds to one encryption algorithm.
[0038] In order to use different encryption algorithms to encrypt keyword information of different confidentiality levels within a file, it is first necessary to filter out the keyword information of each confidentiality level in the file. Therefore, it is necessary to first determine the target keyword information resource library for information matching, so as to determine the target keywords of each confidentiality level in the file to be encrypted.
[0039] Corresponding to the confidentiality level of the file, the confidentiality level of the keyword information can also be divided into confidentiality level one, confidentiality level two and confidentiality level three according to the degree of importance from low to high. Therefore, when determining the target keyword information resource library, the target keyword information resource library can be divided into a first keyword information resource library and a second keyword information resource library. The first keyword information resource library is used to screen the most important confidentiality level three target keywords in the file to be encrypted, and the second keyword information resource library is used to screen the confidentiality level two target keywords in the file to be encrypted. After the screening is completed, the remaining text content is the relatively unimportant confidentiality level one target keyword.
[0040] In some optional embodiments of the present application, professional keyword information can be collected first, and a first keyword information resource library can be determined based on the professional keyword information, wherein the professional keyword information type includes at least one of the following: professional terms and term analysis in a preset technical field, and keywords defined by a target object; at the same time, general keyword information can be collected, and a second keyword information resource library can be determined based on the general keyword information, wherein the general keyword information type includes at least one of the following: name, email address, and telephone number; finally, a target keyword information resource library can be determined based on the first keyword information resource library and the second keyword information resource library.
[0041] Specifically, when determining the first keyword information resource library, first collect professional keyword information, such as professional terms related to user business, term analysis, user-defined keywords, etc., and determine the first form according to the professional keyword information type; then, split each professional keyword information in the first form to obtain a second form, wherein the length of each professional keyword information in the second form is less than a preset length, for example, each keyword in the second form is split into 2 to 4 characters, and English is not split; finally, determine the first keyword information resource library based on the first form and the second form.
[0042] Specifically, when determining the second keyword information resource library, firstly, general keyword information is collected, keyword types are sorted, such as name, email address, telephone number, etc., and the third form is determined according to the general keyword information type; then, each general keyword information in the third form is subjected to dimensionality reduction processing to reduce redundant information in each general keyword information, so that it is easier to match, for example: the name format is sorted into 2-4 characters, the telephone number format is sorted into 11 digits and 12 digits with area code, the email address format is sorted into a specific string + @ + specific string, etc., to obtain the fourth form; then, each general keyword information in the third form is refined, and supplementary information is added to each general keyword information to improve the accuracy of the information, for example: common surnames are collected to match names, the first few digits of telephone numbers, such as 139 / 187 / area codes of various regions / cross-area codes of countries, etc. are collected to match telephone numbers, accurate address keywords are collected to match address information, various email address suffixes are collected to match email addresses, etc., to obtain the fifth form; finally, the second keyword information resource library is determined according to the third form, the fourth form and the fifth form.
[0043] After obtaining the target keyword information resource library, the text content of the to-be-encrypted file can be matched with the corresponding keyword information resource library according to the target confidentiality level of the to-be-encrypted file, thereby determining the target keywords of each confidentiality level to be encrypted in the to-be-encrypted file. An optional information matching scheme is as follows:
[0044] When the target confidentiality level is confidentiality level 1, the text content of the to-be-encrypted file is matched according to the first keyword information resource library, and the third-level target keyword of the confidentiality level 3 of the to-be-encrypted file is determined. Specifically, for the confidentiality level 1 to-be-encrypted file, the most important professional keyword information is encrypted first, so the text content of the to-be-encrypted file can be matched according to the second form in the first keyword information resource library, and the matching results are recorded, and the keywords in the matching results and one or more characters adjacent to these keywords are unified as the third-level target keywords.
[0045] When the target confidentiality level is confidentiality level 2, the third-level target keywords in the file to be encrypted are determined based on the first keyword information resource library, and the text content of the file to be encrypted is matched based on the second keyword information resource library to determine the second-level target keywords in the file to be encrypted whose confidentiality level is confidentiality level 2. Specifically, for the file to be encrypted at confidentiality level 2, the more important professional keyword information and general keyword information are encrypted first. Therefore, the third-level target keywords in the file to be encrypted can be determined according to the above process, and then the text content of the file to be encrypted can be matched through the fifth form, and the matching results can be recorded. Then, the matching results can be matched again through the fourth form to obtain the corresponding second-level target keywords.
[0046] When the target confidentiality level is confidentiality level 3, the third-level target keyword in the file to be encrypted is determined based on the first keyword information resource library, the second-level target keyword in the file to be encrypted is determined based on the second keyword information resource library, and the other text contents in the file to be encrypted except the third-level target keyword and the second-level target keyword are determined as first-level target keywords, wherein the confidentiality level of the first-level target keyword is confidentiality level 1. Specifically, for the confidentiality level 3 file to be encrypted, the full text needs to be encrypted, therefore, the third-level target keyword and the second-level target keyword in the file to be encrypted can be determined according to the above process, and all the remaining text contents are used as first-level target keywords.
[0047] In some optional embodiments of the present application, after determining the target keywords of each confidentiality level in the file to be encrypted, different encryption algorithms can be used to encrypt the target keywords of different confidentiality levels, wherein the commonly used encryption algorithms include: DES (Data Encryption Standard) algorithm, AES (Advanced Encryption Standard) algorithm, RSA (public key cryptography) algorithm, etc. Specifically, an optional encryption scheme is as follows:
[0048] When the target confidentiality level is confidentiality level 1, the third-level target keyword in the file to be encrypted is encrypted according to the first encryption algorithm. For example, the professional keyword information in the file to be encrypted is encrypted by the AES algorithm. Optionally, the picture in the file to be encrypted can also be regarded as the target keyword of confidentiality level 3, and the picture in the file to be encrypted is encrypted by the AES algorithm.
[0049] When the target confidentiality level is confidentiality level 2, the third-level target keywords in the encrypted file are encrypted according to the first encryption algorithm, and the second-level target keywords in the encrypted file are encrypted according to the second encryption algorithm. For example, the professional keyword information and pictures in the encrypted file are encrypted by the AES algorithm, and the general keyword information in the encrypted file is encrypted by the DES algorithm.
[0050] When the target confidentiality level is confidentiality level 3, the third-level target keywords in the encrypted file are encrypted according to the first encryption algorithm, the second-level target keywords in the encrypted file are encrypted according to the second encryption algorithm, and the first-level target keywords in the encrypted file are encrypted according to the third encryption algorithm. For example, the professional keyword information and pictures in the encrypted file are encrypted by the AES algorithm, the general keyword information in the encrypted file is encrypted by the DES algorithm, and then the rest of the content in the encrypted file is encrypted by the RSA algorithm.
[0051] It should be noted that the encryption algorithms used for target keywords of various confidentiality levels in the above scheme are only examples. In the actual encryption process, the user can adjust the encryption algorithm as needed.
[0052] In the embodiment of the present application, after obtaining the file to be encrypted, the target confidentiality level of the file to be encrypted is first determined, and then the text content of the file to be encrypted is matched according to the target keyword information resource library to determine the target keywords of each confidentiality level corresponding to the target confidentiality level in the file to be encrypted, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels; then the target keywords of each confidentiality level are encrypted based on multiple encryption algorithms, wherein each target keyword of each confidentiality level corresponds to an encryption algorithm. Among them, by determining the target confidentiality level of the file to be encrypted, only the target keyword information of each confidentiality level corresponding to the target confidentiality level is encrypted without encrypting the entire file, so that the user can obtain unimportant information in the file without decrypting it, and the flexibility of use is improved while ensuring the security of the file, thereby solving the technical problem that the entire file needs to be encrypted or decrypted to ensure the security of the file in the related art, and the user is not flexible in use. Example
[0053] According to an embodiment of the present application, an embodiment of a file decryption method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0054] Figure 2is a flowchart of a file decryption method according to an embodiment of the present application, such as Figure 2 As shown, the method at least includes steps S202-S206, wherein:
[0055] Step S202, obtaining a file to be decrypted, wherein the file to be decrypted includes an encryption keyword of at least one confidentiality level.
[0056] Corresponding to the first embodiment, the confidentiality level of the file to be decrypted can also be divided into confidentiality level 1, confidentiality level 2 and confidentiality level 3. Among them, the confidentiality level 1 file to be decrypted includes the third-level encryption keyword of confidentiality level 3 encrypted by the AES algorithm; the confidentiality level 2 file to be decrypted includes the third-level encryption keyword of confidentiality level 3 encrypted by the AES algorithm and the second-level encryption keyword of confidentiality level 2 encrypted by the DES algorithm; the confidentiality level 3 file to be decrypted includes: the third-level encryption keyword of confidentiality level 3 encrypted by the AES algorithm, the second-level encryption keyword of confidentiality level 2 encrypted by the DES algorithm and the first-level encryption keyword of confidentiality level 1 encrypted by the RSA algorithm.
[0057] Step S204: Acquire a target key, wherein the target key includes at least one decryption algorithm corresponding to an encryption keyword of at least one confidentiality level.
[0058] In some optional embodiments of the present application, the key can also be divided into a first-level key, a second-level key and a third-level key, wherein the first-level key includes an RSA algorithm, which is used to decrypt relatively unimportant first-level encryption keywords in the file to be decrypted; the second-level key includes an RSA algorithm and a DES algorithm, which are used to decrypt relatively unimportant first-level encryption keywords and relatively important second-level encryption keywords in the file to be decrypted; the third-level key includes an RSA algorithm, a DES algorithm and an AES algorithm, which are used to decrypt relatively unimportant first-level encryption keywords, relatively important second-level encryption keywords and the most important third-level encryption keywords in the file to be decrypted, respectively.
[0059] Step S206, decrypting the encrypted keyword of at least one confidentiality level in the file to be decrypted according to the target key.
[0060] In some optional embodiments of the present application, users can obtain keys of corresponding levels according to their own needs, and decrypt encrypted keywords of corresponding confidentiality levels in the file to be decrypted based on the keys, thereby obtaining the required information without decrypting the entire file.
[0061] Specifically, for the first-level confidentiality file to be decrypted, since the second-level encryption keyword and the first-level encryption keyword are in a public state, the user can obtain the third-level key to decrypt the third-level encryption keyword to obtain the full text information of the file to be decrypted.
[0062] For files to be decrypted at the second level of confidentiality, since the first-level encryption keywords are in public, users can obtain the second-level key to decrypt the second-level encryption keywords to obtain other information in the file to be decrypted except the third-level encryption keywords; they can also obtain the third-level key to decrypt the second-level encryption keywords and the third-level encryption keywords to obtain the full text information of the file to be decrypted.
[0063] For files to be decrypted at the third level of confidentiality, since their full text is confidential, users can obtain the first-level key to decrypt the first-level encrypted keywords to obtain the first-level encrypted keyword information; they can also obtain the second-level key to decrypt the first-level encrypted keywords and the second-level encrypted keywords to obtain the first-level encrypted keywords and the second-level encrypted keyword information in the files to be decrypted; they can also obtain the third-level key to decrypt the first-level encrypted keywords, the second-level encrypted keywords and the third-level encrypted keywords to obtain the full-text information of the files to be decrypted.
[0064] Optionally, in an office scenario, different levels of keys can be distributed to members of different departments and positions. Each member can only obtain information of the corresponding level based on his or her own key, and cannot obtain higher-level file encryption information, thereby avoiding information leakage and ensuring file security.
[0065] In the embodiment of the present application, the file to be decrypted is first obtained, and the file to be decrypted includes at least one encrypted keyword of a confidentiality level; then the target key is obtained, and the target key includes at least one decryption algorithm corresponding to the encrypted keyword of at least one confidentiality level; the encrypted keyword of at least one confidentiality level in the file to be decrypted is decrypted according to the target key. Among them, by obtaining the key of the corresponding level to decrypt the encrypted keyword of at least one confidentiality level in the file to be decrypted, the user can obtain the required information without decrypting the entire file, and the flexibility of use is improved while ensuring the security of the file, thereby solving the technical problem that the entire file needs to be encrypted or decrypted to ensure the security of the file in the related art, and the user is not flexible in use. Example
[0066] According to an embodiment of the present application, a file encryption device for implementing the file encryption method in embodiment 1 is also provided. Figure 3 As shown, the device includes an acquisition module 30, a determination module 32 and an encryption module 34, wherein:
[0067] The acquisition module 30 is used to acquire the file to be encrypted and determine the target confidentiality level of the file to be encrypted;
[0068] A determination module 32 is used to match the text content of the to-be-encrypted file with the target keyword information resource library, and determine the target keywords of each confidentiality level corresponding to the target confidentiality level in the to-be-encrypted file, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels;
[0069] The encryption module 34 is used to encrypt target keywords of different confidentiality levels based on multiple encryption algorithms, wherein each confidentiality level target keyword corresponds to one encryption algorithm.
[0070] It should be noted that each module in the file encryption device in the embodiment of the present application corresponds one by one to the implementation steps of the file encryption method in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be repeated here. Example
[0071] According to an embodiment of the present application, a non-volatile storage medium is also provided, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned file encryption method or file decryption method.
[0072] Optionally, when the program is running, the device where the non-volatile storage medium is located is controlled to execute the following steps: obtaining the file to be encrypted and determining the target confidentiality level of the file to be encrypted; matching the text content of the file to be encrypted according to the target keyword information resource library to determine the target keywords of each confidentiality level in the file to be encrypted corresponding to the target confidentiality level, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels; encrypting the target keywords of each confidentiality level based on multiple encryption algorithms, wherein each target keyword of each confidentiality level corresponds to an encryption algorithm.
[0073] Optionally, when the program is running, the device where the non-volatile storage medium is located is controlled to execute the following steps: obtaining a file to be decrypted, wherein the file to be decrypted includes an encrypted keyword of at least one confidentiality level; obtaining a target key, wherein the target key includes at least one decryption algorithm corresponding to the encrypted keyword of at least one confidentiality level; and decrypting the encrypted keyword of at least one confidentiality level in the file to be decrypted based on the target key.
[0074] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0075] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0076] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0077] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0078] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0079] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0080] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A file encryption method, characterized in that: include: Obtaining a file to be encrypted, and determining a target confidentiality level of the file to be encrypted; Matching the text content of the file to be encrypted according to the target keyword information resource library to determine the target keywords of each confidentiality level in the file to be encrypted corresponding to the target confidentiality level, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels; Encrypting the target keywords of each confidentiality level based on multiple encryption algorithms, wherein each target keyword of each confidentiality level corresponds to one encryption algorithm; Wherein, the target keyword information resource library includes: a first keyword information resource library and a second keyword information resource library, the confidentiality levels include: confidentiality level one, confidentiality level two and confidentiality level three, and information matching is performed on the text content of the to-be-encrypted file according to the target keyword information resource library to determine the target keywords of each confidentiality level corresponding to the target confidentiality level in the to-be-encrypted file, including: when the target confidentiality level is confidentiality level one, information matching is performed on the text content of the to-be-encrypted file according to the first keyword information resource library to determine the third-level target keyword of the confidentiality level of confidentiality level three in the to-be-encrypted file; when the target confidentiality level is confidentiality level two, information matching is performed on the text content of the to-be-encrypted file according to the first keyword information resource library to determine the third-level target keyword of the confidentiality level of confidentiality level three in the to-be-encrypted file The third-level target keyword in the file to be encrypted is determined by the first keyword information resource library, and the text content of the file to be encrypted is matched according to the second keyword information resource library to determine the second-level target keyword with a confidentiality level of confidentiality level 2 in the file to be encrypted; when the target confidentiality level is confidentiality level 3, the third-level target keyword in the file to be encrypted is determined according to the first keyword information resource library, the second-level target keyword in the file to be encrypted is determined according to the second keyword information resource library, and the other text content in the file to be encrypted except the third-level target keyword and the second-level target keyword is determined as the first-level target keyword, wherein the confidentiality level of the first-level target keyword is confidentiality level 1.
2. The method according to claim 1, characterized in that Obtaining a file to be encrypted and determining a target confidentiality level of the file to be encrypted, including: Acquire the file to be encrypted through the file security encryption platform, and read the file information of the file to be encrypted, wherein the file information includes the text content of the file to be encrypted and the target confidentiality level of the file to be encrypted; The target confidentiality level of the file to be encrypted is determined according to the file information.
3. The method according to claim 2, characterized in that Before obtaining the file to be encrypted through the file security encryption platform, the method further includes: A target application is created based on a client / server architecture, and a labeling tool and an encryption tool are integrated into the target application to obtain the file security encryption platform; wherein the labeling tool includes the target keyword information resource library, the encryption tool includes the multiple encryption algorithms, and the target application is used to match the text content of the file to be encrypted according to the labeling tool, and to encrypt the target keywords of each confidentiality level according to the encryption tool.
4. The method according to claim 2, characterized in that: Before obtaining the file to be encrypted through the file security encryption platform, the method further includes: A target browser is created based on a browser / server architecture, and the target browser is used as the file security encryption platform; wherein the target browser is used to call a label tool from the server side to match the text content of the file to be encrypted, and call an encryption tool from the server side to encrypt the target keywords of each confidentiality level, wherein the label tool includes the target keyword information resource library, and the encryption tool includes the multiple encryption algorithms.
5. The method according to claim 1, characterized in that Before performing information matching on the text content of the to-be-encrypted file according to the target keyword information resource library, the method further includes: Collect professional keyword information, and determine a first keyword information resource library based on the professional keyword information, wherein the type of the professional keyword information includes at least one of the following: professional terms and term analysis in a preset technical field, and keywords defined by a target object; Collecting general keyword information, and determining a second keyword information resource library according to the general keyword information, wherein the type of the general keyword information includes at least one of the following: name, email address, telephone number; The target keyword information resource library is determined according to the first keyword information resource library and the second keyword information resource library.
6. The method according to claim 5, characterized in that Collecting professional keyword information and determining a first keyword information resource library according to the professional keyword information includes: Collecting the professional keyword information, and determining a first form according to the type of the professional keyword information; Splitting each professional keyword information in the first form to obtain a second form, wherein the length of each professional keyword information in the second form is less than a preset length; The first keyword information resource library is determined according to the first form and the second form.
7. The method according to claim 5, characterized in that Collecting general keyword information and determining a second keyword information resource library according to the general keyword information includes: Collecting the general keyword information, and determining a third form according to the type of the general keyword information; Performing dimensionality reduction processing on each general keyword information in the third form to reduce redundant information in each general keyword information, thereby obtaining a fourth form; Refining each general keyword information in the third table, adding supplementary information to each general keyword information, and obtaining a fifth table; The second keyword information resource library is determined according to the third form, the fourth form and the fifth form.
8. The method according to claim 1, characterized in that The target keywords of each confidentiality level are encrypted based on a variety of encryption algorithms, including: When the target confidentiality level is confidentiality level one, encrypting the third-level target keyword in the to-be-encrypted file according to a first encryption algorithm; When the target confidentiality level is confidentiality level 2, encrypting the level 3 target keyword in the file to be encrypted according to the first encryption algorithm, and encrypting the level 2 target keyword in the file to be encrypted according to the second encryption algorithm; When the target confidentiality level is confidentiality level three, the third-level target keyword in the file to be encrypted is encrypted according to the first encryption algorithm, the second-level target keyword in the file to be encrypted is encrypted according to the second encryption algorithm, and the first-level target keyword in the file to be encrypted is encrypted according to the third encryption algorithm.
9. The method according to claim 1, characterized in that: The multiple encryption algorithms include at least one of the following: Data Encryption Standard algorithm, Advanced Encryption Standard algorithm, and public key cryptography algorithm.
10. A file encryption device, characterized in that: include: An acquisition module, used to acquire a file to be encrypted and determine a target confidentiality level of the file to be encrypted; A determination module is used to match the text content of the file to be encrypted according to a target keyword information resource library, and determine the target keywords of each confidentiality level corresponding to the target confidentiality level in the file to be encrypted, wherein the target keyword information resource library includes keyword information of multiple confidentiality levels, and the target keyword information resource library includes: a first keyword information resource library and a second keyword information resource library, and the confidentiality levels include: confidentiality level one, confidentiality level two and confidentiality level three; the determination module is used to match the text content of the file to be encrypted according to the first keyword information resource library when the target confidentiality level is confidentiality level one, and determine the third-level target keyword of the confidentiality level of the file to be encrypted as confidentiality level three; at the target confidentiality level When the target confidentiality level is level 2, the third-level target keyword in the file to be encrypted is determined according to the first keyword information resource library, and the text content of the file to be encrypted is matched according to the second keyword information resource library to determine the second-level target keyword with a confidentiality level of level 2 in the file to be encrypted; when the target confidentiality level is level 3, the third-level target keyword in the file to be encrypted is determined according to the first keyword information resource library, and the second-level target keyword in the file to be encrypted is determined according to the second keyword information resource library, and the other text content in the file to be encrypted except the third-level target keyword and the second-level target keyword is determined as the first-level target keyword, wherein the confidentiality level of the first-level target keyword is level 1; The encryption module is used to encrypt the target keywords of each confidentiality level based on multiple encryption algorithms, wherein the target keywords of each confidentiality level correspond to one encryption algorithm.
11. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the file encryption method according to any one of claims 1 to 9.
