HOWTO encrypt files using gpg
GNU privacy guard ,is pretty good tool for secure data storage.There are other features, but this *HOWTO* focus on stand alone encryption of particular file with a password.This can come in handy at times if you want to encrypt your private documents.GnuPG can be download from http://www.gnupg.org/download/index.en.html
On Shell >
To encrypt the file myfile.txt
gpg -c myfile.txt
Which would ask you
Enter passpharse:
Once done you will have a file called myfile.txt.gpg,which is our encrypted file.
To decrypt myfile.txt.gpg file
gpg myfile.txt.gpg
Which would show
gpg:CATS5 encrypted data Enter passpharse:
Tada .. .. decrypted
Explanation
One of the feature of gpg is to encrypt and decrypt files,from the example above we have seen an option -c which means to Encrypt with a symmetric cipher using a pass phrase. The default symmetric cipher used is CAST5, but may be chosen with the --cipher-algo option.If you're wondering what a symmetric cipher means ..those are algorithms for cryptography, we can observe that gpg is highly flexible as it gives the power to choose the algorithm for encryption.CAST5 are block cipher algorithm.
Now let's proceed with explanation, after issue of the gpg with the parameter -c and file name it asks you for a secret key or pass phrase which when entered is not echoed on the screen.Enter it twice for cross checking,once successfully done myfile.txt file would be encrypted to myfile.txt.gpg.
In order to decrypt the file just call gpg with the file name to decrypt.
There are other way to do the same thing using gpg ,those are options -e and -d.