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