Encryption is one way that ensures the safety and security of our data, making the information unreadable to anyone who tries to get it without authorization. In addition to ensuring the integrity of your files, it allows access to be made only for those who have the key (password) to decrypt it. We’ll see about ccrypt tool which will use the process to encrypt / decrypt our files.
Installation (debian / ubuntu)
We can encrypt any type of file, regardless of the extension (txt, mp3, doc, xls, and so on). To encrypt a particular file, browse the terminal to the location of it and type the following command. Note in the image below we will be encrypting a file named tutorial.txt.
Once you enter the command, it will ask for a password which you will never forget. If you forget, depending on the level of the password, you can never recover it. We therefore recommend a strong password so no one can break it with a brute force attack.
Tip: create a password with at least 16 characters in it, uppercase letters, lowercase letters, numbers and special characters.
Now confirm the password again to complete the encryption process on the file.
Now if you want to encrypt an entire directory to facilitate the process, enter the command:
And confirm the password again to complete the process. See the entire file is with a .cpt extension that means it is encrypted, being unable to be opened or read.
To do the reverse process, which is to decrypt the file (which is to .cpt extension), type the following command and then the associated password that you used to encrypt the file.
Note that file back to its original format which is readable your reading. Now to decrypt a directory, type the following command and password:
The ccrypt is a simple and easy tool to use which easily ensures that your files are secure and if someone intercepts, it will be unreadable to read. A good use of it is to encrypt files on external storage media such as flash drive and HD.