# SP 800-56C HKDF Extract and Expand Walkthrough

Show each HMAC step of HKDF Extract+Expand for protocol key derivation, including PRK, T(n), and OKM.

> Canonical page: https://elysiatools.com/en/tools/sp800-56c-hkdf-extract-and-expand-walkthrough

- **Category:** Security

- **Keywords:** hkdf, sp 800-56c, rfc 5869, key derivation, hmac, ecdh, tls

## Overview

A deterministic SP 800-56C/RFC 5869 learning walkthrough for ECDH shared-secret derivation. It is for development and test vectors, not a secret-management service.

## Inputs

- **Input preset** (select)
- **Hash** (select)
- **Input encoding** (select)
- **Input keying material (IKM)** (textarea): Hex, text, or Base64 according to input encoding
- **Salt** (textarea): Optional; empty uses a zero-filled HashLen salt
- **Info** (textarea): Optional context / protocol label
- **Output length (bytes)** (number)

## When to use

- Verify an RFC 5869 HKDF implementation against the published SHA-256 test case.
- Study how SP 800-56C or HKDF Extract and Expand derives protocol key material from ECDH input.
- Create development and test vectors with different hashes, encodings, salts, context info, and output lengths.

## How it works

- Select a preset, or provide the input keying material using Hex, UTF-8 text, or Base64.
- Choose SHA-256, SHA-384, or SHA-512, then optionally enter a salt and protocol context in the Info field.
- Set the desired output length from 1 to 4096 bytes.
- The walkthrough calculates and displays the Extract PRK, each Expand block T(n), and the final OKM.

## Use cases

- Compare HKDF output with RFC 5869 test vectors during cryptographic implementation testing.
- Trace ECDH shared-secret derivation for protocol design and debugging.
- Generate reproducible examples for explaining HMAC-based key derivation.

## Frequently asked questions

### What does this HKDF walkthrough calculate?

It shows the HMAC steps for HKDF Extract and Expand, including PRK, T(n), and OKM.

### Which hash algorithms are supported?

You can select SHA-256, SHA-384, or SHA-512.

### Which input encodings can I use?

IKM, salt, and info values can be entered as Hex, UTF-8 text, or Base64 according to the selected encoding.

### What happens if I omit the salt?

An empty salt uses a zero-filled salt with a length equal to the selected hash output length.

### Is this a secret-management service?

No. It is a deterministic learning walkthrough for development and test vectors.

## Related tools

- [SSH Key Pair Generator](https://elysiatools.com/en/tools/ssh-key-generator): Generate an SSH key pair (Ed25519 recommended, RSA 4096, or ECDSA P-256) with an OpenSSH-format public key ready for ~/.ssh/authorized_keys, a SHA256 fingerprint, and a PEM private key. Optional passphrase encryption. Runs locally.
- [PKCE Code Verifier & Challenge Generator](https://elysiatools.com/en/tools/pkce-code-verifier-generator): Generate, validate and verify OAuth2 / OIDC PKCE (RFC 7636) code_verifier and S256 code_challenge pairs. Three modes: (1) generate a fresh verifier + challenge from cryptographically secure random bytes at 256/384/512/768-bit entropy, (2) audit a verifier you already have against the RFC — length (43–128), charset \[A-Za-z0-9-._~\] and ≥256-bit entropy, and (3) verify a verifier/challenge pair by recomputing BASE64URL(SHA256(verifier)). Optionally build the full authorization-request URL and token-exchange body. Complements the generic nonce-generator (which only emits a verifier+challenge pair) with RFC-compliance auditing and pair verification.
- [TOTP / HOTP Offline Code Generator](https://elysiatools.com/en/tools/totp-hotp-offline-generator): Generate RFC 6238 TOTP (time-based, 6/8 digits, 30/60s step) and RFC 4226 HOTP (counter-based) one-time passwords from a base32 shared secret, fully offline with HMAC-SHA1/256/512, plus an otpauth:// URI for importing into Google Authenticator / Authy
- [Data Column Extractor](https://elysiatools.com/en/tools/data-column-extractor): Extract specific columns from tabular data with support for various formats and flexible column selection
- [Entropy Calculator](https://elysiatools.com/en/tools/entropy-calculator): Measure the randomness of any data — Shannon entropy (bits/symbol), Min-Entropy (worst-case guess work), alphabet size, duplicate rate, and an average brute-force cracking time at a chosen hash rate. Rates data as Strong (≥128-bit min-entropy), Medium (64-127), or Weak (<64).
- [HMAC Generator & Verifier](https://elysiatools.com/en/tools/hmac-generator-verifier): Compute an HMAC message-authentication signature over a message + shared secret using SHA-1/SHA-2/SHA-3/BLAKE2, or verify an incoming signature against the secret — with webhook presets for Stripe / Slack / GitHub and constant-time comparison
- [RSA Encrypt / Decrypt](https://elysiatools.com/en/tools/rsa-encrypt-decrypt): Encrypt text with an RSA public key or decrypt ciphertext with the matching private key, using OAEP padding (SHA-1 or SHA-256). Handles long messages by chunking. Keys and data stay local. PKCS#1 v1.5 is intentionally not offered (Node disables it for decryption due to Bleichenbacher attacks).
- [URL Parameter Extractor](https://elysiatools.com/en/tools/url-parameter-extractor): Extract and parse parameters from URLs including query strings, hash fragments, and path segments

## Samples

- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
