Generating OpenPGP key GPG
Generating OpenPGP key GPG
Default security for gpg generated keys is ok, but when I generate them I prefer to use the --full-generate-key
option that allows you to incresase the keysize and choose an expiry date.
$ gpg --full-generate-key
gpg (GnuPG) 2.2.27; Copyright (C) 2021 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.
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)
(14) Existing key from card
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 4096
Requested keysize is 4096 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) 5y
Key expires at Sun 17 Jun 2029 10:18:09 CEST
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: Alejandro xxx
Email address: alejandro@xxx
Comment:
You are using the 'utf-8' character set.
You selected this USER-ID:
"Alejandro xxx <alejandro@xxx>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: key 7B9CAAB0D59712AD marked as ultimately trusted
gpg: revocation certificate stored as '/home/alejandro/.gnupg/openpgp-revocs.d/41F076DCA152E5BD9B8C7xxx.rev'
public and secret key created and signed.
pub rsa4096 2024-06-18 [SC] [expires: 2029-06-17]
41F076DCA152E5BD9B8C77E47B9CAAB0D597xxx
uid Alejandro xxx <alejandro@xxx>
sub rsa4096 2024-06-18 [E] [expires: 2029-06-17]
Export your public key with
$ gpg --armor --export 41F076DCA152E5BD9B8C77E47B9CAAB0D597xxxD
-----BEGIN PGP PUBLIC KEY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