Skip to content
NOUMENResearch
Network
Engineering
, home page

IntelligenceAlgorithmshkdf

HKDF

An extract-then-expand key derivation function built on HMAC, specified in RFC 5869. TLS 1.3, HPKE, Signal and many other protocols use it to turn shared secrets into keys. Grover's search would roughly halve its effective security, so 256-bit keys and outputs stay adequate.

In short

What a quantum computer changes.

Quantum effect
Weakened by Grover's search
Family
SymmetricRests on hash function security.
What it means
Grover's algorithm searches an unstructured space in roughly the square root of the usual number of steps. Against a symmetric key or a hash preimage, that roughly halves the effective security in bits: a 128-bit key gives about 64 bits of security against it. In practice the answer is size, not replacement. Keys and outputs of 256 bits stay adequate. Grover's search also needs a long, sequential run on a fault-tolerant machine and does not split well across many machines, so the effect is a smaller margin, not a break.

This describes the family, not any project that uses it.

31 in the catalogue

Packages that provide it

Packages that provide HKDF
PackageProvides
eciesjsnpmECIES public-key encryption over secp256k1 or Curve25519 (X25519 or Ed25519 keys), deriving keys with HKDF and encrypting with AES-256-GCM or XChaCha20-Poly1305.
@noble/hashesnpmPure TypeScript hash, MAC and KDF library: SHA-1, SHA-2, SHA-3 and Keccak, BLAKE2 and BLAKE3, RIPEMD-160, HMAC, HKDF, PBKDF2, scrypt and Argon2.
@panva/hkdfnpmHKDF key derivation (RFC 5869) with SHA-1 or SHA-2 digests, computed by the runtime's built-in crypto.
@stablelib/hkdfnpmTypeScript HKDF key derivation (RFC 5869) over a caller-supplied hash.
@peculiar/webcryptonpmWebCrypto API implementation for Node.js on top of the built-in crypto module, adding curves such as secp256k1, brainpool, Ed448 and X448 and non-standard mechanisms such as DES and RSAES-PKCS1-v1_5.
node-josenpmJOSE (JWS, JWE, JWK) implementation from Cisco with RSA, ECDSA and ECDH on the NIST P curves, HMAC, AES (GCM, CBC-HMAC and key wrap), HKDF and PBES2.
hpke-jsnpmHybrid Public Key Encryption (RFC 9180) on top of WebCrypto, with DHKEM over P-256, P-384, P-521, X25519 and X448, HKDF-SHA-2, and AES-GCM or ChaCha20-Poly1305.
@hpke/corenpmCore Hybrid Public Key Encryption (RFC 9180) module on WebCrypto, with DHKEM over P-256, P-384, P-521 and X25519, HKDF-SHA-2 and AES-GCM.
@hpke/dhkem-x25519npmHPKE extension module providing DHKEM(X25519, HKDF-SHA256) for @hpke/core.
micro-eth-signernpmMinimal Ethereum library for secp256k1 transaction and message signing, legacy and EIP-2335 keystores, EIP-2333 key derivation, and KZG and PeerDAS blob commitments.
@libp2p/noisenpmNoise XX handshake connection encrypter for libp2p using X25519, ChaCha20-Poly1305, SHA-256 and HKDF.
@chainsafe/libp2p-noisenpmThe former package of the libp2p Noise handshake connection encrypter using X25519, ChaCha20-Poly1305, SHA-256 and HKDF.
@aptos-labs/ts-sdknpmAptos TypeScript SDK with Ed25519, secp256k1 and secp256r1 WebAuthn accounts, keyless accounts verified with Groth16 proofs over BN254 and Poseidon, and AES-GCM payload encryption.
eciescrates.ioElliptic Curve Integrated Encryption Scheme over secp256k1 or Curve25519, using HKDF-SHA256 with AES-256-GCM or XChaCha20-Poly1305.
ringcrates.ioCryptographic library largely derived from BoringSSL, offering ECDSA P-256 and P-384, Ed25519, RSA signatures, X25519 and ECDH, AES-GCM, ChaCha20-Poly1305, SHA-1 and SHA-2, HMAC, HKDF, PBKDF2 and a system random generator.
aws-lc-rscrates.ioring-compatible Rust API over the AWS-LC C library, adding ML-KEM, ML-DSA, RSA encryption, raw AES modes and an optional FIPS build.
aws-lc-syscrates.ioLow-level generated FFI bindings to the AWS-LC C cryptography library, which aws-lc-rs wraps.
opensslcrates.ioRust bindings to OpenSSL covering TLS, X.509, RSA, DSA, Diffie-Hellman, elliptic curve and Edwards curve keys, symmetric ciphers, hashes, MACs and key derivation.
openssl-syscrates.ioRaw FFI declarations for the OpenSSL C library, used by the openssl crate.
boringcrates.ioRust bindings to BoringSSL with TLS support, RSA, DSA, Diffie-Hellman, ECDSA and ECDH, Ed25519 and X25519, ML-KEM, ML-DSA, HPKE, AEAD ciphers, hashes, HMAC and key derivation.
mbedtlscrates.ioRust wrapper for Mbed TLS covering TLS, X.509, RSA, ECDSA, ECDH, Diffie-Hellman, AES and ChaCha20-Poly1305, hashes, HMAC, HKDF, PBKDF2 and DRBG random generators.
botancrates.ioRust wrapper for the Botan C++ library, exposing ciphers, hashes, MACs, KDFs, password hashing, random generators, X.509 and classical and post-quantum public key algorithms.
libcruxcrates.ioRe-export crate for the libcrux library of formally verified implementations, including ML-KEM, ML-DSA, X25519, P-256 ECDSA and ECDH, Ed25519, RSA-PSS, AES-GCM, ChaCha20-Poly1305, SHA-2, SHA-3, BLAKE2, HMAC, HKDF and HPKE.
orioncrates.ioPure Rust library offering ML-KEM, ML-DSA, X-Wing, HPKE, X25519, (X)ChaCha20-Poly1305, BLAKE2b, BLAKE3, SHA-2, SHA-3, HMAC, HKDF, PBKDF2, Argon2 and scrypt.
dryoccrates.ioPure Rust libsodium-compatible library with crypto_box, secretbox, Ed25519 signatures, BLAKE2b, SHA-2, SHA-3, HMAC, HKDF, Argon2 password hashing, ML-KEM-768, X-Wing and HPKE sealed boxes.
hmac-sha256crates.ioSmall self-contained SHA-256, HMAC-SHA256 and HKDF-SHA256 in pure Rust.
hkdfcrates.ioHMAC-based extract-and-expand key derivation function (HKDF, RFC 5869).
rustlscrates.ioTLS 1.2 and TLS 1.3 library in Rust whose cryptography comes from a pluggable provider, aws-lc-rs by default or ring.
hpkecrates.ioPure Rust Hybrid Public Key Encryption (RFC 9180) with X25519 and NIST P-curve DHKEMs, ML-KEM and X-Wing KEMs, HKDF or SHAKE KDFs and AES-GCM or ChaCha20-Poly1305.
agecrates.ioLibrary for the age file encryption format, with X25519, hybrid ML-KEM-768 plus X25519, P-256 tag, SSH key and scrypt passphrase recipients and ChaCha20-Poly1305 payload encryption.
bitcoin_hashescrates.ioThe hash functions used by rust-bitcoin: SHA-1, SHA-256 (plain, double and tagged), SHA-384, SHA-512, SHA3-256, RIPEMD-160 and HASH160, plus HMAC, HKDF and SipHash.

1 listed

Sources

Full record

Identifier
hkdf
Kind
kdf
Family
Symmetric
Rests on
hash function security
Quantum effect
Weakened by Grover's search

Standards