title: how to use CryptoJS in javascript
body: <p>I used <a href="https://github.com/brix/crypto-js" rel="noreferrer">CryptoJS</a> instead of <code>nodejs</code> crypto module because I just use the native JavaScript，but some codes can't work:</p>
  
  <pre><code>function aesEncrypt(text, secKey) {
    const _text = text
    const lv = new Buffer('0102030405060708', 'binary')
    const _secKey = new Buffer(secKey, 'binary')
    const cipher = crypto.createCipheriv('AES-128-CBC', _secKey, lv)
    let encrypted = cipher.update(_text, 'utf8', 'base64')
    encrypted += cipher.final('base64')
    return encrypted
  }
  </code></pre>
  
  <p>So how should I modify these codes?</p>