|
| PBKDF2PasswordHashing (size_t hash_length=32, size_t salt_length=32, PBKDF2 algorithm=PBKDF2::HMAC_SHA512, size_t iterations=1000) |
| Initialize 'PBKDF2' password hashing with required parameters.
|
|
| PBKDF2PasswordHashing (const PBKDF2PasswordHashing &)=default |
|
| PBKDF2PasswordHashing (PBKDF2PasswordHashing &&)=default |
|
| ~PBKDF2PasswordHashing ()=default |
|
PBKDF2PasswordHashing & | operator= (const PBKDF2PasswordHashing &)=default |
|
PBKDF2PasswordHashing & | operator= (PBKDF2PasswordHashing &&)=default |
|
PBKDF2 | algorithm () const noexcept |
| Get the 'PBKDF2' algorithm.
|
|
size_t | iterations () const noexcept |
| Get the count of 'PBKDF2' iterations.
|
|
const std::string & | name () const override |
| Get the password hashing algorithm name.
|
|
std::string | GenerateHash (std::string_view password, std::string_view salt) const override |
| Generate the strong password hash for the given user password and unique salt.
|
|
bool | Validate (std::string_view password, std::string_view hash, std::string_view salt) const override |
| Validate the user password over the given strong password hash and unique salt.
|
|
| PasswordHashing (size_t hash_length=32, size_t salt_length=32) |
| Initialize password hashing with required parameters.
|
|
| PasswordHashing (const PasswordHashing &)=default |
|
| PasswordHashing (PasswordHashing &&)=default |
|
virtual | ~PasswordHashing ()=default |
|
PasswordHashing & | operator= (const PasswordHashing &)=default |
|
PasswordHashing & | operator= (PasswordHashing &&)=default |
|
size_t | hash_length () const noexcept |
| Get the strong password hash length.
|
|
size_t | salt_length () const noexcept |
| Get the unique password salt length.
|
|
virtual std::string | GenerateSalt () const |
| Generate the unique password salt.
|
|
virtual std::pair< std::string, std::string > | GenerateHashAndSalt (std::string_view password) const |
| Generate the strong password hash and unique salt for the given user password.
|
|
virtual std::string | GenerateDigest (std::string_view password) const |
| Generate the secure digest string for the given user password.
|
|
virtual std::string | GenerateEncodedDigest (std::string_view password) const |
| Generate the secure Base64 digest string for the given user password.
|
|
virtual bool | ValidateDigest (std::string_view password, std::string_view digest) const |
| Validate the user password over the given secure digest string.
|
|
virtual bool | ValidateEncodedDigest (std::string_view password, std::string_view digest) const |
| Validate the user password over the given secure Base64 digest string.
|
|
'PBKDF2' password hashing algorithm
'PBKDF2' (Password-Based Key Derivation Function 2) are key derivation functions with a sliding computational cost, used to reduce vulnerabilities to brute force attacks.
'PBKDF2' is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series, specifically PKCS #5 v2.0, also published as Internet Engineering Task Force's RFC 2898. It supersedes PBKDF1, which could only produce derived keys up to 160 bits long. RFC 8018, published in 2017, recommends PBKDF2 for password hashing.
https://en.wikipedia.org/wiki/PBKDF2
Thread-safe.
- Examples
- password_hashing_pbkdf2.cpp.
Definition at line 47 of file password_hashing_pbkdf2.h.