1. Public-Key Encryption
2. RSA (Rivest, Shamir, Adleman)
3. RSA Setup
p, q
N=p.q
e,
where e<N, gcd(e,ø(N))=1
d:
e.d=1 mod ø(N) and 0<=d<=N
Kr={er,Nr}
K-1r={d,p,q}
4. RSA Parameter Selection
p, q
e to be a small number
ø(N)
e may be the same for all users
3 was suggested
216-1 = 65535 is often used
d will then be large
5. RSA Usage
Kr={er,Nr}
C=Mer mod Nr, where 0<=M<N
K-1r={d,p,q}
M=Cd mod Nr
6. Theory Behind RSA
N = pq where p, q are primes, then:Xø(N) = 1 mod N
gcd(x,ø(N))=1
e.d=1+q.ø(N)
M = Cd = Me.d = M1+q.ø(N) =
M1.(Mø(N))q =
M1.(1)q = M1 mod N
7. RSA Example
N=11*47=517
ø(N) = (p-1)(q-1) = 10*46 = 460
3
GCD(3,ø(N)) = GCD(3,460) = 1
d by solving:e.d=1 mod ø(N) where 0<=d<=N
d=Inverse(3,460)=307 by Euclid's alg
K=(3,517)
K-1=(307,11,47)
8. RSA Example cont.
M = 26
C = 263 mod 517 = 515
M = 515307 mod 517 = 26
9. RSA Security
N
| Decimal Digits in N | #Bit Operations to Factor N |
| 20 | 7.20e+03 |
| 40 | 3.11e+06 |
| 60 | 4.63e+08 |
| 80 | 3.72e+10 |
| 100 | 1.97e+12 |
| 120 | 7.69e+13 |
| 140 | 2.35e+15 |
| 160 | 5.92e+16 |
| 180 | 1.26e+18 |
| 200 | 2.36e+19 |
10. Actual Progress in Factoring
| Decimal Digits | Bits | When | MIPS-Years | Alg Used |
| 100 | 332 | Apr 91 | 7 | Quadratic Sieve |
| 110 | 365 | Apr 92 | 75 | Quadratic Sieve |
| 120 | 398 | Jun 93 | 830 | Quadratic Sieve |
| 129 | 428 | Apr 94 | 5000 | Quadratic Sieve |
| 130 | 431 | Apr 96 | 500 | Number Field Sieve |
| 140 | 464 | Feb 99 | 1500 | Number Field Sieve |
11. RSA in Practise
12. Speeding up RSA - Alternate Multiplication Techniques
13. Speeding up RSA - the Chinese Remainder Theorem
M = Cd mod R
M1 = M mod p = (C mod p)d mod (p-1) M2 = M mod q = (C mod q)d mod (q-1)
M = M1 mod p M = M2 mod q
M = [((M2 +q - M1)u mod q] p + M1 where p.u mod q = 1
14. RSA Implementation in Practice
15. El Gamal Public Key Encryption Scheme
16. El Gamal Setup
p, and
a a primitive element mod p
xB
yB = axB mod p
17. El Gamal Encryption
0<=k<=p-1
K = yBk mod p
C = {C1,C2}
C1 = ak mod p
C2 = K.M mod p
k should be destroyed after use
18. El Gamal Decryption
K = C1xB mod p =
ak.xB mod p
M = C2.K-1 mod p
19. El Gamal Example
p=97 with primitive root a=5
xB=58 & computes & publishes his public key:yB=558=44 mod 97
M=3 to Bob
yB=44
k=36 and computes the stream key:K=4436=75 mod 97
C1 = 536 = 50 mod 97
C2 = 75.3 mod 97 = 31 mod 97
{50,31} to Bob
K=5058=75 mod 97
K-1 = 22 mod 97
M = 31.22 = 3 mod 97
20. Current Status of Public-Key Schemes
21. Practical Use of Public Key Schemes
22. Summary
23. Exercises
System modulus n=119 (7x17)
encryption exp e=11
d, and hence details the
public and private keys fro this user. Then show how a message
M=20 would be encrypted and decrpyted.
System modulus n=95 (5x19)
encryption exp e=11
prime p=31
prim root a=3
M=4.
prime p=31
prim root a=11
M=18.