Skip to content

Generate DSA, RSA, and ED25519 Keys

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.

Leave a Reply

Your email address will not be published.