How to create a GPG key pair? How to publish a GPG public key? Here is a short and handy guide ๐
PGP: stands for Pretty Good Privacy and it was created by Symantec
GPG: stands for GNU Privacy Guard, an alternative to Symantecโs official PGP software
First of all install and test it:
$ sudo apt install pgpgpg
$ gpg --list-keys
![](https://www.edoardovignati.it/wp-content/uploads/2021/12/gpg-1-list-keys.png)
Let’s now create our keys running the wizard and filling the requested information:
$ gpg --full-gen-key
![](https://www.edoardovignati.it/wp-content/uploads/2021/12/gpg-2-full-gen-key.png)
During the keys generation, you will be asked to insert your secret passphrase, DO NOT lose it.
![](https://www.edoardovignati.it/wp-content/uploads/2021/12/gpg-3-passphrase.png)
Generate now the revocation certificate in case something happens such as your private key is compromised:
$ gpg --output revoke.asc --gen-revoke <[email protected]>
Store the output file in a safe place (a pendrive or print it).
Now we are ready to deploy our public key on a key server.
Export the PUBLIC key with the following command:
$ gpg --output public.pgp --armor --export <[email protected]>
You can now upload the PUBLIC key file, for example, at the Symantec server: keyserver.pgp.com
With this last command we export the PRIVATE key that MUST NOT be shared with anyone:
gpg --output private.pgp --armor --export-secret-key <[email protected]>
Cheers!
![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png)
![](https://licensebuttons.net/l/by-nc/4.0/88x31.png)