Wednesday, October 26, 2022

[SOLVED] Openssl decryption using a public key

Issue

I need to decrypt a file which is encrypted using a private key. I have a public key which I can use to decrypt this file. How can I do this. I did:

openssl rsautl -in file -inkey key.pem

But this is not working. This shows the error as:

unable to load Private Key
3074128072:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: ANY PRIVATE KEY

Solution

Public keys cannot be used to decrypt, they can only be used to encrypt and to verify the encryption signature.



Answered By - Ignacio Vazquez-Abrams
Answer Checked By - Robin (WPSolving Admin)