Tuesday, March 24, 2009

How to Encrypt/decrypt files


If you want to protect files so that they can transverse across cyberspace safely, or you just want to protect them from
prying eyes with a password.

use the gpg command.

gpg -c filename

You will be asked for a pass phrase.

enter your pass phrase.

You will be asked to repeat your pass phrase
a file will be created with the .gpg extention

Caution: if you forget your pass phrase you will not be able to recover your file. the encryption used is that good.

to decrypt the file simply type
gpg filename.gpg

enter your pass phrase when asked.

To do multiple files I usually zip them into one zip file and then encrypt the zip file.
you can do this in one shot by typing the following
zip - file1 file2 file3 file4 file5 | gpg -eat > outfile.zip.asc

No comments: