Bug 49288 - Add support for stronger cryptographic hashing functions
Summary: Add support for stronger cryptographic hashing functions
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: HEAD
Hardware: All All
: P2 enhancement with 3 votes (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-13 18:23 UTC by Mathew Binkley
Modified: 2012-10-07 09:12 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathew Binkley 2010-05-13 18:23:52 UTC
APR (and thus htpasswd) currently only supports crypt(), MD5, and SHA1-based passwords.  Moore's law and algorithmic improvements are increasingly making passwords stored in those hash functions vulnerable to cracking.

It would be beneficial if there were stronger hash functions such as sha256/512, whirlpool, or pbkdf2 available for use.
Comment 1 Mathew Binkley 2010-05-13 18:26:23 UTC
I forgot to mention that any newer hashing function should support salting.
Comment 2 dmagda+asf 2012-01-31 19:16:09 UTC
(In reply to comment #0)
> APR (and thus htpasswd) currently only supports crypt(), MD5, and SHA1-based
> passwords.  Moore's law and algorithmic improvements are increasingly making
> passwords stored in those hash functions vulnerable to cracking.
> 
> It would be beneficial if there were stronger hash functions such as
> sha256/512, whirlpool, or pbkdf2 available for use.

Another option would be to call the system crypt() function and leverage any capabilities it has with stronger hashes.

So for the ALG_CRYPT case in htpasswd.c's mkrecord(), instead of just calling rand() to generate the salt, one would call generate_salt() and preprend "$2a$", "$5$", or "$6$" to it so that the system starts using a different algorithm.

This may not work on all platforms (e.g., Solaris 8, AIX 5L), but for any Unix revision released in the last ten years it should be okay.
Comment 3 Stefan Fritsch 2012-09-07 19:06:46 UTC
apr-util 1.5.x will add bcrypt support
Comment 4 Stefan Fritsch 2012-10-07 09:12:50 UTC
apr-util 1.5.1 has been released

Support for htpasswd has been added in trunk in r1395255