I am using Ubuntu in this tutorial but you can use any Linux distribution that uses Nautilus (now called Files) file manager. There are several ways you can encrypt a file in Linux. In fact, there are dedicated command line tools for this task but I am not going to talk about those. I am going to show you how to zip a directory or file without installing a dedicated tool.
Create a password protected zip file in Linux
To follow this tutorial, you just need to make sure that you are using Nautilus/Files file explorer. If you are using Fedora, Ubuntu Unity, or any other Linux distribution with GNOME as its desktop environment, you have Nautilus.
Right click on file(s) and/or folder(s) and click on Compress:
Select the compression format you want to choose. There are several formats available but you cannot use all of them for password protecting the files.
I advise to use the .zip format. After selecting the compression format, click on the Other Options.
You’ll see option of entering password in Other Options. If the compression format you selected doesn’t support encryption, this Password area would be greyed out.
It may also happen that you’ll have to install the compression utility to use the encryption. For example, if you do not have RAR installed, password option will not be available.
Enter a suitable password and click on Create:
Compression takes time based on the size of the file or directory. You’ll see a message like this when the files are compressed successfully:
The compressed file thus created is password protected. If you try to extract it, it will ask you to enter the password:
As you can see, no one (in normal ways) can extract this file without the password. Congratulations, you just learned how to encrypt zip files in Ubuntu Linux.
Just for your information, double clicking on the password protected directory might give the impression that you may access the encrypted directory without a password, but you cannot actually read those files.
I hope this quick tutorial helped you to create password protected zip files in Linux. In coming days, we shall see how to password protect a directory in Linux and how to break the encryption. Stay tuned :)