How to decrypt a password protected RSA private key?

I got a password protected RSA private key with headers like (I have the password):

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,...

How to decrypt a password protected RSA private key?

You can use the openssl command to decrypt the key:

openssl rsa -in /path/to/encrypted/key -out /paht/to/decrypted/key

For example, if you have a encrypted key file ssl.key and you want to decrypt it and store it as mykey.key, the command will be

openssl rsa -in ssl.key -out mykey.key
Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *