#include <PasswordHasher.h>
|
| PasswordHasher (int iterations=DEFAULT_ITERATIONS) |
| Constructs a PasswordHasher with the specified number of iterations.
|
|
std::vector< uint8_t > | hashPassword (const std::string &password, const std::vector< uint8_t > &salt) |
| Hashes a password with the given salt.
|
|
bool | verifyPassword (const std::string &password, const std::vector< uint8_t > &salt, const std::vector< uint8_t > &expectedHash) |
| Verifies a password against an expected hash using the provided salt.
|
|
std::string | hashPasswordBase64 (const std::string &password, const std::vector< uint8_t > &salt) |
| Hashes a password and encodes it in Base64 format.
|
|
bool | verifyPasswordBase64 (const std::string &password, const std::vector< uint8_t > &salt, const std::string &expectedBase64Hash) |
| Verifies a password against an expected Base64 encoded hash using the provided salt.
|
|
std::string | hashAndEncode (const std::string &password) |
|
bool | verifyEncoded (const std::string &password, const std::string &combinedSaltAndHash) |
|
|
static std::string | toBase64 (const std::vector< uint8_t > &data) |
|
static std::vector< uint8_t > | fromBase64 (const std::string &base64) |
|
static std::vector< uint8_t > | generateSalt (size_t length) |
|
◆ PasswordHasher()
- Parameters
-
iterations | Number of iterations for the hashing algorithm. Default is 1,000. |
◆ fromBase64()
static std::vector< uint8_t > PasswordHasher::fromBase64 |
( |
const std::string & |
base64 | ) |
|
|
static |
◆ generateSalt()
static std::vector< uint8_t > PasswordHasher::generateSalt |
( |
size_t |
length | ) |
|
|
static |
◆ hashAndEncode()
std::string PasswordHasher::hashAndEncode |
( |
const std::string & |
password | ) |
|
◆ hashPassword()
std::vector< uint8_t > PasswordHasher::hashPassword |
( |
const std::string & |
password, |
|
|
const std::vector< uint8_t > & |
salt |
|
) |
| |
◆ hashPasswordBase64()
std::string PasswordHasher::hashPasswordBase64 |
( |
const std::string & |
password, |
|
|
const std::vector< uint8_t > & |
salt |
|
) |
| |
◆ toBase64()
static std::string PasswordHasher::toBase64 |
( |
const std::vector< uint8_t > & |
data | ) |
|
|
static |
◆ verifyEncoded()
bool PasswordHasher::verifyEncoded |
( |
const std::string & |
password, |
|
|
const std::string & |
combinedSaltAndHash |
|
) |
| |
◆ verifyPassword()
bool PasswordHasher::verifyPassword |
( |
const std::string & |
password, |
|
|
const std::vector< uint8_t > & |
salt, |
|
|
const std::vector< uint8_t > & |
expectedHash |
|
) |
| |
◆ verifyPasswordBase64()
bool PasswordHasher::verifyPasswordBase64 |
( |
const std::string & |
password, |
|
|
const std::vector< uint8_t > & |
salt, |
|
|
const std::string & |
expectedBase64Hash |
|
) |
| |
◆ DEFAULT_ITERATIONS
constexpr int PasswordHasher::DEFAULT_ITERATIONS = 1000 |
|
staticconstexpr |
◆ HASH_LENGTH
constexpr size_t PasswordHasher::HASH_LENGTH = 32 |
|
staticconstexpr |
◆ iterations
int PasswordHasher::iterations |
|
private |
The documentation for this class was generated from the following file: