Generating a Key Pair
Following is an example of the sequence necessary for generating a key pair in GPG:
gpg --gen-keypg (GnuPG) 1.2.1; Copyright (C) 2008 Free Software Foundation, Inc. This program comes with ABSOLUTELY NO WARRANTY. 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/james/.gnupg/secring.gpg' created gpg: keyring '/home/james/.gnupg/pubring.gpg' created Please select what kind of key you want: (1) DSA and ElGamal (default) (2) DSA (sign only) (5) RSA (sign only) Your selection?
5What keysize do you want? (1024)
2048Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0)
3yKey expires at Fri Sep 18 00:23:00 2009 CET Is this correct (y/n)?
yYou need a User-ID to identify your key; the software constructs the user id from Real Name, Comment and Email Address in this form: "James Stanger (James Stanger) <email@example.com>" Real name:
James StangerEmail address: firstname.lastname@example.org Comment: <nothing> You selected this USER-ID: "James Stanger <email@example.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
oYou need a Passphrase to protect your secret key. Enter passphrase:
<passphrase>We need to generate a lot of random bytes. It ...