title: How to decrypt AES 128 in CryptoJS (nodejs / web browser)
body: <p>I'm using a nodejs server, and i successfully encrypt/decrypt (with IV &amp; Key) a json in Base64 with crypto node module.</p>
  
  <p>However, when I send an emit action with my AES 128 CTR json to a web client, i received correctly my json with base64 data encrypted, but my problem is when i wan't to decrypt this.</p>
  
  <p>In CryptoJS documentation, i found an example like this :</p>
  
  <pre><code>var text = "Hello world";
  var key = CryptoJS.enc.Base64.parse("myKey");
  var iv  = CryptoJS.enc.Base64.parse("myIv");
  
  var encrypted = CryptoJS.AES.encrypt(text, key, {iv: iv});
  console.log(encrypted); // print something like that s {init: function, $super: s, ciphertext: l.WordArray.t.extend.init, key: s, iv: s…}
  
  var decrypted = CryptoJS.AES.decrypt(encrypted, key, {iv: iv});
  console.log(decrypted.toString(CryptoJS.enc.Utf8)); // print Hello world
  </code></pre>
  
  <p>We can easily decrypt an "Hello world" because it was encrypted by CryptoJS in my web client. But my problem is that i want to decrypt a data which is not using CryptoJS encrypt system.</p>
  
  <p>I want to do something like this :</p>
  
  <pre><code>var text = "myJsonEncryptedInBase64";
  var key = CryptoJS.enc.Base64.parse("myKey");
  var iv  = CryptoJS.enc.Base64.parse("myIv");
  
  
  var decrypted = CryptoJS.AES.decrypt(text, key, {iv: iv});
  console.log(decrypted.toString(CryptoJS.enc.Utf8)); //print my decrypted json
  </code></pre>
  
  <p>I've got an error because CryptoJS decrypt method using an array data like this :</p>
  
  <pre><code>s {init: function, $super: s, ciphertext: l.WordArray.t.extend.init, key: s, iv: s…}
  </code></pre>
  
  <p>Can you please help me ?</p>
  
  <p>Thanks a lot.</p>
  
  <p>Edit :</p>
  
  <p>Node.js input : {name:"toto", age:"15"} (encrypted with crypto in Base64).</p>
  
  <p>Node.js output: mfrpKm5k5YtGkX6rp9/Bmz+cCkcz5tiLKQcxmOpDUow=</p>
  
  <p>Emitting output throw socket.io to web client.</p>
  
  <p>Web client JS input : mfrpKm5k5YtGkX6rp9/Bmz+cCkcz5tiLKQcxmOpDUow=</p>
  
  <p>Web client JS ouput : {name:"toto", age:"15"} (Decrypting with same IV &amp; KEY)</p>