# agent402.tools Scrypt Key Derivation

> agent402.tools Scrypt Key Derivation is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Derives a cryptographic key from a password using the memory-hard scrypt algorithm (RFC 7914), returning the hex-encoded derived key and all tuning parameters.

## Facts

- Endpoint: POST https://agent402.tools/api/scrypt-derive
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-scrypt-key-derivation-56f3decc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OBwHUMvyzodsLkckSe51x

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-scrypt-key-derivation-56f3decc -d '<json body>'
```

Example prompt: Run scrypt key derivation on the password 'correct-horse-battery-staple' with salt 'unique-user-salt-2024', using cost factor N=16384, block size r=8, parallelization p=1, and give me a 64-byte hex key.

## When to prefer this

Prefer this endpoint when you need memory-hard password hashing or key derivation that is more resistant to GPU/ASIC attacks than PBKDF2 or bcrypt. Ideal for deriving encryption keys from passphrases, storing password verifiers, or any use case requiring RFC 7914 scrypt compliance with configurable N, r, p parameters.

## Known failure modes

- N is not a power of 2 or exceeds 131072 — returns validation error
- keyLength exceeds 128 bytes — returns validation error
- Missing required password or salt fields — returns 400 bad request
- N×r×p product too large for available memory — returns computation error
- Payment failure via x402 protocol — returns 402 Payment Required

## How this service works

Derive a cryptographic key from a password using scrypt (RFC 7914). Memory-hard by design, making it more resistant to GPU/ASIC brute-force than PBKDF2. Returns the hex-encoded derived key and all tuning parameters (N, r, p).

## Output

Returns the hex-encoded derived key along with the tuning parameters used (N, r, p) and the key length, confirming exactly how the derivation was performed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cost": {
   "type": "integer",
   "description": "CPU/memory cost parameter N (default 16384, max 131072, must be power of 2)"
  },
  "salt": {
   "type": "string",
   "description": "Salt string (should be unique per password)"
  },
  "password": {
   "type": "string",
   "description": "Password or passphrase to derive from"
  },
  "blockSize": {
   "type": "integer",
   "description": "Block size parameter r (default 8)"
  },
  "keyLength": {
   "type": "integer",
   "description": "Desired key length in bytes (default 64, max 128)"
  },
  "parallelization": {
   "type": "integer",
   "description": "Parallelization parameter p (default 1)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "cost": 16384,
  "saltUsed": "random-salt-value",
  "algorithm": "scrypt",
  "blockSize": 8,
  "keyLength": 64,
  "derivedKey": "a1b2c3d4e5f6...",
  "parallelization": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-scrypt-key-derivation-56f3decc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
