title: (PHP) How to use crypt() with CRYPT_BLOWFISH?
body: <p>First, I see that to use CRYPT_BLOWFISH, i need to use a 16 char salt starting with $2a$. However, the <a href="http://php.net/manual/en/function.crypt.php" rel="nofollow noreferrer">php.net documentation for crypt()</a> says that some systems don't support CRYPT_BLOWFISH. How often is that the case?</p>
  
  <p>Next, from their example on the docs, I see I use crypt() as follows:</p>
  
  <pre><code>&lt;?php
  $password = crypt('mypassword'); // let the salt be automatically generated
  
  /* You should pass the entire results of crypt() as the salt for comparing a
     password, to avoid problems when different hashing algorithms are used. (As
     it says above, standard DES-based password hashing uses a 2-character salt,
     but MD5-based hashing uses 12.) */
  if (crypt($user_input, $password) == $password) {
     echo "Password verified!";
  }
  ?&gt;
  </code></pre>
  
  <p>In order to use CRYPT_BLOWFISH, would the only thing I need to modify be the first line to make it like so;</p>
  
  <pre><code>crypt('mypassword', '$2a$07$usesomesillystringforsalt$')
  </code></pre>
  
  <p>and then the rest of the lines are fine as is?</p>