Sunday, January 1, 2012

GPG quick usage

1. Encrypt a file with public key
$ gpg --encrypt --recipient 'Your Name' foo.txt


2.1 Decrypt a file with private key (using the password in the commandline)
$ gpg --output foo.txt --passphrase "$_PASS" --decrypt foo.txt.gpg


2.2 Decrypt a file with private key (not using the password in the commandline)
$ gpg --output foo.txt --decrypt foo.txt.gpg


Resources
http://www.madboa.com/geek/gpg-quickstart/
http://aperiodic.net/phil/pgp/tutorial.html

No comments: