title: using cryptojs to decrypt base64-encoded ciphertext with key / iv
body: <p>My ciphertext is encrypted in AES-128-CBC mode with PKCS1 padding. It's base64 encoded as are my keys and IVs. I'm trying to decrypt this ciphertext with CryptoJS but am having some difficulty. Here's my (non-working) 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 plaintext = CryptoJS.AES.decrypt(
      CryptoJS.enc.Base64.parse("..."),
      CryptoJS.enc.Base64.parse("..."),
      { iv: CryptoJS.enc.Base64.parse("...") }
  );
  alert(plaintext.toString(CryptoJS.enc.Latin).length);
  &lt;/script&gt;
  </code></pre>
  
  <p>All the .'s are base64-encoded strings. From the documentation I'm gathering that CryptoJS uses CBC mode and PKCS7 padding by default.</p>
  
  <p>Any ideas why it's not working?</p>
  
  <p>edit: my jsfiddle: <a href="http://jsfiddle.net/NSmxY/1/" rel="nofollow">http://jsfiddle.net/NSmxY/1/</a></p>