# Crypto Math RSA Arithmetic

> Crypto Math RSA Arithmetic is a paid API for AI agents from crypto-math.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-27).

Analyzes RSA public key parameters (modulus bits, exponent validity, NIST strength) or demonstrates a toy RSA encryption/decryption round-trip using tiny primes.

## Facts

- Endpoint: GET https://crypto-math.x402tookit.com/rsa-arith?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/crypto-math-rsa-arithmetic-fdadbf3a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sTk1prV_kA8Ri_vkiR632

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 crypto-math-rsa-arithmetic-fdadbf3a
```

Example prompt: Check my RSA public key in public mode — the modulus is 0xC4A6B... (2048-bit hex) and the exponent is 65537 — tell me if it meets NIST strength requirements and whether the exponent is valid.

## When to prefer this

Use this endpoint when you need to programmatically assess RSA public key security (NIST compliance, bit strength, exponent validity) or need an educational step-by-step RSA demonstration with small primes. Prefer this over general modular exponentiation endpoints when RSA-specific outputs like phi, Carmichael lambda, NIST verdict, and labeled key components are needed.

## Known failure modes

- Invalid or malformed modulus (non-numeric or wrong format) returns an error
- Exponent fails validity checks (even, too small, or not coprime with phi) returns reasons array
- Toy mode primes p or q exceed 65536 limit returns validation error
- Toy mode message integer >= n causes an out-of-range error
- Missing required 'mode' query parameter returns schema validation error
- Modulus too large (>8192 bits) returns size limit error

## How this service works

RSA public key arithmetic: modulus bits, exponent validity, NIST strength; or a labelled toy RSA with tiny primes.

## Output

Returns a structured object with: verdict on key strength (pass/fail/degraded), modulus bit length, NIST security assessment, exponent validity, reasons for any failures, and in toy mode also phi(n), Carmichael lambda, private exponent d, ciphertext, decrypted value, round-trip boolean, and step-by-step educational explanation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "mode"
     ],
     "properties": {
      "e": {
       "type": "string",
       "description": "public exponent (default 65537; required in toy mode)"
      },
      "n": {
       "type": "string",
       "description": "public mode: the PUBLIC modulus, decimal or 0x hex, up to 8192 bits"
      },
      "p": {
       "type": "string",
       "description": "toy mode: first tiny prime, below 65536"
      },
      "q": {
       "type": "string",
       "description": "toy mode: second tiny prime, below 65536"
      },
      "mode": {
       "type": "string",
       "description": "public (check a public modulus n and exponent e) or toy (educational RSA from tiny primes p and q)"
      },
      "message": {
       "type": "string",
       "description": "toy mode: a small integer below n to encrypt and decrypt, to show the round trip"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "d": {
       "type": [
        "null",
        "string"
       ]
      },
      "e": {
       "type": [
        "null",
        "string"
       ]
      },
      "n": {
       "type": [
        "null",
        "string"
       ]
      },
      "phi": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "steps": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "message": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "ver
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/crypto-math-rsa-arithmetic-fdadbf3a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from crypto-math.x402tookit.com](https://www.zero.xyz/host/crypto-math.x402tookit.com/llms.txt)
