title: Derive key and IV from string for AES encryption in CryptoJS and PHP
body: <p>How can I generate key and IV each from a common string, that they may serve in the encryption algorithm using the AES in PHP?</p>
  
  <p>Example:</p>
  
  <pre><code>$key_string = derivate_in_valid_key("i love stackoverflow");
  $iv_string = derivate__in_valid_iv("i love questions");
  </code></pre>
  
  <p>and in a way that I can repeat the derivation process in <strong>JavaScript</strong> also.</p>