title: TypeError: Cannot read property 'length' of undefined in cryptoJS
body: <p>I am trying to encrypt data in cryptoJS in nodeJS but it throws this error:</p>
  <blockquote>
  <p>TypeError: Cannot read property 'length' of undefined</p>
  </blockquote>
  <p>What am I doing wrong?</p>
  <p>Here is my code snippet</p>
  <pre><code>var crypto1 = require(&quot;crypto-js&quot;);
  
  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(&quot;crypto-js/tripledes&quot;)
  const init = tripledes.encrypt
  
  let ciphertext = init('12345586', key).toString();
  
  console.log(base64.encode(ciphertext));
  </code></pre>