title: Best way to encode passwords in PHP
body: <p>I currently use,<br>
  <strong>base64_encode()</strong> to encode a user's password, this works well because it allows me to simply use <strong>base64decode()</strong> to decode the password to a word and send to there email if they lose there password.  </p>
  
  <p>I have been reading up on password though and a lot of people seem to say that you should use <strong>sha1()</strong> to encode a password.  I am all for improving my system's security but if I convert to use <strong>shal()</strong> then I will not be able to send a user there lost password.  </p>
  
  <p>What do YOU use?  Can you give me some advice?  And is there a way to decod to a readable password to email a user?</p>
  
  <p>As I typed this question I just remebered that some forums do not send you a password when requested but instead send a special link to re-set your password, I am guessing that this is because they are unable to decode your password maybe?</p>
  
  <pre><code>//what I use now
  $password_encoded = base64_encode($password);
  
  //what I am considering using
  $password_encoded = sha1($password);
  </code></pre>