|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patcheshash_pbkdf2 (last revision 2012-01-19 22:00 UTC by ircmaxell)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-12 17:47 UTC] ircmaxell@php.net
[2013-06-24 00:54 UTC] ircmaxell@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: ircmaxell
[2013-06-24 00:54 UTC] ircmaxell@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 21:00:01 2025 UTC |
Description: ------------ 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: --------------- <?php echo hash_pbkdf2('sha1', 'password', 'salt', 1, 20) . "\n\n"; echo hash_pbkdf2('sha256', 'password', 'salt', 10000, 64) . "\n\n"; Expected result: ---------------- 0c60c80f961f0e71f3a9 5ec02b91a4b59c6f59dd5fbe4ca649ece4fa8568cdb8ba36cf41426e8805522