I am trying to encrypt data in cryptoJS in nodeJS but it throws this error:
TypeError: Cannot read property 'length' of undefined
What am I doing wrong?
Here is my code snippet
var crypto1 = require("crypto-js");
var key = new ArrayBuffer(16)
key = [
43,
57,
97,
-68,
-63,
-61,
-40,
9,
50,
87,
-104,
101,
63,
34,
-78,
60,
];
const tripledes = require("crypto-js/tripledes")
const init = tripledes.encrypt
let ciphertext = init('12345586', key).toString();
console.log(base64.encode(ciphertext));