How to encrypt individual folders?

Let's say that I have a folder, within my Documents folder, that has files I want no one to access without a password.

Is there a way to lock down that folder so that it's password protected / encrypted?

In fact, is it possible to password-protect any individual folder?


Cryptkeeper

WARNING: CryptKeeper has recently been reported that it has a universal password bug that puts your data at potential risk. This issue may not yet be fixed in Ubuntu, use this solution at your own risk.

Relevant bug information links:
Upstream bug: https://github.com/tomm/cryptkeeper/issues/23
Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852751


 sudo apt-get install cryptkeeper

                                After installing, go to Applications –> System Tools –> Cryptkeeper.

                                        Cryptkeeper will automatically attach itself to the top panel

                   enter image description here

                     To create an encrypted protected folder, click on Cryptkeeper applet and select                                                                             ‘New encrypted folder’

                   enter image description here

                          Then type the folder name and where to save the folder and click ‘Forward’.

                   enter image description here

                                                              Type the password and click ‘Forward’.

                   enter image description here

                                                      The folder will be created and ready to be used.

                   enter image description here

                   To access all encrypted folder, click on Cryptkeeper applet on the panel and select                                                                                                each folder.

                   enter image description here

                                                   Type the password before it is mounted to be accessed.

                   enter image description here

                                                       Done

                   enter image description here

                 To delete a folder or change the password, right-click the folder in the panel-applet.

                                                                                      For More Help


eCryptfs

EncryptedPrivateDirectory Method.

Ubuntu Official Wiki

Search for and install ‘ecryptfs-utils’ in Ubuntu Software Center:

enter image description here

After installing, go to Applications –> Accessories –> Terminal and run the command below:

ecryptfs-setup-private

enter image description here

You’ll be prompted to type your login passphrase (password), and to create one for your private folder:

enter image description here

When you’re done creating your password, Log Out and Log back in:

enter image description here

Next, go to Places –> Home Folder:

enter image description here

And new folder should be created in your home directory called ‘Private’. This folder in encrypted and password-protected. Move all your personal stuff into this folder to secure them:

enter image description here

Users without access to the folder will be denied:

enter image description here

For More Help


You have 2 choices if you want to lock down a folder from other users

  • Encrypt or create a compressed password protect archive of the files. This method (Cryptkeeper) is perfect for this case when you need to be 100% sure no one will ever look at your files without knowing the password used there.

  • Use your computer folder / file permissions to deny access to your folder to other user.

The first involves making sure that the result cannot be opened by any user without knowing the password used.

The second will only change the file / folder privileges so that another user without rights cannot open it. The folder still exists, can be accessed by any user with sudo rights in your system or using a LiveCD and reading the partition. It is also simpler to implement and does not require that you type a password all the time you need to open / mount the encrypted folder / archive.

An easy and fast way to do so is using chmod to change the privileges for a file or folder.

Open a terminal and navigate to the place where your folder is, lets assume that the folder name is foo and that we are currently located where the folder is.

chmod 700 foo

will make foo only available for your eyes, its not encrypted (that is also possible) but only your user (and or a user with sudo privileges) can read or open that file / folder.

You can also do it graphically by right clicking on a file or folder and changing its permissions manually. In the example below you as owner have all privileges and you deny any other group or user from accessing, reading or modifying that file / folder

enter image description here

For more information about file / folder permissions visit the Ubuntu Understanding and Using File Permissions wiki page.


Another way, depending on your needs is to archive the folder as a password protected zip file.

This is similar to another question about password protecting files.