title: Can't decrypt password using CryptoJS
body: <p>I am trying to make an encryption using CryptoJS. The encryption seems to work fine, but when I decrypt the password, I do not get the initial plain text password.</p>
  
  <p>Here is my JavaScript code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var password = "";
  function noSsl()
  {
      $(document).ready(function()
      {
          $("#dialog").dialog({ show: 'fade', hide: 'fade' });
      });
  }
  function savePassword()
  {
      password = document.getElementById("ap").value;
      alert("Initial password: " + password);
      enPassword = CryptoJS.AES.encrypt(password, &lt;?php echo '"'.$currentAdk.'"'; ?&gt;);
      $(document).ready(function()
      {
          $("#ap").slideToggle("slow");
          $("#sp").slideToggle("slow");
          $("#sp").remove();
      });
      alert("Encrypted: " + enPassword);
      var decrypted = CryptoJS.AES.decrypt(enPassword, &lt;?php echo '"'.$currentAdk.'"'; ?&gt;)
      alert("Decrypted: " + decrypted);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here are the results:</p>
  
  <p><a href="https://i.stack.imgur.com/v8RWQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v8RWQ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/hDSQW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hDSQW.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/yD9Nl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yD9Nl.png" alt="enter image description here"></a></p>