KDF
A key derivation function: an algorithm that turns a password or other secret into one or more cryptographic keys of the right length.
In more detail
KDF stands for key derivation function. Password-based ones such as PBKDF2, scrypt and Argon2 are deliberately slow and use a salt, so guessing the password behind a stolen key or hash becomes expensive. Others, such as the extract-and-expand function used inside TLS, quickly derive several keys from one strong shared secret.
Examples
openssl enc -aes-256-cbc -pbkdf2 -pass file:db.keyhashlib.scrypt(password.encode(), salt=salt, n=2**14, r=8, p=1)Related terms
- PBKDF2 — A standard way to turn a password into an encryption key, or a stored password hash, by hashing it many thousands of times so guessing is slow.
- scrypt — A memory-hard password hashing function that is slow and needs lots of memory, so guessing passwords in bulk is expensive.
- Argon2 — A modern password hashing function that is deliberately slow and needs a lot of memory for every guess, which makes stolen password hashes very expensive to crack.
- salt — An extra value mixed into data before hashing so that otherwise identical inputs produce different hashes.
Taught in
- Symmetric Encryption: AES-GCM & ChaCha20 — Cybersecurity Fundamentals, GRC & Cryptography
- Cryptographic Hashing: SHA-256, SHA-3 & Passwords — Cybersecurity Fundamentals, GRC & Cryptography