RSA and Fermat. RSA: Key Generation: (Alice) Primes: p , q . N = pq - - PowerPoint PPT Presentation

rsa and fermat
SMART_READER_LITE
LIVE PREVIEW

RSA and Fermat. RSA: Key Generation: (Alice) Primes: p , q . N = pq - - PowerPoint PPT Presentation

RSA and Fermat. RSA: Key Generation: (Alice) Primes: p , q . N = pq . Encryption Key: e , where gcd ( e , ( p 1 )( q 1 ))) = 1 Decryption Key: d = e 1 ( mod ( p 1 )( q 1 )) Message: m Encryption (Bob): y = E ( m ) = m e ( mod


slide-1
SLIDE 1

RSA and Fermat.

RSA: Key Generation: (Alice) Primes: p, q. N = pq. Encryption Key: e, where gcd(e,(p −1)(q −1))) = 1 Decryption Key: d = e−1 (mod (p −1)(q −1)) Message: m Encryption (Bob): y = E(m) = me (mod N). Decryption (Alice): D(y) = yd (mod N). Result: med (mod N)

slide-2
SLIDE 2

RSA and Fermat.

RSA: Key Generation: (Alice) Primes: p, q. N = pq. Encryption Key: e, where gcd(e,(p −1)(q −1))) = 1 Decryption Key: d = e−1 (mod (p −1)(q −1)) Message: m Encryption (Bob): y = E(m) = me (mod N). Decryption (Alice): D(y) = yd (mod N). Result: med (mod N) Want D(E(x)) = x

slide-3
SLIDE 3

RSA and Fermat.

RSA: Key Generation: (Alice) Primes: p, q. N = pq. Encryption Key: e, where gcd(e,(p −1)(q −1))) = 1 Decryption Key: d = e−1 (mod (p −1)(q −1)) Message: m Encryption (Bob): y = E(m) = me (mod N). Decryption (Alice): D(y) = yd (mod N). Result: med (mod N) Want D(E(x)) = x Thm: xed = x (mod N)

slide-4
SLIDE 4

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1))

slide-5
SLIDE 5

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic!

slide-6
SLIDE 6

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p),

slide-7
SLIDE 7

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p).

slide-8
SLIDE 8

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)?

slide-9
SLIDE 9

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1.

slide-10
SLIDE 10

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)?

slide-11
SLIDE 11

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3.

slide-12
SLIDE 12

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)?

slide-13
SLIDE 13

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)?

slide-14
SLIDE 14

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)?

slide-15
SLIDE 15

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3.

slide-16
SLIDE 16

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p)

slide-17
SLIDE 17

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back

slide-18
SLIDE 18

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1).

slide-19
SLIDE 19

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)).

slide-20
SLIDE 20

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m).

slide-21
SLIDE 21

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise

slide-22
SLIDE 22

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise a1+k(p−1) ≡

slide-23
SLIDE 23

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise a1+k(p−1) ≡ a1 ∗(ap−1)k

slide-24
SLIDE 24

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise a1+k(p−1) ≡ a1 ∗(ap−1)k ≡ a∗(1)b ≡ a (mod p)

slide-25
SLIDE 25

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise a1+k(p−1) ≡ a1 ∗(ap−1)k ≡ a∗(1)b ≡ a (mod p)

slide-26
SLIDE 26

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise a1+k(p−1) ≡ a1 ∗(ap−1)k ≡ a∗(1)b ≡ a (mod p) Idea: Fermat removes the k(p −1) from the exponent!

slide-27
SLIDE 27

RSA and Fermat: mathematical connection

Thm: med = m (mod pq) if ed = 1 (mod (p −1)(q −1)) Seems like magic! Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). 36 (mod 7)? 1. 37 (mod 7)? 3. 319 (mod 7)? 33∗6+1 (mod 7)? (33∗6 ∗3) (mod 7)? 3. Corollary: ak(p−1)+1 = a (mod p) Get a back when exponent is 1 (mod p −1). A little like RSA: aed (mod (p −1)(q −1)) is a when exponent is 1 (mod (p −1)(q −1)). Proof of Corollary. If a = 0, ak(p−1)+1 = 0 (mod m). Otherwise a1+k(p−1) ≡ a1 ∗(ap−1)k ≡ a∗(1)b ≡ a (mod p) Idea: Fermat removes the k(p −1) from the exponent!

slide-28
SLIDE 28

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p)

slide-29
SLIDE 29

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq)

slide-30
SLIDE 30

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q.

slide-31
SLIDE 31

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q)

slide-32
SLIDE 32

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q.

slide-33
SLIDE 33

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p.

slide-34
SLIDE 34

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p)

slide-35
SLIDE 35

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p) x1+k(q−1)(p−1) −x ≡ 0 mod (p) = ⇒ multiple of p.

slide-36
SLIDE 36

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p) x1+k(q−1)(p−1) −x ≡ 0 mod (p) = ⇒ multiple of p. x1+k(q−1)(p−1) −x is multiple of p and q.

slide-37
SLIDE 37

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p) x1+k(q−1)(p−1) −x ≡ 0 mod (p) = ⇒ multiple of p. x1+k(q−1)(p−1) −x is multiple of p and q. x1+k(q−1)(p−1) −x ≡ 0 mod (pq)

slide-38
SLIDE 38

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p) x1+k(q−1)(p−1) −x ≡ 0 mod (p) = ⇒ multiple of p. x1+k(q−1)(p−1) −x is multiple of p and q. x1+k(q−1)(p−1) −x ≡ 0 mod (pq) = ⇒ x1+k(q−1)(p−1) = x mod pq.

slide-39
SLIDE 39

Correctness of RSA...

Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Let a = x, b = k(p −1) and apply Lemma 1 with modulus q. x1+k(p−1)(q−1) ≡ x (mod q) x1+k(q−1)(p−1) −x ≡ 0 mod (q) = ⇒ multiple of q. Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p) x1+k(q−1)(p−1) −x ≡ 0 mod (p) = ⇒ multiple of p. x1+k(q−1)(p−1) −x is multiple of p and q. x1+k(q−1)(p−1) −x ≡ 0 mod (pq) = ⇒ x1+k(q−1)(p−1) = x mod pq.

slide-40
SLIDE 40

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq)

slide-41
SLIDE 41

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes!

slide-42
SLIDE 42

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d

slide-43
SLIDE 43

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d = xed (mod pq),

slide-44
SLIDE 44

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d = xed (mod pq), where ed ≡ 1 mod (p −1)(q −1) = ⇒ ed = 1+k(p −1)(q −1)

slide-45
SLIDE 45

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d = xed (mod pq), where ed ≡ 1 mod (p −1)(q −1) = ⇒ ed = 1+k(p −1)(q −1) xed ≡

slide-46
SLIDE 46

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d = xed (mod pq), where ed ≡ 1 mod (p −1)(q −1) = ⇒ ed = 1+k(p −1)(q −1) xed ≡ xk(p−1)(q−1)+1

slide-47
SLIDE 47

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d = xed (mod pq), where ed ≡ 1 mod (p −1)(q −1) = ⇒ ed = 1+k(p −1)(q −1) xed ≡ xk(p−1)(q−1)+1 ≡ x (mod pq).

slide-48
SLIDE 48

RSA decodes correctly..

Lemma 2: For any two different primes p,q and any x,k, x1+k(p−1)(q−1) ≡ x (mod pq) Theorem: RSA correctly decodes! Recall D(E(x)) = (xe)d = xed ≡ x (mod pq), where ed ≡ 1 mod (p −1)(q −1) = ⇒ ed = 1+k(p −1)(q −1) xed ≡ xk(p−1)(q−1)+1 ≡ x (mod pq).

slide-49
SLIDE 49

Key Generation...

  • 1. Find large (100 digit) primes p and q?
slide-50
SLIDE 50

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN.

slide-51
SLIDE 51

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime.

slide-52
SLIDE 52

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime?

slide-53
SLIDE 53

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..

slide-54
SLIDE 54

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..Miller-Rabin test..

slide-55
SLIDE 55

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..Miller-Rabin test.. Primes in P).

slide-56
SLIDE 56

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..Miller-Rabin test.. Primes in P).

  • 2. Choose e with gcd(e,(p −1)(q −1)) = 1.
slide-57
SLIDE 57

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..Miller-Rabin test.. Primes in P).

  • 2. Choose e with gcd(e,(p −1)(q −1)) = 1.

Use gcd algorithm to test.

  • 3. Find inverse d of e modulo (p −1)(q −1).
slide-58
SLIDE 58

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..Miller-Rabin test.. Primes in P).

  • 2. Choose e with gcd(e,(p −1)(q −1)) = 1.

Use gcd algorithm to test.

  • 3. Find inverse d of e modulo (p −1)(q −1).

Use extended gcd algorithm.

slide-59
SLIDE 59

Key Generation...

  • 1. Find large (100 digit) primes p and q?

Prime Number Theorem: π(N) denotes the number of primes less than or equal to N. For all N ≥ 17 π(N) ≥ N/lnN. Choosing randomly gives approximately 1/(lnN) chance of number being a prime. (How do you tell if it is prime? ... cs170..Miller-Rabin test.. Primes in P).

  • 2. Choose e with gcd(e,(p −1)(q −1)) = 1.

Use gcd algorithm to test.

  • 3. Find inverse d of e modulo (p −1)(q −1).

Use extended gcd algorithm. All steps are polynomial in O(logN), the number of bits.

slide-60
SLIDE 60

Security of RSA.

slide-61
SLIDE 61

Security of RSA.

Security?

  • 1. Alice knows p and q (and d, and other numbers).
  • 2. Bob only knows, N(= pq), and e.
slide-62
SLIDE 62

Security of RSA.

Security?

  • 1. Alice knows p and q (and d, and other numbers).
  • 2. Bob only knows, N(= pq), and e.

Does not know, for example, d or factorization of N.

slide-63
SLIDE 63

Security of RSA.

Security?

  • 1. Alice knows p and q (and d, and other numbers).
  • 2. Bob only knows, N(= pq), and e.

Does not know, for example, d or factorization of N.

  • 3. Breaking this scheme =

⇒ factoring N.

slide-64
SLIDE 64

Security of RSA.

Security?

  • 1. Alice knows p and q (and d, and other numbers).
  • 2. Bob only knows, N(= pq), and e.

Does not know, for example, d or factorization of N.

  • 3. Breaking this scheme =

⇒ factoring N. Don’t know how to factor N efficiently on regular computers.

slide-65
SLIDE 65

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice,

slide-66
SLIDE 66

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.)

slide-67
SLIDE 67

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!!

slide-68
SLIDE 68

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack”

slide-69
SLIDE 69

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response.

slide-70
SLIDE 70

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response. One trick: Bob encodes credit card number, c,

slide-71
SLIDE 71

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response. One trick: Bob encodes credit card number, c,

slide-72
SLIDE 72

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response. One trick: Bob encodes credit card number, c, concatenated with random k-bit number r.

slide-73
SLIDE 73

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response. One trick: Bob encodes credit card number, c, concatenated with random k-bit number r. Never sends just c.

slide-74
SLIDE 74

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response. One trick: Bob encodes credit card number, c, concatenated with random k-bit number r. Never sends just c. Again, more work to do to get entire system.

slide-75
SLIDE 75

Much more to it in practice!

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. (The encrypted CC number.) Eve can send same credit card number again!! “Replay attack” The protocols are built on RSA but more complicated; For example, several rounds of challenge/response. One trick: Bob encodes credit card number, c, concatenated with random k-bit number r. Never sends just c. Again, more work to do to get entire system. CS161...