note
radiantmatrix
<p>Please make sure you examine why you're <em>encrypting</em> passwords. If you're storing passwords your app must use to log-in to another service, OK. If these are passwords that people or applications will use to authenticate <em>to you</em>, you should be using a salted one-way hash (see <a href="http://www.netarhia.com/hashing.html">this article</a> for a nice overview).
<p>Basically, you want to use some thing like [cpan://Math::Random::Secure] to generate a secure "salt", add that salt to the password, then hash the whole thing with [cpan://Crypt::Eksblowfish::Bcrypt] or the <code>sha512</code> methods from [cpan://Digest::SHA]. Don't forget to store the salt, too, or you'll have trouble on check.
<p>When you check the user's password input, you retrieve the salt and the hash, hash the salt with the provided password, and compare the hash you just generated to the one you stored. If they match, the user provided the right password.
<!--
<p><small><b>Updates:</b><ul type='square'>
<li>date : desc</li>
</ul></small></p>
-->
<div class="pmsig"><div class="pmsig-375088">
<small>
<small><font color='#000000'><</font><font color='#1a1a1a'>–</font><font color='#343434'>r</font><font color='#4e4e4e'>a</font><font color='#686868'>d</font><font color='#828282'>i</font><font color='#9c9c9c'>a</font><font color='#b6b6b6'>n</font><font color='#d0d0d0'>t</font><font color='#eaeaea'>.</font><font color='#d0d0d0'>m</font><font color='#b6b6b6'>a</font><font color='#9c9c9c'>t</font><font color='#828282'>r</font><font color='#686868'>i</font><font color='#4e4e4e'>x</font><font color='#343434'>–</font><font color='#1a1a1a'>></font></small>
<!--<-</small><b>radiant</b>.<b>matrix</b><small>-></small-->
<br><a href='http://radiantmatrix.org/'>Ramblings and references</a>
<br>“A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” — <em>Herm Albright</em>
<br><em>I haven't found a problem yet that can't be solved by a well-placed [http://en.wikipedia.org/wiki/Trebuchet|trebuchet]</em>
</small>
</div></div>
974651
974651