wire / wire-format / key-derivation

Key derivation functions (PBKDF2, scrypt, Argon2, HKDF)

Key derivation functions (KDFs) derive cryptographic keys from a password or shared secret. PBKDF2: applies a pseudorandom function (HMAC) repeatedly (iterations) with a salt. scrypt: memory-hard (uses large memory to resist GPU/ASIC attacks). Argon2: winner of the Password Hashing Competition (2015), memory-hard, with variants (Argon2d, Argon2i, Argon2id). HKDF: extract-then-expand for deriving keys from a shared secret (not password-based).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Key derivation functions (PBKDF2, scrypt, Argon2, HKDF)

wire format

spec: RFC 2898 (PBKDF2), RFC 7914 (scrypt), RFC 9106 (Argon2)

Key derivation functions (KDFs) derive cryptographic keys from a password or shared secret. PBKDF2: applies a pseudorandom function (HMAC) repeatedly (iterations) with a salt. scrypt: memory-hard (uses large memory to resist GPU/ASIC attacks). Argon2: winner of the Password Hashing Competition (2015), memory-hard, with variants (Argon2d, Argon2i, Argon2id). HKDF: extract-then-expand for deriving keys from a shared secret (not password-based).

fieldsizemeaning
PBKDF2functionDK = T_1 || T_2 || ... || T_dklen/hlen, where T_i = F(password, salt, c, i) and F = U_1 XOR U_2 XOR ... XOR U_c, U_1 = PRF(password, salt || INT(i)), U_j = PRF(password, U_{j-1}).
PBKDF2 paramsconfigPRF (HMAC-SHA256), salt (>= 128 bits), iterations (>= 100000 for passwords), key length.
scryptfunctionMemory-hard: uses ROMix (random memory access) and BlockMix. Params: N (CPU/memory cost, power of 2), r (block size), p (parallelism).
Argon2functionMemory-hard with time cost (t), memory cost (m), parallelism (p). Variants: Argon2d (data-dependent, faster, GPU-resistant), Argon2i (data-independent, side-channel resistant), Argon2id (hybrid, recommended).
HKDFfunctionExtract: PRK = HMAC-Hash(salt, IKM). Expand: OKM = T_1 || T_2 || ... where T_i = HMAC-Hash(PRK, T_{i-1} || info || i).
HKDF paramsconfigHash (SHA-256), salt (optional), IKM (input key material), info (context), output length.

example:

00 00 00 00

KDF (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/key-derivation or /wire-format/key-derivation.json