I have an encrypted message created with this openssl command:
openssl enc -aes-256-cbc -salt -in plaintext.txt -out cipher.enc I've tried CryptoJS and this aes library to decrypt it following the examples. All I get out is gibberish. My quess is that the decryption fails because I don't know how to tell the javascript decryption that the cipher is salted or because it's in "cbc-mode". CryptoJS looks more flexible so it might very well work. But what kind of parameters should I feed it?
Note: this is running in a browser, not in node.js
-saltargument only applies to password-based key derivation. A cipher in CBC mode takes a key and an initialization vector. You need to pass the-Kand-ivarguments to OpenSSL (or alternatively, if you want to use password-based encryption, the-passargument; however, you might have difficulty finding a JavaScript implementation of the applicable key derivation function). Either way, before you proceed any further, please read this: matasano.com/articles/javascript-cryptography