37 #ifndef _PASSWORD_HPP_INCLUDED
38 #define _PASSWORD_HPP_INCLUDED
62 Salt(
const unsigned char* data,
size_t bytes );
64 Salt(
const std::string& str );
79 std::string
toBCD()
const;
94 Hash(
const unsigned char* data,
size_t bytes );
96 Hash(
const std::string& str );
111 std::string
toBCD()
const;
131 PasswordHash(
const unsigned char* pwdSalt,
size_t bytes,
const std::string& password );
136 PasswordHash(
const Salt& pwdSalt,
const std::string& password );
141 PasswordHash(
const std::string& pwdSalt,
const std::string& password );
158 std::string
toBCD()
const;
170 #endif // _PASSWORD_HPP_INCLUDED
unsigned char m_hash[PASSWORD_HASH_SIZE]
Definition: passwordHash.hpp:116
~Hash()
Destruct the password hash (set all bits 0).
const unsigned char * hash() const
The unsigned char vector of the password hash.
Definition: passwordHash.hpp:108
bool operator!=(const Salt &rhs)
Definition: passwordHash.hpp:71
bool operator!=(const Hash &rhs)
Definition: passwordHash.hpp:103
std::string toBCD() const
Return the password hash as a BCD encoded string.
std::size_t m_size
Definition: passwordHash.hpp:83
Random Generator interface class.
Definition: randomGenerator.hpp:45
static const size_t PASSWORD_HASH_SIZE
Definition: passwordHash.hpp:46
const Salt & salt() const
The password salt.
Definition: passwordHash.hpp:151
std::string toBCD() const
size_t size() const
The size of the password hash in bytes.
Definition: passwordHash.hpp:106
~Salt()
Destructor (set all bits 0).
std::string toString() const
Return the salt as a base64 encoded string (without base64 padding).
bool operator==(const Hash &rhs)
True if the 2 password hashes are identical, false otherwise.
Definition: passwordHash.hpp:53
Definition: passwordHash.hpp:87
const Hash & hash() const
The unsigned char vector of the password hash.
Definition: passwordHash.hpp:154
Random Generator interface class.
Salt m_salt
Definition: passwordHash.hpp:165
Password hash.
Definition: passwordHash.hpp:50
std::string toString() const
bool operator==(const Salt &rhs)
True if the 2 password salts are identical, false otherwise.
std::string toBCD() const
Return the salt as a BCD encoded string.
Hash()
Construct an empty password hash (all bits 0).
PasswordHash()
Construct an empty password hash.
Definition: passwordHash.hpp:120
static const size_t PASSWORD_SALT_SIZE
Definition: passwordHash.hpp:47
size_t size() const
The size of the salt in bytes.
Definition: passwordHash.hpp:74
std::string toString() const
Salt()
Construct an empty salt (all bits 0).
Hash m_hash
Definition: passwordHash.hpp:164
const unsigned char * salt() const
The unsigned char vector of the salt.
Definition: passwordHash.hpp:76
unsigned char m_salt[PASSWORD_SALT_SIZE]
Definition: passwordHash.hpp:84