Disclosure of Invention
The invention provides a file processing method and a file processing device, which are used for solving the problem that an existing encryption processing mode in the prior art is not safe and still can cause electronic files to be illegally stolen or tampered.
One aspect of the present invention provides a file processing method, including:
receiving an encrypted electronic file and encrypted replacement information sent by a server, wherein the replacement information comprises at least one file datum and position information of each file datum in the at least one file datum, each file datum in the at least one file datum is extracted from the electronic file by the server, the position information represents a position of the file datum in the electronic file, and the encrypted electronic file is the electronic file from which the at least one file datum is extracted;
decrypting the encrypted electronic file and the encrypted replacement information to obtain a decrypted electronic file and the decrypted replacement information;
and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file.
Further, according to the location information of each piece of file data, setting each piece of file data to a location in the decrypted electronic file corresponding to the location information of each piece of file data, to obtain a complete electronic file, including:
determining and eliminating characters on positions corresponding to each piece of position information in the decrypted electronic file according to the position information of each piece of file data;
and filling each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain the complete electronic file.
Further, after setting each piece of file data to a position in the decrypted electronic file corresponding to the position information of each piece of file data according to the position information of each piece of file data to obtain a complete electronic file, the method further includes:
processing and/or displaying the complete electronic file.
Further, the at least one file data is continuous in the electronic file, or the at least one file data is discontinuous in the electronic file.
Another aspect of the present invention provides a file processing method, including:
receiving a file acquisition request sent by a terminal;
sending an encrypted electronic file and encrypted replacement information to the terminal according to the file acquisition request, wherein the replacement information includes at least one file datum and location information of each file datum in the at least one file datum, each file datum in the at least one file datum is extracted from the electronic file, the location information represents a location of the file datum in the electronic file, the encrypted electronic file is the electronic file from which the at least one file datum is extracted, so that the terminal decrypts the encrypted electronic file and the encrypted replacement information to obtain a decrypted electronic file and the replacement information, and then sets each file datum to a location in the decrypted electronic file corresponding to the location information of each file datum according to the location information of each file datum, to obtain a complete electronic file.
Further, before the file obtaining request sent by the receiving terminal, the method further includes:
acquiring an electronic file;
extracting the at least one file data from the electronic file according to a preset rule to obtain the electronic file with the extracted file data, and determining the replacement information;
and encrypting the electronic file with the extracted file data to obtain the encrypted electronic file, and encrypting the replacement information to obtain the encrypted replacement information.
Further, before encrypting the electronic file from which the file data is extracted to obtain the encrypted electronic file, the method further includes:
filling preset characters to positions corresponding to the position information of each file data according to the replacement information to obtain an electronic file filled with the characters;
correspondingly, encrypting the electronic file from which the file data is extracted to obtain the encrypted electronic file includes:
and encrypting the electronic file filled with the characters to obtain the encrypted electronic file.
Further, the preset rule is to continuously extract file data from the electronic file, or to continuously extract file data from the electronic file.
Still another aspect of the present invention provides a document processing apparatus including:
the system comprises a receiving module and a sending module, wherein the receiving module is used for receiving an encrypted electronic file and encrypted replacement information sent by a server, the replacement information comprises at least one file datum and position information of each file datum in the at least one file datum, each file datum in the at least one file datum is extracted from the electronic file by the server, the position information represents the position of the file datum in the electronic file, and the encrypted electronic file is the electronic file from which the at least one file datum is extracted;
the decryption module is used for decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information;
and the setting module is used for setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file.
Further, the setting module includes:
the eliminating submodule is used for determining and eliminating characters on positions corresponding to each piece of position information in the decrypted electronic file according to the position information of each piece of file data;
and the filling submodule is used for filling each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain the complete electronic file.
Further, the apparatus further comprises:
and the processing module is used for processing and/or displaying the complete electronic file after the setting module sets each file data to the position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain the complete electronic file.
Further, the at least one file data is continuous in the electronic file, or the at least one file data is discontinuous in the electronic file.
Still another aspect of the present invention provides a document processing apparatus including:
the receiving module is used for receiving a file acquisition request sent by a terminal;
a sending module, configured to send an encrypted electronic file and encrypted replacement information to the terminal according to the file acquisition request, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file, the location information represents a location of the piece of file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted, so that the terminal decrypts the encrypted electronic file and the encrypted replacement information to obtain a decrypted electronic file and the replacement information, and then sets each piece of file data to the decrypted electronic file corresponding to the location information of each piece of file data according to the location information of each piece of file data And (4) positioning to obtain a complete electronic file.
Further, the apparatus further comprises:
the acquisition module is used for acquiring the electronic file before the receiving module receives the file acquisition request sent by the terminal;
the extraction module is used for extracting the at least one file data from the electronic file according to a preset rule to obtain the electronic file with the extracted file data and determining the replacement information;
and the encryption module is used for encrypting the electronic file with the extracted file data to obtain the encrypted electronic file, and encrypting the replacement information to obtain the encrypted replacement information.
Further, the apparatus further comprises:
the filling module is used for filling preset characters into the positions corresponding to the position information of each file data according to the replacement information before the encryption module encrypts the electronic file with the extracted file data to obtain the encrypted electronic file, so as to obtain the electronic file with the filled characters;
correspondingly, the encryption module is specifically configured to:
and encrypting the electronic file filled with the characters to obtain the encrypted electronic file, and encrypting the replacement information to obtain the encrypted replacement information.
Further, the preset rule is to continuously extract file data from the electronic file, or to continuously extract file data from the electronic file.
The invention provides a file processing method and a device, which are characterized in that an encrypted electronic file and encrypted replacement information are sent by a server, wherein the replacement information comprises at least one file datum and position information of each file datum in the at least one file datum, each file datum in the at least one file datum is extracted from the electronic file by the server, the position information represents the position of the file datum in the electronic file, and the encrypted electronic file is the electronic file from which the at least one file datum is extracted; decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information; and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file. The method comprises the steps of eliminating part of file data in an electronic file, determining the position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The specific application scenarios of the invention are as follows: in the prior art, a public key is arranged in a server, the server encrypts an electronic file by adopting the public key, and then the server sends the encrypted electronic file to a terminal; and the terminal decrypts the encrypted electronic file by adopting a private key corresponding to the public key, and then the terminal acquires the electronic file. However, in the prior art, if other illegal devices acquire the private key, the encrypted electronic file in transmission can be decrypted, and then the electronic file is acquired or tampered, and then the existing encryption processing mode is not safe, and the electronic file is still prevented from being illegally stolen or tampered.
The invention provides a file processing method and a file processing device, and aims to solve the technical problems in the prior art.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a file processing method according to an embodiment of the present application. As shown in fig. 1, the method includes:
step 101, receiving an encrypted electronic file and encrypted replacement information sent by a server, wherein the replacement information includes at least one file datum and location information of each file datum in the at least one file datum, each file datum in the at least one file datum is extracted from the electronic file by the server, the location information represents a location of the file datum in the electronic file, and the encrypted electronic file is the electronic file from which the at least one file datum is extracted.
In an alternative embodiment, at least one file data is continuous in the electronic file, or at least one file data is discontinuous in the electronic file.
In this embodiment, the execution subject of this embodiment is specifically a terminal, but is not limited to the terminal.
The electronic file and the replacement information corresponding to the electronic file are stored in the server. The replacement information corresponding to the electronic file comprises a plurality of file data and position information of each file data, wherein the file data are extracted from the electronic file by a server, the position information of each file data represents the position of the file data in the electronic file, and the electronic file is the electronic file with at least one file data extracted. Specifically, the above plurality of file data are continuous in the electronic file, or the above plurality of file data are discontinuous in the electronic file.
For example, the file data 1 is extracted from the position 1 of the original electronic file, the file data 2 is extracted from the position 2 of the electronic file, the replacement information includes the file data 1, the position 1 of the file data 1, the file data 2, and the position 2 of the file data 2, and the electronic file is an electronic file lacking the file data 1 and the file data 2.
Also, the server may encrypt the electronic file from which the file data is extracted, and the server may encrypt the replacement information. For example, the server encrypts the electronic file from which the file data has been extracted and the replacement information using the public key.
For example, the replacement information includes file data, location information, and a correspondence between the file data and the location information, and the encrypted replacement information includes a correspondence between the encrypted file data and the location information, the encrypted file data, and the encrypted location information.
The terminal sends a file acquisition request to the server, and then the server sends the encrypted electronic file and the encrypted replacement information to the terminal.
And 102, decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information.
In this embodiment, specifically, the terminal decrypts the encrypted electronic file and the encrypted replacement information, respectively, so as to obtain the decrypted electronic file and the decrypted replacement information.
For example, a Personal Computer (PC) client or a mobile Application (APP) client of the terminal downloads an encrypted electronic file, replacement information for restoring file data, and a key for decrypting the data from a server.
And 103, setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file.
In this embodiment, specifically, for each file data in the replacement information, the file data is set to a position corresponding to the position information of the file data according to the position information of the file data, so as to obtain a complete electronic file.
For example, for an electronic file lacking file data 1 and file data 2, file data 1 is set to location 1, and file data 2 is set to location 2, so as to obtain a complete electronic file.
In the embodiment, an encrypted electronic file and encrypted replacement information are received, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file by the server, the location information represents a location of the piece of file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted; decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information; and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file. The method comprises the steps of eliminating part of file data in an electronic file, determining the position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Fig. 2 is a schematic flowchart of another file processing method according to an embodiment of the present application. As shown in fig. 2, the method includes:
step 201, receiving an encrypted electronic file and encrypted replacement information sent by a server, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file by the server, the location information represents a location of the file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted.
In this embodiment, specifically, this step may refer to step 101 in fig. 1, and is not described again.
Step 202, decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information.
In this embodiment, specifically, this step may refer to step 102 in fig. 1, and is not described again.
And step 203, determining and eliminating characters at positions corresponding to the position information in the decrypted electronic file according to the position information of each file data.
In this embodiment, specifically, for each piece of file data in the replacement information, the terminal determines, according to the location information of the piece of file data, a character at a location in the decrypted electronic file corresponding to each piece of location information, and then, the terminal removes the character.
And step 204, filling each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file.
In this embodiment, specifically, for each file data in the replacement information, the terminal sets the file data to a position corresponding to the position information of the file data according to the position information of the file data, so as to obtain a complete electronic file.
For example, for an electronic file lacking file data 1 and file data 2, the characters at position 1 are removed, file data 1 is set at position 1, the characters at position 2 are removed, and file data 2 is set at position 2, so that a complete electronic file is obtained.
Step 205, processing and/or displaying the complete electronic file.
In this embodiment, specifically, the terminal may display the complete electronic file, or the terminal may store the complete electronic file, or the terminal may modify the complete electronic file and then display the modified complete electronic file.
In the embodiment, an encrypted electronic file and encrypted replacement information are received, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file by the server, the location information represents a location of the piece of file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted; decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information; determining and eliminating characters at positions corresponding to each piece of position information in the decrypted electronic file according to the position information of each piece of file data; and filling each file data to the position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain the complete electronic file. The method comprises the steps of replacing part of file data in an electronic file with special characters, determining position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Fig. 3 is a schematic flowchart of another file processing method according to an embodiment of the present application. As shown in fig. 3, the method includes:
and 301, acquiring an electronic file.
In this embodiment, specifically, the execution subject of this embodiment is a server, but is not limited to the server.
The server acquires the electronic file, specifically, the server may acquire the electronic file from other terminals or a cloud.
Step 302, extracting at least one file data from the electronic file according to a preset rule, obtaining the electronic file with the extracted file data, and determining the replacement information.
In an alternative embodiment, the preset rule is to continuously extract the document data from the electronic document, or to continuously extract the document data from the electronic document.
In this embodiment, specifically, the server extracts a plurality of file data with a preset size from the electronic file according to a preset rule, for example, the preset size is N bytes or several kbytes. Specifically, the server extracts file data from consecutive locations of the electronic file, or the server extracts file data from non-consecutive locations of the electronic file, specifically, the server extracts consecutive bytes in the electronic file, or X non-consecutive bytes in the electronic file.
And 303, encrypting the electronic file with the file data extracted to obtain an encrypted electronic file, and encrypting the replacement information to obtain encrypted replacement information.
In an alternative embodiment, step 303 includes: filling preset characters into positions corresponding to the position information of each file data according to the replacement information to obtain the electronic file filled with the characters; and encrypting the electronic file filled with the characters to obtain an encrypted electronic file, and encrypting the replacement information to obtain encrypted replacement information.
In this embodiment, specifically, the server fills in the file data with preset characters at the position where the file data is extracted, and then replaces the file data with the preset characters, where the filling characters can be used as? "," # ", etc.
Then the server stores the replacement information, wherein the replacement information comprises the extracted file data, the position information of the file data and the corresponding relation between the file data and the position information of the file data.
Then, the server encrypts the replacement information to obtain encrypted replacement information; and the server encrypts the electronic file from which the file data is extracted to obtain an encrypted electronic file.
And step 304, receiving a file acquisition request sent by the terminal.
In this embodiment, specifically, the terminal sends a file acquisition request to the server.
Step 305, sending the encrypted electronic file and the encrypted replacement information to the terminal according to the file acquisition request, wherein the replacement information includes at least one file data, location information of each file data of the at least one file data, wherein each of the at least one document data is extracted from the electronic document, the position information represents a position of the document data in the electronic document, the encrypted electronic document is the electronic document from which the at least one document data is extracted, so that the terminal decrypts the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the replacement information, and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file.
In this embodiment, specifically, the server sends the encrypted electronic file and the encrypted replacement information to the terminal.
The terminal decrypts the encrypted replacement information to obtain the replacement information, wherein the replacement information comprises the extracted file data, the file data position information and the corresponding relation between the file data and the file data position information; and the terminal decrypts the encrypted electronic file to obtain the electronic file. Then, the terminal removes the characters at the position corresponding to the file data position information in the electronic file according to the file data position information, and fills the file data at the position corresponding to the file data position information in the electronic file according to the corresponding relation between the file data and the file data position information, so as to obtain the complete electronic file. And displaying the complete electronic file by the terminal.
The embodiment receives a file acquisition request sent by a terminal; transmitting the encrypted electronic file and the encrypted replacement information to the terminal according to the file acquisition request, wherein the replacement information includes at least one file data, location information of each file data of the at least one file data, wherein each of the at least one document data is extracted from the electronic document, the position information represents a position of the document data in the electronic document, the encrypted electronic document is the electronic document from which the at least one document data is extracted, so that the terminal decrypts the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the replacement information, and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file. The method comprises the steps of replacing part of file data in an electronic file with special characters, determining position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Fig. 4 is a schematic structural diagram of a file processing apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus according to the embodiment may include:
the receiving module 41 is configured to receive an encrypted electronic file sent by the server and encrypted replacement information, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file by the server, the location information represents a location of the piece of file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted.
And the decryption module 42 is configured to decrypt the encrypted electronic file and the encrypted replacement information to obtain a decrypted electronic file and the decrypted replacement information.
And a setting module 43, configured to set each piece of file data to a position, corresponding to the position information of each piece of file data, in the decrypted electronic file according to the position information of each piece of file data, so as to obtain a complete electronic file.
The file processing apparatus of this embodiment can execute the file processing method provided in the embodiments of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment, an encrypted electronic file and encrypted replacement information are received, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file by the server, the location information represents a location of the piece of file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted; decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information; and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file. The method comprises the steps of eliminating part of file data in an electronic file, determining the position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Fig. 5 is a schematic structural diagram of another file processing apparatus according to an embodiment of the present invention, and based on the embodiment shown in fig. 3, as shown in fig. 5, a setting module 43 includes:
and the eliminating submodule 431 is used for determining and eliminating characters at the position corresponding to each position information in the decrypted electronic file according to the position information of each file data.
And the filling submodule 432 is configured to fill each file data to a position, corresponding to the position information of each file data, in the decrypted electronic file according to the position information of each file data, so as to obtain a complete electronic file.
The apparatus provided in this embodiment further includes:
and the processing module 51 is configured to, after the setting module 43 sets each piece of file data to a position in the decrypted electronic file corresponding to the position information of each piece of file data according to the position information of each piece of file data, obtain a complete electronic file, and process and/or display the complete electronic file.
At least one file data is continuous in the electronic file, or at least one file data is discontinuous in the electronic file.
The file processing apparatus of this embodiment can execute another file processing method provided in this embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment, an encrypted electronic file and encrypted replacement information are received, where the replacement information includes at least one piece of file data and location information of each piece of file data in the at least one piece of file data, where each piece of file data in the at least one piece of file data is extracted from the electronic file by the server, the location information represents a location of the piece of file data in the electronic file, and the encrypted electronic file is the electronic file from which the at least one piece of file data is extracted; decrypting the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the decrypted replacement information; determining and eliminating characters at positions corresponding to each piece of position information in the decrypted electronic file according to the position information of each piece of file data; and filling each file data to the position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain the complete electronic file. The method comprises the steps of replacing part of file data in an electronic file with special characters, determining position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Fig. 6 is a schematic structural diagram of another file processing apparatus according to an embodiment of the present invention, and as shown in fig. 6, the apparatus according to the embodiment may include:
the receiving module 61 is configured to receive a file acquisition request sent by a terminal.
A sending module 62, configured to send the encrypted electronic file and the encrypted replacement information to the terminal according to the file obtaining request, where the replacement information includes at least one file datum and location information of each file datum in the at least one file datum, where each file datum in the at least one file datum is extracted from the electronic file, the location information represents a location of the file datum in the electronic file, the encrypted electronic file is the electronic file from which the at least one file datum is extracted, so that the terminal decrypts the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the replacement information, and then sets each file datum to a location in the decrypted electronic file corresponding to the location information of each file datum according to the location information of each file datum, to obtain a complete electronic file.
This embodiment provides the device, still includes:
an obtaining module 63, configured to obtain the electronic file before the receiving module 61 receives the file obtaining request sent by the terminal.
And the extraction module 64 is configured to extract at least one piece of file data from the electronic file according to a preset rule, obtain the electronic file with the extracted file data, and determine the replacement information.
And an encryption module 65 configured to encrypt the electronic file from which the file data is extracted to obtain an encrypted electronic file, and encrypt the replacement information to obtain encrypted replacement information.
The apparatus provided in this embodiment further includes:
a padding module 66, configured to pad preset characters in positions corresponding to the position information of each piece of file data according to the replacement information before the encryption module 65 encrypts the electronic file from which the file data is extracted to obtain an encrypted electronic file, so as to obtain an electronic file with padded characters.
Correspondingly, the encryption module 65 is specifically configured to: and encrypting the electronic file filled with the characters to obtain an encrypted electronic file, and encrypting the replacement information to obtain encrypted replacement information.
The preset rule is to continuously extract file data from the electronic file or to discontinuously extract file data from the electronic file.
The file processing apparatus of this embodiment can execute another file processing method provided in this embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
The embodiment receives a file acquisition request sent by a terminal; transmitting the encrypted electronic file and the encrypted replacement information to the terminal according to the file acquisition request, wherein the replacement information includes at least one file data, location information of each file data of the at least one file data, wherein each of the at least one document data is extracted from the electronic document, the position information represents a position of the document data in the electronic document, the encrypted electronic document is the electronic document from which the at least one document data is extracted, so that the terminal decrypts the encrypted electronic file and the encrypted replacement information to obtain the decrypted electronic file and the replacement information, and setting each file data to a position corresponding to the position information of each file data in the decrypted electronic file according to the position information of each file data to obtain a complete electronic file. The method comprises the steps of replacing part of file data in an electronic file with special characters, determining position information of the file data, sending the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information to a terminal, encrypting the electronic file with part of the file data extracted, and sending the electronic file to the terminal; therefore, after other illegal equipment acquires the encrypted electronic file, even if the electronic file can be decrypted, the illegal equipment cannot acquire complete electronic data due to the fact that part of file data is extracted from the electronic file, and the electronic file is guaranteed not to be illegally stolen or tampered; the terminal can recover the electronic file with part of the file data extracted according to the corresponding relation between the encrypted file data and the position information, the encrypted file data and the encrypted position information, and further obtain the complete electronic file.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.