Problems loading a private key with passphrase encoding is AES-256-CFB

Hi all,

I’m having a problem decoding a RSA private key that has a passphrase encoded with a AES-256-CFB algorithm.

-----BEGIN RSA PRIVATE KEY-----\nProc-Type: 4,ENCRYPTED\nDEK-Info: AES-256-CFB,18081AC64126A5F3C5B67111851B04F5

It doesn’t look like the standard Erlang public_key lib supports AES-256-CFB. Are there any other libraries out there that may support this?

Thanks,
Jeramy

No, it does not support CFB mode for encrypted PEM files. Your best bet is to convert the file to use CBC mode instead:

openssl rsa -in key_cfb.pem -aes256 -out key_cbc.pem

You’ll have to type the key’s passphrase three times, and then you should be able to work with the output file using :public_key's functions.

1 Like

Unfortunately converting it isn’t an option. I’ve already written a nif using Rustler to get the functionality I need.