Gnu Privacy Guard (GPG) is a encryption program that many of you will know because it is widely used in GNU / Linux systems, for example it is used to increase repository security, it supports various encryption algorithms:
- AES, AES192, AES256,
- CAMELLIA128, CAMELLIA192, CAMELLIA256
many of you will not be interested in how each algorithm works, but you will surely be interested in how safe one is compared to the other: let's say right away that any of these algorithms is good for protecting our personal files, hardly our PC home will be subject to massive attacks to decrypt our files, having said that, the Safer algorithms are BEA, TWOFISH e CAMELLIA while by default GnuPG uses CAST5 (key to 128bit) which, as mentioned above, is more than fine to secure our files.
GPG it is already pre-installed in Ubuntu, let's see how to use it simply from a terminal: in fact, with a simple command we can encrypt every type of file on our hard disk:
If we wanted to encrypt a text file called "prova.txt"Which is in our folder"Documents"It will be sufficient to open the terminal and go to the document folder using the command:
the command "cd"Allows us to move between the various folders of our PC the generic syntax is"cd”Followed by folder path to open, for example if we wanted to open the folder “video"Located inside the folder"Downloads"We will write in the terminal:
alternatively we can go to the folder Documents means fillet manager and with the right key mouse open a terminal in the desired position
after having positioned ourselves correctly in the file folder "prova.txt", We can encrypt it with the following syntax:
naturally we will have to modify the name "prova.txt" with the exact name of the file to be encrypted; we will be required for 2 times to enter a password that will allow us to decrypt the file later (be careful not to forget your password because there will be no way to recover the file without it).
this command will create a new encrypted file with the same name, in this case "prova.txt.gpg"That if we try to open it it will be indecipherable with any program; at this point we delete the "prova.txt" file in clear, leaving only the one encrypted in our hard disk.
to decrypt the file use the following command:
the decryption password will be requested, once entered it will recreate the original file in clear “prova.txt”
do not perform this procedure for the first time on important files, but try the procedure on a test file.
we carry out the same procedure for encrypt an image (Inthebit.png):
we can now delete the image in clear inthebit.png leaving the one with the .gpg extension that will result unreadable from any image viewing program.
to encrypt a folder instead it will be enough to compress it with any compression program: .zip, .7zip, .rar and carry out the same procedure seen until now.
if we wanted to change the encryption algorithm the command is the following:
secure your personal files is simple! never leave documents that contain your passwords, other registration or financial data without any protection, one day you may regret it.