WO2011137743A1 - 一种文件保护方法及系统 - Google Patents

一种文件保护方法及系统 Download PDF

Info

Publication number
WO2011137743A1
WO2011137743A1 PCT/CN2011/073667 CN2011073667W WO2011137743A1 WO 2011137743 A1 WO2011137743 A1 WO 2011137743A1 CN 2011073667 W CN2011073667 W CN 2011073667W WO 2011137743 A1 WO2011137743 A1 WO 2011137743A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
protected
shadow
module
application
Prior art date
Application number
PCT/CN2011/073667
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
北京飞天诚信科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京飞天诚信科技有限公司 filed Critical 北京飞天诚信科技有限公司
Priority to US13/696,200 priority Critical patent/US8856521B2/en
Publication of WO2011137743A1 publication Critical patent/WO2011137743A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Definitions

  • the present invention relates to the field of information security, and in particular, to a file protection method and system.
  • BACKGROUND OF THE INVENTION With the development of computer technology, various industries have begun to evolve greatly in informationization, especially various financial companies, software development companies, etc., and sensitive data is increasing, and electronic data that needs to be protected is increasing. The security is mostly related to the survival of enterprises, so the protection of documents is getting more and more attention.
  • various Trojans and viruses are also coming to the moon. Malicious attackers are developing more and more illegal programs to be implanted in other people's computers, stealing all kinds of sensitive data, and stealing technology is getting higher and higher. In order to prevent the theft of confidential data, more and more methods of file protection have emerged.
  • the easiest way is to hide the secret file, or to save the file with a password, but this method is fragile, it is easy to crack the file by scanning the computer or brute force, etc., and it is safer.
  • Sexual means The key needs to be encrypted for the file to be kept secret, and the key is secretly saved, for example, stored in the encryption lock.
  • the encryption lock is generally a USB interface smart device, which can be connected with the computer and complete the file protection with the computer. And the function of rights management, in the case that the key is obtained by the attacker, the security of the file can be guaranteed.
  • the method is specifically: installing a file protection program in the computer, and when the legal program opens the encrypted file, the file protection program The file is decrypted using the key to obtain a plaintext file for the legitimate person to operate.
  • the file protector prohibits it from opening the encrypted file and does not provide decryption services.
  • this method still has insecurity.
  • a legitimate program opens and decrypts a protected file
  • the operating system allocates a certain amount of space in the cache for the decrypted plaintext, and stores the plaintext.
  • the legitimate file can operate on the protected file.
  • the protected file in the cache is not immediately emptied, and the illegal program also passes through the upper interface.
  • the data of the protected file in the cache can be directly read out to read the plaintext data.
  • the plaintext data in the cache is not immediately cleared, resulting in the number of illegal applications in the cache. If the protected file is accessed when it is not cleared, the plaintext data in the cache can be obtained, so that the protected file data is leaked.
  • a main object of the embodiments of the present invention is to provide a file protection method and system, which can solve the problem that after a legitimate program accesses a protected file in the prior art, the plaintext data remains in the cache and the illegal program can pass.
  • the problem of the cache address accessing the plaintext data.
  • a file protection method the method comprising: an application receiving an instruction issued by a user to operate a protected file, wherein the protected file is a file encrypted and stored in a cipher text on a disk.
  • the instruction for operating the protected file includes an instruction to open, read, write, and close the protected file; after receiving the instruction to open the protected file, the opening the protected file includes: The application invokes an upper layer interface of the operating system, and the upper layer interface issues an instruction to open the protected file to the file system; the filtering driver intercepts an instruction issued by the upper layer interface to the file system to open the protected file, and Determining whether the application is a legitimate application; if legal, the filtering driver reads the attribute information of the protected file, and issues an instruction to the file system to create a shadow file of the protected file in the virtual disk, The file system creates the described in the virtual disk by a virtual disk drive Subfile, the operating system returns the handle to the application program image file, the reference count increased by one step; wherein the method comprises creating a shadow files A and B in the virtual disk:
  • the filter driver reads the attribute information of the protected file by using the file system, creates the shadow file in the virtual disk, randomly names the shadow file, and writes the protected file Property information, the data of the shadow file is empty; or, B.
  • the filter driver reads the protected file by using the file system, and decrypts the protected file by using a key stored in an encryption lock connected to the host to obtain a plaintext, and inserting the plaintext into the file.
  • the operation of reading the protected file includes: the application The program sends an instruction to read the file according to the handle; when the shadow file is created by using the method A, the data of the shadow file is empty, the filtering driver intercepts the handle issued by the application according to the handle An instruction to read a file, read a predetermined portion or all of the protected file from a disk, and decrypt a predetermined portion or all of the protected file using a key stored in an encrypted lock connected to the host Obtaining a plain text or all plaintext of a predetermined portion of the protected file, the operating system allocates a buffer space to the shadow file, and The plaintext or all plaintext of the predetermined part is placed in a cache space allocated by the operating system for the shadow file, and a file mapping relationship is established, and the application completes a read operation on the protected file; when creating a shadow file, Method B, when the data in the shadow file is
  • the application completes a read operation on the protected file; after receiving the instruction to write the protected file, the operation of writing the protected file includes: the application sends a response according to the handle An instruction to write a file; the application completes in the cache allocated by the operating system for the shadow file a write operation of the protected file of the plaintext, the write operation including inserting new data, tampering, replacing, and editing the protected file; the filtering driver encrypting the modified file after the tampering Operating and saving; after receiving the instruction to close the protected file, the operation of closing the protected file includes: The filter driver closes the handle of the opened shadow file one by one, decrements the reference count value, and decrements the check reference value, and deletes the shadow file when the reference count value is an initial value.
  • a file protection system the system includes a file protection driver and an encryption lock:
  • the file protection driver includes: an application module, an upper interface module, a filter driver module, a file system module, a virtual disk drive module; And means for opening a protected file stored in the disk by calling the upper interface module, and issuing, by the upper interface module, an instruction to perform a read operation and a write operation on the file according to the handle;
  • the upper interface module is configured to receive The operation module sends an instruction to the file operation, and performs operations of opening, reading, writing, and closing the file by operating the file system module;
  • the filtering driver module is configured to monitor the file system in the host The operation of the module, when a predefined operation on the file system module is found, performing a preset additional operation to control the predefined operation of the file system module;
  • the files stored in the management disk can be created on the disk.
  • the virtual disk drive module configured to receive, by the file system module, an instruction to create a shadow file of the protected file by the filter drive module After the shadow file is created, the operating system returns a handle of the shadow file to the application module;
  • the encryption lock includes: a verification module and a key storage module;
  • the danger certificate module is configured to: when the application module is started, whether the auxiliary-risk card has an encryption lock connected to the host, if yes, the application module can be started; otherwise, the application module cannot start up.
  • the key storage module is configured to provide a key for the encryption and decryption operation when the filtering driver module performs an encryption and decryption operation on the protected file.
  • the technical solution provided by the embodiment of the present invention has the beneficial effect that the plaintext data of the protected file is put into the buffer space allocated by the shadow file by adding a shadow file to the file protection system. And the shadow file is stored in the virtual disk, the virtual disk is invisible to the very program, and the shadow file is not known to the illegal program, so the program cannot obtain the plaintext data of the protected file in the cache by accessing the shadow file, and the existing file is solved.
  • the plaintext data remains in the cache when the cache is not cleared, and the illegal program can access the plaintext data through the cache address, which has higher security.
  • Embodiment 1 is a flowchart of a file protection method according to a specific embodiment of the present invention.
  • FIG. 2 is a flowchart of a file protection method according to Embodiment 2 of the present invention.
  • FIG. 3 is a block diagram of a file protection system according to Embodiment 3 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
  • Embodiment 1 This embodiment provides a file protection method. This embodiment uses a read operation of a protected file Encrypt.txt stored in a disk as an example. Encrypt.txt is protected on a user disk.
  • the file, encrypted by the key, is stored on the disk in cipher text.
  • a decryption operation is required to enable the user to obtain plaintext file data on the user interface; in different operating systems, the corresponding application is required.
  • this embodiment is described in the Windows XP system as an example.
  • notepad.exe When reading and writing a file in the txt format under the Windows XP system, it is necessary to start the program provided by the system, notepad.exe, and in the system. In the process of creating notepad.exe, notepad.exe can call the interface provided by the operating system NtcreateFile, NtReadFile, etc.
  • the file protection method provided by the embodiment further includes: preprocessing the legal application provided by the operating system according to the file to be protected, in this embodiment, Encrypt.txt is a protected file, The protected file is in txt format, then the application notepad.exe Pre-processing, in this embodiment, preferably, pre-processing the notepad.exe to the shelling process, specifically: in the notepad.exe force input code, so that when the system runs notepad.exe, first check Whether there is a legal encryption lock access on the host, if there is, you can run the process, otherwise, the system is not able to port the notepad.exe process; a file protection method, participate in Figure 1, the specific steps are as follows: Step 101, application The command issued by the user to open the protected file Encrypt.txt; in this embodiment, specifically, the application receives a command issued by the user to read the file
  • step 4 before the start of 101 includes: starting the operating system, loading the filter driver and the virtual disk drive And creating a virtual disk in the memory, wherein the filter driver and the virtual disk drive are provided by the invention, and the filter driver operates the virtual disk driver through the file system, and the operations of creating, modifying, flashing files, etc. can be completed in the virtual disk, the above virtual
  • the disk is built into the memory, which can improve the read and write speed, and is only visible to the programs approved by the filter driver and the filter driver.
  • the virtual disk simulates a disk partition in the memory and establishes the same data storage format as the disk storage.
  • the area in memory that is divided into virtual disks can be used as a normal storage class disk.
  • Step 102 The application invokes an upper layer application interface of the operating system to prepare to open the protected file.
  • the operating system upper layer application interface is an interface provided by the operating system for operating the file Encrypt.txt, for example, NtcreateFile, NtReadFile. Etc., these interfaces can complete the operations of establishing, reading, and the like of the txt file.
  • Step 103 The filter driver intercepts the instruction sent by the upper application interface, and determines whether the application is legal. If not, the execution step 4 is 104, and if it is legal, Step 4: The filter driver can be used to monitor the operation of the file system in the host.
  • the filtering driver further has a function of determining whether the application for issuing the protected file command is legal; wherein the predefined operations on the file system include reading and writing a preset file, etc., in this embodiment, the predefined The operation of the file system is to read the protected file Encrypt.txt; the preset additional operations include: creating a shadow file, encrypting and decrypting the file, personalizing the data, etc.; filtering driver to determine whether the application is Legitimate, specifically: When the legitimate application is shelled, the packaged application is registered with the filter driver, and the filter driver registers the registration information of the legitimate application.
  • Step 104 The operating system finds the protected file Encrypt.txt on the disk, and allocates a buffer space for reading. In this step, the file is put into the cache and read because the key is not used for decryption. Encrypt.txt is in cipher text form.
  • this step may also be: returning an error, prohibiting the illegal application from accessing the protected file Encrypt.txt.
  • Step 105 The filter driver creates a new file in the virtual disk as a shadow file of the protected file.
  • the shadow file of the protected file is named l.txt; wherein, the filter driver creates a shadow of the protected file.
  • the file specifically includes: Step A: The filter driver reads the attribute information of the protected file; the attribute information of the protected file includes the size, type, creation time, and the like of the file, wherein the specific content of the protected file is encrypted storage, but the attribute thereof The information can be obtained through the file system, which is plaintext data, and the filter driver reads the attribute information of the protected file through the file system; Step B, the filter driver sends an instruction to establish a 1.txt in the virtual disk to the file system; Step C, the file system sends an instruction to create a l.txt to the virtual disk driver, and the virtual disk driver establishes a l.txt; step D, in the virtual The disk writes data for the shadow file 1.txt.
  • Method 1 the attribute information of the protected file Encrypt.txt is written into the virtual Disk, as the attribute of the shadow file 1.txt, but the data of 1.txt is empty;
  • Method 2 write the attribute information of the protected file Encrypt.txt to the virtual disk, as the attribute of the shadow file l.txt, and filter drive
  • the data in the protected file Encrypt.txt is read out, and the key stored in the encrypted lock connected to the host is used for decryption to obtain the plaintext data, which is written into the virtual disk as the data of the shadow file l.txt;
  • the ciphertext is preferably decrypted in units of clusters, and a predetermined part or all of Encrypt.txt is decrypted to obtain a predetermined part of the plaintext.
  • All the plain text is put into the virtual disk as the data of 1.txt; when the protected file is encrypted and decrypted, it is not limited to decryption in units of clusters, and can also be decrypted in units of streams, in bytes.
  • the unit decrypts, decrypts in units of data blocks, etc.; when the filter driver creates a shadow file for the protected file Encrypt.txt, the shadow file is named randomly, that is, a name is randomly generated for the shadow file, and the name and the disk are randomly generated.
  • the names of other files stored in the file are different. In this embodiment, the name of the shadow file randomly generated is l.txt.
  • Step 106 The filter region file returns a handle of the shadow file l.txt; in this embodiment, the handle of the shadow file l.txt is hltxt; in this step, the method further includes: adding a reference count value by one step Long, preferably, the reference count value is increased by 1, and the reference count value records the number of handles of the opened shadow file.
  • the reference count value is set to the initial value of 0, when there is a handle of the shadow file. When closed, the reference count value is decremented by one step.
  • Step 107 the application sends an instruction to perform a read operation according to the handle hltxt;
  • the method can select the symmetric force secret or the asymmetric force secret; the Encrypt.txt content in the plaintext form is read into the cache allocated by the operating system for l.txt, and the filter driver is the encrypted file Encrypt.txt and the disk.
  • the stored ciphertext Encrypt.txt establishes a file mapping relationship, decrypts the protected file Encrypt.txt stored in the disk, and blocks the block into the cache to save the cache space; decrypts the protected file and puts the plaintext into
  • ⁇ ⁇ Method 1, decrypt all the data of the protected file, and complete In the cache allocated for the shadow file, this applies to the protected file is relatively small; Method 2, the part of the protected file that needs to be accessed is decrypted in units of clusters, and the decrypted part is allocated for the shadow file.
  • this method is suitable when the protected file is relatively large, and preferably the protected file is encrypted in clusters when it is encrypted and saved.
  • step 4 in step 4, when step 2 is used, step 4 can also be: filter drive interception
  • the instruction to read the hltxt according to the handle hltxt is sent to the file system to send a command to read the shadow file, and the file system reads the data in the shadow file l.txt through the virtual disk drive, and puts the data in the l.txt into the operation.
  • the system is allocated in the cache for the shadow file.
  • step 109 the application closes the opened protected file Encrypt.txt.
  • the step 109 may further include: the filter driver closes the handle of the opened shadow file 1.txt one by one, and decrements the reference count value, and checks the I count value after each decrement, when? When the count value of I is 0, the shadow file is deleted.
  • a file protection method provided by this embodiment does not open a real protected text in a process in which a legitimate application accesses a protected file by installing a filter driver in the system. Instead, create a shadow file of the protected file in the virtual disk, change it to another name, allocate a cache space for it, and then read the protected file into the cache. The legitimate application passes the handle of the shadow file.
  • Embodiment 2 In this embodiment, a write operation of a protected file Encrypt.txt stored on a disk is taken as an example. The write operation includes inserting new data on the data of the original document Encrypt.txt.
  • the protected file Encrypt.txt is encrypted and stored in ciphertext on the disk, for example, in Windows XP system, it will be used to open the file Encrypt.txt.
  • the legal application notepad.exe performs the shelling process.
  • the shelling process in this embodiment specifically includes: adding code in the application notepad.exe, so that the application has the following functions at runtime, when the notepad.exe is started, Check if there is a legal encryption lock access. When there is a legal encryption lock access, notepad.exe can run, the system allows to establish the notepad.exe process, and write the protected file Encrypt.txt through notepad.exe.
  • Step 201 The application receives an instruction issued by the user to open the protected file Encrypt.txt.
  • the application includes: a legitimate application and an illegal application; and the legitimate application is a sealed notebook.exe, Notepad.exe can be associated with the txt format.
  • Step 202 the application calls the upper layer application interface of the operating system to issue an instruction to open the protected file to the file system; wherein, the legitimate application and the illegal application need to be provided by the operating system
  • the upper layer interface opens the protected file.
  • the above upper layer interfaces include: NtcreateFile, NtReadFile, etc.
  • the above file system specifically means that the operating system manages the files stored on the disk through the file system, including FAT, NTFS, and the like.
  • Step 203 The filter driver intercepts an instruction of the upper layer of the operating system to open the protected file Encrypt.txt to the file system, and determines whether the application is legal. If not, go to step 204.
  • Driving which can be used to monitor the operation of the file system in the host system, perform a preset additional operation when a predefined operation on the file system occurs, or control a predefined operation on the file system, and
  • the filter driver further has a function of determining whether the application that issued the command to open the protected file is legal; in this embodiment, the filter driver intercepts the open protected file Encrypt.txt issued to the file system by the upper layer interface of the operating system.
  • the command may be suspended, and after the judgment of the application, the corresponding command is executed according to the judgment result; wherein, the filter driver determines whether the application is legal, specifically: when the legitimate application is packed, Make the packaged application register with the filter driver.
  • the filter driver records the registration information of the legitimate application.
  • the filter driver acquires the information of the application, and determines the registration of the legitimate application with the record. Whether the information is the same, if the same, the application is considered legal, if not the same, the application is considered illegal; the above registration information includes the name of the application, the process ID, the path, and the registry information of the application.
  • Step 204 The operating system opens the file Encrypt.txt through the file system, and the file is in the cipher text form.
  • the filtering driver determines that the application is an illegal application in step 203
  • the file Encrypt.txt is opened by the file system, and the file is stored in the disk.
  • the Encrypt.txt data is loaded into the cache.
  • the system allocates a cache address and returns a handle. Since the decryption operation is not performed, the displayed file content is ciphertext.
  • the illegal application can also pass through the upper layer of the operating system.
  • the interface sends an instruction to write to the file Encrypt.txt, and the upper interface sends an instruction to write to the file system, and the filtering system intercepts the instruction, prohibits execution, and returns an illegal modification error.
  • Step 205 The filter driver creates a new file as a shadow file of the protected file.
  • the shadow file of the protected file is named l.txt; wherein, the filtering driver creates a shadow file of the protected file and The same is true in step 105 in Embodiment 1, and is not described here again;
  • Step 206 the filter driver returns a handle hltxt of l.txt to the legitimate application, and opens the file protected file; in this embodiment, the specific open file Encrypt.
  • the operation of txt and the plaintext data includes: 206a, filtering the horse area to return the handle of l.txt hltxt;
  • the application issues an instruction to read the file according to the handle hltxt;
  • the filter driver reads the data of the protected file Encrypt.txt, and performs a decryption operation, and puts the Encrypt.txt content in the plaintext form into a cache allocated by the operating system as l.txt, and establishes a file mapping relationship; 4 poly 206c can also be, the filter driver reads the contents of the shadow file l.txt from the virtual disk, 1. txt stores the plaintext data of the protected file Encrypt.txt; the filter driver encrypts the Encrypt.txt in ciphertext form The decryption operation is performed.
  • the key used in the decryption operation is stored in the encryption lock connected to the host, and the encryption mode of the protected file may select symmetric encryption or asymmetric encryption; the filter driver returns l.txt to the legitimate application.
  • the handle hltxt it can also include: The filter driver increments the reference count value by 1.
  • Step 207 The application issues an instruction to write to the specified location of the protected file Encrypt.txt according to the handle, and performs a write operation. In this step, the write operation to the file Encrypt.txt is completed in the cache, that is, the modified The data in Encrypt.txt stored in the cache; wherein the write operation includes writing new data, deleting, replacing, modifying, editing, etc. to the original protected file.
  • Step 208 After the write operation ends, the filter driver encrypts and saves the plaintext Encrypt.txt content in the cache to obtain the modified protected file Encrypt.txt.
  • the filter driver encrypts the plaintext Encrypt in the cache.
  • the txt content is encrypted and saved, and the modified protected file Encrypt.txt is obtained, which specifically includes the following methods: Method 1, in step 206c, the plaintext of Encrypt.txt is completely read into the cache for the user to Encrypt.txt is written in the cache.
  • Encrypt.txt stored in the cache is used to completely overwrite the original protected file Encrypt.txt stored on the disk, and the modified protected file Encrypt is obtained.
  • Tx Tx; Method 2, when encrypting and decrypting the protected file, performing encryption and decryption operations in units of clusters, wherein the cluster is the smallest storage unit of the disk storage medium.
  • the Encrypt.txt file part that needs to be operated is read into the cache. After the write operation is completed in the cache, the data is encrypted in units of clusters, and the Encrypt.txt file stored in the disk is modified. The cluster is replaced, and the file system allocates a new cluster for the added data portion for storage. When the location of the data in the file Encrypt.txt changes, the file system records the order of the cluster, and the modified protected file Encrypt is obtained.
  • step 206c reads the contents of the shadow file l.txt from the virtual disk for the filter driver, the method 3 is used: the application completes the tampering of the plaintext Encrypt.txt in the cache, and the virtual disk is in the virtual disk. The stored Encrypt.txt is falsified. When the write operation is completed, the Encrypt.txt of the plaintext in the virtual disk is encrypted in units of clusters, and the ciphertext Encrypt.txt stored in the disk is replaced.
  • step 208 The method may further include: the filter driver closes the handle of the opened shadow file 1.txt one by one, and decrements the reference count value, and checks the I meter after each decrement Value, and when? When the count value of I is 0, the shadow file is deleted.
  • the file protection method provided in this embodiment, by establishing a virtual disk in the memory and establishing a shadow file in the virtual disk, the method of decrypting the protected file into the cache in the conventional technology is easy to be leaked. Disadvantages of Protecting Files In the present invention, all read and write operations are performed on shadow files, and virtual disks are only visible to legitimate applications, greatly improving the security of file data.
  • Embodiment 3 This embodiment provides a file protection system. Referring to FIG.
  • the above file protection system includes a file protection driver 1 and a dongle 2; wherein the file protection driver 1 includes: an application module 11 and an upper interface.
  • the application module 11 is configured to open a protected file stored in the disk by calling the upper interface module 12, and issue an instruction for performing a read operation and a write operation according to the handle through the upper layer interface module; further, the application module 11 includes: - a risk certificate unit 111, for when the application module 11 is started, - whether the license card host is connected with a legal encryption lock, if so, the application program module 11 can be started, otherwise, the application module 11 cannot be started.
  • the opening unit 112 is configured to: when receiving an instruction sent by the user to open the protected file, issue an instruction to open the protected file to the upper interface module 12, and when receiving the handle of the shadow file, according to the above
  • the handle accesses the protected file;
  • the read/write unit 113 is configured to, after receiving the handle of the shadow file returned by the operating system, issue an instruction for the read and write operations according to the handle.
  • the upper interface module 12 is configured to receive an instruction for the file operation issued by the application module 11, and complete the operation of opening, reading, writing, and closing the file by operating the file system module 14; and filtering the driving module 13 for monitoring the host
  • a preset additional operation is performed to control the operation of the predefined file system module 14;
  • the preset additional operations are specifically: creating a shadow file, encrypting and decrypting the file, and performing a personalized operation on the data.
  • the filtering driver module 13 includes: filtering The unit 131, the determining unit 132, the decrypting unit 133, the shadow file creating unit 134, and the filtering unit 131 are configured to monitor whether the upper interface module 12 has an operation to open the protected file. When there is an operation to open the protected file, the preset is executed.
  • the determining unit 132 is configured to determine, when the filtering unit 131 intercepts the preset operation of the file system module 14, whether the application for opening the protected file is legal, and if it is legal, issue a shadow to the file system module 14
  • the instruction of the file if it is not legal, directly opens the protected file, and when the protected file is opened, the decryption operation is not performed, wherein the preset operation on the file system module 14 refers to opening, reading, and a write operation;
  • a decryption unit 133 configured to receive the base sentence when receiving the upper interface module 12 When an instruction to read or write a file is issued, a command to read the protected file is issued to the file system module 14, and the protected file in the form of the ciphertext is decrypted to obtain a protected file of the plaintext, which is placed.
  • the operating system is in the cache allocated by the shadow file; the shadow file creating unit 134 is configured to send an instruction for creating a shadow file to the file system module 14, and randomly name the shadow file.
  • the file system module 14 is configured to manage files stored in the disk, and can complete operations of creating files, indexing files, reading files, and modifying files on the disk.
  • the virtual disk drive module 15 is configured to receive the filter driver module 13 when received.
  • a shadow file is created in the virtual disk.
  • the operating system returns a handle of the shadow file to the application module 11;
  • the encryption lock 2 includes: the verification module 21 and a key storage module 22; - a security module 21, for when the application module 11 is started, whether the auxiliary-risk card has an encryption lock connected to the host, and if so, the application module 11 can be started, otherwise, Application module 11 cannot be started.
  • the key storage module 22 is configured to provide a key for encrypting and decrypting operations when the filter driver module 14 performs an encryption and decryption operation on the protected file.
  • the method for creating a shadow file in the virtual disk is specifically: the filter driver module 13 passes the file system module.
  • the attribute information of the protected file is read, the shadow file is created in the virtual disk, and the attribute information of the protected file is written, and the data of the shadow file is empty; or, the filter driver module 13 passes The file system module 14 reads the protected file, and decrypts the protected file using the key stored in the encryption lock 2 to obtain a plaintext, and puts the plaintext into the virtual disk as a shadow file; wherein, the data of the shadow file When it is empty, after the application module 11 issues a read operation according to the handle, the method further includes: the filter driver module 13 intercepts an instruction issued by the application module 11 to perform a read operation according to the handle, and reads the protected file from the disk.
  • the operating system allocates a buffer space for the shadow file, and puts the plaintext or all the plaintext of the predetermined portion into the cache space allocated by the operating system for the shadow file, and creates a file.
  • the method further includes: the filter driver module intercepting an instruction issued by the application to read the file according to the handle, to the file system module 14 Sending an instruction to perform a read operation according to the above handle, and reading a shadow file in the virtual disk by using the virtual disk module, the operating system allocates a cache space for the shadow file, and puts the plaintext in the virtual disk into an operation The system allocates the cache space for the shadow file to complete the read operation on the protected file.
  • the filter driver module 13 decrypts the predetermined part or all of the protected file by using the key stored in the encryption lock 2, specifically: filtering Drive module 13 uses encrypted lock 2 internal storage Key units of clusters predetermined part or all of the protected file decrypting operation;
  • the filter driver module 13 further includes an encryption unit 135 for: when the predetermined portion of the plaintext is placed into the cache space allocated by the operating system for the shadow file, the encryption unit 135 passes the application module.
  • the plaintext of the protected file is encrypted in units of clusters, and the protected file stored in the disk is falsified by the file system module 14; or, when all the plaintext is put into the operating system as the above shadow
  • the encryption unit 135 encrypts the plaintext of the protected file modified by the write operation of the application module 11 in units of clusters, overwriting the protected file stored in the disk.
  • the filter driver module 13 may further include a reference counting unit 136 for: recording the number of handles of the shadow file, when preparing to open the protected file and not returning the handle of the shadow file, The count value of the reference counting unit 136 is an initial value.
  • the reference count value is increased by one step.
  • the reference count value is decremented by one step, when the reference count value is referenced.
  • the shadow file is deleted.
  • the system provided in this embodiment corresponds to the methods provided in Embodiments 1 and 2, and complements each other.
  • the method can be embodied in the system, and the system can be obtained by the method 4.
  • the various operations and sequences provided are only optimal, and are not necessarily implemented in strict accordance with the operation sequence provided by the above embodiments in actual use, and file names and the like may be performed.

Description

一种文件保护方法及系统 技术领域 本发明涉及信息安全领域, 特别涉及一种文件保护方法和系统。 背景技术 随着计算机技术的发展, 各行各业都开始了信息化的大进化, 尤其是各种 金融公司、 软件开发公司等, 敏感数据不断增多, 需要进行保护的电子数据不 断增多, 这些电子数据的安全大多关系着企业的生存, 因此文件的保护越来越 受到重视。 同时, 各种木马、 病毒也越来月活动, 恶意攻击者开发越来越多的非法程 序植入他人计算机, 窃取各种敏感数据, 同时窃取技术也越来越高。 为了防止 保密数据被窃取, 出现了越来越多的文件保护方法。 最简单是方法是, 对秘密 文件进行隐藏, 或是对文件加上密码保存, 但是这种方式及其脆弱, 很容易通 过扫面计算机或是暴力破解等手段破解文件, 也出现了更高安全性的手段。 对需要保密的文件使用密钥进行加密, 并且密钥是秘密保存的, 例如保存 在加密锁中, 加密锁一般为 USB 接口的智能设备, 其可以与计算机进行了连 接, 和计算机一起完成文件保护和权限管理的功能, 在密钥被攻击者获取的情 况下, 可以保证文件的安全性, 该方法具体为, 在计算机中安装一个文件保护 程序, 当合法的程序打开加密文件时,文件保护程序使用密钥对文件进行解密, 得到明文的文件以供合法者操作, 当非法的程序试图打开加密文件时, 文件保 护程序禁止其打开加密文件, 并且不提供解密 艮务。 但是这种方法仍然存在不安全性, 在计算机操作系统中, 当合法的程序打 开并解密受保护的文件时, 操作系统会为解密得到的明文在緩存中分配一定的 空间, 并将这些明文存放在緩存中, 同时返回句柄, 合法者即可以对受保护文 件进行操作, 当合法用户关闭受保护文件时, 在緩存中的受保护文件并不会立 即清空, 这时非法程序如果同样通过上层接口访问该文件时, 可直接得到受保 护文件在緩存中的地址读出明文的数据。 综上所述, 现有的文件保护方案中存在缺陷, 在合法的应用程序访问受保 护文件后, 緩存中的明文数据不会立即被清除, 导致非法应用程序在緩存中数 据未清除时访问受保护文件, 可以得到緩存中的明文数据, 使得受保护文件数 据泄露。 发明内容 本发明实施例的主要目的在于提供了一种文件保护方法和系统, 以解决现 有技术中存在合法的程序访问受保护文件后, 明文数据遗留在緩存未清除时, 非法的程序可通过緩存地址对明文数据进行访问的缺陷的问题。 技术方案如 下: 一种文件保护方法, 所述方法包括: 应用程序接收用户发出的对受保护文件进行操作的指令, 所述受保护文件 为经过加密并以密文形式保存在磁盘中的文件, 所述对受保护文件进行操作的 指令包括打开、 读、 写、 关闭所述受保护文件的指令; 接收到所述打开所述受保护文件的指令之后, 打开所述受保护文件的操作 包括: 所述应用程序调用操作系统的上层接口, 所述上层接口向文件系统发出打 开所述受保护文件的指令; 过滤驱动截获所述上层接口向文件系统发出的打开所述受保护文件的指 令, 并判断所述应用程序是否为合法应用程序; 如果合法, 所述过滤驱动读取受保护文件的属性信息, 向所述文件系统发 出在虚拟磁盘中创建所述受保护文件的影子文件的指令, 所述文件系统通过虚 拟磁盘驱动在所述虚拟磁盘中创建所述影子文件, 所述操作系统向所述应用程 序返回所述影子文件的句柄, 引用计数值增加一个步长; 其中, 在所述虚拟磁盘中创建影子文件包括方法 A和 B:
A, 所述过滤驱动通过所述文件系统读取所述受保护文件的属性信息, 在 所述虚拟磁盘中创建所述影子文件, 为所述影子文件随机命名, 并写入所述受 保护文件的属性信息, 所述影子文件的数据为空; 或, B, 所述过滤驱动通过所述文件系统读取所述受保护文件, 并使用与主机 连接的加密锁中存储的密钥对所述受保护文件进行解密, 得到明文, 将明文放 入所述虚拟磁盘中作为影子文件的数据, 并为所述明文随机命名, 作为所述影 子文件; 接收到所述读所述受保护文件的指令之后, 读所述受保护文件的操作包 括: 所述应用程序发出才艮据所述句柄对文件进行读的指令; 当创建影子文件使用方法 A , 所述影子文件的数据为空时, 所述过滤驱动 截获所述应用程序发出的才艮据所述句柄对文件进行读的指令, 从磁盘中读取所 述受保护文件的预定部分或全部, 使用与所述主机连接的加密锁内存储的密钥 对所述受保护文件的预定部分或全部进行解密, 得到所述受保护文件的预定部 分的明文或全部明文, 所述操作系统为所述影子文件分配緩存空间中, 并将所 述预定部分的明文或全部明文放入所述操作系统为所述影子文件分配的緩存 空间, 建立文件映射关系, 所述应用程序完成对所述受保护文件的读操作; 当创建影子文件使用方法 B , 所述影子文件中的数据为受保护文件的明文 时, 所述过滤驱动截获所述应用程序发出的才艮据所述句柄对文件进行读的指 令, 通过所述虚拟磁盘驱动在所述虚拟磁盘中读取所述影子文件, 所述操作系 统为所述影子文件分配緩存空间, 并将所述虚拟磁盘中的明文放入所述操作系 统为所述影子文件分配的緩存空间中, 所述应用程序完成对所述受保护文件的 读操作; 接收到所述写所述受保护文件的指令之后, 写所述受保护文件的操作包 括: 所述应用程序发出才艮据所述句柄对文件进行写操作的指令; 所述应用程序在所述操作系统为所述影子文件分配的緩存中完成对所述 明文的受保护文件的写操作, 所述写操作包括对所述受保护文件的插入新数 据、 4爹改、 替换、 编辑; 所述过滤驱动对所述 4爹改后的受保护文件进行加密操作并保存; 接收到所述关闭所述受保护文件的指令之后, 关闭所述受保护文件的操作 包括: 所述过滤驱动逐一关闭打开的所述影子文件的句柄, 将所述引用计数值递 减, 递减后检查所述引用计数值, 当所述引用计数值为初值时, 删除所述影子 文件。 一种文件保护系统, 所述系统包括文件保护驱动和加密锁: 所述文件保护驱动包括: 应用程序模块、 上层接口模块、 过滤驱动模块、 文件系统模块、 虚拟磁盘驱动模块; 所述应用程序模块, 用于通过调用所述上层接口模块打开存储在磁盘中的 受保护文件, 并通过所述上层接口模块发出根据句柄对文件进行读操作和写操 作的指令; 所述上层接口模块, 用于接收所述应用程序模块发出的对文件操作的指 令, 并通过操作所述文件系统模块完成文件的打开、 读、 写、 关闭的操作; 所述过滤驱动模块, 用于监控主机中对所述文件系统模块的操作, 当发现 预定义的对所述文件系统模块的操作时, 执行预设的附加操作, 对所述预定义 的对所述文件系统模块的操作进行控制; 所述文件系统模块, 用于管理磁盘中存储的文件, 可以在磁盘中完成建立 文件, 索引文件, 读取文件, 修改文件的操作; 所述虚拟磁盘驱动模块, 用于当接收到所述过滤驱动模块通过所述文件系 统模块发出的创建所述受保护文件的影子文件的指令后, 在虚拟磁盘中建立影 子文件, 当所述影子文件建立完成后, 操作系统向所述应用程序模块返回所述 影子文件的句柄; 所述加密锁包括: 验证模块和密钥存储模块; 所述-险证模块, 用于在所述应用程序模块启动时, 辅助 -险证是否有加密锁 连接在主机中, 如果有, 则所述应用程序模块可以启动, 否则, 所述应用程序 模块不能启动。 所述密钥存储模块, 用于在所述过滤驱动模块对受保护文件进行加解密操 作时, 提供加解密操作的密钥。 本发明实施例提供的技术方案带来的有益效果是通过在文件保护系统中 加入影子文件, 将受保护文件的明文数据放入为影子文件分配的緩存空间中, 并且影子文件存储在虚拟磁盘中, 虚拟磁盘对非常程序不可见, 且影子文件不 为非法程序所知, 因此非常程序无法通过访问影子文件得到緩存中受保护文件 的明文数据, 解决了在现有技术中存在合法的程序访问受保护文件后, 明文数 据遗留在緩存未清除时, 非法的程序可通过緩存地址对明文数据进行访问的缺 陷, 具有更高的安全性。 附图说明 图 1为本发明具体实施例一提供的一种文件保护方法的流程图。 图 2为本发明具体实施例二提供的一种文件保护方法的流程图。 图 3为本发明具体实施例三提供的一种文件保护系统的框图。 具体实施方式 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明 实施方式作进一步地详细描述。 实施例 1 本实施例提供了一种文件保护方法, 本实施例以对在磁盘中存储的受保护 文件 Encrypt.txt进行读操作为例进行说明, Encrypt.txt为存储在用户磁盘上的 受保护文件, 并经过密钥加密, 是以密文形式在磁盘上存储的。 在用户对文件 Encrypt.txt进行读取或^ ί'爹改操作时, 需要进行解密操作, 以 使用户能够在用户界面上得到明文的文件数据; 在不同的操作系统中, 需要相应的应用程序用以打开不同格式的文件, 本 实施例以在 windows XP系统中为例进行说明, 在 windows XP系统下对 txt格 式的文件进行读写时, 需要启动系统提供的程序 notepad.exe, 并在系统中建立 进程 notepad. exe, notepad.exe 可以调用操作系统提供的接口 NtcreateFile、 NtReadFile 等进行打开文件、 建立文件、 读取文件等操作, 即打开文件 Encrypt.txt, 需启动程序 notepad.exe; 在本实施例所提供的一种文件保护方法之前还包括, 艮据需要保护的文 件,对操作系统提供的合法的应用程序进行预处理,在本实施例中, Encrypt.txt 为受保护文件, 由于受保护的文件为 txt格式, 则对应用程序 notepad. exe进行 预处理, 在本实施例中, 优选地, 对 notepad.exe进行预处理为加壳处理, 具体 的为: 在 notepad.exe中力口入代码, 使得在系统运行 notepad.exe时, 先要检查 主机上是否有合法的加密锁接入, 如果有, 则可以运行该进程, 否则, 系统不 力口载 notepad.exe进程; 一种文件保护方法, 参加图 1 , 具体步骤如下: 步骤 101 , 应用程序接欠用户发出的 4丁开受保护文件 Encrypt.txt的命令; 在本实施例中, 具体的为, 应用程序接收用户发出的读文件 Encrypt.txt的 命令, 其中, 应用程序可能为合法应用程序或非法应用程序: 合法应用程序为上述经过加壳处理的程序 notepad.exe, 并且有合法的加密 锁接入, 具有运行 notepad. exe的权限; 非法应用程序为未经授权访问受保护文件 Encrypt.txt的程序; 在本实施例中, 步 4聚 101开始前还包括: 启动操作系统, 加载过滤驱动和 虚拟磁盘驱动, 并在内存中建立虚拟磁盘, 其中, 过滤驱动和虚拟磁盘驱动为 本发明所提供, 过滤驱动通过文件系统操作虚拟磁盘驱动, 可以在虚拟磁盘中 完成创建、 修改、 闪存文件等操作, 上述虚拟磁盘建立在内存中, 可以提高读 写速度, 并且只对过滤驱动及过滤驱动认可的程序可见; 虚拟磁盘为在内存中模拟出一个磁盘分区, 并在上面建立与磁盘存储相同 的数据存储格式, 使得内存中被划分为虚拟磁盘的区域可以作为普通存储类磁 盘使用。 步骤 102, 应用程序调用操作系统上层应用接口准备打开受保护文件; 在本实施例中, 所述操作系统上层应用接口, 为操作系统提供的用于操作 文件 Encrypt.txt的接口, 例如 NtcreateFile、 NtReadFile等, 这些接口可以完成 txt文件的建立、 读取等操作; 步骤 103 , 过滤驱动截取上层应用接口发送的指令, 并判断应用程序是否 合法, 如果不合法, 执行步 4聚 104, 如果合法, 则执行步 4聚 105; 所述过滤驱动, 可以用于监控主机中对于文件系统的操作, 当发生预定义 的对文件系统的操作时, 执行预设的附加操作, 或对预定义的对文件系统的操 作进行控制。 并且, 所述过滤驱动还具有判断发出打开受保护文件命令的应用 程序是否合法的功能; 其中, 上述预定义的对文件系统的操作包括读写预设文件等, 在本实施例 中, 预定义的对文件系统的操作为读取受保护文件 Encrypt.txt的操作; 上述预设的附加操作包括, 创建影子文件、 对文件进行加解密、 对数据进 行个性化操作等; 过滤驱动判断应用程序是否合法, 具体的为: 在对合法的应用程序进行加 壳处理时, 使加壳后的应用程序向过滤驱动进行注册, 过滤驱动 ΐ己录合法的应 用程序的注册信息, 当操作系统中存在应用程序通过调用上层应用接口发送打 开受保护文件的指令时, 过滤驱动获取应用程序的信息, 并判断与记录的合法 应用程序的注册信息是否相符, 如果相同, 则认为应用程序合法, 如果不相同, 则认为应用程序不合法。 其中, 上述注册信息包括应用程序的名称、 进程 ID、 路径, 以及应用程序 的注册表信息等。 步骤 104, 操作系统在磁盘上找到受保护文件 Encrypt.txt, 并为其分配緩 存空间, 进行读取; 在本步骤中, 由于没有使用密钥进行解密, 因此放入緩存并进行读取的文 件 Encrypt.txt为密文形式; 在本实施例中, 本步骤还可以为: 返回错误, 禁止非法应用程序对受保护 文件 Encrypt.txt进行访问。 步骤 105 , 过滤驱动在虚拟磁盘中创建一个新文件作为受保护文件的影子 文件, 在本实施例中, 将受保护文件的影子文件命名为 l.txt; 其中, 过滤驱动创建受保护文件的影子文件具体包括: 步骤 A, 过滤驱动读取受保护文件的属性信息; 上述受保护文件的属性信息包括文件的大小、 类型、 创建时间等, 其中受 保护文件的具体内容为加密存储, 但是其属性信息可通过文件系统获得, 为明 文数据, 过滤驱动通过文件系统读取受保护文件的属性信息; 步骤 B , 过滤驱动向文件系统发送在虚拟磁盘中建立 1.txt的指令; 步骤 C , 文件系统向虚拟磁盘驱动发送创建 l .txt的指令, 虚拟磁盘驱动建 立 l .txt; 步骤 D,在虚拟磁盘中为影子文件 1.txt写入数据; 在本实施例中, 在为影子文件 l .txt写入数据时包括两种方法: 方法 1 , 将受保护文件 Encrypt.txt的属性信息写入虚拟磁盘, 作为影子文 件 1.txt的属性, 但是 1.txt的数据为空; 方法 2 , 将受保护文件 Encrypt.txt的属性信息写入虚拟磁盘, 作为影子文 件 l .txt的属性, 同时过滤驱动将受保护文件 Encrypt.txt中的数据读出, 并使用 与主机连接的加密锁内存储的密钥进行解密, 得到明文的数据, 写入虚拟磁盘 中作为影子文件 l .txt的数据; 其中, 在方法 2中, 对 Encrypt.txt进行解密时, 优选地以簇为单位对密文 进行解密, 将 Encrypt.txt中的预定部分或全部解密, 得到预定部分的明文或全 部的明文放入虚拟磁盘中, 作为 1.txt的数据; 在对受保护文件进行加解密操作时, 不局限于以簇为单位进行解密, 还可 以以流为单位进行解密、以字节为单位进行解密、以数据块为单位进行解密等; 在过滤驱动为受保护文件 Encrypt.txt创建影子文件时, 影子文件的命名为 随机命名, 即为影子文件随机生成一个名称, 并且该名称与磁盘中所存储的其 他文件名称不同, 在本实施例中, 以为影子文件随机生成的名称为 l .txt为例进 行说明。 步骤 106 , 过滤马区动向应用程序返回影子文件 l .txt的句柄; 在本实施例中, 认为影子文件 l .txt的句柄为 hltxt; 在本步骤中, 还包括: 将引用计数值增加一个步长, 优选地, 将引用计数 值增加 1 , 引用计数值记录打开的影子文件的句柄数, 当未有影子文件的句柄 返回时, 将引用计数值设置为初值 0 , 当有影子文件的句柄被关闭时, 将引用 计数值递减一个步长。 步骤 107 , 应用程序发出根据句柄 hltxt进行读操作的指令; 步骤 108 , 过滤驱动截获到根据句柄 hltxt进行读操作的命令, 读出磁盘中 存储的密文形式的受保护文件 Encrypt.txt , 并进行解密操作, 将明文形式的 Encrypt.txt内容读入操作系统为 l.txt分配的緩存当中; 其中, 过滤驱动对密文形式的 Encrypt.txt进行解密操作, 还包括, 解密操 作所使用的密钥存储于与主机连接的加密锁中, 受保护文件的加密方式可以选 择对称力口密或非对称力口密; 将明文形式的 Encrypt.txt 内容读入操作系统为 l.txt分配的緩存当中还包 括: 过滤驱动为緩存中的文件 Encrypt.txt与磁盘中存储的密文的 Encrypt.txt建 立文件映射关系, 将磁盘中存储的受保护文件 Encrypt.txt解密后分块读入緩存 中, 以节省緩存空间; 在对受保护文件进行解密并将明文放入为影子文件分配的緩存时, 可以包 括^ σ下方法: 方法一, 将受保护文件的全部数据解密, 并完整的放入为影子文件分配的 緩存中, 这个适用于受保护文件比较小时; 方法二, 将受保护文件中需要访问的部分, 以簇为单元进行解密, 并将解 密的部分放入为影子文件分配的緩存中, 这种方法适用于受保护文件比较大 时, 并优选地受保护文件在进行加密保存时, 以簇为单位进行加密。 在本步 4聚中, 上述描述的方法适用于步 4聚 105中步 4聚 D釆用方法 1时; 在步 4聚 D釆用方法 2时, 步 4聚 108还可以为: 过滤驱动截获到才艮据句柄 hltxt进行读操作的指令, 向文件系统发送读取 影子文件的指令, 文件系统通过虚拟磁盘驱动读取影子文件 l.txt中的数据, 将 l.txt中的数据放入操作系统为影子文件分配的緩存中。 步骤 109, 应用程序关闭打开的受保护文件 Encrypt.txt。 在本实施例中, 步骤 109后还可以包括: 过滤驱动逐一关闭打开的影子文 件 1.txt的句柄, 同时将引用计数值递减, 每次递减后检查所述 I用计数值, 当 ? I用计数值为初值 0时, 删除所述影子文件。 本实施例所提供的一种文件保护方法, 通过在系统中安装一个过滤驱动, 在合法的应用程序访问受保护文件的过程中, 首先并不打开真实的受保护文 件, 而是在虚拟磁盘中建立受保护文件的影子文件, 并更改为其他名称, 为其 分配緩存空间, 再将受保护文件进行解密操作读入緩存中, 合法的应用程序通 过影子文件的句柄打开受保护文件, 其中, 虚拟磁盘只对合法程序可见, 影子 文件的句柄也只有合法程序可以得到, 因此,避免了被非法恶意程序获得句柄, 而在緩存中将明文形式的受保护文件读出, 因此, 克服了现有技术中, 当文件 读入緩存中不能进行有效保护的缺点, 因此, 本发明提供的一种文件保护方法 具有更好的安全性。 实施例 2 在本实施例中, 以对存储在磁盘上的受保护文件 Encrypt.txt进行写操作为 例进行说明, 其中, 写操作包括, 在原有文档 Encrypt.txt的数据基础上插入新 数据、 编辑和 4爹改数据的操作; 同实施例 1 , 受保护文件 Encrypt.txt加密后以密文的形式存储在磁盘上, 以在 windows XP 系统中为例, 将用于打开文件 Encrypt.txt 的合法应用程序 notepad. exe 进行加壳处理, 本实施例中的加壳处理具体的为: 在应用程序 notepad. exe 中加入代码, 使得应用程序在运行时具有如下功能, 在启动 notepad. exe 时, 检查是否有合法的加密锁接入, 当有合法的加密锁接入时, notepad.exe可以运行, 系统允许建立 notepad.exe进程, 并通过 notepad.exe对 受保护文件 Encrypt.txt进行写操作, 当没有合法的加密锁接入时, notepad.exe 不能运行; 上述加密锁在接入主机时, 可以提供对合法进程 notepad.exe需要的认证, 并且, 在加密锁中秘密的存储有密钥, 所述密钥用于对受保护文件 Encrypt.txt 进行加解密操作; 一种文件的保护方法, 参加图 2, 具体的如下: 步骤 201 , 应用程序接收用户发出的打开受保护文件 Encrypt.txt的指令; 在本实施例中, 应用程序包括: 合法应用程序和非法应用程序; 合法应用程序为经过加壳处理的 notepad.exe, 可将 notepad.exe与 txt格式 进行关联, 当用户打开文件 Encrypt.txt时, notepad.exe启动, 并-险证是否有合 法的加密锁接入, 如果有, 则建立 notepad.exe进程, 可以通过 notepad.exe对 Encrypt.txt进行操作; 非法应用程序为攻击者写入, 以窃取或修改受保护文件为目的的程序, 不 需加密锁接入就可以启动; 同实施例 1 , 在步骤 201前, 还包括: 系统启动, 加载过滤驱动和虚拟磁 盘驱动, 并在内存中创建虚拟磁盘; 步骤 202, 应用程序调用操作系统上层应用接口向文件系统发出打开受保 护文件的指令; 其中, 合法应用程序和非法应用程序都需要通过操作系统提供的上层接口 打开受保护文件, 在 Windows XP系统中, 上述上层接口包括: NtcreateFile、 NtReadFile等; 上述文件系统具体的为, 操作系统通过文件系统管理磁盘上存储的文件, 包括 FAT、 NTFS等。 步骤 203 , 过滤驱动截取操作系统上层接口向文件系统发出的打开受保护 文件 Encrypt.txt的指令,并判断应用程序是否合法,如果不合法,执行步骤 204, 如果合法, 则执行步骤 205; 上述过滤驱动, 可以用于监控所述主机系统中对文件系统的操作, 当发生 预定义的对文件系统的操作时, 执行预设的附加操作, 或对预定义的对文件系 统的操作进行控制, 并且, 所述过滤驱动还具有判断发出打开受保护文件命令 的应用程序是否合法的功能; 在本实施例中, 过滤驱动当截获到操作系统上层接口向文件系统发出的打 开受保护文件 Encrypt.txt的指令时, 可以挂起该命令, 在对应用程序判断后, 根据判断结果执行相应的命令; 其中, 过滤驱动判断应用程序是否合法, 具体的为: 在对合法的应用程序 进行加壳处理时, 使加壳后的应用程序向过滤驱动进行注册, 过滤驱动记录合 法的应用程序的注册信息, 当操作系统中发现应用程序通过调用上层应用接口 发送访问受保护文件的指令时, 过滤驱动获取应用程序的信息, 并判断与记录 的合法应用程序的注册信息是否相同, 如果相同, 则认为应用程序合法, 如果 不相同, 则认为应用程序不合法; 上述注册信息包括应用程序的名称、 进程 ID、 路径, 以及应用程序的注册 表信息等。 步骤 204 , 操作系统通过文件系统打开文件 Encrypt.txt, 文件为密文形式; 当步骤 203中, 过滤驱动判断应用程序为非法应用程序时, 则通过文件系 统打开文件 Encrypt.txt, 将磁盘中存储的 Encrypt.txt数据加载入緩存, 系统为 其分配緩存地址并返回句柄, 由于未进行解密操作,所显示的文件内容为密文; 在本步骤后, 还可以包括: 非法应用程序通过操作系统上层接口发送对文 件 Encrypt.txt进行写操作的指令, 上层接口向文件系统发出写数据的指令, 过 滤系统截获该指令, 禁止执行, 并返回非法修改的错误。 步骤 205 , 过滤驱动创建一个新文件作为受保护文件的影子文件, 在本实 施例中, 将受保护文件的影子文件命名为 l.txt; 其中, 过滤驱动创建受保护文件的影子文件的过程与实施例 1 中步骤 105 中相同, 这里不再赘述; 步骤 206 , 过滤驱动向合法的应用程序返回 l.txt的句柄 hltxt,打开文件受 保护文件; 在本实施例中, 具体的打开文件 Encrypt.txt并得到明文数据的操作包括: 206a, 过滤马区动返回 l.txt的句柄 hltxt;
206b, 应用程序发出根据句柄 hltxt读文件的指令;
206c, 过滤驱动读出受保护文件 Encrypt.txt的数据, 并进行解密操作, 将 明文形式的 Encrypt.txt内容放入操作系统为 l.txt分配的緩存中,并建立文件映 射关系; 其中, 步 4聚 206c也可以为, 过滤驱动从虚拟磁盘中读取影子文件 l.txt的 内容, 1.txt中存储的为受保护文件 Encrypt.txt的明文数据; 过滤驱动对密文形式的 Encrypt.txt进行解密操作, 具体地, 解密操作所使 用的密钥存储于与主机连接的加密锁中, 受保护文件的加密方式可以选择对称 加密或非对称加密; 过滤驱动向合法的应用程序返回 l.txt的句柄 hltxt后, 还可以包括: 过滤 驱动将引用计数值增加 1。 步骤 207 , 应用程序发出根据句柄对向受保护文件 Encrypt.txt指定位置进 行写操作的指令, 并进行写操作; 在本步骤中, 对文件 Encrypt.txt的写操作在緩存中完成, 即修改的为緩存 中存储的 Encrypt.txt中的数据; 其中, 所述写操作包括对原受保护文件的写入新数据、 删除、 替换、 修改、 编辑等操作。 步骤 208 , 写操作结束, 过滤驱动对緩存中的明文 Encrypt.txt内容进行加 密操作并保存, 得到修改后的受保护文件 Encrypt.txt; 在本实施例中, 过滤驱动对緩存中的明文 Encrypt.txt内容进行加密操作并 保存, 得到修改后的受保护文件 Encrypt.txt, 具体的包括如下方法: 方法一, 在步骤 206c 中, 将 Encrypt.txt的明文完整的读入緩存中, 以供 用户在緩存中对 Encrypt.txt进行写操作, 当写操作结束后, 使用存储于緩存中 的 Encrypt.txt完整覆盖存储于磁盘中的原受保护文件 Encrypt.txt, 得到爹改后 的受保护文件 Encrypt.txt; 方法二,在对受保护文件进行加解密操作时, 以簇为单位进行加解密操作, 其中, 簇为磁盘存储介质的最小存储单元。 在步骤 206c 中, 将需要操作的 Encrypt.txt文件部分读入緩存中, 在緩存中完成写操作后, 以簇为单位对数据 进行加密操作, 将磁盘中存储的 Encrypt.txt文件中被修改的簇进行替换, 并由 文件系统为增加的数据部分分配新簇进行存储, 当簇中数据在文件 Encrypt.txt 中的位置发生改变时, 文件系统记录簇的顺序, 得到修改后的受保护文件 Encrypt.txt; 当步骤 206c为过滤驱动从虚拟磁盘中读取影子文件 l.txt的内容时, 使用 方法三: 应用程序在緩存中完成对明文的 Encrypt.txt的 4爹改, 并对虚拟磁盘中 存储的 Encrypt.txt进行爹改,当写操作完成后,将虚拟磁盘中明文的 Encrypt.txt 以簇为单位进行加密, 替换磁盘中存储的密文 Encrypt.txt; 在本实施例中, 步骤 208后还可以包括: 过滤驱动逐一关闭打开的影子文 件 1.txt的句柄, 同时将引用计数值递减, 每次递减后检查所述 I用计数值, 当 ? I用计数值为初值 0时, 删除所述影子文件。 本实施例所提供的文件保护方法, 通过在内存中建立虚拟磁盘, 并在虚拟 磁盘中建立影子文件的方法, 克月艮了传统技术中的将受保护文件解密到緩存 中, 容易暴漏受保护文件的缺点, 在本发明中, 所有的读写操作均是对影子文 件进行的, 并且虚拟磁盘只是合法的应用程序可见, 大大提高了文件数据的安 全性。 实施例 3 本实施例提供了一种文件保护系统, 参加图 2, 上述一种文件保护系统包 括, 文件保护驱动 1和加密锁 2; 其中, 文件保护驱动 1 包括: 应用程序模块 11、 上层接口模块 12、 过滤 驱动模块 13、 文件系统模块 14、 虚拟磁盘驱动模块 15。 具体地: 应用程序模块 11 , 用于通过调用上层接口模块 12打开存储在磁盘中的受 保护文件, 并通过 12上层接口模块发出根据句柄进行读操作和写操作的指令; 进一步地, 应用程序模块 11包括: -险证单元 111 , 用于在应用程序模块 11启动时, -险证主机是否连接有合法 的加密锁, 如果有, 所应用程序模块 11可以启动, 否则, 应用程序模块 11不 能启动; 打开单元 112, 用于在接收到用户发送的打开受保护文件的指令时, 向上 层接口模块 12发出打开受保护文件的指令, 并在接收到所述影子文件的句柄 时, 才艮据上述句柄访问受保护文件; 读写单元 113 , 用于在接收到操作系统返回的影子文件的句柄后, 根据上 述句柄发出读和写操作的指令。 上层接口模块 12 , 用于接收应用程序模块 11发出的对文件操作的指令, 并通过操作文件系统模块 14完成文件的打开、 读、 写、 关闭的操作;; 过滤驱动模块 13 , 用于监控主机中对于文件系统模块 14的操作, 当发现 预定义的对文件系统模块 14 的操作时, 执行预设的附加操作, 对上述预定义 的对文件系统模块 14的操作进行控制; 在本实施例中, 优选地, 上述预设的附加操作具体的为, 创建影子文件、 对文件进行加解密、 对数据进行个性化操作等; 进一步地, 过滤驱动模块 13 , 具体的包括: 过滤单元 131、 判断单元 132、 解密单元 133、 影子文件创建单元 134; 过滤单元 131 , 用于监控上层接口模块 12是否有打开受保护文件的操作, 当存在打开受保护文件的操作时, 执行预设的附加操作; 判断单元 132,用于在过滤单元 131截获预设的对文件系统模块 14的操作 时, 判断打开受保护文件的应用程序是否合法, 如果合法, 则向文件系统模块 14发出创建影子文件的指令, 如果不合法, 则直接打开受保护文件, 打开受保 护文件时, 不进行解密操作, 其中, 预设的对文件系统模块 14 的操作指的是 对受保护文件的打开、 读、 写操作; 解密单元 133 ,用于当接收到上层接口模块 12发送根据句柄对文件进行读 或写操作的指令时, 向文件系统模块 14 发出读取受保护文件的命令, 并将读 出的密文形式的受保护文件进行解密操作, 得到明文的受保护文件, 放入操作 系统为上述影子文件分配的緩存中; 影子文件创建单元 134 ,用于向文件系统模块 14发送创建影子文件的指令, 并为该影子文件随机命名。 文件系统模块 14, 用于管理磁盘中存储的文件, 可以在磁盘中完成建立文 件, 索引文件, 读取文件, 修改文件的操作; 虚拟磁盘驱动模块 15 , 用于当接收到过滤驱动模块 13通过文件系统模块
14发出的创建受保护文件的影子文件的指令后, 在虚拟磁盘中建立影子文件, 当影子文件建立完成后, 操作系统向应用程序模块 11 返回上述影子文件的句 柄; 加密锁 2包括: 验证模块 21和密钥存储模块 22; -险证模块 21 , 用于在应用程序模块 11启动时, 辅助-险证是否有加密锁连 接在主机中, 如果有, 则应用程序模块 11 可以启动, 否则, 应用程序模块 11 不能启动。 密钥存储模块 22, 用于在过滤驱动模块 14对受保护文件进行加解密操作 时, 提供加解密操作的密钥; 在虚拟磁盘中建立影子文件具体的为: 过滤驱动模块 13通过文件系统模块 14读取所述受保护文件的属性信息, 在虚拟磁盘中创建所述影子文件, 并写入所述受保护文件的属性信息, 所述影 子文件的数据为空; 或, 过滤驱动模块 13通过文件系统模块 14读取受保护文件, 并使用加密锁 2 中存储的密钥对受保护文件进行解密,得到明文,将明文放入上述虚拟磁盘中, 作为影子文件; 其中, 当影子文件的数据为空时, 应用程序模块 11 根据句柄发出读操作 的指令后, 还包括: 过滤驱动模块 13截获应用程序模块 11发出的才艮据上述句柄进行读操作的 指令, 从磁盘中读取受保护文件的预定部分或全部, 使用加密锁 2内部存储的 密钥对受保护文件的预定部分或全部进行解密操作, 得到受保护文件的预定部 分的明文或全部明文, 操作系统为影子文件分配緩存空间, 并将预定部分的明 文或全部明文放入操作系统为上述影子文件分配的緩存空间, 建立文件映射关 系; 应用程序模块 11根据上述句柄发出读操作的指令后, 还包括: 所述过滤驱动模块截获所述应用程序发出的才艮据所述句柄对文件进行读 的指令, 向文件系统模块 14 发送根据上述句柄进行读操作的指令, 并通过所 述虚拟磁盘模块在所述虚拟磁盘中读取影子文件, 操作系统为上述影子文件分 配緩存空间, 并将所述虚拟磁盘中的明文放入操作系统为上述影子文件分配的 緩存空间, 完成对受保护文件的读操作; 过滤驱动模块 13使用加密锁 2 内部存储的密钥对受保护文件的预定部分 或全部进行解密操作, 具体的为: 过滤驱动模块 13使用加密锁 2 内部存储的密钥以簇为单位对受保护文件 的预定部分或全部进行解密操作; 在本实施例中,过滤驱动模块 13还包括加密单元 135 ,加密单元 135用于: 当将预定部分的明文放入操作系统为上述影子文件分配的緩存空间时, 加 密单元 135将经过应用程序模块 11 写操作 4爹改的受保护文件的明文以簇为单 位进行加密, 并通过文件系统模块 14对磁盘中存储的受保护文件进行爹改; 或, 当将全部明文放入操作系统为上述影子文件分配的緩存空间时, 加密单元 135将经过应用程序模块 11写操作修改的受保护文件的明文以簇为单位进行加 密, 覆盖磁盘中存储的受保护文件。 在本实施例中, 过滤驱动模块 13还可以包括引用计数单元 136, 引用计数 单元 136用于: 记录影子文件的句柄数, 当准备打开受保护文件并且未返回所述影子文件 的句柄时, 所述引用计数单元 136的计数值为初值, 每返回一个上述影子文件 的句柄, 引用计数值增加一个步长, 每关闭一个上述影子文件的句柄, 引用计 数值递减一个步长, 当引用计数值递减为初值时, 删除所述影子文件。 本实施例所提供的系统, 与实施例 1、 2 所提供的方法相对应, 并互做补 充, 在系统中可以体现方法, 并由方法可以 4舞断得出系统。 在本发明所提供的实施例中, 所提供的各种操作及顺序仅为最优情况, 在 实际的使用中并不一定严格按照上述实施例提供的操作顺序进行实施, 并且文 件名称等可以进行协定的变化只要按照本发明所提供的方法以及通过本发明 所提供的方法进行的没有创造性的变换进行的实施均应该属于本发明的保护 范围。 以上仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神 和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。

Claims

权 利 要 求 书
1. 一种文件保护方法, 其特征在于, 所述方法包括:
应用程序接收用户发出的对受保护文件进行操作的指令, 所述受保 护文件为经过加密并以密文形式保存在磁盘中的文件, 所述对受保护文 件进行操作的指令包括打开、 读、 写、 关闭所述受保护文件的指令; 接收到所述打开所述受保护文件的指令之后, 打开所述受保护文件 的操作包括:
所述应用程序调用操作系统的上层接口, 所述上层接口向文件系统 发出打开所述受保护文件的指令;
过滤驱动截获所述上层接口向文件系统发出的打开所述受保护文件 的指令, 并判断所述应用程序是否为合法应用程序;
如果合法, 所述过滤驱动读取受保护文件的属性信息, 向所述文件 系统发出在虚拟磁盘中创建所述受保护文件的影子文件的指令, 所述文 件系统通过虚拟磁盘驱动在所述虚拟磁盘中创建所述影子文件, 所述操 作系统向所述应用程序返回所述影子文件的句柄, 引用计数值增加一个 步长;
其中, 在所述虚拟磁盘中创建影子文件包括:
所述过滤驱动通过所述文件系统读取所述受保护文件的属性信 息, 在所述虚拟磁盘中创建所述影子文件, 为所述影子文件随机命 名, 并写入所述受保护文件的属性信息, 所述影子文件的数据为空, 或者,
所述过滤驱动通过所述文件系统读取所述受保护文件, 并使用 与主机连接的加密锁中存储的密钥对所述受保护文件进行解密, 得 到明文, 将明文放入所述虚拟磁盘中作为影子文件的数据, 并为所 述影子文件随机命名, 作为所述影子文件;
接收到所述读所述受保护文件的指令之后, 读所述受保护文件的操 作包括:
所述应用程序发出才艮据所述句柄对文件进行读的指令; 当所述影子文件的数据为空时, 所述过滤驱动截获所述应用程序发 出的根据所述句柄对文件进行读的指令, 从磁盘中读取所述受保护文件 的预定部分或全部, 使用与所述主机连接的加密锁内存储的密钥对所述 受保护文件的预定部分或全部进行解密, 得到所述受保护文件的预定部 分的明文或全部明文, 所述操作系统为所述影子文件分配緩存空间, 并 将所述预定部分的明文或全部明文放入所述操作系统为所述影子文件分 配的緩存空间中, 建立文件映射关系, 所述应用程序完成对所述受保护 文件的读操作;
当所述影子文件中的数据为受保护文件的明文时, 所述过滤驱动截 获所述应用程序发出的才艮据所述句柄对文件进行读的指令, 通过所述虚 拟磁盘驱动在所述虚拟磁盘中读取所述影子文件, 所述操作系统为所述 影子文件分配緩存空间, 并将所述虚拟磁盘中的明文放入所述操作系统 为所述影子文件分配的緩存空间中, 所述应用程序完成对所述受保护文 件的读操作;
接收到所述写所述受保护文件的指令之后, 写所述受保护文件的操 作包括:
所述应用程序发出才艮据所述句柄对文件进行写操作的指令; 所述应用程序在所述操作系统为所述影子文件分配的緩存中完成对 所述明文的受保护文件的写操作, 所述写操作包括对所述受保护文件的 插入新数据、 修改、 替换、 编辑;
所述过滤驱动对所述 4爹改后的受保护文件进行加密操作并保存; 接收到所述关闭所述受保护文件的指令之后, 关闭所述受保护文件 的操作包括:
所述过滤驱动逐一关闭打开的所述影子文件的句柄, 将所述引用计 数值递减, 递减后检查所述引用计数值, 当所述引用计数值为初值时, 删除所述影子文件。
2. 如权利要求 1所述的方法, 其特征在于, 所述应用程序接收用户发出的 打开所述受保护文件的指令前, 所述方法还包括:
所述操作系统启动, 再自动加载所述过滤驱动、 所述虚拟磁盘驱动 , 并在内存中创建所述虚拟磁盘。
3. 如权利要求 1所述的方法, 其特征在于, 当判断所述应用程序为不合法 时, 所述方法还包括:
所述上层接口通过所述文件系统找到所述受保护文件, 所述操作系 统为所述受保护文件分配緩存, 并将所述受保护文件读入緩存, 所述读 入緩存中的受保护文件为密文形式;
或,
向所述应用程序返回错误 ,非法应用程序禁止访问所述受保护文件。
4. 如权利要求 1所述的方法, 其特征在于, 所述过滤驱动使用与所述主机 连接的加密锁内存储的密钥对所述受保护文件的预定部分或全部进行解 密, 具体的为:
所述过滤驱动使用与所述主机连接的加密锁内存储的密钥以簇为单 位对所述受保护文件的预定部分或全部进行解密。
5. 如权利要求 4所述的方法, 其特征在于,
当所述将预定部分的明文放入所述操作系统为所述影子文件分配的 緩存空间时, 所述过滤驱动对所述 4爹改后的受保护文件进行加密操作并 保存, 具体的包括: 所述过滤驱动将所述 4爹改后的受保护文件的明文以 簇为单位使用与所述主机连接的加密锁内存储的密钥进行加密, 并通过 所述文件系统对磁盘中存储所述受保护文件的簇进行修改,
或者,
当所述将全部明文放入所述操作系统为所述影子文件分配的緩存空 间时, 所述过滤驱动对所述 4爹改后的受保护文件进行加密操作并保存, 具体的包括: 所述过滤驱动将完整的所述修改后的受保护文件使用与所 述主机连接的加密锁内存储的密钥进行加密, 覆盖所述磁盘中存储的所 述受保护文件。
6. 如权利要求 1所述的方法, 其特征在于, 所述上层接口为, 所述操作系 统提供的供所述应用程序调用, 为所述应用程序提供创建、 打开、 读取 文件操作的功能的接口。
7. 如权利要求 1所述的方法, 其特征在于, 所述过滤驱动判断所述应用程 序是否合法, 具体的包括: 在进行文件保护前, 使合法的应用程序向所述过滤驱动进行注册, 过滤驱动记录所述合法的应用程序的注册信息, 当存在应用程序通过调 用上层接口发送访问受保护文件的指令时, 过滤驱动获取应用程序的信 息, 并判断与记录的合法应用程序的注册信息是否相同, 如果相同, 则 认为应用程序合法, 如果不相同, 则认为应用程序不合法, 所述注册信 息包括所述合法的应用程序的名称、 进程 ID、 路径, 以及应用程序的注 册表信息。
8. 如权利要求 1所述的方法, 其特征在于, 所述应用程序接收用户发出的 打开受保护文件的指令前, 还包括:
对所述应用程序进行加壳处理, 使得所述加壳后的应用程序在启动 时判断是否有合法的加密锁接入, 如果有, 则所述应用程序可以启动, 否则, 所述应用程序不能启动。
9. 如权利要求 1所述的方法, 其特征在于, 所述引用计数值用于记录所述 影子文件的句柄数, 当未返回所述影子文件的句柄时, 所述引用计数值 为初值, 每返回一个所述影子文件的句柄, 所述引用计数值增加一个步 长, 每关闭一个所述影子文件的句柄, 所述引用计数值递减一个步长。
10. —种文件保护系统, 其特征在于, 所述系统包括: 文件保护驱动和加密 锁:
所述文件保护驱动包括: 应用程序模块、 上层接口模块、 过滤驱动 模块、 文件系统模块、 虚拟磁盘驱动模块;
所述应用程序模块, 用于通过调用所述上层接口模块打开存储在磁 盘中的受保护文件, 并通过所述上层接口模块发出根据句柄对文件进行 读操作和写操作的指令; 所述上层接口模块, 用于接收所述应用程序模块发出的对文件操作 的指令, 并通过操作所述文件系统模块完成文件的打开、 读、 写、 关闭 的操作;
所述过滤驱动模块, 用于监控主机中对所述文件系统模块的操作, 当发现预定义的对所述文件系统模块的操作时, 执行预设的附加操作, 对所述预定义的对所述文件系统模块的操作进行控制;
所述文件系统模块, 用于管理磁盘中存储的文件, 可以在磁盘中完 成建立文件, 索引文件, 读取文件, 4爹改文件的操作; 所述虚拟磁盘驱动模块, 用于当接收到所述过滤驱动模块通过所述 文件系统模块发出的创建所述受保护文件的影子文件的指令后, 在虚拟 磁盘中建立影子文件, 当所述影子文件建立完成后, 操作系统向所述应 用程序模块返回所述影子文件的句柄;
所述加密锁包括: 验证模块和密钥存储模块;
所述-险证模块, 用于在所述应用程序模块启动时, 辅助 -险证是否有 加密锁连接在主机中, 如果有, 则所述应用程序模块可以启动, 否则, 所述应用程序模块不能启动。
所述密钥存储模块, 用于在所述过滤驱动模块对受保护文件进行加 解密操作时, 提供加解密操作的密钥。
11. 如权利要求 10所述的系统, 其特征在于, 所述应用程序模块包括-险证单 元、 打开单元、 读写单元: 所述-险证单元, 用于在所述应用程序模块启动时, -险证主机是否连 接有合法的加密锁, 如果有, 所述应用程序模块可以启动, 否则, 所述 应用程序模块不能启动;
所述打开单元, 用于在接收到所述用户发送的打开受保护文件的指 令时, 向所述上层接口模块发出打开所述受保护文件的指令, 并在接收 到所述影子文件的句柄时, 才艮据所述句柄打开受保护文件;
所述读写单元, 用于在接收到所述操作系统返回的所述影子文件的 句柄后, 才艮据所述句柄发出读写操作的指令。
12. 如权利要求 10所述的系统, 其特征在于, 所述过滤驱动模块, 具体的包 括: 过滤单元、 判断单元、 解密单元、 影子文件创建单元;
所述过滤单元, 用于监控所述上层接口模块是否有打开所述受保护 文件的操作, 当存在打开所述受保护文件的操作时, 执行预设的附加操 作;
所述判断单元, 用于在所述过滤单元截获预设的对所述文件系统模 块的操作时, 判断打开受保护文件的应用程序是否合法, 如果合法, 则 向所述文件系统模块发出创建影子文件的指令, 如果不合法, 则直接打 开所述受保护文件, 打开所述受保护文件时, 不进行解密操作; 所述解密单元, 用于当接收到所述上层接口模块发送的根据所述句 柄读或写所述影子文件的指令时, 向所述文件系统模块发出读取受保护 文件的命令, 并将读出的密文形式的所述受保护文件进行解密操作, 得 到明文形式的受保护文件 ,放入操作系统为所述影子文件分配的緩存中; 所述影子文件创建单元, 用于向所述文件系统模块发送创建影子文 件的指令, 并为所述影子文件随机命名。
13. 如权利要求 12所述的系统 ,其特征在于,所述预设的附加操作具体的为 , 创建影子文件、 对文件进行加解密、 对数据进行个性化操作。
14. 如权利要求 12所述的系统, 其特征在于, 所述文件系统模块还用于, 当 接收到所述影子创建单元发送的创建影子文件的指令时, 向所述虚拟磁 盘驱动模块发送创建影子文件的指令。
15. 如权利要求 10所述的系统, 其特征在于, 所述在虚拟磁盘中建立影子文 件具体的为: 所述过滤驱动模块通过所述文件系统模块读取所述受保护文件的属 性信息, 在所述虚拟磁盘中创建所述影子文件, 并写入所述受保护文件 的属性信息, 所述影子文件的数据为空, 或者,
所述过滤驱动模块通过所述文件系统模块读取所述受保护文件, 并 使用所述加密锁中存储的密钥对所述受保护文件进行解密, 得到明文, 将所述明文放入所述虚拟磁盘中, 作为所述影子文件。
16. 如权利要求 15所述的系统,其特征在于,当所述影子文件的数据为空时, 所述应用程序模块发出才艮据所述句柄对文件进行读操作的指令后, 还包 括:
所述过滤驱动模块截获所述应用程序模块发出的才艮据所述句柄对文 件进行读的指令, 从磁盘中读取所述受保护文件的预定部分或全部, 使 用所述加密锁内部存储的密钥对所述受保护文件的预定部分或全部进行 解密操作, 得到所述受保护文件的预定部分的明文或全部明文, 所述操 作系统为所述影子文件分配緩存空间, 并将所述预定部分的明文或全部 明文放入所述操作系统为所述影子文件分配的緩存空间, 建立文件映射 关系。
17. 如权利要求 15所述的系统, 其特征在于, 所述应用程序模块发出才艮据所 述句柄对文件读操作的指令后, 还包括:
所述过滤驱动模块截获所述应用程序发出的才艮据所述句柄对文件进 行读的指令, 向所述文件系统模块发送根据所述句柄对文件进行读的指 令, 并通过所述虚拟磁盘模块在所述虚拟磁盘中读取所述影子文件, 所 述操作系统为所述影子文件分配緩存空间, 并将所述虚拟磁盘中的明文 放入所述操作系统为所述影子文件分配的緩存空间, 完成对所述受保护 文件的读操作。
18. 如权利要求 16所述的系统, 其特征在于, 所述过滤驱动模块使用所述加 密锁内部存储的密钥对所述受保护文件的预定部分或全部进行解密操 作, 具体的为: 所述过滤驱动模块使用所述加密锁内部存储的密钥以簇为单位对所 述受保护文件的预定部分或全部进行解密操作。
19. 如权利要求 16所述的系统, 其特征在于, 所述过滤驱动模块还包括加密 单元, 所述加密单元用于:
当所述将预定部分的明文放入所述操作系统为所述影子文件分配的 緩存空间时, 所述加密单元将经过所述应用程序模块写操作爹改的所述 受保护文件的明文以簇为单位进行加密, 并通过所述文件系统模块对磁 盘中存储的所述受保护文件进行修改,
或者,
当所述将全部明文放入所述操作系统为所述影子文件分配的緩存空 间时, 所述加密单元将经过所述应用程序模块写操作爹改的所述受保护 文件的明文以簇为单位进行加密, 覆盖磁盘中存储的所述受保护文件。
20. 如权利要求 16所述的系统, 其特征在于, 所述过滤驱动模块还包括? I用 计数单元, 所述引用计数单元用于:
记录所述影子文件的句柄数, 当未返回所述影子文件的句柄时, 所 述引用计数单元的计数值为初值, 每返回一个所述影子文件的句柄, 所 述引用计数值增加一个步长, 每关闭一个所述影子文件的句柄, 所述引 用计数值递减一个步长, 当所述引用计数值递减为初值时, 删除所述影 子文件。
PCT/CN2011/073667 2010-05-07 2011-05-04 一种文件保护方法及系统 WO2011137743A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/696,200 US8856521B2 (en) 2010-05-07 2011-05-04 Methods and systems for performing secure operations on an encrypted file

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010172056.7A CN101853363B (zh) 2010-05-07 2010-05-07 一种文件保护方法及系统
CN201010172056.7 2010-05-07

Publications (1)

Publication Number Publication Date
WO2011137743A1 true WO2011137743A1 (zh) 2011-11-10

Family

ID=42804844

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/073667 WO2011137743A1 (zh) 2010-05-07 2011-05-04 一种文件保护方法及系统

Country Status (3)

Country Link
US (1) US8856521B2 (zh)
CN (1) CN101853363B (zh)
WO (1) WO2011137743A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338889A (zh) * 2020-02-14 2020-06-26 奇安信科技集团股份有限公司 支持多种操作系统的取证方法、装置、设备及存储介质
US20210294910A1 (en) * 2020-03-18 2021-09-23 Veritas Technologies Llc Systems and methods for protecting a folder from unauthorized file modification
US11443056B2 (en) * 2019-09-20 2022-09-13 International Business Machines Corporation File access restrictions enforcement

Families Citing this family (48)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853363B (zh) 2010-05-07 2012-08-08 飞天诚信科技股份有限公司 一种文件保护方法及系统
US9053339B2 (en) * 2010-10-27 2015-06-09 Hytrust, Inc. System and method for secure storage of virtual machines
US9069467B2 (en) 2011-06-01 2015-06-30 Microsoft Technology Licensing, Llc Isolation of virtual machine I/O in multi-disk hosts
CN102306255B (zh) * 2011-08-29 2013-06-19 飞天诚信科技股份有限公司 一种文档保护方法及系统
CN103020537B (zh) * 2011-09-22 2015-07-22 腾讯科技(深圳)有限公司 数据加密方法和装置、数据解密方法和装置
CN102521533B (zh) * 2011-12-01 2014-11-19 中国空间技术研究院 一种遥控指令码版本验证方法
US9858149B2 (en) 2012-01-03 2018-01-02 Microsoft Technology Licensing, Llc Accessing overlay media over a network connection
US8966574B2 (en) * 2012-02-03 2015-02-24 Apple Inc. Centralized operation management
CN102609652B (zh) * 2012-02-07 2015-01-07 浪潮(北京)电子信息产业有限公司 针对打开中的文件实现保护的方法及装置
WO2013189008A1 (en) 2012-06-18 2013-12-27 Honeywell International Inc. Design pattern for secure store
CN102902925B (zh) * 2012-09-29 2016-08-03 北京奇虎科技有限公司 一种染毒文件的处理方法和系统
CN102930208B (zh) * 2012-09-29 2015-11-25 北京奇虎科技有限公司 一种染毒文件的处理方法和系统
CN104252601B (zh) * 2013-06-28 2017-05-24 苏州捷泰科信息技术有限公司 数据保护的方法及装置
CN103530581A (zh) * 2013-10-09 2014-01-22 中国联合网络通信集团有限公司 硬盘加密方法和操作系统
US10073957B2 (en) 2013-10-31 2018-09-11 Xiaomi Inc. Method and terminal device for protecting application program
CN103824003B (zh) * 2013-10-31 2017-02-15 小米科技有限责任公司 应用程序保护方法、装置和终端
CN103617401B (zh) * 2013-11-25 2017-02-08 北京深思数盾科技股份有限公司 一种数据文件保护方法及装置
CN103778382A (zh) * 2014-01-16 2014-05-07 宇龙计算机通信科技(深圳)有限公司 加密文件的访问方法及通信终端
CN104102885A (zh) * 2014-06-19 2014-10-15 肖龙旭 一种基于内核过滤驱动的数据安全隔离方法
CN105243332A (zh) * 2014-06-23 2016-01-13 中兴通讯股份有限公司 加密方法及装置、内核加密数据的操作方法及装置
CN105844170A (zh) * 2015-01-16 2016-08-10 阿里巴巴集团控股有限公司 一种文件处理方法和装置
US9501301B2 (en) * 2015-02-26 2016-11-22 Nxp B.V. Flexible instruction sets for obfuscated virtual machines
US10025606B2 (en) * 2015-04-14 2018-07-17 Vmware, Inc. Enabling filter-level access to virtual disks
CN105653971A (zh) * 2015-07-24 2016-06-08 哈尔滨安天科技股份有限公司 一种基于中间层的文件保护方法及装置
CN106407831A (zh) * 2015-07-31 2017-02-15 中兴通讯股份有限公司 文件保护方法、装置及移动终端
CN105184186A (zh) * 2015-09-08 2015-12-23 北京元心科技有限公司 保护智能终端文件系统的方法以及智能终端
CN105335663B (zh) * 2015-10-22 2018-08-03 武汉理工大学 一种基于双像文件的加密文件系统
CN105574431B (zh) * 2015-12-10 2018-08-03 武汉理工大学 一种基于多像文件的加密文件系统
CN105550582B (zh) * 2015-12-11 2018-08-14 福建联迪商用设备有限公司 访问虚拟磁盘的方法及系统
CN105608147B (zh) * 2015-12-17 2019-05-21 无锡天脉聚源传媒科技有限公司 一种隐藏图片原始地址的方法及装置
CN105787359B (zh) * 2016-02-19 2019-01-08 百度在线网络技术(北京)有限公司 进程守护方法和装置
CN106372537B (zh) * 2016-08-31 2019-08-30 宇龙计算机通信科技(深圳)有限公司 一种文档保护方法、装置及终端设备
CN106446718A (zh) * 2016-09-13 2017-02-22 郑州云海信息技术有限公司 一种基于事件驱动机制的文件保护方法及系统
US11423165B2 (en) * 2017-05-18 2022-08-23 NeuShield, Inc. Computer-implemented methods and system for preventing unauthorized file modification by malicious software and the like
US10657248B2 (en) 2017-07-31 2020-05-19 KnowBe4, Inc. Systems and methods for using attribute data for system protection and security awareness training
US11295010B2 (en) * 2017-07-31 2022-04-05 KnowBe4, Inc. Systems and methods for using attribute data for system protection and security awareness training
CN108229190B (zh) * 2018-01-02 2021-10-22 北京亿赛通科技发展有限责任公司 透明加解密的控制方法、装置、程序、存储介质和电子设备
CN108509802B (zh) * 2018-02-28 2020-01-14 郑州信大捷安信息技术股份有限公司 一种应用程序数据防泄密方法和装置
CN108763401A (zh) * 2018-05-22 2018-11-06 平安科技(深圳)有限公司 一种文件的读写方法及设备
CN110245464B (zh) * 2018-10-10 2021-08-27 爱信诺征信有限公司 保护文件的方法和装置
CN109840208B (zh) * 2019-01-07 2022-08-05 烽火通信科技股份有限公司 一种检测文件异常操作的方法及系统
US11874954B2 (en) 2019-01-09 2024-01-16 Science Park Corporation Electronic data management device, electronic data management system, and non-transitory computer-readable recording medium
US11586750B2 (en) * 2019-03-21 2023-02-21 Blackberry Limited Managing access to protected data file content
CN111563269B (zh) * 2020-03-18 2023-08-29 宁波送变电建设有限公司永耀科技分公司 基于影子系统的敏感数据安全保护方法及系统
CN112035885B (zh) * 2020-08-26 2023-03-28 山谷网安科技股份有限公司 基于minifilter和usbkey的透明加解密文件驱动的方法
CN117633265A (zh) * 2022-08-10 2024-03-01 华为技术有限公司 图片的存储方法、装置和终端设备
CN115495794A (zh) * 2022-11-17 2022-12-20 北京华云安信息技术有限公司 一种基于无文件技术的反解析文件保护方法和装置
CN117077219A (zh) * 2023-10-17 2023-11-17 西安热工研究院有限公司 操作系统完整性保护方法、系统、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101008974A (zh) * 2007-01-26 2007-08-01 北京飞天诚信科技有限公司 一种电子文件保护方法及系统
US7272654B1 (en) * 2004-03-04 2007-09-18 Sandbox Networks, Inc. Virtualizing network-attached-storage (NAS) with a compact table that stores lossy hashes of file names and parent handles rather than full names
CN101063978A (zh) * 2006-04-28 2007-10-31 联发科技股份有限公司 文件系统管理装置
US7526720B1 (en) * 2000-11-22 2009-04-28 Adobe Systems Incorporated System and method for storing data associated with a file
US20090171971A1 (en) * 2007-12-26 2009-07-02 Oracle International Corp. Server-centric versioning virtual file system
CN101853363A (zh) * 2010-05-07 2010-10-06 北京飞天诚信科技有限公司 一种文件保护方法及系统

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0862124A3 (en) * 1997-02-28 2003-03-26 Fujitsu Limited File access system for efficiently accessing a file having encrypted data within a storage device
US7594265B2 (en) * 2001-11-14 2009-09-22 Ati Technologies, Inc. System for preventing unauthorized access to sensitive data and a method thereof
CN1154050C (zh) * 2001-11-29 2004-06-16 上海格尔软件股份有限公司 在Windows环境下虚拟磁盘的方法
TW591630B (en) * 2002-06-04 2004-06-11 Key Technology Corp Data security device of storage medium and data security method
US7143288B2 (en) * 2002-10-16 2006-11-28 Vormetric, Inc. Secure file system server architecture and methods
US7280956B2 (en) * 2003-10-24 2007-10-09 Microsoft Corporation System, method, and computer program product for file encryption, decryption and transfer
US7694151B1 (en) * 2003-11-20 2010-04-06 Johnson Richard C Architecture, system, and method for operating on encrypted and/or hidden information
CN101057288B (zh) * 2004-11-09 2010-12-22 汤姆森许可贸易公司 把内容绑定到可移动存储器上的方法和装置
CN1831701A (zh) * 2005-03-11 2006-09-13 北京共创开源软件有限公司 一种基于虚拟文件系统的操作系统保护方法
CN100461007C (zh) 2006-01-27 2009-02-11 中国科学院过程工程研究所 数码复印机用碳粉及其制备方法
JP4969572B2 (ja) * 2007-06-15 2012-07-04 株式会社日立ソリューションズ ファイル処理システム及び方法、並びに、ファイル処理プログラム
CN101201883B (zh) * 2007-09-18 2010-04-14 北京赛柏科技有限责任公司 基于虚拟机的软件保护方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7526720B1 (en) * 2000-11-22 2009-04-28 Adobe Systems Incorporated System and method for storing data associated with a file
US7272654B1 (en) * 2004-03-04 2007-09-18 Sandbox Networks, Inc. Virtualizing network-attached-storage (NAS) with a compact table that stores lossy hashes of file names and parent handles rather than full names
CN101063978A (zh) * 2006-04-28 2007-10-31 联发科技股份有限公司 文件系统管理装置
CN101008974A (zh) * 2007-01-26 2007-08-01 北京飞天诚信科技有限公司 一种电子文件保护方法及系统
US20090171971A1 (en) * 2007-12-26 2009-07-02 Oracle International Corp. Server-centric versioning virtual file system
CN101853363A (zh) * 2010-05-07 2010-10-06 北京飞天诚信科技有限公司 一种文件保护方法及系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11443056B2 (en) * 2019-09-20 2022-09-13 International Business Machines Corporation File access restrictions enforcement
CN111338889A (zh) * 2020-02-14 2020-06-26 奇安信科技集团股份有限公司 支持多种操作系统的取证方法、装置、设备及存储介质
CN111338889B (zh) * 2020-02-14 2023-05-23 奇安信科技集团股份有限公司 支持多种操作系统的取证方法、装置、设备及存储介质
US20210294910A1 (en) * 2020-03-18 2021-09-23 Veritas Technologies Llc Systems and methods for protecting a folder from unauthorized file modification

Also Published As

Publication number Publication date
CN101853363B (zh) 2012-08-08
US20130080773A1 (en) 2013-03-28
US8856521B2 (en) 2014-10-07
CN101853363A (zh) 2010-10-06

Similar Documents

Publication Publication Date Title
WO2011137743A1 (zh) 一种文件保护方法及系统
JP4089171B2 (ja) 計算機システム
CN104951409B (zh) 一种基于硬件的全盘加密系统及加密方法
EP2696305B1 (en) Method and device for file protection
CN100449560C (zh) 一种计算机数据安全防护方法
JP4392241B2 (ja) 付属記憶装置を採用したコンピュータ・システム内の安全保護を促進するための方法ならびにシステム
TWI241818B (en) Application-based data encryption system and method thereof
US20060174352A1 (en) Method and apparatus for providing versatile services on storage devices
US20030221115A1 (en) Data protection system
KR100596135B1 (ko) 가상 디스크를 이용한 응용 프로그램 별 접근통제시스템과 그 통제방법
US20050060561A1 (en) Protection of data
TW200830830A (en) Hard disc streaming cryptographic operations with embedded authentication
GB2404537A (en) Controlling access to data using software wrappers
TW200405963A (en) Sleep protection
CN103218575A (zh) 一种主机文件安全监控方法
KR20140051350A (ko) 디지털 서명 권한자 의존형 플랫폼 기밀 생성 기법
TW201530344A (zh) 應用程式存取保護方法及應用程式存取保護裝置
TW201234210A (en) Method for loading a code of at least one software module
JP4084971B2 (ja) 電子データ交換システムにおけるデータ保護装置及びデータ保護方法並びにそれに用いるプログラム
KR20030084798A (ko) 문서보안 시스템
WO2024045407A1 (zh) 虚拟磁盘安全存储方法
TWI377483B (zh)
JP2009059008A (ja) ファイル管理システム
TWI514834B (zh) 機敏資料加密演算儲存裝置
JP2000029792A (ja) 機密情報格納装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11777164

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13696200

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11777164

Country of ref document: EP

Kind code of ref document: A1