dauth.hashdrbg

DAuth - Salted Hashed Password Library for D Hash_DRBG Cryptographic Random Number Generator

Members

Aliases

SystemEntropy
alias SystemEntropy(Elem, string pathToRandom = defaultPathToRandom, string pathToStrongRandom = defaultPathToStrongRandom) = WrappedStreamRNG!(SystemEntropyStream!(pathToRandom, pathToStrongRandom), Elem)

Reads random entropy from a system-specific cryptographic random number generator. On Windows, this loads ADVAPI32.DLL and uses RtlGenRandom. On Posix, this reads from a file (by default, "/dev/urandom" normally and "/dev/random" when Yes.PredictionResistance is requested). The speed and cryptographic security of this is dependent on your operating system.

Structs

HashDRBGStream
struct HashDRBGStream(TSHA = SHA512, string custom = "D Crypto RNG", EntropyStream = SystemEntropyStream!())

The underlying stream-like interface for SystemEntropy.

SystemEntropyStream
struct SystemEntropyStream(string pathToRandom = defaultPathToRandom, string pathToStrongRandom = defaultPathToStrongRandom)

The underlying stream-like interface for SystemEntropy.

WrappedStreamRNG
struct WrappedStreamRNG(RandomStream, StaticUByteArr)
struct WrappedStreamRNG(RandomStream, UIntType)

Takes a RandomStream (ex: SystemEntropyStream or HashDRBGStream) and wraps it into a UniformRNG InputRange.

Templates

HashDRBG
template HashDRBG(Elem, TSHA = SHA512, string custom = "D Crypto RNG", EntropyStream = SystemEntropyStream!())

Cryptographic random number generator Hash_DRBG, as defined in NIST's SP800-90A.

Variables

defaultPathToRandom
enum string defaultPathToRandom;

The path to the default OS-provided cryptographic entropy generator. This should not be a blocking generator.

defaultPathToStrongRandom
enum string defaultPathToStrongRandom;

The path to an OS-provided cryptographic entropy generator to be used when Yes.PredictionResistance is requested. This should be at least as strong as defaultPathToRandom. But unlike defaultPathToRandom, this may be a generator that blocks when system entropy is low.

Meta