Title: CSC2110%20Discrete%20Mathematics%20Tutorial%206%20Chinese%20Remainder%20Theorem%20and%20RSA
1CSCI2110 Discrete MathematicsTutorial 6Chinese
Remainder Theorem and RSA
Hackson Leung
2Announcement
- Project
- Those who have not registered, we assigned for
you, please check CUHK email - Midterm
- Next Monday 230pm to 400pm
- Bring your own calculator
3Agenda
- Chinese Remainder Theorem
- RSA
4Chinese Remainder Theorem
- Example 1
- Solve for
- Since
- Then 3-1 exists and
- Therefore,
5Chinese Remainder Theorem
- Example 2
- Solve for
- Since
- We reduce it to
- Same as example 1
- What if ?
- Contradiction!
6Chinese Remainder Theorem
- Example 3
- Solve the followings, or show no solution if it
has no solution
7Chinese Remainder Theorem
- Example 4
- Solve the following, or show no solution if it
has no solution
8Chinese Remainder Theorem
9Chinese Remainder Theorem
- Consider so that
- Step 1 Let
- Step 2 Construct
10Chinese Remainder Theorem
- Step 3 Find the multiplicative inverse of
- Remember how to find multiplicative inverse?
- Extended Euclids Algorithm!
- Step 4
- Step 5 Adjust to meet the requirement
11Chinese Remainder Theorem
- Example 1
- Solve for largest such that
12Chinese Remainder Theorem
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
13Chinese Remainder Theorem
- Example 2
- Solve for such that
14Chinese Remainder Theorem
- Example 3
- Solve for smallest such that
15Chinese Remainder Theorem
- What if
? - We can always reduce them
- Example 4
- Solve the largest such that
16Chinese Remainder Theorem
- Analyze first
- Thus, we have
17Chinese Remainder Theorem
- Take a look at
- So
- Same as example 1
- We want s to be relatively prime only!
18Chinese Remainder Theorem
- Example 5
- Solve for smallest such that
19Chinese Remainder Theorem
- Example 6
- Solve for largest such that
20RSA
- Step 1 , and very large
prime - Step 2
- Step 3 Choose
- Step 4 Find
- Public key
- Private key
21RSA
- Example 1
- Let
- Give the public and private keys in RSA
cryptosystem
22RSA
- Step 1
- Step 2
- Step 3 , the choice is
ok - Step 4
23RSA
- Public key
- Private key
- Example 2 Encrypt 5
- Example 3 Decrypt
24RSA
25The End