A reference-counted type for passwords. The memory containing the password is automatically zeroed-out when there are no more references or when a new password is assigned.
Thrown when a known-weak algortihm or setting it attempted, UNLESS compiled with '-version=DAuth_AllowWeakSecurity'
Thrown whenever a digest type cannot be determined. For example, when the provided (or default) 'digestCodeOfObj' or 'digestFromCode' delegates fail to find a match. Or when passing isPasswordCorrect a Hash!Digest with a null 'digest' member (which prevents it from determining the correct digest to match with).
Default implementation of 'digestCodeOfObj'. See 'Hash!(TDigest).toString' for more info.
Default implementation of 'digestCodeOfObj'. See 'parseHash' for more info.
Default salter for 'makeHash' and 'isPasswordCorrect'.
This function exists as a convenience in case you need it, HOWEVER it's recommended to design your code so you DON'T need to use this (use toPassword instead):
Note, this only checks Phobos's RNG's and digests, and only by type. This works on a blacklist basis - it blindly accepts any Phobos-compatible RNG or digest it does not know about. This is only supplied as a convenience. It is always your own responsibility to select an appropriate algorithm for your own needs.
Validates a password against an existing salted hash.
Compare two arrays in "length-constant" time. This thwarts timing-based attacks by guaranteeing all comparisons (of a given length) take the same amount of time.
Generates a salted password using any Phobos-compatible digest, default being SHA-512.
Parses a string that was encoded by Hash.toString.
Constructs a Password from a ubyte[]. Mainly provided for syntactic consistency with 'toPassword(char[])'.
Constructs a Password from a char[] so you don't have to cast to ubyte[], and don't accidentally cast away immutability.
Contains all the relevant information for a salted hash. Note the digest type can be obtained via DigestOf!(SomeHashType).
Like std.digest.digest.DigestType, but also accepts OO-style digests (ie. classes deriving from interface std.digest.digest.Digest)
Retreive the digest type of a struct Hash(some digest)
Like std.digest.digest.isDigest, but also accepts OO-style digests (ie. classes deriving from interface std.digest.digest.Digest)
Tests if the type is an instance of struct Hash(some digest)
DAuth - Authentication Utility for D Core package
Main module: dauth