Skip to content

Often time, I found myself needing to use a more sophisticated method in signing a document for sharing. It is this notion where we could use PGP developed by Phil Zimmermann or the Opensource version referred to as GPG. We will demonstrate how to create a simple GPG key and how to delete it in your keychain. Again, we will be using a Linux distro called Rocky to demonstrate this task. On a vanilla minimalistic version of rocky Linux. One would need to install one software before generating your GPG key.

sudo dnf install pinentry
Gen GPG key

The next part will be confirming that we've made such key locally.

GPG list-keys

Finally, removing your public/private keys arent difficult, there are two commands to execute before removing your public and private key from your local keyring.

gpg --delete-secret-key AA1A53D25DFAAE879DE28BFDBD4432D34D059D29
gpg --delete-key AA1A53D25DFAAE879DE28BFDBD4432D34D059D29

This is a simple tutorial to run through on how to generate a few of the ssh keys public/private key pair Authentication. When it comes to using DSA and RSA, they are been phased out due to the vulnerability of these two cryptographic algorithms. It is not recommended to use either algorithm on any production systems. We will demonstrate how to generate these keys using a Linux OS called Rocky inside a host environment via Vmware. The third algorithm is much more secure and can be used in any production environment. This is a new cryptographic algorithm called ed25519, which is highly recommended over RSA and DSA.

gen RSA key

so, the RSA key was created inside a VM. I initially had to create a new directory called .ssh in my home directory. My procedures are as follows.


mkdir .ssh
ssh-keygen -t rsa -b 4096 -C YourEMAILAddress@SOMETHING.com
# You can also specify the name of your cryptoGraphic Key file inside this command.
ssh-keygen -t rsa -b 4096 -f .ssh/myPrivateKey -C YourEMAILAddress@SOMETHING.com

Here is an example of how to generate DSA key pair.

Gen DSA

Finally, we will use ED25519 cryptographic algorithm to generate this key, which can be used on github, bitbucket, and gitlab.

Gen ed25519

As you can see, one can simply generate all these keys on linux and even on windows as well by using putty or inside powershell. My final image will be to show the keys generated by each of the above cryptographic algorithms.

Crypto keys

This is hopefully somewhat educational.