API Reference
HKDF
HMAC-based Extract-and-Expand Key Derivation Function
Table of Contents
Theory
HKDF (RFC 5869) is a simple key derivation function based on HMAC. It is often used to derive multiple session keys from a single master secret.
It follows a standard "Extract-then-Expand" paradigm:
- Extract: Derives a fixed-length pseudorandom key () from the input keying material () and optional salt.
- Expand: Expands the into multiple cryptographically strong output keys.
Module Methods
hkdfSync(digest, key, salt, info, keylen)
Synchronous HKDF derivation.
import QuickCrypto from 'react-native-quick-crypto';
// Combined Extract + Expand
const derived = QuickCrypto.hkdfSync(
'sha256', // Digest
'ikm-secret', // Input Key Material
'salt', // Salt
'context-info', // Context Info
64 // Output length
);hkdf(digest, key, salt, info, keylen, callback)
Prop
Type