Tuesday, April 28, 2009

password protect your tar archive

Just today my not-so-close friend asked for my flash-drive. That drive contained some data that i didn't wanted to let him see. So i started searching for a method to password protect my archive of secret files. Following are the commands that worked like a charm for me:

to create password protected archive

tar cfz - my_folder/ | gpg -c -o my_folder.stgz

and to decrypt and decompress the password protected archive

gpg -d my_folder.stgz |tar xfz -

Reference : http://mydebian.blogdns.org/?p=461

No comments: