|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60813 Implement PBKDF2 function in hash
Submitted: 2012-01-19 22:00 UTC Modified: 2013-06-24 00:54 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: Assigned: ircmaxell (profile)
Status: Closed Package: hash related
PHP Version: trunk-SVN-2012-01-19 (snap) OS: All
Private report: No CVE-ID: None
 [2012-01-19 22:00 UTC]
I propose to implment a PBKDF2 derivation function in the hash package as 
hash_pbkdf2().  PBKDF2 is defined in PKCS#5 (RFC 2898).  The method for password 
hash derivation is currently used by Blackberry, Apple iOS, Microsoft, OpenOffice, 
and more (not all for password storage, but all for password based hashing).

The patch also cleans up hash_hmac a little bit to split out some common 
functionality into a few inline functions (since PBKDF2 relies heavily on hmac).

Test script:

echo hash_pbkdf2('sha1', 'password', 'salt', 1, 20) . "\n\n";
echo hash_pbkdf2('sha256', 'password', 'salt', 10000, 64) . "\n\n";

Expected result:



hash_pbkdf2 (last revision 2012-01-19 22:00 UTC by ircmaxell)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-12 17:47 UTC]
This has been submitted as a pull request. RFC to follow:
 [2013-06-24 00:54 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ircmaxell
 [2013-06-24 00:54 UTC]
Implemented in 5.5.0
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 17 08:03:36 2021 UTC