Apex › Cryptography

One number, many remainders (Chinese Remainder Theorem)

A number below M = m₁·m₂·… (coprime moduli) is uniquely pinned by its remainders — a collision-free fingerprint. CRT reconstructs it as x = Σ rᵢ·eᵢ mod M, where each basis element eᵢ is ≡1 at its own modulus and ≡0 at the others (for 3·5·7: e = 70, 21, 15). Verified in node: reconstruction satisfies every congruence, the solution is unique in [0,M), and the round-trip is exact. Powers RSA decryption (~4× faster, mod p and mod q separately) and carry-free residue arithmetic. Dial the remainders mod 3, 5, 7 and watch the unique number appear.

More in Cryptography