New tool: the CRT Demo page shows the Chinese Remainder Theorem as two meshed gears (mod and mod ) turning a big mod dial, along with the table from class. Try it with and coprime, and then with and sharing a factor.
Relevant Textbook Sections:
3.3 (Computing modular inverses), 3.4 (Sunzi’s Theorem (Chinese Remainder Theorem)).
To Do:
- Find the inverse of modulo . Use the extended Euclidean algorithm. Verify your answer by multiplying out.
- Try out this Chinese Remainder Theorem problem, by hand: and . Show all the steps of the process, including the extended Euclidean algorithm. You can use the computer to do modular arithmetic for you (e.g. multiplying things if needed), but show the steps as if doing it by hand.
- Use any remaining time to do extra examples of CRT problems (you can make up your own by just putting in whatever numbers you want, as long as the moduli are coprime, and you can always check your answer by plugging it back into the original equations). The CRT Demo page can solve small ones too (moduli up to 20), so you can check your answers there.
- (AI suggestion) Sunzi’s original problem (c. 3rd–5th century): “There are certain things whose number is unknown. Counted by threes, two are left over; by fives, three are left over; by sevens, two are left over. How many things are there?” Solve it using CRT with three congruences.
- (AI suggestion) When the moduli are not coprime, CRT can fail. Does , have a solution? What about , ? Explain when such a system has a solution, and how many solutions it has modulo .
- (AI suggestion) Another way to invert modulo a prime: by Fermat’s little theorem, . Compute and compare with problem 1. Which method would you rather use for a 300-digit prime, and why? Which method still works modulo a composite ?
- (AI suggestion) CRT speeds up RSA. Alice’s key from the last daily post is , , , and she receives the ciphertext . Instead of computing directly, compute and (why may you reduce the exponent modulo and modulo respectively?), and then combine the two answers with CRT. Check your answer against the direct computation. Why is this faster?
- (AI suggestion) Håstad’s broadcast attack. Bob sends the same message to three friends, all using , with public moduli , , . Eve sees the ciphertexts , , . Use CRT to find modulo with for each . Explain why must equal exactly (as an integer, not just modulo something), and recover . What does this suggest about sending the same message to several people with a small ?