{
  "slug": "hkdf-derive",
  "name": "gizza-ai/hkdf-derive",
  "version": "0.1.0",
  "title": "HKDF Key Derivation — extract-and-expand (RFC 5869) — gizza.ai",
  "description": "Derive keys with HKDF, the HMAC-based extract-and-expand KDF from RFC 5869 — choose hash, salt, info label, length and hex/base64 output, all in your browser.",
  "tags": [
    "hkdf",
    "key derivation",
    "kdf",
    "rfc 5869",
    "extract and expand",
    "hmac",
    "hkdf-sha256",
    "derive key",
    "hkdf-expand",
    "info context"
  ],
  "category": "security",
  "urls": {
    "page": "https://gizza.ai/tools/hkdf-derive/",
    "markdown": "https://gizza.ai/tools/hkdf-derive/index.md",
    "descriptor": "https://gizza.ai/tools/hkdf-derive/tool.json",
    "deep_link_example": "https://gizza.ai/tools/hkdf-derive/?ikm=The%20secret%20%2F%20source%20key&mode=derive&ikm_encoding=utf8&salt=Non-secret%20random%20salt%20%28recommended%29&salt_encoding=utf8&info=e.g.%20app%3Atls%20key&info_encoding=utf8&hash=sha256&length=32&encoding=hex"
  },
  "cli": "gizza tool hkdf-derive \"The secret / source key\"",
  "tool": {
    "description": "Derive a cryptographic key from input key material (IKM) using HKDF, the HMAC-based extract-and-expand key derivation function (RFC 5869). mode=derive (default) runs the full extract-then-expand and outputs `length` bytes; mode=extract returns only the intermediate pseudorandom key (PRK). Choose the hash (sha1, sha256 default, sha384, sha512), an optional salt, an optional info/context string (each with its own utf8/hex/base64 encoding), the output length in bytes (default 32, max 255*HashLen), and the output encoding (hex default or base64). HKDF is the standard for splitting one strong secret into multiple keys (used in TLS 1.3, Signal, Noise); it is NOT a password hash. Deterministic and runs locally; the secret never leaves the device.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "encoding": {
          "default": "hex",
          "description": "Output encoding of the derived key / PRK: hex (default) or base64.",
          "enum": [
            "hex",
            "base64"
          ],
          "type": "string"
        },
        "hash": {
          "default": "sha256",
          "description": "HMAC hash function (default sha256). sha1 is for legacy/interop only.",
          "enum": [
            "sha1",
            "sha256",
            "sha384",
            "sha512"
          ],
          "type": "string"
        },
        "ikm": {
          "description": "Input key material (IKM): the secret/source key to derive from. Interpreted per `ikm_encoding`.",
          "type": "string"
        },
        "ikm_encoding": {
          "default": "utf8",
          "description": "How to interpret the IKM string: utf8 text (default), hex, or base64.",
          "enum": [
            "utf8",
            "hex",
            "base64"
          ],
          "type": "string"
        },
        "info": {
          "description": "Optional context/application info string that binds the output to a use (e.g. \"app:tls key\"). Empty by default.",
          "type": "string"
        },
        "info_encoding": {
          "default": "utf8",
          "description": "How to interpret the info string: utf8 text (default), hex, or base64.",
          "enum": [
            "utf8",
            "hex",
            "base64"
          ],
          "type": "string"
        },
        "length": {
          "description": "Derived key length in bytes (derive mode, default 32). Max is 255 * HashLen for the chosen hash.",
          "maximum": 8160,
          "minimum": 1,
          "type": "integer"
        },
        "mode": {
          "default": "derive",
          "description": "derive (default) runs full HKDF extract-then-expand to produce `length` bytes; extract returns only the intermediate pseudorandom key (PRK).",
          "enum": [
            "derive",
            "extract"
          ],
          "type": "string"
        },
        "salt": {
          "description": "Optional salt. If empty, HKDF uses HashLen zero bytes (per RFC 5869). A non-secret random salt is recommended.",
          "type": "string"
        },
        "salt_encoding": {
          "default": "utf8",
          "description": "How to interpret the salt string: utf8 text (default), hex, or base64.",
          "enum": [
            "utf8",
            "hex",
            "base64"
          ],
          "type": "string"
        }
      },
      "required": [
        "ikm"
      ],
      "type": "object"
    }
  }
}