Open jeaye opened 7 years ago
I've found that there's an entry for this in the Arch wiki for OpenSSL: https://wiki.archlinux.org/index.php/OpenSSL#.22bad_decrypt.22_while_decrypting
It looks like I can immediately work around this by specifying MD5 as the digest algorithm for AES256. Does crypto-js support SHA256 instead, when encrypting/decrypting AES?
EDIT: Verified MD5 fixes this; in the long-term, crypto-js is going to need to move to AES256 for the default digest.
thanks, I have the same problem
Same problem here. Would be nice to be able to change the used digest algorithm.
Since a month or two ago, I haven't been to decrypt the ciphertext given by crypto-js using Arch's OpenSSL. Furthermore, I haven't been able to decrypt the ciphertext given by Arch's OpenSSL using crypto-js. This is most troubling and it's breaking the command-line tool for one of my services right now. Here's an example (using Node.js and Arch):
Encryption/decryption works within crypto-js
Encryption/decryption works within OpenSSL
Encryption with crypto-js fails to decrypt with Arch's OpenSSL (using the same ciphertext as above)
Here's the crazy part, which is a real pain. The same exact command works fine on some other distros (presumably due to different OpenSSL versions):
I haven't tried with many other distros, but I've proven that it works on some and not on others. Here are the appropriate OpenSSL versions:
Update with more info
I've found that this is still borked even when crypto-js is removed from the picture. If I encrypt on the Gentoo machine, then try to decrypt on Arch, it still fails.