跳到主要内容
uencoder

Use Chinese Remainder Theorem

CRT solves systems 的 modular congruences. Learn algorithm 和其 applications 在 RSA 优化和 secret sharing.

  1. 1

    CRT states: 如果 moduli m1, m2,。.., mn 是 pairwise coprime, 然后系统 x ≡ a1 (mod m1), x ≡ a2 (mod m2),。.., x ≡ (mod mn) 有唯一解决方案取模 M = m1 * m2 *。.. * mn. CRT 是 used 在 RSA 解密 (using p 和 q separately, 然后 combining via CRT — 4x faster) 和在 Shamir's Secret Sharing.

  2. 2
    中国剩余定理计算器 →

    Solve 系统的 congruences. Enter remainders [a1, a2,。..] 和 moduli [m1, m2,。..]. tool computes 解决方案 x 和 combined modulus M. Verify: x mod m1 = a1, x mod m2 = a2, etc.

  3. 3
    最大公约数计算器 →

    Verify 该 moduli 是 pairwise coprime (gcd(mi, mj) = 1 为所有 i ≠ j). 如果任何对 shares 常见因子, CRT 不应用 directly — 系统可以有 否解决方案或 多个 solutions.

常见问题

如何 CRT 速度上 RSA?
RSA 解密 computes m = c^d mod n, where n = p*q. Using CRT: 计算 m_p = c^(d mod p-1) mod p 和 m_q = c^(d mod q-1) mod q separately (smaller exponents 和 moduli), 然后组合具有 CRT. 此是 4x faster because two exponentiations use half-大小 numbers 和能够是 parallelized.
什么如果 moduli 是不 coprime?
CRT requires pairwise coprime moduli. 如果它们是 不, 系统可以有 否解决方案 (如果 congruences 是 inconsistent) 或多个 solutions. Check pairwise GCDs 第一. 为 non-coprime moduli, use generalized CRT 或 solve 通过 substitution.

相关工具