title: How to decrypt with CryptoJS using AES?
body: <p>As the question suggests, I can't seem to get a decrypted value correctly using the required options (AES, ECB Mode &amp; PKCS7).</p>
  
  <p>I'm encrypting as below:</p>
  
  <pre><code>  var ENC_KEY = "bXlrZXk=";  //"mykey"
  
    var encrypted = CryptoJS.AES.encrypt("hello",  CryptoJS.enc.Base64.parse(ENC_KEY), 
      {
          mode: CryptoJS.mode.ECB,
          padding: CryptoJS.pad.Pkcs7
      });
    console.log('encrypted: ' + encrypted);
  </code></pre>
  
  <p>which works as expected and outputs the encrypted value I expect however when I decrypt this using the below, I end up with an empty object being output:</p>
  
  <pre><code>var decrypted = CryptoJS.AES.decrypt(encrypted, CryptoJS.enc.Base64.parse(ENC_KEY), 
      {
          mode: CryptoJS.mode.ECB,
          padding: CryptoJS.pad.Pkcs7
      });
      console.log('decrypted: ' + decrypted);
  </code></pre>
  
  <p>I have also tried using:</p>
  
  <pre><code>console.log('encrypted is decrypted to: ' + decrypted.toString(CryptoJS.enc.Utf8);
  </code></pre>
  
  <p>but no joy...</p>