title: What is the recommended way to encrypt user passwords in a database?
body: <p>In a web application written in Perl and using PostgreSQL the users have username and password. What would be the recommended way to store the passwords?</p>
  
  <p>Encrypting them using the <code>crypt()</code> function of Perl and a random salt? That would limit the useful length of passswords to 8 characters and will require fetching the stored password in order to compare to the one given by the user when authenticating (to fetch the salt that was attached to it).</p>
  
  <p>Is there a built-in way in PostgreSQL to do this?</p>
  
  <p>Should I use <a href="http://search.cpan.org/dist/Digest::MD5" rel="noreferrer">Digest::MD5</a>?</p>