2. Learning
Objectives:
• Understanding the concept of the Chinese Remainder
Theorem and its significance in number theory.
• Learning how to apply the Chinese Remainder Theorem to
solve systems of congruences.
• Exploring applications of the Chinese Remainder Theorem in
cryptography.
By the end of this lesson, you will be able to
3. CHINESE REMAINDER THEOREM
The Chinese remainder theorem (CRT) is
used to solve a set of congruent equations
with one variable but different moduli, which
are relatively prime, as shown below:
x a₁ (mod m₁)
≡
x a
≡ 2 (mod m2)
x a
≡ k (mod mk)
4. Example:
The following is an example of a set of
equations with different moduli:
The solution to this set of equations is given in
the next section; for the moment, note that the
answer to this set of equations is x = 23. This
value satisfies all equations: 23 2 (mod 3), 23
≡
3 (mod 5), and 23 2 (mod 7).
≡ ≡
Continued...
x 2 (mod 3)
≡
x 3 (mod 5)
≡
x 2 (mod 7)
≡
5. Continue
d...
Solution To Chinese Remainder Theorem
1. Find M = m₁ × m₂ × ... × mₖ. This is the common
modulus.
2. Find M₁ = M/m₁, M₂ = M/m₂, ..., Mₖ = M/mₖ.
3. Find the multiplicative inverse of M₁, M₂, ..., Mₖ
using the corresponding moduli (m₁, m₂, ..., mₖ).
Call the inverses M₁⁻¹, M₂⁻¹, ..., Mₖ⁻¹.
4. The solution to the simultaneous equations is
x = (a₁ × M₁ × M₁⁻¹ + a₂ × M₂ × M₂⁻¹ + ... + aₖ × Mₖ × Mₖ⁻¹) mod
M
6. Continued.
..
Example
Find the solution to the simultaneous equations:
Solution
We follow the four steps.
1. M = 3 × 5 × 7 = 105
2. M₁ = 105 / 3 = 35, M₂ = 105 / 5 = 21, M₃ = 105 / 7 = 15
3. The inverses are M₁⁻¹ = 2, M₂⁻¹ = 1, M₃⁻¹ = 1
4. x = (2 × 35 × 2 + 3 × 21 × 1 + 2 × 15 × 1) mod 105
x = 23 mod 105
x 2 (mod
≡
3)
x 3 (mod
≡
5)
x 2 (mod
≡
7)
7. Continue
d...
Example
Find an integer that has a remainder of 3 when divided by 7 and
13, but is divisible by 12.
Solution
This is a CRT problem. We can form three equations and solve
them to find the value of x.
If we follow the four steps, we find x = 276. We can check that
276 3 (mod 7), 276 3 (mod 13) and 276 is divisible by 12 (the
≡ ≡
quotient is 23 and the remainder is zero).
x 3 (mod
≡
7)
x 3 (mod
≡
13)
x 0 (mod
≡
12)
8. Chinese Remainder Theorem
Used to speed up modulo computations
If working modulo a product of numbers
• eg. mod M = m₁m₂...mₖ
Chinese Remainder theorem lets us work
in each moduli mᵢ separately
Since computational cost is proportional to
size, this is faster than working in the full
modulus M
9. Chinese Remainder Theorem
Can implement CRT in several ways
to compute A (mod M)
• first compute all aᵢ = A mod mᵢ separately
• determine constants cᵢ below, where Mᵢ = M/mᵢ
• then combine results to get answer using:
10. Chinese Remainder Theorem (CRT)
Suppose m₁, ..., mₖ are pairwise relatively
prime positive integers, and suppose a₁, ..., aₖ
are integers. Then the system of k
congruences x aᵢ (mod mᵢ) (1 i k) has a
≡ ≤ ≤
unique solution modulo M = m₁ × ... × mₖ,
which is given by
where cᵢ = Mᵢ(Mᵢ⁻¹ mod mᵢ) and Mᵢ = M/mᵢ,
for 1 i k.
≤ ≤