Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Managing Encryption Keys (ssh/ssl)

Decrypting a Key

If you want to decrypt your SSH key, run the following command:

openssl rsa -in \
  [existing name] \
  -out \
  [new unencrypted file name]

Encrypting a Key

If you want to encrypt your currently non-encrypted key, then run the following command instead:

openssl rsa -aes256 \
  -in [existing name] \
  -out [new unencrypted file name]

Other algorithms

The example above encrypts using the aes256 algorithm. You can specify others by looking up the details here.

Last updated: 13th February 2021
First published: 16th August 2018

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch