{"uid":"cap_s1QJmx6BOBvZ2uxQ9dy46","slug":"crypto-math-modular-exponentiation-mod-pow-bd28b208","name":"Crypto Math: Modular Exponentiation (mod-pow)","description":"Modular exponentiation base^exp mod m for big integers, decimal or 0x hex, up to 4096 bits.","url":"https://crypto-math.x402tookit.com/mod-pow?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":["base","exp","mod"],"properties":{"exp":{"type":"string","description":"Exponent, non-negative whole number"},"mod":{"type":"string","description":"Modulus, whole number of at least 1"},"base":{"type":"string","description":"Base, whole number (decimal or 0x hex, may be negative)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"result":{"type":["null","object"],"properties":{"hex":{"type":["null","string"]},"bits":{"type":["null","number"]},"decimal":{"type":["null","string"]}}},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"modulusBits":{"type":["null","number"]},"exponentBits":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xY-d2d9qQNGHTIXjbhJa2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes base^exp mod m for big integers (up to 4096 bits), accepting decimal or 0x hex inputs, returning both decimal and hex results.","exampleAgentPrompt":"Can you compute 0x3A7F ^ 65537 mod 0xFFFFFFFFFFFFFFC5 and give me the result in both decimal and hex?","exampleUseCases":[{"title":"RSA encryption step verification","prompt":"I need to verify the RSA encryption step: compute 42^65537 mod 3233 — give me the result in decimal and hex please."},{"title":"Diffie-Hellman key exchange check","prompt":"Can you calculate the Diffie-Hellman public key: 2^48271 mod 0xFFFFFFFFFFFFFFC5 using big integer modular exponentiation?"},{"title":"CTF cryptography challenge solver","prompt":"I'm working on a crypto challenge — I need to compute 0xDEADBEEF raised to the power 0x10001 modulo 0xFFFFFFFFFFFFFFFB and see both the hex and decimal output."}],"resultDescription":"Returns the computed value of base^exp mod m as both a decimal string and a hex string, along with the bit lengths of the modulus and exponent, and metadata like source and summary.","failureModes":["Missing required query parameters (base, exp, or mod) returns an error","Modulus of zero or negative value causes an invalid input error","Exponent that is negative returns an error","Input exceeding 4096-bit limit may be rejected","Malformed hex strings (bad 0x prefix or non-hex characters) cause parse errors"],"whenToPreferThis":"Use this endpoint when you need to perform modular exponentiation on large integers (up to 4096 bits) typical in cryptographic operations like RSA, Diffie-Hellman, or ElGamal. It is ideal when inputs may be in either decimal or hex format and you need results in both representations. Prefer this over general-purpose math APIs when working specifically with big-integer cryptographic arithmetic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:08:21.555Z","isFirstParty":false,"canonicalSlug":"crypto-math-modular-exponentiation-mod-pow-bd28b208"}