File encryption method based on alternate data streams

The invention discloses a file encryption method based on alternate data streams. File data to be encrypted are written onto an NTFS (New Technology File System) volume through the alternate data streams, so that file encryption is realized. The method comprises the following steps of creating an extended data stream for the file; setting file secret level marking information including encryption person and secret level, and automatically acquiring the encryption time; inputting an encryption marking command as a verification command; calling file I/O, writing the set file secret level marking information into the extended data stream for the file, and completing encryption. According to the method provided by the invention, secret level marking cannot influence the original file content so as not to influence the normal operation of other programs on the file, and the method for encrypting the file by utilizing the alternate data streams has the advantages of simplicity and convenience in operation.