Quote from: 16bitgirl on June 28, 2012, 12:58 pmDespite being a computer geek, I found GPG a bit tricky to use at first, and I'm guessing I'm not alone, so here is my guide to GPG usage.First off - import the keys of the sellers you want to send stuff to. On their user page, they should have a block of text that looks like this:Quote-----BEGIN PGP PUBLIC KEY BLOCK-----Version: Something or otherCharset: This line may or may not be hereRandomStuffLikeRDri646D7xb24RG (etc etc)-----END PGP PUBLIC KEY BLOCK-----Copy that entire block (including the lines with -----BEGIN----- and -----END-----) into a text file, say, lucykey.txt (I've decided my pretend seller is called Lucy), save it in your home directory, then open up a terminal window / command line, which should start out in your home directory. Type the following command:Code: [Select]gpg --import lucykey.txtAnd GPG will show you some information about the name of the person, for example:Code: [Select]gpg: key 7A8B9C0D: public key "Lucy " importedgpg: Total number processed: 1gpg: imported: 1Which means that GPG now knows how to encrypt files for "Lucy", the part before the email address being what GPG calls her. To encrypt a text file, such as top_secret.txt for Lucy, you'd type:Code: [Select]gpg -e --armor -r "Lucy" top_secret.txtGPG will ask if you want to trust the key, and assuming you answer "y", it'll spit out a file called top_secret.txt.asc which is the PGP-encoded version of top_secret.txt, and can only be read by Lucy. This'll look a lot like those PGP public key blocks, like this:Quote-----BEGIN PGP MESSAGE-----Version: Something or otherRandomStuffLikeRDri646D7xb24RG-----END PGP MESSAGE-----Just copy that whole block from top_secret.txt.asc to Lucy, and she'll be able to read it!Now, personally I didn't quite like the way that worked. I mean, what if some time later, I want to encrypt top_secret.txt for Mary-Jane? After I'd done it, I might forget whether top_secret.txt.asc was Lucy's version or Mary-Jane's version. So I created a bash script! Here it is, in all its glory:Code: [Select]#!/bin/bashif [ "$#" -ne 2 ]; then echo "usage: $0 recipient_name text_file_to_encrypt" exit 1figpg -e --armor -o $2-$1.asc -r "$1" $2echoecho "File $2 has been encrypted, and saved as $2-$1.asc"Save this script somewhere in your path (I recommend the name gpg-encrypt), remembering to run chmod +x on the file. Then, all you have to type is the following:Code: [Select]gpg-encrypt Lucy top_secret.txtAnd instead of giving you a file named top_secret.txt.asc, it'll give you a file named top_secret.txt-Lucy.asc, eliminating any confusion! The script also tells you what it's called the file just to make it easier to find. Anyway, I hope this information and script helps people who find GPG as cumbersome as I do :D+1 for a very well put together post 16bitgirl well done! If you need help encrypting Truecrypt/LUKS partitions please let me know I'd be happy to help.V.