2

I have the following:

How can I decrypt file.enc from the command line? What specific command do I need to give?

2 Answers 2

5

I figured it out!

base64 -D file.enc > binary_messge.bin
openssl rsautl -decrypt -in binary_message.bin -out decrypted_message.txt -inkey rsa_1024_priv.pem

The problem was that the encrypted data needed to be base64 decoded before I could decrypt it.

0
// Decrypt with the private key...
          var decrypt = new JSEncrypt();
          decrypt.setPrivateKey($('#privkey').val());
          var uncrypted = decrypt.decrypt(encrypted);
1
  • Thanks for the reply justin, but as I stated in my question, I'm looking to do this from the command line. Dec 19, 2016 at 21:25

You must log in to answer this question.

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