INTRODUCTION
Check the GnuPG web page for documentation on the GnuPG package:
PUBLIC KEY CRYPTOGRAPHY
We'll use pkg_add to install GNUPG. A local copy is on our noc box:
CREATING A PUBLIC/PRIVATE KEY PAIR
Now that GnuPG is installed you can use the
At this point your PGP public and private keys have been created. Your PGP information will be stored in your user's account home directory under the ".gnupg" directory.
EXTRACTING YOUR PUBLIC KEY
To extract your public key as text do:
To see what public keys you have installed, you can always type
GENERATING YOUR PUBLIC KEY'S FINGERPRINT
You calculate the fingerprint for a local copy of a public key like
this:
Once you have obtained a public key, you can import it to your local
keyring so that you can use it like this:
If you have a copy of someone else's public key on your keyring and
you have decided that you trust it (e.g. by verifying the fingerprint
with the key's owner) and you have also decided that you trust the
identity of the key's owner (e.g. by checking a passport) you can
sign it.
To sign a key:
There are many more things you can do with GnuPG than those described
in these notes. For more information, see:
http://www.gnupg.org/
In particular, look at the documentation, and the "Mini HOWTO" for
lots of good information:
# pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/8.0-RELEASE/packages/All/gnupg-1.4.10.tbz
gpg
command
to use the Gnu version of PGP. In these steps you should do this as your user on your system (i.e. afnog), not as the root user!:
Here is what the key generation session looks like. We have indicated in bold and red reasonable responses to the questions you will be asked:
$ gpg --gen-key
--------------------------------------------------------------------
gpg (GnuPG) 1.4.10; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gpg: keyring `/home/afnog/.gnupg/secring.gpg' created
gpg: keyring `/home/afnog/.gnupg/pubring.gpg' created
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 2048
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
Note: "your key id" is probably your email address in this case.
$ gpg -a --export <your key id>
To place your newly generated public key on the MIT
(Massachussetts Institute of Technology in Boston, Massachussetts,
United States) PGP server do the following:
$ gpg --list-keys
Look for the line that says "pub" - the second set of numbers after the "/" is your key-id. A sample such line is:
$ gpg --list-keys yourUserid
The string "E947C3B4" is the key-id in this case.
pub 1024D/E947C3B4 2012-11-28 [expires: 2012-11-28]
Only send this newly generated pgp key to the MIT keyserver if the key you have generated is one you plan on using in the future. Your instructor should discuss this before you do these exercises. If not, remind your instructor to do this now. :-)
So, to send your newly created public key to a keyserver you would do:
That's it! Your public key is now available to anyone who goes to the MIT PGP server and searches on your name, email address, etc. Your key information will propagate to all the pgp key-servers worldwide within a few hours.
$ gpg --keyserver pgp.mit.edu --send-keys key-id
IMPORTING SOMEONE ELSE'S PUBLIC KEY
$ gpg --fingerprint <key id>
SIGNING A PUBLIC KEY
$ gpg --import <filename>
This does several things:
$ gpg --sign-key <key id>
http://www.gnupg.org/
Last update by Hervey Allen on: Thu May 27 00:59:52 CEST 2010