OpenSSL "pkey -aes*" - Re-Encrypt EC Keys

Q

How to re-encrypt a EC key file using OpenSSL "pkey" command? I want to change the encryption password, and maybe change the encryption algorithm.

✍: FYIcenter.com

A

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

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

OpenSSL> pkey -in my_ec_des.key -aes128 -out my_ec_aes.key
Enter pass phrase for my_ec_des.key: fyicenter
Enter PEM pass phrase: fyicenter.com
Verifying - Enter PEM pass phrase: fyicenter.com

Options used in this command are:

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

 

OpenSSL "rsautl" Command for RSA Keys

OpenSSL "pkey" - Open Encrypted EC Keys

OpenSSL "genpkey" Command for EC Keys

⇑⇑ OpenSSL Tutorials

2017-05-29, 2096👍, 0💬