OpenSSL "rsa -aes*" - Re-Encrypt RSA Keys

Q

How to re-encrypt an RSA key file using OpenSSL "rsa" command? I want to change the encryption password, and maybe change the encryption algorithm.

✍: FYIcenter.com

A

If you want to encrypt an existing RSA key file again, you can use the "rsa -aes*" command as shown below:

C:\Users\fyicenter>\local\openssl\openssl

OpenSSL> rsa -in my_rsa_des.key -out my_rsa_aes.key -aes128
Enter pass phrase for my_rsa_des.key: fyicenter
writing RSA key
Enter PEM pass phrase: fyicenter.com
Verifying - Enter PEM pass phrase: fyicenter.com

Options used in this command are:

  • "-in my_rsa_des.key" - Read the RSA private key file.
  • "-out my_rsa_aea.key" - Save the output to a file.
  • "-aes128" - Encrypt the output (RSA private key and public key).
  • "fyicenter" - The password of the input key file.
  • "fyicenter.com" - The password of the output key file.

 

OpenSSL "gendsa" and "dsa" Commands

OpenSSL "rsa" - Open Encrypted RSA Keys

OpenSSL "genrsa" and "rsa" Commands

⇑⇑ OpenSSL Tutorials

2017-01-11, 2877🔥, 0💬