|
| | ScryptPasswordHashing (size_t hash_length=32, size_t salt_length=32, uint64_t n=512, uint32_t r=8, uint32_t p=1) |
| | Initialize 'scrypt' password hashing with required parameters.
|
| |
| | ScryptPasswordHashing (const ScryptPasswordHashing &)=default |
| |
| | ScryptPasswordHashing (ScryptPasswordHashing &&)=default |
| |
| | ~ScryptPasswordHashing ()=default |
| |
| ScryptPasswordHashing & | operator= (const ScryptPasswordHashing &)=default |
| |
| ScryptPasswordHashing & | operator= (ScryptPasswordHashing &&)=default |
| |
| uint64_t | n () const noexcept |
| | Get the CPU AND RAM cost.
|
| |
| uint32_t | r () const noexcept |
| | Get the RAM Cost.
|
| |
| uint32_t | p () const noexcept |
| | Get the degree of parallelism.
|
| |
| 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.
|
| |
'scrypt' password hashing algorithm
'scrypt' key derivation function was originally developed for use in the Tarsnap online backup system and is designed to be far more secure against hardware brute-force attacks than alternative functions such as PBKDF2 or bcrypt.
http://www.tarsnap.com/scrypt.html
Thread-safe.
- Examples
- password_hashing_scrypt.cpp.
Definition at line 26 of file password_hashing_scrypt.h.