KDF.derive

ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt, size_t length)

Derives a key of the specified length using default parameters.

Parameters

secretThe secret input (e.g., password).
saltThe salt (should be random and unique).
lengthThe desired length of the derived key in bytes.

Returns

The derived key bytes.
ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt, size_t length, KDFParams params)

Derives a key of the specified length using the given parameters.

Implementations that do not support a particular parameter should ignore it. Implementations that require a parameter not present in KDFParams should throw CryptoException.

Parameters

secretThe secret input (e.g., password).
saltThe salt (should be random and unique).
lengthThe desired length of the derived key in bytes.
paramsAlgorithm-specific parameters.

Returns

The derived key bytes.

Throws

CryptoException if a required parameter is missing or invalid.