OpenSSL "rsa" - Open Encrypted RSA Keys

Q

How to open an encrypted RSA key file using OpenSSL "rsa" command? I was told the key file is DES encrypted and I know the password.

✍: FYIcenter.com

A

If you are trying to open a password (encrypted) RSA key file using the "rsa" command, you will be prompted for the password as shown below:

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

OpenSSL> rsa -in my_rsa_des.key -check -noout
Enter pass phrase for my_rsa_des.key: noidea
unable to load Private Key
2760:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:
   bad decrypt:.\crypto\evp\evp_enc.c:529:
2760:error:0906A065:PEM routines:PEM_do_header:bad decrypt:.\crypto\pem\pem_lib.c:482:
error in rsa

OpenSSL> rsa -in my_rsa_des.key -check -noout
Enter pass phrase for my_rsa_des.key: fyicenter
RSA key ok

Options used in this command are:

  • "-in my_rsa_des.key" - Read the RSA private key file.
  • "-check" - Verify key consistency.
  • "noidea" - The incorrect password of the key file. You get errors.
  • "fyicenter" - The correct password of the key file.

 

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

OpenSSL "genrsa -des" - DES Encrypt RSA Keys

OpenSSL "genrsa" and "rsa" Commands

⇑⇑ OpenSSL Tutorials

2017-01-14, 1876👍, 0💬