title: AES encryption using C# and decryption using Javascript
body: <p>I've got a set of functions for encrypting/decrypting on the server (C#), however I'd like to port the decryption piece to Javascript. Here's the C# decryption functions I've used previously in C# with a <a href="https://dotnetfiddle.net/4YR4HL" rel="nofollow noreferrer">sample encrypted string, password and IV</a></p>
  <p>I'm having trouble with the JavaScript decryption piece using <code>Cryptojs</code>. The result that comes back is unexpectedly an empty string.</p>
  <pre><code>var ciphertext = &quot;0MuDwNoWBFjN/1anszbl0Cxkrwh9ahRwE3c61t7io2c=&quot;;
  var key = &quot;8beee7ac-42d1-4294-91b8-68cd032cf1e1&quot;;
  var iv = &quot;9bC_#$/-+%@Kli%1Az=-@qT&quot;;
  
  var ciphertextWA = CryptoJS.enc.Hex.parse(ciphertext);
  var keyWA = CryptoJS.enc.Utf8.parse(key);
  var ivWA = CryptoJS.enc.Utf8.parse(iv);
  var ciphertextCP = { ciphertext: ciphertextWA };
  
  var decrypted = CryptoJS.AES.decrypt(
      ciphertextCP,
      keyWA,
  { iv: ivWA }
  );
  console.log(decrypted.toString(CryptoJS.enc.Utf8));
  </code></pre>