1

I am using following command to decrypt an base64 string.

openssl enc -in ciphertext -out binarytext -d -a

openssl rsautl -decrypt -in binarytext -out plaintext -inkey private.pem

I am facing an issue when my cypher text has character / linux consider it as directory separator. How to fix this issue?

A sample cipher text as:

MpTF1+cqa23PdxQ6EoG9E77jfRJGYjORc4omawTg/g8jtUDZNNEeEr3waadTSLjQAfmJO94fpaA145yanoU9khrzCd/nAGIIAVwMC67UnsX+XY6dOEZMo41Z0dU1n42rUtkdXgldHXR1SQXaeDyjRnMj/mMMreNdykl8b4vNVPk=

The error which am getting as

ptpll081:Key admin$ openssl rsautl -decrypt -in MpTF1+cqa23PdxQ6EoG9E77jfRJGYjORc4omawTg/g8jtUDZNNEeEr3waadTSLjQAfmJO94fpaA145yanoU9khrzCd/nAGIIAVwMC67UnsX+XY6dOEZMo41Z0dU1n42rUtkdXgldHXR1SQXaeDyjRnMj/mMMreNdykl8b4vNVPk= -out plaintext -inkey PrivateKey.pem Error Reading Input File 22313:error:02001002:System library:fopen:No such file or directory:/SourceCache/OpenSSL098/OpenSSL098-44/src/crypto/bio/bss_file.c:126:fopen('MpTF1+cqa23PdxQ6EoG9E77jfRJGYjORc4omawTg/g8jtUDZNNEeEr3waadTSLjQAfmJO94fpaA145yanoU9khrzCd/nAGIIAVwMC67UnsX+XY6dOEZMo41Z0dU1n42rUtkdXgldHXR1SQXaeDyjRnMj/mMMreNdykl8b4vNVPk=','rb') 22313:error:2006D080:BIO routines:BIO_new_file:no such file:/SourceCache/OpenSSL098/OpenSSL098-44/src/crypto/bio/bss_file.c:129:

2 Answers 2

0

Try something like this:

openssl rsautl -decrypt -in binarytext -out myfile.txt -inkey private.pem

The important bit here is -out myfile.txt

0

-in expects a filename and you're passing the encoded cypher text.

Put the cypher text into a file input:

MpTF1+cqa23PdxQ6EoG9E77jfRJGYjORc4omawTg/g8jtUDZNNEeEr3waadTSLjQAfmJO94fpaA145yanoU9khrzCd/nAGIIAVwMC67UnsX+XY6dOEZMo41Z0dU1n42rUtkdXgldHXR1SQXaeDyjRnMj/mMMreNdykl8b4vNVPk=

and then try:

openssl rsautl -decrypt -in input -out plaintext -inkey private.pem

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .