eCryptfs is a POSIX-compliant enterprise-class stacked cryptographic filesystem for Linux. It is derived from Erez Zadok’s Cryptfs, implemented through the FiST framework for generating stacked filesystems. eCryptfs extends Cryptfs to provide advanced key management and policy features. eCryptfs is already included in the official Ubuntu repositories and encrypting directories is a simple matter of mounting them with the ecryptfs filesystem
You can install ecryptfs using the following command
#sudo apt install ecryptfs-utils
Create a secrets directory in the top level of the filesystem, and encrypt it. Note how you list the directory name twice, because you also need to specify a mount point. Essentially, you’re using the directory that you’re mounting as its own mount point:
#sudo mkdir /secrets
#sudo mount -t ecryptfs /secrets /secrets
Enter your desired passphrase, and choose the encryption algorithm and the key length
Go with the default of aes encryption, and 16 bytes for the key.
Go with the default of no for plaintext passthrough, and with yes for filename encryption:
Go with the default Filename Encryption Key and verify the mounting options:
This warning only comes up when you mount the directory for the first time. For the final two questions, type yes in order to prevent that warning from coming up again
Create a file within your new encrypted secrets directory, and then unmount the directory. Then, try to do a directory listing:
By choosing to encrypt filenames, nobody can even tell what files you have when the directory is unmounted. When you’re ready to access your encrypted files again, just remount the directory the same as you did before.
If you’re just encrypting individual directories with eCryptfs instead of using LUKS whole- disk encryption, you’ll need to encrypt your swap partition in order to prevent accidental data leakage. Fixing that problem requires just one simple command:
#ecryptfs-setup-swap
Latest posts by Ruwantha Nissanka (see all)
- 4 ways to hide your identity using linux - January 18, 2021
- How To Install Kali Linux in Virtualbox - December 31, 2020
- Kali Linux : The OS That Hackers Use - December 31, 2020
- How to monitor user activity in Linux with Acct - December 30, 2020
- Debsecan : You will not miss another security update - December 28, 2020