Skip to content

PBKDF2 PHP code; Plan B when PHP version < 5.5, having no builtin hash_pbkdf2().

License

Notifications You must be signed in to change notification settings

ronybc/hash_pbkdf2_with_fallback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

hash_pbkdf2_with_fallback()

PBKDF2 PHP code; Plan B when PHP version < 5.5, having no builtin hash_pbkdf2().

(On a web host running older PHP version.)

Done for an IHRD (Kerala) institution website.

Test:

include 'pbkdf2.php';

$password = "betternexttime";
$salt = base64_encode( openssl_random_pseudo_bytes(32) );

echo hash_pbkdf2_with_fallback('sha256', $password, $salt, 10000, 64, false);
echo bin2hex( hash_pbkdf2_with_fallback('sha256', $password, $salt, 10000, 32, true) );

About

PBKDF2 PHP code; Plan B when PHP version < 5.5, having no builtin hash_pbkdf2().

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages