PwHash

Undocumented in source.

Members

Aliases

PwStringBytes
alias PwStringBytes = crypto_pwhash_scryptsalsa208sha256_STRBYTES
Undocumented in source.
PwStringBytes
alias PwStringBytes = crypto_pwhash_STRBYTES
Undocumented in source.
Salt
alias Salt = ubyte[crypto_pwhash_scryptsalsa208sha256_SALTBYTES]
Undocumented in source.
Salt
alias Salt = ubyte[crypto_pwhash_SALTBYTES]
Undocumented in source.
makeSalt
alias makeSalt = randomArray!Salt

Generate a salt suitable for hashing passwords.

Functions

hashPassword
string hashPassword(string password, PwHashConfig config)

Create a string that can be used to store a password safely. It includes the hash, the salt, and information about the CPU and memory limits used to compute it.

hashPassword
ubyte[] hashPassword(char[] password, Salt salt, PwHashConfig config, size_t length)

Hash a password with a salt. Returns the hash as a ubyte[].

hashPasswordBuffer
void hashPasswordBuffer(ubyte[] out_, char[] password, Salt salt, PwHashConfig config)
Undocumented in source. Be warned that the author may not have intended to support it.
verifyPassword
bool verifyPassword(string password, string storageString)

Verify a password against a storage string obtained from hashPassword

verifyPassword
bool verifyPassword(ubyte[] hash, string password, Salt salt, PwHashConfig config)

Verify a password with a hash and salt

Manifest constants

interactivePwHashConfig
enum interactivePwHashConfig;

Password hashing config suitable for interactive use.

interactivePwHashConfig
enum interactivePwHashConfig;

Password hashing config suitable for interactive use.

moderatePwHashConfig
enum moderatePwHashConfig;

Password hashing config suitable for moderate use.

sensitivePwHashConfig
enum sensitivePwHashConfig;

Password hashing config suitable for highly sensitive data

sensitivePwHashConfig
enum sensitivePwHashConfig;

Password hashing config suitable for highly sensitive data.

Meta