cis 428/628 - introduction to cryptography - spring 2009
background for quiz 2
i. terminology
Be able to define and give an example of the
following terms. Each term is in the index of either
Lewand or Trappe and Washington.
- asymmetric cryptosystem
- birthday attack
- bit commitment
- cipher block chaining
- cipher block feed back
- Chinese Remainder Theorem
- chosen plaintext attack
- collision-free
- congruence class
- discrete log
- double encryption
- electronic codebook
- Euler's Theorem
- Euler's phi function
- extended g.c.d.
- existential forgery
- Fermat's Little Lemma
- finite field
- hash function
- index of coincidence
- message digest
- one-time pad
- one-way function
- prime number theorem
- primitive root
- pseudoprime
- RSA signature
ii. number theory
The themes of this part of the quiz will be: Euler's Theorem,
Fermat's Little Lemma, and RSA.
Here are some sample problems.
-
Suppose p is a prime and a and b are numbers such that
a * b == 0 (mod p). Show that a == 0 (mod p) or b == 0 (mod p).
-
Suppose p is an odd prime. Show that the only solutions
to x2 == 1 (mod p) are 1 and p-1. (Hint:
consider (x+1)(x-1) == 0 (mod p) and use the previous problem.)
-
Let p be a prime. Show that ap == a (mod p) for all a.
-
Andrews exercise 5 on page 64.
-
Andrews exercise 6 on page 64.
-
Andrews exercise 8 on page 64.
-
Suppose Alice's public RSA key is (n,e).
Also suppose that instead of choosing n=p*q (where p and q are prime),
Alice goofs and chooses n = p (where p is some prime).
Show that Eve can easily decrypt Alice's messages.
questions from a previous year's quiz 2
Problem 1 (9 points)
Define and give an example of each of the following.
(A one or two sentence definition is enough and a small
example suffices.)
a. birthday attack
b. discrete log
c. message digest
[show answer]
Problem 2 (3 points)
Evaluate 21415926202003 (mod 11).
[show answer]
answer:
By F.L.L.:
21415926202003 mod 11
= 2(1415926202003 mod phi(11)) mod 11
= 2(1415926202003 mod 10) mod 11
= 23 mod 11
= 8.
[hide answer]
Problem 3 (8 points)
Do two of the following three problems.
If you work all three, indicate the ones you want graded.
- (4 points)
Show that ap-2 = a-1 (mod p),
where p is an odd prime.
- (4 points)
Show that n5 and n have the same ending decimal digit,
where n>0.
- (4 points)
Suppose (n,p,q,e,d) is Alice's RSA key, so
encryptA(m) = me (mod n)
is Alice's public encryption function. Show that
encryptA( (m1 * m2) mod n )
≡
(encryptA(m1)*encryptA(m2))
(mod n).
for every m1 and m2 in Zn*.
[show answer]
answers:
-
Fix a in Zp*.
Then
ap-2 = a-1*ap-1 (by algebra)
= a-1*1 (by Fermat's Little Lemma)
= a-1 (mod p) (by algebra).
-
By the table, phi(10)=4.
Case 1: gcd(n,10)=1.
By Euler's Theorem, n4 = 1 (mod 10).
So, n5 = n (mod 10) as required.
Case 2: gcd(n,10)=10.
Then, n5 = 0 = n (mod 10) as required.
Case 3: gcd(n,10)=2.
Then n5 = 0 = n (mod 2).
Also gcd(n,5)=1. So, n5 = n (mod 5) by FLL.
Therefore, by the CRT, n5 = n (mod 10).
Case 4: gcd(n,10)=5.
This follows similarly to Case 3.
-
encryptA( (m1 * m2) mod n )
= ((m1 * m2) mod n)e mod n
= (m1e * m2e) mod n
= ( (m1e mod n) * (m2e mod n) ) mod n
= ( encryptA(m1) * encryptA(m2) ) mod n
[hide answer]
number theory and crypto facts given on the quiz
The binomial theorem. For n>0 and x,y in Z:
(x+y)n =
xn +
C(n,1) * xn-1y1 +
C(n,2) * xn-2y2 + … +
C(n,n-1) * x1yn-1 + yn,
where C(n,k) = n!/(k!*(n-k)!).
Theorem. For each a,b>0 we have that
gcd(a,b) = min {xa+yb | x,y in Z & xa+yb>0 }.
Fermat's little lemma. Suppose p is a
prime. Then for each integer a,
ap-1 ≅ 1 (mod p).
Euler's theorem. Suppose n>1. Then
for each a in Zn*,
aphi(n) ≅ 1 (mod n).
Euler's corollary. Suppose n=p * q, where
p and q are distinct primes. Then,
for each integer a, aphi(n)+1 ≅ a (mod n).
The multiplication table for Z11*.
* 1 2 3 4 5 6 7 8 9 10
1 1 2 3 4 5 6 7 8 9 10
2 2 4 6 8 10 1 3 5 7 9
3 3 6 9 1 4 7 10 2 5 8
4 4 8 1 5 9 2 6 10 3 7
5 5 10 4 9 3 8 2 7 1 6
6 6 1 7 2 8 3 9 4 10 5
7 7 3 10 6 2 9 5 1 8 4
8 8 5 2 10 7 4 1 9 6 3
9 9 7 5 3 1 10 8 6 4 2
10 10 9 8 7 6 5 4 3 2 1
Some values of phi(n)
n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
phi(n) 1 1 2 2 4 2 6 4 6 4 10 4 12 6 8 8
The RSA algorithm: Each user does the following.
- Picks to large, distinct primes p & q.
- Computes n=p * q and phi(n) = (p-1) * (q-1).
- Picks a random e in {1,…,phi(n)-1} with gcd(e,phi(n))=1.
- Computes d in {1,…,phi(n)-1} with d * e ≅ 1 (mod phi(n)).
- Publishes e and n.
- The values p, q, and d are kept private.
A user with key (n,p,q,e,d) has the following
encryption and decryption functions:
encrypt(m) = me (mod n) [public]
decrypt(c) = cd (mod n) [private]
where c,m in Zn*.
back to the course home page
Jim Royer /