CS70: Lecture 11. Outline. 1. RSA system (continued) 1.1 - - PowerPoint PPT Presentation

cs70 lecture 11 outline
SMART_READER_LITE
LIVE PREVIEW

CS70: Lecture 11. Outline. 1. RSA system (continued) 1.1 - - PowerPoint PPT Presentation

CS70: Lecture 11. Outline. 1. RSA system (continued) 1.1 Correctness: Fermats Theorem. 1.2 Construction. 2. Signature Schemes. 3. Warnings. Bijections Bijection is one to one and onto. Bijection: Bijections Bijection is one to one and


slide-1
SLIDE 1

CS70: Lecture 11. Outline.

  • 1. RSA system (continued)

1.1 Correctness: Fermat’s Theorem. 1.2 Construction.

  • 2. Signature Schemes.
  • 3. Warnings.
slide-2
SLIDE 2

Bijections

Bijection is one to one and onto. Bijection:

slide-3
SLIDE 3

Bijections

Bijection is one to one and onto. Bijection: f : A → B.

slide-4
SLIDE 4

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B.

slide-5
SLIDE 5

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range.

slide-6
SLIDE 6

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x).

slide-7
SLIDE 7

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals.

slide-8
SLIDE 8

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1].

slide-9
SLIDE 9

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1].

slide-10
SLIDE 10

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one.

slide-11
SLIDE 11

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0.

slide-12
SLIDE 12

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto.

slide-13
SLIDE 13

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m.

slide-14
SLIDE 14

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}.

slide-15
SLIDE 15

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}.

slide-16
SLIDE 16

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one.

slide-17
SLIDE 17

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size.

slide-18
SLIDE 18

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size. When is it a bijection?

slide-19
SLIDE 19

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size. When is it a bijection? When gcd(a,m) is ....

slide-20
SLIDE 20

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size. When is it a bijection? When gcd(a,m) is ....?

slide-21
SLIDE 21

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size. When is it a bijection? When gcd(a,m) is ....? ... 1.

slide-22
SLIDE 22

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size. When is it a bijection? When gcd(a,m) is ....? ... 1. Not Example: a = 2, m = 4,

slide-23
SLIDE 23

Bijections

Bijection is one to one and onto. Bijection: f : A → B. Domain: A, Co-Domain: B. Versus Range. E.g. sin (x). A = B = reals. Range is [−1,1]. Onto: [−1,1]. Not one-to-one. sin (π) = sin (0) = 0. Range Definition always is onto. Consider f(x) = ax mod m. f : {0,...,m −1} → {0,...,m −1}. Domain/Co-Domain: {0,...,m −1}. Note: Why? Inverse if and only if f(·) one to one. Same size. When is it a bijection? When gcd(a,m) is ....? ... 1. Not Example: a = 2, m = 4, f(0) = f(2) = 0 (mod 4).

slide-24
SLIDE 24

Isomorphisms.

Bijection:

slide-25
SLIDE 25

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1.

slide-26
SLIDE 26

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem:

slide-27
SLIDE 27

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1.

slide-28
SLIDE 28

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n.

slide-29
SLIDE 29

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45).

slide-30
SLIDE 30

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45).

slide-31
SLIDE 31

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider:

slide-32
SLIDE 32

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2).

slide-33
SLIDE 33

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2). What is x where x = 0 (mod 5) and x = 2 (mod 9)?

slide-34
SLIDE 34

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2). What is x where x = 0 (mod 5) and x = 2 (mod 9)? Try 43+22 = 65

slide-35
SLIDE 35

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2). What is x where x = 0 (mod 5) and x = 2 (mod 9)? Try 43+22 = 65 = 20 (mod 45).

slide-36
SLIDE 36

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2). What is x where x = 0 (mod 5) and x = 2 (mod 9)? Try 43+22 = 65 = 20 (mod 45). Isomorphism:

slide-37
SLIDE 37

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2). What is x where x = 0 (mod 5) and x = 2 (mod 9)? Try 43+22 = 65 = 20 (mod 45). Isomorphism: the actions under (mod 5), (mod 9)

slide-38
SLIDE 38

Isomorphisms.

Bijection: f(x) = ax (mod m) if gcd(a,m) = 1. Simplified Chinese Remainder Theorem: There is a unique x (mod mn) where x = a (mod m) and x = b (mod n) and gcd(n,m) = 1. Bijection between (a (mod n),b (mod m)) and x (mod m)n. Consider m = 5, n = 9, then if (a,b) = (3,7) then x = 43 (mod 45). Consider (a′,b′) = (2,4), then x = 22 (mod 45). Now consider: (a,b)+(a′,b′) = (0,2). What is x where x = 0 (mod 5) and x = 2 (mod 9)? Try 43+22 = 65 = 20 (mod 45). Isomorphism: the actions under (mod 5), (mod 9) correspond to actions in (mod 45)!

slide-39
SLIDE 39

Public key crypography.

Bob Alice Eve

slide-40
SLIDE 40

Public key crypography.

Bob Alice Eve Public: K

slide-41
SLIDE 41

Public key crypography.

Bob Alice Eve Public: K Private: k

slide-42
SLIDE 42

Public key crypography.

Bob Alice Eve Public: K Private: k Message m

slide-43
SLIDE 43

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K)

slide-44
SLIDE 44

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K)

slide-45
SLIDE 45

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k)

slide-46
SLIDE 46

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K!

slide-47
SLIDE 47

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve

slide-48
SLIDE 48

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve and me

slide-49
SLIDE 49

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve and me and you

slide-50
SLIDE 50

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve and me and you and you ...) can encode.

slide-51
SLIDE 51

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve and me and you and you ...) can encode. Only Alice knows the secret key k for public key K.

slide-52
SLIDE 52

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve and me and you and you ...) can encode. Only Alice knows the secret key k for public key K. (Only?) Alice can decode with k.

slide-53
SLIDE 53

Public key crypography.

Bob Alice Eve Public: K Private: k Message m E(m,K) m = D(E(m,K),k) Everyone knows key K! Bob (and Eve and me and you and you ...) can encode. Only Alice knows the secret key k for public key K. (Only?) Alice can decode with k. Is this even possible?

slide-54
SLIDE 54

Is public key crypto possible?

1Typically small, say e = 3.

slide-55
SLIDE 55

Is public key crypto possible?

We don’t really know.

1Typically small, say e = 3.

slide-56
SLIDE 56

Is public key crypto possible?

We don’t really know. ...but we do it every day!!!

1Typically small, say e = 3.

slide-57
SLIDE 57

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman)

1Typically small, say e = 3.

slide-58
SLIDE 58

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq.

1Typically small, say e = 3.

slide-59
SLIDE 59

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1

1Typically small, say e = 3.

slide-60
SLIDE 60

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1 Compute d = e−1 mod (p −1)(q −1).

1Typically small, say e = 3.

slide-61
SLIDE 61

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1 Compute d = e−1 mod (p −1)(q −1). Announce N(= p ·q) and e: K = (N,e) is my public key!

1Typically small, say e = 3.

slide-62
SLIDE 62

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1 Compute d = e−1 mod (p −1)(q −1). Announce N(= p ·q) and e: K = (N,e) is my public key! Encoding: mod (xe,N).

1Typically small, say e = 3.

slide-63
SLIDE 63

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1 Compute d = e−1 mod (p −1)(q −1). Announce N(= p ·q) and e: K = (N,e) is my public key! Encoding: mod (xe,N). Decoding: mod (yd,N).

1Typically small, say e = 3.

slide-64
SLIDE 64

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1 Compute d = e−1 mod (p −1)(q −1). Announce N(= p ·q) and e: K = (N,e) is my public key! Encoding: mod (xe,N). Decoding: mod (yd,N). Does D(E(m)) = med = m mod N?

1Typically small, say e = 3.

slide-65
SLIDE 65

Is public key crypto possible?

We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) Pick two large primes p and q. Let N = pq. Choose e relatively prime to (p −1)(q −1).1 Compute d = e−1 mod (p −1)(q −1). Announce N(= p ·q) and e: K = (N,e) is my public key! Encoding: mod (xe,N). Decoding: mod (yd,N). Does D(E(m)) = med = m mod N? Yes!

1Typically small, say e = 3.

slide-66
SLIDE 66

RSA is pretty fast.

Modular Exponentiation: xy mod N.

slide-67
SLIDE 67

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time.

slide-68
SLIDE 68

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time. Remember RSA encoding/decoding!

slide-69
SLIDE 69

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time. Remember RSA encoding/decoding! E(m,(N,e)) = me (mod N).

slide-70
SLIDE 70

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time. Remember RSA encoding/decoding! E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N).

slide-71
SLIDE 71

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time. Remember RSA encoding/decoding! E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N).

slide-72
SLIDE 72

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time. Remember RSA encoding/decoding! E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). For 512 bits, a few hundred million operations.

slide-73
SLIDE 73

RSA is pretty fast.

Modular Exponentiation: xy mod N. All n-bit numbers. O(n3) time. Remember RSA encoding/decoding! E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). For 512 bits, a few hundred million operations. Easy, peasey.

slide-74
SLIDE 74

Decoding.

E(m,(N,e)) = me (mod N).

slide-75
SLIDE 75

Decoding.

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N).

slide-76
SLIDE 76

Decoding.

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N).

slide-77
SLIDE 77

Decoding.

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq

slide-78
SLIDE 78

Decoding.

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)).

slide-79
SLIDE 79

Decoding.

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want:

slide-80
SLIDE 80

Decoding.

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N).

slide-81
SLIDE 81

Always decode correctly?

E(m,(N,e)) = me (mod N).

slide-82
SLIDE 82

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N).

slide-83
SLIDE 83

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N).

slide-84
SLIDE 84

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq

slide-85
SLIDE 85

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)).

slide-86
SLIDE 86

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want:

slide-87
SLIDE 87

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N).

slide-88
SLIDE 88

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view:

slide-89
SLIDE 89

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1.

slide-90
SLIDE 90

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider...

slide-91
SLIDE 91

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p),

slide-92
SLIDE 92

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p).

slide-93
SLIDE 93

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). = ⇒ ak(p−1) ≡ 1 (mod p)

slide-94
SLIDE 94

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). = ⇒ ak(p−1) ≡ 1 (mod p) = ⇒

slide-95
SLIDE 95

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). = ⇒ ak(p−1) ≡ 1 (mod p) = ⇒ ak(p−1)+1

slide-96
SLIDE 96

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). = ⇒ ak(p−1) ≡ 1 (mod p) = ⇒ ak(p−1)+1 = a (mod p)

slide-97
SLIDE 97

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). = ⇒ ak(p−1) ≡ 1 (mod p) = ⇒ ak(p−1)+1 = a (mod p) versus ak(p−1)(q−1)+1 = a (mod pq).

slide-98
SLIDE 98

Always decode correctly?

E(m,(N,e)) = me (mod N). D(m,(N,d)) = md (mod N). N = pq and d = e−1 (mod (p −1)(q −1)). Want: (me)d = med = m (mod N). Another view: d = e−1 (mod (p −1)(q −1)) ⇐ ⇒ ed = k(p −1)(q −1)+1. Consider... Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). = ⇒ ak(p−1) ≡ 1 (mod p) = ⇒ ak(p−1)+1 = a (mod p) versus ak(p−1)(q−1)+1 = a (mod pq). Similar, not same, but useful.

slide-99
SLIDE 99

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p),

slide-100
SLIDE 100

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p).

slide-101
SLIDE 101

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof:

slide-102
SLIDE 102

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}.

slide-103
SLIDE 103

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p.

slide-104
SLIDE 104

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p.

slide-105
SLIDE 105

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p,

slide-106
SLIDE 106

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p, Since multiplication is commutative.

slide-107
SLIDE 107

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p, Since multiplication is commutative. a(p−1)(1···(p −1)) ≡ (1···(p −1)) mod p.

slide-108
SLIDE 108

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p, Since multiplication is commutative. a(p−1)(1···(p −1)) ≡ (1···(p −1)) mod p. Each of 2,...(p −1) has an inverse modulo p,

slide-109
SLIDE 109

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p, Since multiplication is commutative. a(p−1)(1···(p −1)) ≡ (1···(p −1)) mod p. Each of 2,...(p −1) has an inverse modulo p, solve to get...

slide-110
SLIDE 110

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p, Since multiplication is commutative. a(p−1)(1···(p −1)) ≡ (1···(p −1)) mod p. Each of 2,...(p −1) has an inverse modulo p, solve to get... a(p−1) ≡ 1 mod p.

slide-111
SLIDE 111

Correct decoding...

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Proof: Consider S = {a·1,...,a·(p −1)}. All different modulo p since a has an inverse modulo p. S contains representative of {1,...,p −1} modulo p. (a·1)·(a·2)···(a·(p −1)) ≡ 1·2···(p −1) mod p, Since multiplication is commutative. a(p−1)(1···(p −1)) ≡ (1···(p −1)) mod p. Each of 2,...(p −1) has an inverse modulo p, solve to get... a(p−1) ≡ 1 mod p.

slide-112
SLIDE 112

Always decode correctly? (cont.)

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p).

slide-113
SLIDE 113

Always decode correctly? (cont.)

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Proof:

slide-114
SLIDE 114

Always decode correctly? (cont.)

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Proof: If a ≡ 0 (mod p), of course.

slide-115
SLIDE 115

Always decode correctly? (cont.)

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Proof: If a ≡ 0 (mod p), of course. Otherwise a1+b(p−1) ≡

slide-116
SLIDE 116

Always decode correctly? (cont.)

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Proof: If a ≡ 0 (mod p), of course. Otherwise a1+b(p−1) ≡ a1 ∗(ap−1)b

slide-117
SLIDE 117

Always decode correctly? (cont.)

Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p), ap−1 ≡ 1 (mod p). Lemma 1: For any prime p and any a,b, a1+b(p−1) ≡ a (mod p) Proof: If a ≡ 0 (mod p), of course. Otherwise a1+b(p−1) ≡ a1 ∗(ap−1)b ≡ a∗(1)b ≡ a (mod p)

slide-118
SLIDE 118

...Decoding correctness...

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

slide-119
SLIDE 119

...Decoding correctness...

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-120
SLIDE 120

...Decoding correctness...

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-121
SLIDE 121

...Decoding correctness...

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-122
SLIDE 122

...Decoding correctness...

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) Let a = x, b = k(q −1) and apply Lemma 1 with modulus p.

slide-123
SLIDE 123

...Decoding correctness...

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) Let a = x, b = k(q −1) and apply Lemma 1 with modulus p. x1+k(p−1)(q−1) ≡ x (mod p)

slide-124
SLIDE 124

...Decoding correctness...

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) 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 is multiple of p and q. x1+k(q−1)(p−1) −x ≡ 0 mod (pq)

slide-125
SLIDE 125

...Decoding correctness...

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) 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 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-126
SLIDE 126

...Decoding correctness...

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) 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 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-127
SLIDE 127

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-128
SLIDE 128

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-129
SLIDE 129

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-130
SLIDE 130

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-131
SLIDE 131

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-132
SLIDE 132

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-133
SLIDE 133

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-134
SLIDE 134

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-135
SLIDE 135

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-136
SLIDE 136

Construction of keys.. ..

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

Construction of keys.. ..

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

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

slide-138
SLIDE 138

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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-139
SLIDE 139

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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-140
SLIDE 140

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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-141
SLIDE 141

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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-142
SLIDE 142

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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). For 1024 bit number, 1 in 710 is prime.

slide-143
SLIDE 143

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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). For 1024 bit number, 1 in 710 is prime.

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

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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). For 1024 bit number, 1 in 710 is prime.

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

Use gcd algorithm to test.

slide-145
SLIDE 145

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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). For 1024 bit number, 1 in 710 is prime.

  • 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-146
SLIDE 146

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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). For 1024 bit number, 1 in 710 is prime.

  • 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-147
SLIDE 147

Construction of keys.. ..

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

Prime Number Theorem: π(N) number of primes less than 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). For 1024 bit number, 1 in 710 is prime.

  • 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-148
SLIDE 148

Security of RSA.

slide-149
SLIDE 149

Security of RSA.

Security?

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

Security of RSA.

Security?

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

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

slide-151
SLIDE 151

Security of RSA.

Security?

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

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

  • 3. I don’t know how to break this scheme without factoring N.
slide-152
SLIDE 152

Security of RSA.

Security?

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

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

  • 3. I don’t know how to break this scheme without factoring N.

No one I know or have heard of admits to knowing how to factor N.

slide-153
SLIDE 153

Security of RSA.

Security?

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

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

  • 3. I don’t know how to break this scheme without factoring N.

No one I know or have heard of admits to knowing how to factor N. Breaking in general sense = ⇒ factoring algorithm.

slide-154
SLIDE 154

Much more to it.....

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

slide-155
SLIDE 155

Much more to it.....

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

slide-156
SLIDE 156

Much more to it.....

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

slide-157
SLIDE 157

Much more to it.....

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. Eve can send credit card again!! The protocols are built on RSA but more complicated;

slide-158
SLIDE 158

Much more to it.....

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

slide-159
SLIDE 159

Much more to it.....

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. Eve can send credit card again!! 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-160
SLIDE 160

Much more to it.....

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. Eve can send credit card again!! 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-161
SLIDE 161

Much more to it.....

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. Eve can send credit card again!! 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-162
SLIDE 162

Much more to it.....

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. Eve can send credit card again!! 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-163
SLIDE 163

Much more to it.....

If Bobs sends a message (Credit Card Number) to Alice, Eve sees it. Eve can send credit card again!! 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...

slide-164
SLIDE 164

Signatures using RSA.

Verisign: Browser. Amazon

slide-165
SLIDE 165

Signatures using RSA.

Verisign: Browser. Amazon Certificate Authority: Verisign, GoDaddy, DigiNotar,...

slide-166
SLIDE 166

Signatures using RSA.

Verisign: kv, Kv Browser. Amazon Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.)

slide-167
SLIDE 167

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV.

slide-168
SLIDE 168

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.”

slide-169
SLIDE 169

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N.

slide-170
SLIDE 170

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N.

slide-171
SLIDE 171

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y]

slide-172
SLIDE 172

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C?

slide-173
SLIDE 173

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV)

slide-174
SLIDE 174

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV) = (Sv(C))e

slide-175
SLIDE 175

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV) = (Sv(C))e = (Cd)e

slide-176
SLIDE 176

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV) = (Sv(C))e = (Cd)e = Cde

slide-177
SLIDE 177

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV) = (Sv(C))e = (Cd)e = Cde = C (mod N)

slide-178
SLIDE 178

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV) = (Sv(C))e = (Cd)e = Cde = C (mod N) Valid signature of Amazon certificate C!

slide-179
SLIDE 179

Signatures using RSA.

Verisign: kv, Kv

  • Browser. Kv

Amazon [C,Sv(C)] [C,Sv(C)] C = E(SV(C),kV)? Certificate Authority: Verisign, GoDaddy, DigiNotar,... Verisign’s key: KV = (N,e) and kV = d (N = pq.) Browser “knows” Verisign’s public key: KV. Amazon Certificate: C = “I am Amazon. My public Key is KA.” Versign signature of C: Sv(C): D(C,kV) = Cd mod N. Browser receives: [C,y] Checks E(y,KV) = C? E(Sv(C),KV) = (Sv(C))e = (Cd)e = Cde = C (mod N) Valid signature of Amazon certificate C! Security: Eve can’t forge unless she “breaks” RSA scheme.

slide-180
SLIDE 180

RSA

slide-181
SLIDE 181

RSA

Public Key Cryptography:

slide-182
SLIDE 182

RSA

Public Key Cryptography: D(E(m,K),k) = (me)d mod N = m.

slide-183
SLIDE 183

RSA

Public Key Cryptography: D(E(m,K),k) = (me)d mod N = m. Signature scheme:

slide-184
SLIDE 184

RSA

Public Key Cryptography: D(E(m,K),k) = (me)d mod N = m. Signature scheme: E(D(C,k),K) = (Cd)e mod N = C

slide-185
SLIDE 185

Other Eve.

slide-186
SLIDE 186

Other Eve.

Get CA to certify fake certificates: Microsoft Corporation.

slide-187
SLIDE 187

Other Eve.

Get CA to certify fake certificates: Microsoft Corporation. 2001..Doh.

slide-188
SLIDE 188

Other Eve.

Get CA to certify fake certificates: Microsoft Corporation. 2001..Doh. ... and August 28, 2011 announcement.

slide-189
SLIDE 189

Other Eve.

Get CA to certify fake certificates: Microsoft Corporation. 2001..Doh. ... and August 28, 2011 announcement. DigiNotar Certificate issued for Microsoft!!!

slide-190
SLIDE 190

Other Eve.

Get CA to certify fake certificates: Microsoft Corporation. 2001..Doh. ... and August 28, 2011 announcement. DigiNotar Certificate issued for Microsoft!!! How does Microsoft get a CA to issue certificate to them ...

slide-191
SLIDE 191

Other Eve.

Get CA to certify fake certificates: Microsoft Corporation. 2001..Doh. ... and August 28, 2011 announcement. DigiNotar Certificate issued for Microsoft!!! How does Microsoft get a CA to issue certificate to them ... and only them?

slide-192
SLIDE 192

Summary.

Public-Key Encryption.

slide-193
SLIDE 193

Summary.

Public-Key Encryption. RSA Scheme:

slide-194
SLIDE 194

Summary.

Public-Key Encryption. RSA Scheme: N = pq and d = e−1 (mod (p −1)(q −1)). E(x) = xe (mod N). D(y) = yd (mod N).

slide-195
SLIDE 195

Summary.

Public-Key Encryption. RSA Scheme: N = pq and d = e−1 (mod (p −1)(q −1)). E(x) = xe (mod N). D(y) = yd (mod N). Repeated Squaring = ⇒ efficiency.

slide-196
SLIDE 196

Summary.

Public-Key Encryption. RSA Scheme: N = pq and d = e−1 (mod (p −1)(q −1)). E(x) = xe (mod N). D(y) = yd (mod N). Repeated Squaring = ⇒ efficiency. Fermat’s Theorem = ⇒ correctness.

slide-197
SLIDE 197

Summary.

Public-Key Encryption. RSA Scheme: N = pq and d = e−1 (mod (p −1)(q −1)). E(x) = xe (mod N). D(y) = yd (mod N). Repeated Squaring = ⇒ efficiency. Fermat’s Theorem = ⇒ correctness. Good for Encryption

slide-198
SLIDE 198

Summary.

Public-Key Encryption. RSA Scheme: N = pq and d = e−1 (mod (p −1)(q −1)). E(x) = xe (mod N). D(y) = yd (mod N). Repeated Squaring = ⇒ efficiency. Fermat’s Theorem = ⇒ correctness. Good for Encryption and Signature Schemes.