How to encrypt a file within seconds in Linux! – Medium

The art of Cryptography consists of two parts Encryption and Decryption. One is the exact reverse of the other and they are both powered by some serious math. The purpose of Cryptography is to hide the content of a message so that if someone, other than the receiver of the message, finds it, they wont be able to read it.

In this article I will show you the easiest way to encrypt a file in Linux in just a few seconds using the GNU Privacy Guard(gpg tool).

In most modern Linux distros the gpg tool is already pre-installed. To check if gpg is installed on your system, run:

If gpg is not installed on your system simply run:

Once installed on your system, you can start encrypting your files by running:

Then we provide an easy to remember passphrase and we are done. A new encrypted version of the file is created alongside the original one but with the .gpg extension.GPG offers many encoding algorithms, meaning that you can choose which one will be used to encrypt your data.To list the algorithms run:

You can select a specific algorithm by running instead:

In order to decrypt a file you simply run the following command and then provide the passphrase that was used to encrypt it.

Note:If you encrypt a file and then try to decrypt it you may not be promted with a passphrase request. Cache needs to be cleared first in order for a passphrase to be requested.

See original here:
How to encrypt a file within seconds in Linux! - Medium

Related Posts

Comments are closed.