PBKDF.keyDerivation

Derive a key from a passphrase for a number of iterations specified by either iterations or if iterations == 0 then running until seconds time has elapsed.

interface PBKDF
const
Pair!(size_t, OctetString)
keyDerivation
(
size_t output_len
,
in string passphrase
,
const(ubyte)* salt
,
size_t salt_len
,
size_t iterations
,
Duration loop_for
)

Parameters

output_len size_t

the desired length of the key to produce

passphrase string

the password to derive the key from

salt const(ubyte)*

a randomly chosen salt

salt_len size_t

length of salt in bytes

iterations size_t

the number of iterations to use (use 10K or more)

loop_for Duration

if iterations is zero, then instead the PBKDF is run until duration has passed.

Return Value

Type: Pair!(size_t, OctetString)

the number of iterations performed and the derived key

Meta