HowTo make GPG Keys under Linux/Unix

You can install the command line tools from gnupg.org. Go to the downloads section.

I don't know about the graphical tools. This guide describes only the command line tools.

1. Download the tar.

2. cd into directory.

3. The program is called "gpg". Note the following important options/commands


Commands

--gen-key : to make keys

--import : import a public key into your keyring

--export : export a public key

-e : encrypt

-d : decrypt

Options

-o : specify output file

-a : asci armor, used for sending in plain text. This creates text output instead of binary, useful for email.

-r : user id


Examples

$ gpg --gen-key

...Then follow the directions for making a key... Then put your data file (usually a text file) in the gpg folder)

$ gpg -o output.gpg -r ID -ea mySecret.txt

...The command above will encrypt the file mySecret.txt and save the encrypted version as output.gpg (you can name it anything you want). The ID is usually the "real name" or "email" you specified when generating your Key Pair above. The "mySecret.txt" is the original message to encrypt.

To create a messae for your friend, use your friend's Public Key instead. You must first import that public key into your keyring. Get your friend's key and put it in the gpg folder. Let's call it "friend.key".

$ gpg --import friend.key

...or to export a key

$ gpg -a --export ID

...where ID is the "real name" or "email" you specified when generating your Key Pair above. Then encrypt the message for your frient now that you have their public key.

$ gpg -o output.gpg -r IdOfYouFriend'sPublicKey -ea mySecret.txt

...to get the IdOfYourFriend'sPublicKey use the following command to veiw all keys in your key ring:

$ gpg --list-keys

questions / comments to: jxd52@cwru.edu