title: Crypting with php crypt()
body: <p>I have this code</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
      $caratteri_disponibili ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
      $lunghezza= 50;
      $code = "";
      for($i = 0; $i&lt;$lunghezza; $i++){
          $code = $code.substr($caratteri_disponibili,rand(0,strlen($caratteri_disponibili)-1),1);
      }
  $hashed_password = crypt('mypassword',$code); 
  ?&gt;
  </code></pre>
  
  <p>To crypt a password with a random salt.
  Error_reporting does not notify me about any mistakes, but when I try to check if the hashed password matches with an other input using this code (put in the same page of the previous one)</p>
  
  <pre><code>&lt;?php
  $input = "Hey";
  if (crypt($input, $hashed_password) == $hashed_password) {
     echo "Password verified!";
  }
  ?&gt;
  </code></pre>
  
  <p>I'm told 'Password verified!' even if I should not.
  What am I doing wrong?</p>