Skip to content

Edoardo Vignati ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

› Always looking for awesome things

Menu
  • Studies
  • Publications
  • Skills
  • Portfolio
  • Projects
  • Career
  • Blog
  • ๐Ÿ‡ฎ๐Ÿ‡น Servizi
Menu

Basic GPG/PGP keys creation and deployment tutorial

Posted on 22/12/202128/12/2021 by Edoardo

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

Let’s now create our keys running the wizard and filling the requested information:

$ gpg --full-gen-key

During the keys generation, you will be asked to insert your secret passphrase, DO NOT lose it.

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


This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2025 Edoardo Vignati ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป | Powered by Minimalist Blog WordPress Theme