API & MCP
Everything a person can do on Key Derivation Lab, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://keyderivationlab.usefulweb.site/api/v1/calculate– run Key Derivation LabGET https://keyderivationlab.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Key Derivation Lab
Derives keys from a password and salt with PBKDF2 (SHA-1/256/512), scrypt, Argon2id and HKDF using the parameters you choose, and compares their memory and work settings with the OWASP Password Storage recommendations. With JavaScript on, the page shows real timings for PBKDF2, HKDF and scrypt.
| Field | Type | Default | Description |
|---|---|---|---|
password (required) | text | — | Password or input key material |
passwordFormat | select (utf8, hex, base64) | "utf8" | Password is |
salt (required) | text | — | Salt. Use a random, unique salt of 16 bytes per password in real systems. |
saltFormat | select (utf8, hex, base64) | "utf8" | Salt is |
algorithms | multiselect (pbkdf2-sha1, pbkdf2-sha256, pbkdf2-sha512, scrypt, argon2id, hkdf-sha256, hkdf-sha512) | ["pbkdf2-sha256","scrypt","argon2id","hkdf-sha256"] | Functions |
keyLength | integer | 32 | Output length |
pbkdf2Iterations | integer | — | PBKDF2 iterations. Empty = OWASP value for each hash (SHA-1 1,300,000; SHA-256 600,000; SHA-512 210,000). |
scryptLogN | integer | 17 | scrypt cost N = 2^… |
scryptR | integer | 8 | scrypt block size r |
scryptP | integer | 1 | scrypt parallelism p |
argon2MemoryKiB | integer | 19456 | Argon2 memory |
argon2Passes | integer | 2 | Argon2 passes (t) |
argon2Parallelism | integer | 1 | Argon2 parallelism (p) |
hkdfInfo | text | — | HKDF info (context) |
outputEncoding | select (hex, base64) | "hex" | Output |
Example request
OWASP defaults: PBKDF2-SHA-256, scrypt, Argon2id, HKDF
curl -X POST https://keyderivationlab.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"password":"correct horse battery staple","salt":"c2FsdHNhbHRzYWx0c2FsdA==","saltFormat":"base64"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://keyderivationlab.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
key_derivation_lab - Local stdio connector:
node src/mcp-stdio.ts --tool=key-derivation-lab
{
"mcpServers": {
"key-derivation-lab": { "type": "http", "url": "https://keyderivationlab.usefulweb.site/mcp" }
}
}