x402AgentTools

๐ŸŽฒSecure Random Generator

Generate cryptographically secure randomness: passwords with charset rules, hex keys of any byte length, and uniform random integers (rejection sampling, no modulo bias). Never use Math.random for secrets.

Worked examples

24-char password, all charsets

GET /api/v1/crypto/random-generator?mode=password&length=24

Result: ubmgsjawpbmdkfnqnxafyycf

64-char hex API key

GET /api/v1/crypto/random-generator?mode=hex&length=64

Result: 0f8e15654eb9d53bf050a8f1d6abda01df4b24e5fb6feb7221838cb8b58b26cb

Random dice roll 1โ€“6

GET /api/v1/crypto/random-generator?mode=int&min=1&max=6&length=24

Result: 2

Machine API (x402)

$0.001 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol โ€” no accounts, no API keys.

GET /api/v1/crypto/random-generator?mode=password&length=24 HTTP/1.1
Host: agenttools-hub.vercel.app

โ†’ 402 (payment required, instructions in headers)
โ†’ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "crypto/random-generator",
  "input": {"mode":"password","length":24},
  "result": { "value": null, "answer": "zjzjplsrdopmxxzkbwvopcvv" }
}

Agent docs: /llms.txt ยท OpenAPI spec ยท integration guide

About this tool

Cryptographically secure randomness from the platform CSPRNG: passwords with per-charset rules and an honest entropy estimate, hex keys of any length, and uniform integers using rejection sampling โ€” no modulo bias, never Math.random.

Frequently asked questions

Why not Math.random?

Math.random is a fast PRNG whose output is predictable from a few observations. Anything guarding value โ€” passwords, keys, session tokens โ€” must come from a CSPRNG.

How much password entropy is enough?

80+ bits for most purposes, 100+ for high-value secrets. At 24 characters with all charsets (~72 symbols) this tool produces โ‰ˆ148 bits.

Related tools