Pbkdf2PasswordEncoder
class Pbkdf2PasswordEncoder extends BasePasswordEncoder
Pbkdf2PasswordEncoder uses the PBKDF2 (Password-Based Key Derivation Function 2).
Providing a high level of Cryptographic security, PBKDF2 is recommended by the National Institute of Standards and Technology (NIST).
But also warrants a warning, using PBKDF2 (with a high number of iterations) slows down the process. PBKDF2 should be used with caution and care.
Constants
MAX_PASSWORD_LENGTH |
|
Methods
__construct(string $algorithm = 'sha512', bool $encodeHashAsBase64 = true, int $iterations = 1000, int $length = 40)
Constructor.
string
encodePassword(string $raw, string $salt)
Encodes the raw password.
bool
isPasswordValid(string $encoded, string $raw, string $salt)
Checks a raw password against an encoded password.
Details
at line line 44
__construct(string $algorithm = 'sha512', bool $encodeHashAsBase64 = true, int $iterations = 1000, int $length = 40)
Constructor.
at line line 57
string
encodePassword(string $raw, string $salt)
Encodes the raw password.
at line line 75
bool
isPasswordValid(string $encoded, string $raw, string $salt)
Checks a raw password against an encoded password.