GNU Privacy Guard (GnuPG or GPG) is a GPL Licensed alternative to the PGP suite of cryptographic software.

PGP encryption uses a serial combination of hashing, data compression, symmetric-key cryptography and finally public-key cryptography; each step uses one of several supported algorithms. Each public key is bound to a user name and/or an e-mail address. A detailed example is here.

Also, you can encrypt files using a custom password, without a public key.

Install GnuPg tool:

on Gentoo

emerge pv app-crypt/gnupg

on Debian

apt-get install gnupg

I want to crypt file:

gpg2 -c

enter twice the password.

The result is a new encrypted

tmp # ls -l

Delete “”, do not forget this step if you wish to keep your work only in a encrypted file.

To get back your original file, issue this command:

tmp # gpg2
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected

It ask for password!

….wait….and now you have again “” file!


GNUPG – gpg encrypt files
Tagged on:                             

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.