Professional Documents
Culture Documents
7 0 Lect7 RSA-2
7 0 Lect7 RSA-2
2 RSA algorithm
Mathematical basis of RSA
Simple example (Schoolbook) RSA
3 Security of RSA
Security basis of RSA
Attacks on RSA
4 Applications of RSA
a p ≡ a mod p, i.e.
a p−1 ≡ 1 mod p
• Uses:
• Testing if an integer is prime
• Compute multiplicative inverse modulo a prime p
a−1 ≡ a p−2 mod p
φ(n) = (pq − 1) − (q − 1) − (p − 1) = pq − p − q + 1
= (p − 1)(q − 1)
aφ(n) ≡ 1 mod n
where φ(n) is then number of elements in {1, 2, · · · , n − 1}
that are relatively prime to n, and gcd(a, n) = 1
Dr Bobby Yang 10/26
Chinese Remainder Theorem SunZi
x ≡ 2 mod 3
x ≡ 3 mod 5
x ≡ 2 mod 7
x ≡ a mod p
x ≡ b mod q
then x ≡ c mod pq has a unique solution for z
where c = (p + q)−1 (qa + pb)
x ≡ 4 mod 5
x ≡ 3 mod 7
write x ≡ c mod 35
where
c = (5 + 7)−1 (4 × 7 + 3 × 5)
c = 12−1 · 43 = 3 · 43 = 24 mod 35
Ans: 24
Let P ≡ C d mod p
and P ≡ C d mod q
by CRT, P ≡ (p + q)−1 (qC d + pC d ) mod q
≡ C d mod pq
i.e. P ≡ C d mod n