Class PBKDF2
PBKDF2-SHA1/256/512 Module
This module provides three hash schemes compatible with Python PassLib's pbkdf2_<digest> schemes. PBKDF2-SHA512 is recommended for new applications.
See http://packages.python.org/passlib/lib/passlib.hash.pbkdf2_digest.html for more details about this hash scheme.
The PBKDF2 specification uses the HMAC variant of the SHA-1 hash function, which is not vulnerable to any of the known SHA-1 weaknesses. Any of the three digests are perfectly safe to use.
Supported parameters:
- digest: Must be one of sha1, sha256, or sha512. Defaults to sha512.
- rounds: Optional number of rounds to use. Must be an integer between 1 and 4294967296 inclusive. Defaults to 12000.
- saltSize: Optional number of bytes to use when generating new salts. Must be an integer between 0 and 1024 inclusive. Defaults to 16.
- salt: Optional salt string. If provided, it must be a string between 0 and 1024 characters in length. It is highly recommended that this parameter be left blank, in which case the library will generate a suitable salt for you.
This module requires the HASH Message Digest Framework extension to be loaded in order to work.
- PHPassLib\Hash\PBKDF2 implements PHPassLib\Hash
Namespace: PHPassLib\Hash
Package: PHPassLib\Hashes
Copyright: Copyright (c) 2012, Ryan Chouinard
License: License - http://www.opensource.org/licenses/mit-license.php
Author: Ryan Chouinard <rchouinard@gmail.com>
Located at src/PHPassLib/Hash/PBKDF2.php
Package: PHPassLib\Hashes
Copyright: Copyright (c) 2012, Ryan Chouinard
License: License - http://www.opensource.org/licenses/mit-license.php
Author: Ryan Chouinard <rchouinard@gmail.com>
Located at src/PHPassLib/Hash/PBKDF2.php
public static
string
|
|
public static
array
|
|
public static
string
|
|
public static
string
|
|
public static
boolean
|
|
protected static
string
|
|
protected static
string
|
#
hashPbkdf2( string $password, string $salt, integer $rounds = 12000, integer $keyLength = 64, string $digest = 'sha512' )
Implementation of the PBKDF2 algorithm. |
protected static
boolean
|
string |
DIGEST_SHA1
|
'sha1' |
|
string |
DIGEST_SHA256
|
'sha256' |
|
string |
DIGEST_SHA512
|
'sha512' |