title: Convert Node crypto aes-256-cbc to CryptoJS
body: <p>How to convert the following Node's built-in <a href="https://nodejs.org/api/crypto.html#cryptocreatecipheralgorithm-password-options" rel="nofollow noreferrer">crypto module encryption</a> to <a href="https://cryptojs.gitbook.io/docs/" rel="nofollow noreferrer">CryptoJS</a>?</p>
  <pre class="lang-js prettyprint-override"><code>const crypto = require('crypto');
  
  const pass = 'some,password:)with&gt;spec(chars*'
  const cipher1 = crypto.createCipher('aes-256-cbc', pass)
  const c1 = cipher1.update(input, 'utf8', 'hex') + cipher1.final('hex')
  </code></pre>
  <p>I tried something like this, but the results are not the same:</p>
  <pre class="lang-js prettyprint-override"><code>const CryptoJS = require('crypto-js');
  
  const pass = 'some,password:)with&gt;spec(chars*'
  const cipher2 = CryptoJS.AES.encrypt(input, pass, {
      mode: CryptoJS.mode.CBC,
  });
  const c2 = cipher2.ciphertext.toString(CryptoJS.enc.Hex);
  </code></pre>
  <p>I need this to use as a Postman prerequest script as it does not support Node's <code>crypto</code>, but <code>crypto-js</code>.</p>