You are on page 1of 2

Dr. Z.

s Number Theory Lecture 16 Handout: Eulers Theorem and The RSA Encrypton
By Doron Zeilberger
Important Theorem: If a and n are coprime (alias relatively prime) then
a
(n)
1 (mod n)
Problem 16.1: Check Eulers theorem for n = 6.
Solution of 16.1: The set of integers between 1 and 5 that are coprime to 6 are {1, 5}, so (6) = 2
(also 6 = 2 3, so (6) = 2 3 (1
1
2
) (1
1
3
) = 2).
Of course 1
2
(mod 6) = 1. Also 5
2
25 (mod 6) 1 (mod 6).
You should know (and understand! and be able to reproduce!) at least one proof. Two are given
in wikipedia. Here is another one, for the special case needed for RSA, that you can easily extend.
Basic RSA Fact (Special case of Eulers Theorem)
If p and q are prime, and a is divisible by neither p nor q, then
a
(p1)(q1)
1 (mod pq) .
Proof: By Fermat:
a
p1
1 (mod p) and a
q1
1 (mod q) hence a
(p1)(q1)
1 (mod p) and a
(q1)(p1)
1
(mod q), hence a
(p1)(q1)
1 (mod pq) by the by Chinese Remainder theorem.
RSA
See the wikipedia article for the algorithm.
Problem 16.2: For p = 3 and q = 5 (and hence n = pq) and public key e = 5
(i) Check that e is an OK key, i.e. that it is coprime to (n).
(ii) Find the deciphering key, d, such that de 1 (mod (n))
(iii) Suppose Alice sent you the encrypted message 11. Check that this is an OK message (coprime
to n), and if it is nd her original message?
Solution of 16.2:
(i) Now (15) = 2 4 = 8, and gcd(e, (n)) = gcd(5, 8) = 1, so e = 5 is OK
(ii) 5
1
(mod 8) = 5 (it is just a uke that d = e in this case.
1
(iii) gcd(11, 15) = 1 so 11 is an OK message.
11
5
(mod 15) (4)
5
(mod 15) 4(4
2
)
2
(mod 15) 41
2
(mod 15) 4 (mod 15) 11 (mod 15)
Ans. to 16.2: Alices original message was (the same!, but this is a uke).
2

You might also like