{"uid":"cap_kF4Pr2QbiQw_ehSmUJEGm","slug":"crypto-math-chinese-remainder-theorem-solver-a99fdc21","name":"Crypto Math: Chinese Remainder Theorem Solver","description":"Solve x = a1 (mod m1), x = a2 (mod m2), ... with the Chinese remainder theorem, coprime or not.","url":"https://crypto-math.x402tookit.com/crt?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":["congruences"],"properties":{"congruences":{"type":"string","description":"Comma-separated residue:modulus pairs, e.g. 2:3,3:5,2:7 (2 to 12 pairs)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"x":{"type":["null","string"]},"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"modulus":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"equation":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"equationCount":{"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__I00XRV4y_qUmNZGO4LI2","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":"Solves systems of simultaneous congruences (x ≡ a1 mod m1, x ≡ a2 mod m2, …) using the Chinese Remainder Theorem, supporting both coprime and non-coprime moduli.","exampleAgentPrompt":"Use the CRT solver to find x satisfying the congruences 2:3, 3:5, 2:7 — tell me the solution x and the combined modulus.","exampleUseCases":[{"title":"Cryptographic key reconstruction","prompt":"I need to recover a value using the Chinese Remainder Theorem from these congruences: 6:11, 9:13, 17:19 — what is x and the combined modulus?"},{"title":"Number theory homework check","prompt":"Can you solve this system of congruences for me: x ≡ 2 mod 3, x ≡ 3 mod 5, x ≡ 2 mod 7? Use the CRT and tell me if a solution exists and what it is."},{"title":"Non-coprime moduli feasibility check","prompt":"I have these congruences: 4:6, 3:9 — are the moduli non-coprime, and does a solution still exist? Run the CRT and show me the result or why it fails."}],"resultDescription":"Returns the solution x (smallest non-negative integer satisfying all congruences), the combined modulus, a human-readable equation string, a summary of the computation, a verdict on whether a solution exists, and optional reasons if no solution is found. Also includes a degraded flag and disclaimer if relevant.","failureModes":["No solution exists when moduli are non-coprime and residues are incompatible — returns null x with reasons","Malformed congruences string (wrong separator, non-integer values) causes a 400-style error","Fewer than 2 or more than 12 congruence pairs may be rejected","Overflow or extremely large integers may cause computation failure","Missing required 'congruences' query parameter returns an error"],"whenToPreferThis":"Choose this endpoint when you need to solve a system of simultaneous modular congruences — especially when moduli may not be pairwise coprime and a generalized CRT is required. Ideal for cryptographic computations (e.g. RSA CRT optimization), number theory problems, and scheduling or calendar calculations based on modular cycles. Prefer over general-purpose CAS tools when you need a lightweight, paid-per-call API with structured output including solvability verdict and modulus.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:11:24.074Z","isFirstParty":false,"canonicalSlug":"crypto-math-chinese-remainder-theorem-solver-a99fdc21"}