If you don’t know what file encryption is, I’ll give you the simple definition. When you encrypt a file, the encryption software will create a password protected copy of that file. Nobody will be able to open this file or know exactly what it is without entering the password you encrypted it with. AES Crypt is a free encryption software that works on all types of systems. You can download it from this link.
AES Crypt – Advanced File Encryption
I recommend the GUI (Linux 64-bit) version, which contains both the GUI and the command line version.
First, you need to unzip the file.
– Open a terminal.
– Navigate to the directory that contains the downloaded file.
– Run the following command.
Now make the file executable.
Finally, run the installer.
Okie dokie. Now that you’re all set up we can start encrypting files. Let’s start by creating a text file with the phrase This is a sample file. inside of it.
When you encrypt a file, it keeps the same name and adds the .aes extension behind it. So if you were to encrypt sample.txt, the encrypted file would be named sample.txt.aes
If the point of encrypting a file is to keep it hidden, it seems to me that it would kind of defeat the purpose if you leave the .txt extension in the name. You can rename the file without the extension. Don’t worry, your system will still know what type of file it is. In fact, it would probably be in your best interest to change the actual file name itself as well. The point is to keep prying eyes unaware of the contents, is it not? So we are going to start by renaming the file.
Now we have a file named sp with no visible extension. So let’s encrypt it and set the password to monkey.
As you can see, your original file is still there, but now there is another file called sp.aes that you cannot open. At this point you can either move the original file or delete it entirely. I’m just going to delete it.
To decrypt sp.aes we just use a -d instead of -e and enter the password we set for it.
This will recreate the original file from the encrypted copy. You can recreate this file an infinite number of times!
However, there is always a risk associated with typing a password out in plain text where anyone looking over your shoulder can see. So I recommend leaving out the -p on these commands. This will prompt you to enter the password in the shell without displaying it as you type.
Encrypt like this…
Then decrypt it with the following.
Still with me? Alright, we’re going to make this a bit more interesting. Let’s say that sp.aes was actually a password file with all of your passwords stored in it. You can display the contents of the encrypted file right in the terminal, without actually recreating the document.
If you do use this method for viewing a password file, I recommend running reset in the terminal afterwards. The clear command will clear the shell, but you can still scroll back to where you displayed the contents of the file. Using reset will totally clear the shell.
That’s all for now. You go and have yourself a fantastic day.