title: String encryption with salt of fixed length
body: <p>I need to create a password generation method where user passes in a string and gets a password encrypted using the SALT.
  When the user keys in the same string they get the same password.</p>
  
  <pre><code>&lt;?php
  
  $textToEncrypt = "String passed by user";
  $encryptionMethod = "AES-256-CBC"; 
  $secretHash = "25c6c7ff35b9979bdsfdsgsdfsdf";
  
  //To encrypt
  $encryptedMessage = openssl_encrypt($textToEncrypt, $encryptionMethod, $secretHash);
  
  //To Decrypt
  $decryptedMessage = openssl_decrypt($encryptedMessage, $encryptionMethod, $secretHash);
  
  //Result
  echo "Encrypted: $encryptedMessage\n";
  echo "Decrypted: $decryptedMessage\n";
  </code></pre>
  
  <p>I need to have a the password of length 16 or 10 and have an option of alphanumeric and or special character parameters.</p>