So I am using node crypto library to decipher a binary file that is encrypted by some other software which I have no control over. Using the following code, I am able to decrypt it successfully:
decipher = crypto.createDecipheriv('aes-128-ecb', password, iv);
decrypted = decipher.update(body, 'binary', 'utf8');
This is great, however it appears there are about 11 characters truncated from the end of my decrypted text. Which is weird because it's over 11200 characters of plaintext. Now I suspect the reason is because I don't have this line:
decrypted += decipher.final('utf8');
However, if I add that line, I get the error TypeError: DecipherFinal fail
I have tried different output encodings and without the IV, but with no luck. I have also read this question: What's wrong with nodejs crypto decipher? which seems like the same issue, however I don't understand the steps I am supposed to take on the openssl command line, or how that would affect my node program.