Get a 25% off coupon to use on any of our website scripts! - Subscribe to our Newsletter now!
Free Web Site Evaluations
Home » Scriptalicious Blog » Guides » How to Use GPG to Encrypt and Decrypt Files

Scriptalicious Blog

How to Use GPG to Encrypt and Decrypt Files

Posted 2009-04-17 in Guides

Scriptalicious Blog

A good friend recently provided me with some dead-simple instructions on how to use GPG in linux so we could share a few sensitive files. I have edited them slightly and with his permission I will share them with you.

To encrypt a file for someone you first need to import their public key:

gpg –import key_file_to_import

Then you can encrypt a file for them to decrypt, like this:

gpg -r someone@email.com -a -e file_to_encrypt

You’ll end up with file_to_encrypt.asc, and that’s the file you send them.

You could also encrypt data right from stdin, like this:

gpg -r someone@email.com -a -e > outputfile.asc

Then type the information to be encrypted, and hit ctrl+d when done.

There are also GUI tools like the Enigmail plugin for Thunderbird to make it nicer, but the command line isn’t really too bad.

Oh yeah, and if you want someone to be able to encrypt stuff to send you, they need your public key. Here’s how to export it:

gpg -a –export > your_key.asc

Then send them your_key.asc.




Tags: gpg, guides

 


Search



Subscribe


Subscribe via RSS

Stay current with Scriptalicious news and subscribe in your favorite RSS reader.

Subscribe by RSS

Subscribe via Email

Get the latest Scriptalicious news delivered to your inbox.




77 powerful SEO scripts for under $100.

Real-time Backlink Rank Checker script.


Scriptalicious is in no way affiliated with myspace.com® or Google®. Google, PageRank™ and MySpace are the trademarks of their owners.