SlideShare a Scribd company logo
1 of 14
CHINESE REMAINDER THEOREM
By: ykchan56@gmail.com
1
《孫子算經》卷下第二十六題
written between AD300 and AD470
Do not know the actual time of writing
有物不知其數
三三數之剩二
五五數之剩三
七七數之剩二
問物幾何?
2
In today’s notation:
X ≡ 2 mod 3
X ≡ 3 mod 5
X ≡ 2 mod 7
Find X
• X ≡ a1 mod m1
• X ≡ a2 mod m2
• X ≡ a3 mod m3
• X ≡ ( a1 m2 m3 (m2 m3
-1 mod m1 ) +
a2 m1 m3 (m1 m3
-1 mod m2 ) +
a3 m1 m2 (m1 m2
-1 mod m3 )
) mod m1 m2 m3
Solution to CRT
3
a-1 mod m
is the inverse modulus
see next page
• a-1 mod m
• a and m must be relative prime
• There exists a value t where
at = mx + 1 (for some x)
• t is the inverse modulus of a
• t ≡ a-1 mod m
• It can also be express as
at ≡ 1 mod m
• Inverse Modulus can be found by tries and errors
• or by Extended Euclidean Algorithm
– which is Euclidean Algorithm going backward
(擴展歐幾里得算法)
Inverse Modulus
4
• X ≡ 2 mod 3
• X ≡ 3 mod 5
• X ≡ 2 mod 7
• X ≡ ( 2*5*7* ((5*7)-1 mod 3 ) +
3*3*7* ((3*7)-1 mod 5) +
2*3*5* ((3*5)-1 mod 7)
) mod (3*5*7)
Chinese Remainder Theorem in 孫子算經
5
CRT only works if 3,
5, 7 are pairwise
relative prime
(5*7)-1 mod 3 ) => 35-1 mod 3 => 35Y1 = 3*X1 + 1
Y1 = 2, X1 = 23
(3*7)-1 mod 5) => 21-1 mod 5 => 21Y2 = 5*X2 + 1
Y2 = 1, X2 = 4
(3*5)-1 mod 7 => 15-1 mod 7 => 15Y3 = 7*X3 + 1
Y3 = 1, X3 = 2
Find the inverse moduli
6
• X ≡ 2 mod 3; X ≡ 3 mod 5 ; X ≡ 2 mod 7
• X ≡ ( 2*5*7* ((5*7)-1 mod 3 ) +
3*3*7* ((3*7)-1 mod 5) +
2*3*5* ((3*5)-1 mod 7)
) mod (3*5*7)
X ≡ ( 70 * 2 + 63 * 1 + 30 * 1 ) mod 105
≡ (140 + 63 + 30 ) mod 105
≡ 233 mod 105
X = 23
Back to the original problem
7
• For
X ≡ a1 mod m1
X ≡ a2 mod m2
…
X ≡ ak mod mk
• And m1 to mk are pairwise relative prime
• There exists a value of X where …
CRT in general
8
• M ≡ m1 * m2 * … * mk
• M1 ≡ M/m1 ; M2 ≡ M/m2 ;… ; Mk ≡ M/mk
• Find the inverse moduli of
y1 ≡ M1
-1 mod m1 ; y2 ≡ M2
-1 mod m2 ; … ;
yk ≡ Mk
-1 mod mk
X ≡ (a1*M1*y1 + a2*M2*y2 +…+ak*Mk*yk) mod M
CRT in general (cont.)
9
• Crack a low value e in RSA
• e can be computed faster in RSA if it is
3 (binary 11)
17 (binary 10001)
65537 (binary 1000000000000001)
• NEVER use 3 as e in RSA
Why? See next page
What is the application of Chinese
Remainder Theorem?
10
• Hacking H listen to all the packages sent
among A, B, C and F
• A tries to send the same message M to B, C
and F using 3 different RSA keys
(eb, Kb), (ec, Kc), (ef, Kf)
• Values of eb, ec and ef are all 3
• The message M is encrypted as MB, MC, Mf
Low value e RSA hacking
11
• Mb = M**eb mod Kb
• Mc = M**ec mod Kc
• Mf = M**ef mod Kf
With eb, ec, ef = 3
Rearrange left and right parts
• M3 ≡ Mb mod Kb
• M3 ≡ Mc mod Kc
• M3 ≡ Mf mod Kf
Low value e RSA hacking (cont.)
12
M3 can be found using
Chinese Remainder Theorem
M is the cubic root of M3
You do not need to know db, dc or df
• Find 11-1 mod 3220 by Extended Euclidean Algorithm
• 3220 = 11 * 292 + 8 -> ( 8 = 3220 – 11 * 292 ) [1]
• 11 = 8 * 1 + 3 -> ( 3 = 11 – 8 * 1 ) [2]
• 8 = 3 * 2 + 2 -> ( 2 = 8 – 3 * 2 ) [3]
• 3 = 2 * 1 + 1 (First phase finish when the remainder is 1, start second phase)
• Reverse the steps by rearranging the equations
• 1 = 3 – 2 * 1 (using [3])
• 1 = 3 – (8-3*2) * 1
• 1 = 3 – 8 + 3 * 2
• 1 = 3 * 3 – 8 (using [2])
• 1 = (11-8*1) *3 – 8
• 1 = 3*11 - 8*3 – 8
• 1 = 3 * 11 – 8 * 4 (using [1])
• 1 = 3 * 11 – ( 3220 – 11 * 292 ) * 4 (Keep 11 and 3220 as two variables)
• 1 = 3 * 11 – 3220 * 4 + 4 * 11 * 292 (compute the other values)
• 1 = 11 * ( 3 + 4 * 292 ) – 3220 * 4
• 1 = 11 * 1171 – 3220 * 4 (Answer is 1171 )
11-1 mod 3220 = 1171
11*t = 3220*X+1 X any number < 11
13
It appears using Extended Euclidean Algorithm is
slower than tries and errors
In this special case because 11 is small and you only
need to try 10 times
If the value of Y in Y-1 mod M = R is large
Extended Euclidean Algorithm is much faster
• Chinese Reminder Theorem is used in many
Crypto-algorithm as lots of crpyto-algorithm
depends on Modulus Arithmetic
• It is a case where something invented long
time ago finds an application 1600 years later
About CRT
14

More Related Content

What's hot

2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes
jennoga08
 
Distributive Property
Distributive PropertyDistributive Property
Distributive Property
Bitsy Griffin
 
7 2 adding and subtracting polynomials
7 2 adding and subtracting polynomials7 2 adding and subtracting polynomials
7 2 adding and subtracting polynomials
hisema01
 
Add/Subtracting Polynomials
Add/Subtracting PolynomialsAdd/Subtracting Polynomials
Add/Subtracting Polynomials
swartzje
 
Factorising Common Factors
Factorising Common FactorsFactorising Common Factors
Factorising Common Factors
Passy World
 

What's hot (19)

Family feud
Family feudFamily feud
Family feud
 
Understanding the remainder theorem
Understanding  the remainder theoremUnderstanding  the remainder theorem
Understanding the remainder theorem
 
Difference of squares
Difference of squaresDifference of squares
Difference of squares
 
Algebra
AlgebraAlgebra
Algebra
 
2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes
 
Addition and subtraction of polynomial functions
Addition and subtraction of polynomial functionsAddition and subtraction of polynomial functions
Addition and subtraction of polynomial functions
 
Operations on Polynomials
Operations on PolynomialsOperations on Polynomials
Operations on Polynomials
 
Square of trinomial
Square of trinomialSquare of trinomial
Square of trinomial
 
Distributive Property
Distributive PropertyDistributive Property
Distributive Property
 
1.1 ss factoring the difference of two squares
1.1 ss factoring the difference of two squares1.1 ss factoring the difference of two squares
1.1 ss factoring the difference of two squares
 
Lesson 6 subtraction of polynomials
Lesson 6 subtraction of polynomialsLesson 6 subtraction of polynomials
Lesson 6 subtraction of polynomials
 
7 2 adding and subtracting polynomials
7 2 adding and subtracting polynomials7 2 adding and subtracting polynomials
7 2 adding and subtracting polynomials
 
Add/Subtracting Polynomials
Add/Subtracting PolynomialsAdd/Subtracting Polynomials
Add/Subtracting Polynomials
 
Addition and Subtraction of Polynomials
Addition and Subtraction of PolynomialsAddition and Subtraction of Polynomials
Addition and Subtraction of Polynomials
 
factoring polynomials
factoring polynomialsfactoring polynomials
factoring polynomials
 
Factorising Common Factors
Factorising Common FactorsFactorising Common Factors
Factorising Common Factors
 
Evaluating a function
Evaluating a functionEvaluating a function
Evaluating a function
 
March 6
March 6March 6
March 6
 
Factoring quadratic trinomial
Factoring quadratic trinomialFactoring quadratic trinomial
Factoring quadratic trinomial
 

Similar to Chinese_Remainder_Theorem.pptx

Mathnasium Presentation (1)
Mathnasium Presentation (1)Mathnasium Presentation (1)
Mathnasium Presentation (1)
Muhammad Arslan
 
Chapter 3 linear equations
Chapter 3 linear equationsChapter 3 linear equations
Chapter 3 linear equations
Chandran Chan
 
Quantum factorization.pdf
Quantum factorization.pdfQuantum factorization.pdf
Quantum factorization.pdf
ssuser8b461f
 

Similar to Chinese_Remainder_Theorem.pptx (20)

CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptxCSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
 
Adición y sustracción de fracciones
Adición y sustracción de fraccionesAdición y sustracción de fracciones
Adición y sustracción de fracciones
 
Mathnasium Presentation (1)
Mathnasium Presentation (1)Mathnasium Presentation (1)
Mathnasium Presentation (1)
 
Q1-W1-Factoring Polynomials.pptx
Q1-W1-Factoring Polynomials.pptxQ1-W1-Factoring Polynomials.pptx
Q1-W1-Factoring Polynomials.pptx
 
Chapter 3 linear equations
Chapter 3 linear equationsChapter 3 linear equations
Chapter 3 linear equations
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
 
Lec_4.pdf
Lec_4.pdfLec_4.pdf
Lec_4.pdf
 
Laws of Exponent
Laws of ExponentLaws of Exponent
Laws of Exponent
 
Lecture 03 special products and factoring
Lecture 03 special products and factoringLecture 03 special products and factoring
Lecture 03 special products and factoring
 
Completing the square
Completing the squareCompleting the square
Completing the square
 
Lec39
Lec39Lec39
Lec39
 
Project in Mathematics. Functions
Project in Mathematics. FunctionsProject in Mathematics. Functions
Project in Mathematics. Functions
 
the inverse of the matrix
the inverse of the matrixthe inverse of the matrix
the inverse of the matrix
 
Dynamic Programming Matrix Chain Multiplication
Dynamic Programming Matrix Chain MultiplicationDynamic Programming Matrix Chain Multiplication
Dynamic Programming Matrix Chain Multiplication
 
Quantum factorization.pdf
Quantum factorization.pdfQuantum factorization.pdf
Quantum factorization.pdf
 
DAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxDAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptx
 
Algebra unit 8.7
Algebra unit 8.7Algebra unit 8.7
Algebra unit 8.7
 
3 more on algebra of radicals
3 more on algebra of radicals3 more on algebra of radicals
3 more on algebra of radicals
 
Stacks image 1721_36
Stacks image 1721_36Stacks image 1721_36
Stacks image 1721_36
 
New stack
New stackNew stack
New stack
 

Recently uploaded

Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 

Recently uploaded (20)

Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 

Chinese_Remainder_Theorem.pptx

  • 1. CHINESE REMAINDER THEOREM By: ykchan56@gmail.com 1
  • 2. 《孫子算經》卷下第二十六題 written between AD300 and AD470 Do not know the actual time of writing 有物不知其數 三三數之剩二 五五數之剩三 七七數之剩二 問物幾何? 2 In today’s notation: X ≡ 2 mod 3 X ≡ 3 mod 5 X ≡ 2 mod 7 Find X
  • 3. • X ≡ a1 mod m1 • X ≡ a2 mod m2 • X ≡ a3 mod m3 • X ≡ ( a1 m2 m3 (m2 m3 -1 mod m1 ) + a2 m1 m3 (m1 m3 -1 mod m2 ) + a3 m1 m2 (m1 m2 -1 mod m3 ) ) mod m1 m2 m3 Solution to CRT 3 a-1 mod m is the inverse modulus see next page
  • 4. • a-1 mod m • a and m must be relative prime • There exists a value t where at = mx + 1 (for some x) • t is the inverse modulus of a • t ≡ a-1 mod m • It can also be express as at ≡ 1 mod m • Inverse Modulus can be found by tries and errors • or by Extended Euclidean Algorithm – which is Euclidean Algorithm going backward (擴展歐幾里得算法) Inverse Modulus 4
  • 5. • X ≡ 2 mod 3 • X ≡ 3 mod 5 • X ≡ 2 mod 7 • X ≡ ( 2*5*7* ((5*7)-1 mod 3 ) + 3*3*7* ((3*7)-1 mod 5) + 2*3*5* ((3*5)-1 mod 7) ) mod (3*5*7) Chinese Remainder Theorem in 孫子算經 5 CRT only works if 3, 5, 7 are pairwise relative prime
  • 6. (5*7)-1 mod 3 ) => 35-1 mod 3 => 35Y1 = 3*X1 + 1 Y1 = 2, X1 = 23 (3*7)-1 mod 5) => 21-1 mod 5 => 21Y2 = 5*X2 + 1 Y2 = 1, X2 = 4 (3*5)-1 mod 7 => 15-1 mod 7 => 15Y3 = 7*X3 + 1 Y3 = 1, X3 = 2 Find the inverse moduli 6
  • 7. • X ≡ 2 mod 3; X ≡ 3 mod 5 ; X ≡ 2 mod 7 • X ≡ ( 2*5*7* ((5*7)-1 mod 3 ) + 3*3*7* ((3*7)-1 mod 5) + 2*3*5* ((3*5)-1 mod 7) ) mod (3*5*7) X ≡ ( 70 * 2 + 63 * 1 + 30 * 1 ) mod 105 ≡ (140 + 63 + 30 ) mod 105 ≡ 233 mod 105 X = 23 Back to the original problem 7
  • 8. • For X ≡ a1 mod m1 X ≡ a2 mod m2 … X ≡ ak mod mk • And m1 to mk are pairwise relative prime • There exists a value of X where … CRT in general 8
  • 9. • M ≡ m1 * m2 * … * mk • M1 ≡ M/m1 ; M2 ≡ M/m2 ;… ; Mk ≡ M/mk • Find the inverse moduli of y1 ≡ M1 -1 mod m1 ; y2 ≡ M2 -1 mod m2 ; … ; yk ≡ Mk -1 mod mk X ≡ (a1*M1*y1 + a2*M2*y2 +…+ak*Mk*yk) mod M CRT in general (cont.) 9
  • 10. • Crack a low value e in RSA • e can be computed faster in RSA if it is 3 (binary 11) 17 (binary 10001) 65537 (binary 1000000000000001) • NEVER use 3 as e in RSA Why? See next page What is the application of Chinese Remainder Theorem? 10
  • 11. • Hacking H listen to all the packages sent among A, B, C and F • A tries to send the same message M to B, C and F using 3 different RSA keys (eb, Kb), (ec, Kc), (ef, Kf) • Values of eb, ec and ef are all 3 • The message M is encrypted as MB, MC, Mf Low value e RSA hacking 11
  • 12. • Mb = M**eb mod Kb • Mc = M**ec mod Kc • Mf = M**ef mod Kf With eb, ec, ef = 3 Rearrange left and right parts • M3 ≡ Mb mod Kb • M3 ≡ Mc mod Kc • M3 ≡ Mf mod Kf Low value e RSA hacking (cont.) 12 M3 can be found using Chinese Remainder Theorem M is the cubic root of M3 You do not need to know db, dc or df
  • 13. • Find 11-1 mod 3220 by Extended Euclidean Algorithm • 3220 = 11 * 292 + 8 -> ( 8 = 3220 – 11 * 292 ) [1] • 11 = 8 * 1 + 3 -> ( 3 = 11 – 8 * 1 ) [2] • 8 = 3 * 2 + 2 -> ( 2 = 8 – 3 * 2 ) [3] • 3 = 2 * 1 + 1 (First phase finish when the remainder is 1, start second phase) • Reverse the steps by rearranging the equations • 1 = 3 – 2 * 1 (using [3]) • 1 = 3 – (8-3*2) * 1 • 1 = 3 – 8 + 3 * 2 • 1 = 3 * 3 – 8 (using [2]) • 1 = (11-8*1) *3 – 8 • 1 = 3*11 - 8*3 – 8 • 1 = 3 * 11 – 8 * 4 (using [1]) • 1 = 3 * 11 – ( 3220 – 11 * 292 ) * 4 (Keep 11 and 3220 as two variables) • 1 = 3 * 11 – 3220 * 4 + 4 * 11 * 292 (compute the other values) • 1 = 11 * ( 3 + 4 * 292 ) – 3220 * 4 • 1 = 11 * 1171 – 3220 * 4 (Answer is 1171 ) 11-1 mod 3220 = 1171 11*t = 3220*X+1 X any number < 11 13 It appears using Extended Euclidean Algorithm is slower than tries and errors In this special case because 11 is small and you only need to try 10 times If the value of Y in Y-1 mod M = R is large Extended Euclidean Algorithm is much faster
  • 14. • Chinese Reminder Theorem is used in many Crypto-algorithm as lots of crpyto-algorithm depends on Modulus Arithmetic • It is a case where something invented long time ago finds an application 1600 years later About CRT 14