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 my_work.zip file:

gpg2 -c my_work.zip

enter twice the password.

The result is a new encrypted my_work.zip.gpg

tmp # ls -l
   my_work.zip
   my_work.zip.gpg

Delete “my_work.zip”, 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 my_work.zip.gpg
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 “my_work.zip” file!

 

GNUPG – gpg encrypt files
Tagged on:                             

Leave a Reply

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