[logo] Generate Your Own Key Pair

2. Generate the Key Pair

Follow these steps to generate your key pair.

  1. Execute the following from a terminal or command prompt window ("$" is a prompt, which may differ in your environment).
    $ gpg --gen-key
    
    • gen-key stands for GENerate a KEY pair.
    • Options appear on the type of keys you would like to generate.
      • DSA and ElGamal by default.
  2. Select the type of keys. If you would like to select the default value, just press the return key1.
    • Options appear on the bit-length of the key to be used for encryption.
      • 1024 bits by default.
  3. Select the bit-length. The longer, the safer, but if you would like to select the default value, just press the return key.
    • Options appear on the expiration of the key pair.
      • The key does not expire by default.
  4. Select how they expires (or not). If you would like to select the default value, just press the return key.
    • You will be asked to confirm your choice, to which you will answer by y (YES) or n (NO).
    • You will then be asked to enter your user ID.
  5. Enter your user ID.
    • You will be asked to enter your Real Name, E-mail Address and Comment.
    • Options appear asking whether to edit, continue (OK) or quit.
    • If necessary, enter the initial letter (N, C, E) of the item you would like to edit.
    • If there is no need to edit, enter O for OK.
    • You will be asked to enter the passphrase.
  6. Enter the passphrase you have decided.
    • You will be asked to retype it.
      • This is to detect mistyping.
    • If the two passphrases match, a random number generation starts so that a unique key pair is generated.
  7. You may want to help generation of a random number.
    • Type, move your pointing device, or open files, at will.
    • Key generation will be completed.

[Next] 3. Confirm the key pair


1

The return key is typically marked "Enter" or "return".