The invention discloses a file
encryption method and device on the basis of partitions. The method includes that file
encryption partitions which are protected by user
password and / or key file are established; firstly, one of partitions is selected, which comprises a partition head, a file area and an idle area; then a random number is generated and stored as a salt figure in a first part of the partition head, and a file
encryption key is generated to encrypt file data of the file area; the
password and / or the key file set by a user are / is read, a user encryption key is generated by the
password and / or the key file and the salt figure, and the file encryption key is encrypted according to the generated user encryption key to be stored on a
tail portion of the partition head; a file encryption partition is loaded, which includes that a drive is distributed to the file encryption partition; after the use of the encryption partition is finished, the file encryption partition is unloaded, which includes that the drive of the file encryption partition is released. Thereby, by means of the method and the device, strength and encryption strength of the file password can be improved.