An encryption method based on DES comprises the following steps: randomly obtaining a character string with the length being x and used for logical operation from a file to be encrypted; dividing the file to be encrypted into sections with the length of being y, wherein y is more than and equal to x, the length of the final section is set as z, and z is less than or equal to y; conducting left alignment and right alignment on the subsections and the character string, and conducting logical operation with the character string so as to generate the encryption file, when the subsections and the character string are in the left alignment, conducting the logical operation with x bit on the left haft part, and when the subsections and the character string are in the right alignment, conducting the logical operation with x bit on the right half part, and if z is more than or equal to x, conducting the logical operation with x bit on the final small section, or conducting the logical operation with z bit; and by the DES algorithm, encrypting the character string to obtain encrypted logic element, and then appending the content and the length of the logic element, the length of the character string, and user-defined mark sections behind the encryption file. The method has the advantages that the rapid for decryption is quick, the requirement of playing when conducting decryption is met, and the encryption scheme is flexible.