Premitive Roots_lecture3
Premitive Roots_lecture3
Since (22) = 10, the possible orders of residues modulo 22 are 1; 2; 5; 10.
We find one primitive root by trying residues 3; 5; ::: (2 is out because it is not invertible modulo 22)
Since 35 1 (mod 22), 3 is not a primitive root modulo 22.
Since 55 1 (mod 22), 5 is not a primitive root modulo 22.
Since 72 / 1 (mod 22), 7 is a primitive root modulo 22.
/ 1, 75 ¡1
10
7x (mod 22) has order gcd (10; x)
. We have gcd (10; x) = 1 for x = 1; 3; 7; 9.
Theorem 156. (number of primitive roots) Suppose there is a primitive root modulo n. Then
there are ((n)) primitive roots modulo n.
Proof. Let x be a primitive root. It has order (n). All other invertible residues are of the form xa.
(n)
Recall that xa has order gcd ((n); a)
. This is (n) if and only if gcd ((n); a) = 1. There are ((n)) values
a among 1; 2; :::; (n), which are coprime to (n).
In conclusion, there are ((n)) primitive roots modulo n.
Comment. Recall that, for instance, there is no primitive root modulo 15. That's why we needed the assumption
that there should be a primitive root modulo n (which is the case if and only if n is of the form 1; 2; 4; pk ; 2pk
for some odd prime p).
In particular, since there are always primitive roots modulo primes, we have the following important
case:
Example 157. (bonus challenge) For which prime p < 106 is the proportion of primitive roots
among invertible residues the smallest?
Send in a solution by next week for a bonus point!
Armin Straub 58
[email protected]
Back to RSA
(RSA encryption)
Bob chooses e, and then computes d such that de 1 (mod (p ¡ 1)(q ¡ 1)).
Theorem 158. Let N = pq and d; e be as in RSA. Then, for any m, m mde (mod N ).
Comment. Using Euler's theorem, this follows immediately for residues m which are invertible modulo N .
However, it then becomes tricky to argue what happens if m is a multiple of p or q.
Proof. By the CRT, we have m mde (mod N ) if and only if m mde (mod p) and m mde (mod q).
Since d e 1 (mod (p ¡ 1)(q ¡ 1)), we also have d e 1 (mod p ¡ 1). By little Fermat, it follows that
mde m (mod p) for all m
/ 0 (mod p). On the other hand, if m 0 (mod p), then this is obviously true.
Thus, m mde (mod p) for all m. Likewise, modulo q .
(c) We need to compute m = cd (mod N ), that is, m = 317 (¡2)7 4 (mod 33).
That is, m = 4 (as we already knew from the first part).
Example 160. For his public RSA key, Bob needs to select p; q and e. Which of these must be
chosen randomly?
Solution. The primes p and q must be chosen randomly. Anything that makes these primes more predictable,
makes it easier for an attacker to get her hands on them [in which case, the secret key d is trivial to compute].
On the other hand, e does not need to be chosen at random. In fact, knowing any pair e; d such that ed
1 (mod (p ¡ 1)(q ¡ 1)) would allow us to factor N = pq (and thus break RSA). We'll prove that later.
Armin Straub 59
[email protected]