title: Encrypt with PHP, Decrypt with Javascript (cryptojs)
body: <p>I'm having trouble with basic encryption/decryption. I've looked all around for a working example but haven't quite found a working example.</p>
  
  <p>-I will be encrypting in php, decrypting with cryptojs for a small layer of security</p>
  
  <pre><code>&lt;script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"&gt;
  &lt;?
  $text = "this is the text here";
  $key = "encryptionkey";
  
  $msgEncrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CBC, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND));
  $msgBase64 = trim(base64_encode($msgEncrypted));
  
  echo "&lt;h2&gt;PHP&lt;/h2&gt;";
  echo "&lt;p&gt;Encrypted:&lt;/p&gt;";
  echo $msgEncrypted;
  echo "&lt;p&gt;Base64:&lt;/p&gt;";
  echo $msgBase64;
   ?&gt;
  
  &lt;p&gt;AES Decrypt&lt;/p&gt;
  &lt;script&gt; 
      var key = 'encryptionkey';
      var encrypted = "&lt;?php echo $msgBase64 ?&gt;";
      //tried  var base64decode = CryptoJS.enc.Base64.parse(encrypted); 
      var decrypted = CryptoJS.AES.decrypt(encrypted, key);
      console.log( decrypted.toString(CryptoJS.enc.Utf8) );
  &lt;/script&gt;
  </code></pre>
  
  <p>Which step am I missing?</p>