HKDF (RFC 5869), PBKDF2 (RFC 2898) and scrypt (RFC 7914), each verified against its RFC known-answer test vector. |
||
|---|---|---|
| .. | ||
| Makefile | ||
| README.md | ||
| hkdf.c | ||
| pbkdf2.c | ||
| scrypt-kdf.c | ||
README.md
wolfSSL KDF Examples
Demonstrates the main wolfCrypt key derivation functions, each verified against its RFC known-answer test vector.
hkdf.c- HKDF (RFC 5869): extract-then-expand derivation from existing keying material, shown both as separatewc_HKDF_Extract()/wc_HKDF_Expand()steps and as the one-shotwc_HKDF().pbkdf2.c- PBKDF2 (RFC 2898) viawc_PBKDF2(): deriving keys from passwords with a salt and an iteration work factor.scrypt-kdf.c- scrypt (RFC 7914) viawc_scrypt(): memory-hard password-based derivation for stronger resistance to GPU/ASIC attacks.
Use HKDF when the input is already a high-entropy secret (e.g. a DH shared secret); use PBKDF2 or scrypt when the input is a password.
Building wolfSSL
./configure --enable-hkdf --enable-scrypt
make
sudo make install
PBKDF2 is enabled by default (disabled only by NO_PWDBASED).
Building and running the examples
make
./hkdf
./pbkdf2
./scrypt-kdf