HKDF
Derive a key from high-entropy input using HKDF.
Derive a key with HKDF (RFC 5869). Free, offline, runs entirely in your browser. Read more Show less
What is HKDF?
HKDF (HMAC-based Extract-and-Expand Key Derivation Function) is defined in RFC 5869. It converts a piece of high-entropy input into one or more cryptographic keys. It is not a password hash - it should be fed with data that is already uniformly random, such as a Diffie-Hellman shared secret or a raw random key.
HKDF has two steps. The extract step compresses the input key material into a pseudorandom key using the salt. The expand step stretches that key into the desired output length, using the info parameter as a domain separator.
How to use
Paste the input key material (usually as hex or Base64). Provide an optional salt. Provide optional context information in the info field to separate different uses of the same input. Choose a hash and the desired output length.
FAQ
Is HKDF a password hash?
No. If your input is a user password, use PBKDF2, scrypt, or Argon2 instead. HKDF is for high-entropy inputs.
What is the info field for?
Domain separation. If you use one shared secret to derive multiple keys, each key should have a unique info value, like an application name or protocol identifier. This prevents cross-protocol attacks.
Is the salt required?
No. HKDF works without a salt; the extract step uses an all-zero key in that case. Providing a random salt is still recommended.
Are inputs decoded as text or bytes?
This tool treats all inputs as UTF-8 text by default. For binary input, use hex with the 0x prefix or Base64.