chloride.password

Undocumented in source.

Members

Aliases

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

Generate a salt suitable for hashing passwords.

Functions

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.
passwordStorageString
string passwordStorageString(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.

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

Verify a password with a hash and salt

verifyPassword
bool verifyPassword(string password, string storageString)

Verify a password against a storage string obtained from passwordStorageString

Manifest constants

interactivePwHashConfig
enum interactivePwHashConfig;

Password hashing config suitable for interactive use.

sensitivePwHashConfig
enum sensitivePwHashConfig;

Password hashing config suitable for highly sensitive data

Structs

PwHashConfig
struct PwHashConfig

Struct containing configuration for password hashing. Specifically the parameters to control the amount of CPU and memory required.

Meta