# Crypto Math Modular arithmetic, primality, CRT, curve parameters, RSA sizing, encodings, entropy and check digits. ## How to pay Machine-payable over x402. USDC on: Base (eip155:8453), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), Polygon (eip155:137), Arbitrum One (eip155:42161). No accounts. No API keys. No signup. The paying wallet is the account. ## Machine-readable - OpenAPI: https://crypto-math.x402tookit.com/openapi.json - x402 manifest: https://crypto-math.x402tookit.com/.well-known/x402 - Catalog (free): https://crypto-math.x402tookit.com/catalog - Health (free): https://crypto-math.x402tookit.com/health - Uptime (free): https://crypto-math.x402tookit.com/uptime ## Endpoints (10) ### GET /check-digits — $0.02 Generate or validate Luhn and ISO 7064 mod 97-10 (IBAN style) check digits from the string you supply. Params: scheme: string, value: string, action?: string Example: https://crypto-math.x402tookit.com/check-digits?scheme=iban&value=GBWEST12345698765432&action=generate ### GET /crt — $0.02 Solve x = a1 (mod m1), x = a2 (mod m2), ... with the Chinese remainder theorem, coprime or not. Params: congruences: string Example: https://crypto-math.x402tookit.com/crt?congruences=2%3A3%2C3%3A5%2C2%3A7 ### GET /ec-params — $0.02 secp256k1, P-256 and P-384 public parameters (p, n, G) from SEC 2, with an on-curve check of a public point. Params: curve: string, publicKey?: string, x?: string, y?: string Example: https://crypto-math.x402tookit.com/ec-params?curve=secp256k1&publicKey=0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 ### GET /encoding — $0.02 Convert public bytes between hex, base64 and base64url (RFC 4648) with strict decoding and expected-length check. Params: input: string, from: string, expectBytes?: integer Example: https://crypto-math.x402tookit.com/encoding?input=Zm9vYmFy&from=base64&expectBytes=6 ### GET /entropy — $0.02 Shannon entropy in bits per symbol from a frequency table, plus min-entropy, collision entropy and efficiency. Params: table: string Example: https://crypto-math.x402tookit.com/entropy?table=a%3A4%2Cb%3A2%2Cc%3A1%2Cd%3A1 ### GET /gcd-extended — $0.02 gcd, lcm and extended-Euclid Bezout coefficients of two integers, plus gcd/lcm of up to 20 more. Params: a: string, b: string, more?: string Example: https://crypto-math.x402tookit.com/gcd-extended?a=240&b=46&more= ### GET /mod-inverse — $0.02 Modular multiplicative inverse of a mod m, or the gcd that proves none exists. Params: a: string, mod: string Example: https://crypto-math.x402tookit.com/mod-inverse?a=17&mod=3120 ### GET /mod-pow — $0.02 Modular exponentiation base^exp mod m for big integers, decimal or 0x hex, up to 4096 bits. Params: base: string, exp: string, mod: string Example: https://crypto-math.x402tookit.com/mod-pow?base=4&exp=13&mod=497 ### GET /prime — $0.02 Primality test (deterministic Miller-Rabin below 2^64) plus the next and previous prime, with BigInt. Params: n: string, neighbors?: boolean Example: https://crypto-math.x402tookit.com/prime?n=18446744073709551557&neighbors=true ### GET /rsa-arith — $0.02 RSA public key arithmetic: modulus bits, exponent validity, NIST strength; or a labelled toy RSA with tiny primes. Params: mode: string, n?: string, e?: string, p?: string, q?: string, message?: string Example: https://crypto-math.x402tookit.com/rsa-arith?mode=toy&p=61&q=53&e=17&message=65 ## Terms Educational arithmetic on PUBLIC values computed locally, provided as is. Never send private keys, seeds, mnemonics, passphrases or secret exponents to this or any service: obviously key-shaped inputs are refused. The code is not constant-time and is not a cryptographic library. Toy RSA is an educational illustration with tiny primes and must never protect anything. Not security advice.