MCF reader/writer for ShaCrypt.
More...
#include <kdf_sha_crypt.h>
MCF reader/writer for ShaCrypt.
◆ kdf_type
◆ mcf_type
◆ Type
◆ ShaCryptMcfAdaptor()
ShaCryptMcfAdaptor::ShaCryptMcfAdaptor |
( |
Type |
digest, |
|
|
unsigned long |
rounds, |
|
|
const std::string & |
salt, |
|
|
const std::string & |
checksum |
|
) |
| |
|
inline |
◆ checksum()
std::string ShaCryptMcfAdaptor::checksum |
( |
| ) |
const |
|
inline |
checksum.
in crypt-specific base64 encoding
◆ digest()
Type ShaCryptMcfAdaptor::digest |
( |
| ) |
const |
|
inline |
◆ from_mcf()
build ShaCrypt from a MCF notation.
- ${prefix}$rounds={rounds}${salt}${checksum}
- ${prefix}$rounds={rounds}${salt}
- ${prefix}${salt}${checksum}
- ${prefix}${salt}
prefix : [56] (5 is SHA256, 6 is SHA512)
rounds : [0-9]+
salt : [^$]*
checksum : [./a-zA-Z0-0]*
◆ hash()
void ShaCryptMcfAdaptor::hash |
( |
const std::string & |
password | ) |
|
|
inline |
hash a password into checksum.
updates checksum
◆ mcf_digest_name()
std::string ShaCryptMcfAdaptor::mcf_digest_name |
( |
| ) |
const |
|
inline |
name of the digest according to MCF.
- 5 for SHA256
- 6 for SHA512
- A for caching_sha2_password
◆ rounds()
unsigned long ShaCryptMcfAdaptor::rounds |
( |
| ) |
const |
|
inline |
rounds.
number of rounds the hash will be applied
◆ salt()
std::string ShaCryptMcfAdaptor::salt |
( |
| ) |
const |
|
inline |
salt.
- Precondition
- must be [a-z0-9]*
◆ supports_mcf_id()
static bool ShaCryptMcfAdaptor::supports_mcf_id |
( |
const std::string |
mcf_id | ) |
|
|
inlinestatic |
◆ to_mcf()
std::string ShaCryptMcfAdaptor::to_mcf |
( |
| ) |
const |
encode to MCF.
MCF (Modular Crypt Format)
◆ validate()
static std::error_code ShaCryptMcfAdaptor::validate |
( |
const std::string & |
mcf_line, |
|
|
const std::string & |
password |
|
) |
| |
|
inlinestatic |
◆ checksum_
std::string ShaCryptMcfAdaptor::checksum_ |
|
private |
◆ digest_
Type ShaCryptMcfAdaptor::digest_ |
|
private |
◆ kDefaultRounds
constexpr unsigned long ShaCryptMcfAdaptor::kDefaultRounds = 5000 |
|
staticconstexpr |
number of rounds if no rounds was specified in from_mcf().
◆ kMaxRounds
constexpr unsigned long ShaCryptMcfAdaptor::kMaxRounds = 999999999 |
|
staticconstexpr |
◆ kMaxSaltLength
constexpr size_t ShaCryptMcfAdaptor::kMaxSaltLength = 16 |
|
staticconstexpr |
maximum length of the salt.
only the first kMaxSaltLength bytes of the salt will be used.
◆ kMinRounds
constexpr unsigned long ShaCryptMcfAdaptor::kMinRounds = 1000 |
|
staticconstexpr |
◆ rounds_
unsigned long ShaCryptMcfAdaptor::rounds_ |
|
private |
◆ salt_
std::string ShaCryptMcfAdaptor::salt_ |
|
private |
The documentation for this class was generated from the following files: