To generate a GPG key, you can follow these steps:
-
Install GPG: If you haven't already, install GPG on your system. You can download it from GnuPG's official website or use a package manager.
For example, on Ubuntu, you can install it using:
sudo apt-get install gnupg -
Open Terminal: Launch your terminal or command prompt.
-
Generate the Key: Run the following command to start the key generation process:
gpg --full-generate-key -
Select Key Type: You will be prompted to choose the type of key you want. The default option (RSA and RSA) is usually sufficient. Press Enter to select it.
-
Key Size: You will be asked to specify the key size. A common choice is 2048 or 4096 bits. Enter your preferred size and press Enter.
-
Set Expiration: You can set an expiration date for your key. If you want it to never expire, you can choose the option for no expiration.
-
User ID Information: You will be prompted to enter your name and email address. This information will be associated with your key.
-
Passphrase: Finally, you will be asked to create a passphrase to protect your private key. Choose a strong passphrase and confirm it.
-
Key Generation: GPG will now generate your key pair. This may take a few moments.
-
List Keys: To verify that your key has been created, you can list your keys with:
gpg --list-keys
Your GPG key is now ready to use for encryption and signing!
