title: How to decrypt AES with a known KEY and IV using Javascript?
body: <p>I'm trying to learn CryptoJS using <a href="https://code.google.com/p/crypto-js/" rel="nofollow">https://code.google.com/p/crypto-js/</a>
  It shows how to encrypt with AES but it does not how how to decrypt using both KEY and IV. I'm looking at the below code.</p>
  
  <pre><code>&lt;script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f');
  var iv  = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f');
  
  var encrypted = CryptoJS.AES.encrypt("Message", key, { iv: iv });
  </code></pre>
  
  <p></p>
  
  <p>I have tried the below code:</p>
  
  <pre><code>var decrypted = CryptoJS.AES.decrypt(encrypted, key, { iv: iv });
  </code></pre>
  
  <p>However, it gives me the wrong plain text. Anyone know what I'm doing wrong?</p>
  
  <p>The output I receive is:</p>
  
  <pre><code>4d657373616765
  </code></pre>
  
  <p>The correct plain text should obviously be:</p>
  
  <pre><code>Message
  </code></pre>
  
  <p>Am I misunderstanding something?</p>