Encrypt and decrypt files using GPG

To install GPG on your Debian/Ubuntu/Mint Linux operating system use command:

sudo apt-get install gpg

Default GPG folder is: /home/user/.gnupg. Generate private and public keys:

gpg --full-gen-key

Answer the several questions (encryption type: RSA, keysize: 4096 for better encryption, key expiration time, your name and email address) and press “O” if all changes are correct.

To view public keys use command:

gpg -k

To view secret gpg keys use command:

gpg -K