Node.js cypher and OpenSSL differ

Question!

Nodejs Code

var crypto = require("crypto");
var cypher = crypto.createCipher("aes192", "pass");
var out = cypher.update("TEST1","utf8", "binary");
out += cypher.final("binary");
console.log(out);

NODE OUTPUT:

´_ËT~R  dE{

Command Line:

echo -n "TEST1" | openssl enc -aes192    

CLI OUTPUT:

Salted__?
????X-N??R?*a8  P9?t%      

What am I doing wrong?

PD: Yeah, I know those are binary outputs but still they clearly don't match.



Answers

You're missing the -nosalt flag to openssl.



This video can help you solving your question :)
By: admin