CppSecurity
1.1.1.0
C++ Security Library
|
'Argon2i' password hashing algorithm More...
#include <password_hashing_argon2.h>
Public Member Functions | |
const std::string & | name () const override |
Get the password hashing algorithm name. More... | |
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. More... | |
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. More... | |
Argon2dPasswordHashing (size_t hash_length=32, size_t salt_length=32, uint32_t t=3, uint32_t m=512, uint32_t p=1) | |
Initialize 'Argon2' password hashing with required parameters. More... | |
Argon2dPasswordHashing (const Argon2dPasswordHashing &)=default | |
Argon2dPasswordHashing (Argon2dPasswordHashing &&)=default | |
![]() | |
Argon2dPasswordHashing (size_t hash_length=32, size_t salt_length=32, uint32_t t=3, uint32_t m=512, uint32_t p=1) | |
Initialize 'Argon2' password hashing with required parameters. More... | |
Argon2dPasswordHashing (const Argon2dPasswordHashing &)=default | |
Argon2dPasswordHashing (Argon2dPasswordHashing &&)=default | |
~Argon2dPasswordHashing ()=default | |
Argon2dPasswordHashing & | operator= (const Argon2dPasswordHashing &)=default |
Argon2dPasswordHashing & | operator= (Argon2dPasswordHashing &&)=default |
uint32_t | t () const noexcept |
Get the number of iterations. More... | |
uint32_t | m () const noexcept |
Get the memory usage in kibibytes. More... | |
uint32_t | p () const noexcept |
Get the degree of parallelism. More... | |
![]() | |
PasswordHashing (size_t hash_length=32, size_t salt_length=32) | |
Initialize password hashing with required parameters. More... | |
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. More... | |
size_t | salt_length () const noexcept |
Get the unique password salt length. More... | |
virtual std::string | GenerateSalt () const |
Generate the unique password salt. More... | |
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. More... | |
virtual std::string | GenerateDigest (std::string_view password) const |
Generate the secure digest string for the given user password. More... | |
virtual std::string | GenerateEncodedDigest (std::string_view password) const |
Generate the secure Base64 digest string for the given user password. More... | |
virtual bool | ValidateDigest (std::string_view password, std::string_view digest) const |
Validate the user password over the given secure digest string. More... | |
virtual bool | ValidateEncodedDigest (std::string_view password, std::string_view digest) const |
Validate the user password over the given secure Base64 digest string. More... | |
'Argon2i' password hashing algorithm
'Argon2i' is a password-hashing function that summarizes the state of the art in the design of memory-hard functions and can be used to hash passwords for credential storage, key derivation, or other applications.
Argon2i instead uses data-independent memory access, which is preferred for password hashing and password-based key derivation, but it is slower as it makes more passes over the memory to protect from tradeoff attacks.
https://github.com/P-H-C/phc-winner-argon2
Thread-safe.
Definition at line 82 of file password_hashing_argon2.h.
|
default |
|
default |
CppSecurity::Argon2dPasswordHashing::Argon2dPasswordHashing |
Initialize 'Argon2' password hashing with required parameters.
hash_length | - Strong password hash length (default is 32) |
salt_length | - Unique password salt length (default is 32) |
t | - Number of iterations (default is 3) |
m | - Memory usage in kibibytes (default is 512) |
p | - Degree of parallelism (default is 1) |
Definition at line 41 of file password_hashing_argon2.cpp.
|
overridevirtual |
Generate the strong password hash for the given user password and unique salt.
password | - User password |
salt | - Unique password salt |
Reimplemented from CppSecurity::Argon2dPasswordHashing.
Definition at line 47 of file password_hashing_argon2.cpp.
|
inlineoverridevirtual |
Get the password hashing algorithm name.
Reimplemented from CppSecurity::Argon2dPasswordHashing.
Definition at line 88 of file password_hashing_argon2.h.
|
overridevirtual |
Validate the user password over the given strong password hash and unique salt.
password | - User password |
hash | - Strong password hash |
salt | - Unique password salt |
Reimplemented from CppSecurity::Argon2dPasswordHashing.
Definition at line 56 of file password_hashing_argon2.cpp.