Lecture 8: Cryptography Trust No One. 1 / 20 Cryptography: Basic - - PowerPoint PPT Presentation

lecture 8 cryptography
SMART_READER_LITE
LIVE PREVIEW

Lecture 8: Cryptography Trust No One. 1 / 20 Cryptography: Basic - - PowerPoint PPT Presentation

Lecture 8: Cryptography Trust No One. 1 / 20 Cryptography: Basic Set Up Alice Bob Eve Goal: system st Bob gets the message, Eve doesnt 2 / 20 Cryptography: Basic Set Up Alice Bob Eve Goal: system st Bob gets the message, Eve


slide-1
SLIDE 1

Lecture 8: Cryptography

Trust No One.

1 / 20

slide-2
SLIDE 2

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-3
SLIDE 3

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-4
SLIDE 4

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-5
SLIDE 5

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-6
SLIDE 6

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-7
SLIDE 7

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-8
SLIDE 8

Cryptography: Basic Set Up

Alice Bob Eve Goal: system st Bob gets the message, Eve doesn’t

2 / 20

slide-9
SLIDE 9

XOR

First scheme built on the XOR operation: x y x ⊕ y 1 1 1 1 1 1 Claim: x b b x for any bits x, b b 0 doesn’t fmip, b 1 fmips twice

3 / 20

slide-10
SLIDE 10

XOR

First scheme built on the XOR operation: x y x ⊕ y 1 1 1 1 1 1 Claim: (x ⊕ b) ⊕ b = x for any bits x, b b 0 doesn’t fmip, b 1 fmips twice

3 / 20

slide-11
SLIDE 11

XOR

First scheme built on the XOR operation: x y x ⊕ y 1 1 1 1 1 1 Claim: (x ⊕ b) ⊕ b = x for any bits x, b b = 0 doesn’t fmip, b = 1 fmips twice

3 / 20

slide-12
SLIDE 12

One-Time Pad

Alice wants to send an n-bit message m to Bob Setup: A and B generate random n-bit pad p Encryption: A creates ciphertext c Ep m m p Decryption: B decrypts m Dp c c p Does Bob receive the message correctly? Can Eve read the message?

4 / 20

slide-13
SLIDE 13

One-Time Pad

Alice wants to send an n-bit message m to Bob Setup:

▶ A and B generate random n-bit pad p

Encryption: A creates ciphertext c Ep m m p Decryption: B decrypts m Dp c c p Does Bob receive the message correctly? Can Eve read the message?

4 / 20

slide-14
SLIDE 14

One-Time Pad

Alice wants to send an n-bit message m to Bob Setup:

▶ A and B generate random n-bit pad p

Encryption:

▶ A creates ciphertext c = Ep(m) := m ⊕ p

Decryption: B decrypts m Dp c c p Does Bob receive the message correctly? Can Eve read the message?

4 / 20

slide-15
SLIDE 15

One-Time Pad

Alice wants to send an n-bit message m to Bob Setup:

▶ A and B generate random n-bit pad p

Encryption:

▶ A creates ciphertext c = Ep(m) := m ⊕ p

Decryption:

▶ B decrypts m = Dp(c) := c ⊕ p

Does Bob receive the message correctly? Can Eve read the message?

4 / 20

slide-16
SLIDE 16

One-Time Pad

Alice wants to send an n-bit message m to Bob Setup:

▶ A and B generate random n-bit pad p

Encryption:

▶ A creates ciphertext c = Ep(m) := m ⊕ p

Decryption:

▶ B decrypts m = Dp(c) := c ⊕ p

Does Bob receive the message correctly? Can Eve read the message?

4 / 20

slide-17
SLIDE 17

OTP Correctness

Claim: Bob always receives the message Alice sent. Formally: messages m & pads p, Dp Ep m m Proof: Ep m m p, so Dp Ep m m p p Each bit of m XORed by same bit twice By previous claim, each bit of m stays the same Thus Dp Ep m m

5 / 20

slide-18
SLIDE 18

OTP Correctness

Claim: Bob always receives the message Alice sent. Formally: ∀ messages m & pads p, Dp(Ep(m)) = m Proof: Ep m m p, so Dp Ep m m p p Each bit of m XORed by same bit twice By previous claim, each bit of m stays the same Thus Dp Ep m m

5 / 20

slide-19
SLIDE 19

OTP Correctness

Claim: Bob always receives the message Alice sent. Formally: ∀ messages m & pads p, Dp(Ep(m)) = m Proof:

▶ Ep(m) = m ⊕ p, so Dp(Ep(m)) = (m ⊕ p) ⊕ p

Each bit of m XORed by same bit twice By previous claim, each bit of m stays the same Thus Dp Ep m m

5 / 20

slide-20
SLIDE 20

OTP Correctness

Claim: Bob always receives the message Alice sent. Formally: ∀ messages m & pads p, Dp(Ep(m)) = m Proof:

▶ Ep(m) = m ⊕ p, so Dp(Ep(m)) = (m ⊕ p) ⊕ p ▶ Each bit of m XORed by same bit twice ▶ By previous claim, each bit of m stays the same

Thus Dp Ep m m

5 / 20

slide-21
SLIDE 21

OTP Correctness

Claim: Bob always receives the message Alice sent. Formally: ∀ messages m & pads p, Dp(Ep(m)) = m Proof:

▶ Ep(m) = m ⊕ p, so Dp(Ep(m)) = (m ⊕ p) ⊕ p ▶ Each bit of m XORed by same bit twice ▶ By previous claim, each bit of m stays the same ▶ Thus Dp(Ep(m)) = m

5 / 20

slide-22
SLIDE 22

OTP Security

Claim: Any message possible just given ciphertext. Formally: c & m, pad p st Ep m c Proof: Take p c m Then Ep m p m c m m c Intuition: set pi 1 ifg ith bit needs to fmip w/o pad, c says nothing about m!

6 / 20

slide-23
SLIDE 23

OTP Security

Claim: Any message possible just given ciphertext. Formally: ∀ c & m, ∃ pad p st Ep(m) = c Proof: Take p c m Then Ep m p m c m m c Intuition: set pi 1 ifg ith bit needs to fmip w/o pad, c says nothing about m!

6 / 20

slide-24
SLIDE 24

OTP Security

Claim: Any message possible just given ciphertext. Formally: ∀ c & m, ∃ pad p st Ep(m) = c Proof:

▶ Take p = c ⊕ m

Then Ep m p m c m m c Intuition: set pi 1 ifg ith bit needs to fmip w/o pad, c says nothing about m!

6 / 20

slide-25
SLIDE 25

OTP Security

Claim: Any message possible just given ciphertext. Formally: ∀ c & m, ∃ pad p st Ep(m) = c Proof:

▶ Take p = c ⊕ m ▶ Then Ep(m) = p ⊕ m = (c ⊕ m) ⊕ m = c

Intuition: set pi 1 ifg ith bit needs to fmip w/o pad, c says nothing about m!

6 / 20

slide-26
SLIDE 26

OTP Security

Claim: Any message possible just given ciphertext. Formally: ∀ c & m, ∃ pad p st Ep(m) = c Proof:

▶ Take p = c ⊕ m ▶ Then Ep(m) = p ⊕ m = (c ⊕ m) ⊕ m = c

Intuition: set pi = 1 ifg ith bit needs to fmip w/o pad, c says nothing about m!

6 / 20

slide-27
SLIDE 27

OTP Security

Claim: Any message possible just given ciphertext. Formally: ∀ c & m, ∃ pad p st Ep(m) = c Proof:

▶ Take p = c ⊕ m ▶ Then Ep(m) = p ⊕ m = (c ⊕ m) ⊕ m = c

Intuition: set pi = 1 ifg ith bit needs to fmip w/o pad, c says nothing about m!

6 / 20

slide-28
SLIDE 28

Problems With OTP

How do Alice and Bob agree on their pad? Can’t just send it over the channel! Secure only for a single message — can’t reuse pad! Solve these issues with public key cryptography Idea: don’t assume shared secret key Have separate private (only Bob) and public keys

7 / 20

slide-29
SLIDE 29

Problems With OTP

How do Alice and Bob agree on their pad? Can’t just send it over the channel! Secure only for a single message — can’t reuse pad! Solve these issues with public key cryptography Idea: don’t assume shared secret key Have separate private (only Bob) and public keys

7 / 20

slide-30
SLIDE 30

Problems With OTP

How do Alice and Bob agree on their pad? Can’t just send it over the channel! Secure only for a single message — can’t reuse pad! Solve these issues with public key cryptography Idea: don’t assume shared secret key Have separate private (only Bob) and public keys

7 / 20

slide-31
SLIDE 31

Problems With OTP

How do Alice and Bob agree on their pad? Can’t just send it over the channel! Secure only for a single message — can’t reuse pad! Solve these issues with public key cryptography Idea: don’t assume shared secret key Have separate private (only Bob) and public keys

7 / 20

slide-32
SLIDE 32

Problems With OTP

How do Alice and Bob agree on their pad? Can’t just send it over the channel! Secure only for a single message — can’t reuse pad! Solve these issues with public key cryptography Idea: don’t assume shared secret key Have separate private (only Bob) and public keys

7 / 20

slide-33
SLIDE 33

“Textbook” RSA Protocol

Alice wants to send an n-bit message m to Bob Setup: B chooses primes p, q st pq 2n B chooses e st e p 1 q 1 1 B publicizes N pq and e B keeps p, q, d e 1 p 1 q 1 Encryption: A encrypts c EN e m me N Decryption: B decrypts m DN d c cd N

8 / 20

slide-34
SLIDE 34

“Textbook” RSA Protocol

Alice wants to send an n-bit message m to Bob Setup:

▶ B chooses primes p, q st pq > 2n ▶ B chooses e st gcd(e, (p − 1)(q − 1)) = 1 ▶ B publicizes N = pq and e ▶ B keeps p, q, d = e−1 (mod (p − 1)(q − 1))

Encryption: A encrypts c EN e m me N Decryption: B decrypts m DN d c cd N

8 / 20

slide-35
SLIDE 35

“Textbook” RSA Protocol

Alice wants to send an n-bit message m to Bob Setup:

▶ B chooses primes p, q st pq > 2n ▶ B chooses e st gcd(e, (p − 1)(q − 1)) = 1 ▶ B publicizes N = pq and e ▶ B keeps p, q, d = e−1 (mod (p − 1)(q − 1))

Encryption:

▶ A encrypts c = EN,e(m) := me (mod N)

Decryption: B decrypts m DN d c cd N

8 / 20

slide-36
SLIDE 36

“Textbook” RSA Protocol

Alice wants to send an n-bit message m to Bob Setup:

▶ B chooses primes p, q st pq > 2n ▶ B chooses e st gcd(e, (p − 1)(q − 1)) = 1 ▶ B publicizes N = pq and e ▶ B keeps p, q, d = e−1 (mod (p − 1)(q − 1))

Encryption:

▶ A encrypts c = EN,e(m) := me (mod N)

Decryption:

▶ B decrypts m = DN,d(c) := cd (mod N)

8 / 20

slide-37
SLIDE 37

Fermat’s Little Theorem

Theorem: Let p be a prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof: Consider set Sp 1 2 3 p 1 Claim: f x ax p is bijection Sp Sp 1 2 p 1 a 2a p 1 a p Means

i i i ia

ap 1

i i

p Multiply by

i i 1, get 1

ap 1 p

9 / 20

slide-38
SLIDE 38

Fermat’s Little Theorem

Theorem: Let p be a prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ Consider set Sp = {1, 2, 3, ..., p − 1}

Claim: f x ax p is bijection Sp Sp 1 2 p 1 a 2a p 1 a p Means

i i i ia

ap 1

i i

p Multiply by

i i 1, get 1

ap 1 p

9 / 20

slide-39
SLIDE 39

Fermat’s Little Theorem

Theorem: Let p be a prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ Consider set Sp = {1, 2, 3, ..., p − 1} ▶ Claim: f(x) = ax (mod p) is bijection Sp → Sp

1 2 p 1 a 2a p 1 a p Means

i i i ia

ap 1

i i

p Multiply by

i i 1, get 1

ap 1 p

9 / 20

slide-40
SLIDE 40

Fermat’s Little Theorem

Theorem: Let p be a prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ Consider set Sp = {1, 2, 3, ..., p − 1} ▶ Claim: f(x) = ax (mod p) is bijection Sp → Sp ▶ {1, 2, ..., p − 1} = {a, 2a, ..., (p − 1)a} (mod p)

Means

i i i ia

ap 1

i i

p Multiply by

i i 1, get 1

ap 1 p

9 / 20

slide-41
SLIDE 41

Fermat’s Little Theorem

Theorem: Let p be a prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ Consider set Sp = {1, 2, 3, ..., p − 1} ▶ Claim: f(x) = ax (mod p) is bijection Sp → Sp ▶ {1, 2, ..., p − 1} = {a, 2a, ..., (p − 1)a} (mod p) ▶ Means ∏

i i ≡ ∏ i ia ≡ ap−1 ∏ i i (mod p)

Multiply by

i i 1, get 1

ap 1 p

9 / 20

slide-42
SLIDE 42

Fermat’s Little Theorem

Theorem: Let p be a prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ Consider set Sp = {1, 2, 3, ..., p − 1} ▶ Claim: f(x) = ax (mod p) is bijection Sp → Sp ▶ {1, 2, ..., p − 1} = {a, 2a, ..., (p − 1)a} (mod p) ▶ Means ∏

i i ≡ ∏ i ia ≡ ap−1 ∏ i i (mod p)

▶ Multiply by ∏

i i−1, get 1 ≡ ap−1 (mod p)

9 / 20

slide-43
SLIDE 43

Proof Of Claim

To fjnish FLT proof, need to prove: Claim: f(x) = ax (mod p) is bijection Sp → Sp Proof:

▶ Need that for x ∈ Sp, f(x) ∈ Sp

If x Sp, p x p a either, so p ax Hence ax p Sp Inverse is f 1 y a 1y p f 1 f x a 1ax x p f f 1 x aa 1x x p

10 / 20

slide-44
SLIDE 44

Proof Of Claim

To fjnish FLT proof, need to prove: Claim: f(x) = ax (mod p) is bijection Sp → Sp Proof:

▶ Need that for x ∈ Sp, f(x) ∈ Sp

▶ If x ∈ Sp, p ̸ | x ▶ p ̸ | a either, so p ̸ | ax ▶ Hence ax (mod p) ∈ Sp

Inverse is f 1 y a 1y p f 1 f x a 1ax x p f f 1 x aa 1x x p

10 / 20

slide-45
SLIDE 45

Proof Of Claim

To fjnish FLT proof, need to prove: Claim: f(x) = ax (mod p) is bijection Sp → Sp Proof:

▶ Need that for x ∈ Sp, f(x) ∈ Sp

▶ If x ∈ Sp, p ̸ | x ▶ p ̸ | a either, so p ̸ | ax ▶ Hence ax (mod p) ∈ Sp

▶ Inverse is f−1(y) = a−1y (mod p)

f 1 f x a 1ax x p f f 1 x aa 1x x p

10 / 20

slide-46
SLIDE 46

Proof Of Claim

To fjnish FLT proof, need to prove: Claim: f(x) = ax (mod p) is bijection Sp → Sp Proof:

▶ Need that for x ∈ Sp, f(x) ∈ Sp

▶ If x ∈ Sp, p ̸ | x ▶ p ̸ | a either, so p ̸ | ax ▶ Hence ax (mod p) ∈ Sp

▶ Inverse is f−1(y) = a−1y (mod p)

▶ f−1(f(x)) ≡ a−1ax ≡ x (mod p) ▶ f(f−1(x)) ≡ aa−1x ≡ x (mod p) 10 / 20

slide-47
SLIDE 47

RSA Correctness

Theorem: RSA protocol always decrypts correctly. Formally: p, q, e, and m, DN d EN e m m Proof: Note: D E m med mod N So just need to prove med m N ed 1 k p 1 q 1 So med m p 1

k q 1 m

m p Similarly, have med m q med m pq is solution to those two CRT: m is only solution!

11 / 20

slide-48
SLIDE 48

RSA Correctness

Theorem: RSA protocol always decrypts correctly. Formally: ∀ p, q, e, and m, DN,d(EN,e(m)) = m Proof: Note: D E m med mod N So just need to prove med m N ed 1 k p 1 q 1 So med m p 1

k q 1 m

m p Similarly, have med m q med m pq is solution to those two CRT: m is only solution!

11 / 20

slide-49
SLIDE 49

RSA Correctness

Theorem: RSA protocol always decrypts correctly. Formally: ∀ p, q, e, and m, DN,d(EN,e(m)) = m Proof:

▶ Note: D(E(m)) = med mod N ▶ So just need to prove med ≡ m (mod N)

ed 1 k p 1 q 1 So med m p 1

k q 1 m

m p Similarly, have med m q med m pq is solution to those two CRT: m is only solution!

11 / 20

slide-50
SLIDE 50

RSA Correctness

Theorem: RSA protocol always decrypts correctly. Formally: ∀ p, q, e, and m, DN,d(EN,e(m)) = m Proof:

▶ Note: D(E(m)) = med mod N ▶ So just need to prove med ≡ m (mod N) ▶ ed = 1 + k(p − 1)(q − 1) ▶ So med = (m(p−1))k(q−1)m ≡ m (mod p)

Similarly, have med m q med m pq is solution to those two CRT: m is only solution!

11 / 20

slide-51
SLIDE 51

RSA Correctness

Theorem: RSA protocol always decrypts correctly. Formally: ∀ p, q, e, and m, DN,d(EN,e(m)) = m Proof:

▶ Note: D(E(m)) = med mod N ▶ So just need to prove med ≡ m (mod N) ▶ ed = 1 + k(p − 1)(q − 1) ▶ So med = (m(p−1))k(q−1)m ≡ m (mod p) ▶ Similarly, have med ≡ m (mod q)

med m pq is solution to those two CRT: m is only solution!

11 / 20

slide-52
SLIDE 52

RSA Correctness

Theorem: RSA protocol always decrypts correctly. Formally: ∀ p, q, e, and m, DN,d(EN,e(m)) = m Proof:

▶ Note: D(E(m)) = med mod N ▶ So just need to prove med ≡ m (mod N) ▶ ed = 1 + k(p − 1)(q − 1) ▶ So med = (m(p−1))k(q−1)m ≡ m (mod p) ▶ Similarly, have med ≡ m (mod q) ▶ med ≡ m (mod pq) is solution to those two ▶ CRT: m is only solution!

11 / 20

slide-53
SLIDE 53

RSA Effjciency

Need protocol to run quickly For security, p and q often 512 bits or more. Setup: need to sample p and q (next slide) Setup: need to invert e to get d EGCD runs in log time! Encryption: need to fjnd me N Repeated squaring runs in log time! Decryption: need to fjnd cd N Again use repeated squaring!

12 / 20

slide-54
SLIDE 54

RSA Effjciency

Need protocol to run quickly For security, p and q often 512 bits or more. Setup: need to sample p and q (next slide) Setup: need to invert e to get d EGCD runs in log time! Encryption: need to fjnd me N Repeated squaring runs in log time! Decryption: need to fjnd cd N Again use repeated squaring!

12 / 20

slide-55
SLIDE 55

RSA Effjciency

Need protocol to run quickly For security, p and q often 512 bits or more. Setup: need to sample p and q (next slide) Setup: need to invert e to get d

▶ EGCD runs in log time!

Encryption: need to fjnd me N Repeated squaring runs in log time! Decryption: need to fjnd cd N Again use repeated squaring!

12 / 20

slide-56
SLIDE 56

RSA Effjciency

Need protocol to run quickly For security, p and q often 512 bits or more. Setup: need to sample p and q (next slide) Setup: need to invert e to get d

▶ EGCD runs in log time!

Encryption: need to fjnd me (mod N)

▶ Repeated squaring runs in log time!

Decryption: need to fjnd cd N Again use repeated squaring!

12 / 20

slide-57
SLIDE 57

RSA Effjciency

Need protocol to run quickly For security, p and q often 512 bits or more. Setup: need to sample p and q (next slide) Setup: need to invert e to get d

▶ EGCD runs in log time!

Encryption: need to fjnd me (mod N)

▶ Repeated squaring runs in log time!

Decryption: need to fjnd cd (mod N)

▶ Again use repeated squaring!

12 / 20

slide-58
SLIDE 58

Sampling Primes

How to fjnd primes p and q? Can’t use the same ones for every key! Theorem: Num primes n at least

n n

Means we can guess randomly until we fjnd one! Note: can quickly test primality

13 / 20

slide-59
SLIDE 59

Sampling Primes

How to fjnd primes p and q? Can’t use the same ones for every key! Theorem: Num primes ≤ n at least

n ln(n)

Means we can guess randomly until we fjnd one! Note: can quickly test primality

13 / 20

slide-60
SLIDE 60

Sampling Primes

How to fjnd primes p and q? Can’t use the same ones for every key! Theorem: Num primes ≤ n at least

n ln(n)

Means we can guess randomly until we fjnd one! Note: can quickly test primality

13 / 20

slide-61
SLIDE 61

Sampling Primes

How to fjnd primes p and q? Can’t use the same ones for every key! Theorem: Num primes ≤ n at least

n ln(n)

Means we can guess randomly until we fjnd one! Note: can quickly test primality

13 / 20

slide-62
SLIDE 62

Time For A Break

4 minute breather! Today’s Discussion Question: What is the best kind of sandwich?

14 / 20

slide-63
SLIDE 63

Time For A Break

4 minute breather! Today’s Discussion Question: What is the best kind of sandwich?

14 / 20

slide-64
SLIDE 64

RSA Security

Correctness and effjciency great; need security too Open problem in Computer Science! Generally accepted as secure, but no proof (yet) Can easily break if factor N into p and q But naïve factoring too slow if p and q big Note: can factor quickly on quantum computers Not an immediate issue, but may be in the future!

15 / 20

slide-65
SLIDE 65

RSA Security

Correctness and effjciency great; need security too Open problem in Computer Science! Generally accepted as secure, but no proof (yet) Can easily break if factor N into p and q But naïve factoring too slow if p and q big Note: can factor quickly on quantum computers Not an immediate issue, but may be in the future!

15 / 20

slide-66
SLIDE 66

RSA Security

Correctness and effjciency great; need security too Open problem in Computer Science! Generally accepted as secure, but no proof (yet) Can easily break if factor N into p and q But naïve factoring too slow if p and q big Note: can factor quickly on quantum computers Not an immediate issue, but may be in the future!

15 / 20

slide-67
SLIDE 67

RSA Security

Correctness and effjciency great; need security too Open problem in Computer Science! Generally accepted as secure, but no proof (yet) Can easily break if factor N into p and q But naïve factoring too slow if p and q big Note: can factor quickly on quantum computers Not an immediate issue, but may be in the future!

15 / 20

slide-68
SLIDE 68

RSA Security

Correctness and effjciency great; need security too Open problem in Computer Science! Generally accepted as secure, but no proof (yet) Can easily break if factor N into p and q But naïve factoring too slow if p and q big Note: can factor quickly on quantum computers Not an immediate issue, but may be in the future!

15 / 20

slide-69
SLIDE 69

Breaking Textbook RSA

Even if RSA secure, need careful implementation Ex: suppose my credit card number is m I send Amazon E m to make a purchase Alice can’t recover m from E m ... ...but what if she sends E m to Amazon?

16 / 20

slide-70
SLIDE 70

Breaking Textbook RSA

Even if RSA secure, need careful implementation Ex: suppose my credit card number is m I send Amazon E(m) to make a purchase Alice can’t recover m from E m ... ...but what if she sends E m to Amazon?

16 / 20

slide-71
SLIDE 71

Breaking Textbook RSA

Even if RSA secure, need careful implementation Ex: suppose my credit card number is m I send Amazon E(m) to make a purchase Alice can’t recover m from E(m)... ...but what if she sends E m to Amazon?

16 / 20

slide-72
SLIDE 72

Breaking Textbook RSA

Even if RSA secure, need careful implementation Ex: suppose my credit card number is m I send Amazon E(m) to make a purchase Alice can’t recover m from E(m)... ...but what if she sends E(m) to Amazon?

16 / 20

slide-73
SLIDE 73

Breaking Textbook RSA

Even if RSA secure, need careful implementation Ex: suppose my credit card number is m I send Amazon E(m) to make a purchase Alice can’t recover m from E(m)... ...but what if she sends E(m) to Amazon?

16 / 20

slide-74
SLIDE 74

Defense Against Replay Attacks

Last slide was a replay attack Fix: pad message with a bunch of randomness If Amazon gets same message twice, reject Moral: even secure protocol can be vulnerable!

17 / 20

slide-75
SLIDE 75

Defense Against Replay Attacks

Last slide was a replay attack Fix: pad message with a bunch of randomness If Amazon gets same message twice, reject Moral: even secure protocol can be vulnerable!

17 / 20

slide-76
SLIDE 76

Defense Against Replay Attacks

Last slide was a replay attack Fix: pad message with a bunch of randomness If Amazon gets same message twice, reject Moral: even secure protocol can be vulnerable!

17 / 20

slide-77
SLIDE 77

Digital Signature Scheme

Alternate use of RSA: proof of identity “Amazon” wants to send me a message. How do I know it’s actually Amazon? Idea: Amazon sends s md N along with m I can verify se m N Only Amazon can sign consistently! Ability to sign ability to decrypt

18 / 20

slide-78
SLIDE 78

Digital Signature Scheme

Alternate use of RSA: proof of identity “Amazon” wants to send me a message. How do I know it’s actually Amazon? Idea: Amazon sends s md N along with m I can verify se m N Only Amazon can sign consistently! Ability to sign ability to decrypt

18 / 20

slide-79
SLIDE 79

Digital Signature Scheme

Alternate use of RSA: proof of identity “Amazon” wants to send me a message. How do I know it’s actually Amazon? Idea: Amazon sends s = md (mod N) along with m I can verify se m N Only Amazon can sign consistently! Ability to sign ability to decrypt

18 / 20

slide-80
SLIDE 80

Digital Signature Scheme

Alternate use of RSA: proof of identity “Amazon” wants to send me a message. How do I know it’s actually Amazon? Idea: Amazon sends s = md (mod N) along with m I can verify se ≡ m (mod N) Only Amazon can sign consistently! Ability to sign ability to decrypt

18 / 20

slide-81
SLIDE 81

Digital Signature Scheme

Alternate use of RSA: proof of identity “Amazon” wants to send me a message. How do I know it’s actually Amazon? Idea: Amazon sends s = md (mod N) along with m I can verify se ≡ m (mod N) Only Amazon can sign consistently! Ability to sign ≡ ability to decrypt

18 / 20

slide-82
SLIDE 82

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE m pls Amazon: reE m

d

N What can Eve now do? reE m

d

redmed rm N Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-83
SLIDE 83

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE m pls Amazon: reE m

d

N What can Eve now do? reE m

d

redmed rm N Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-84
SLIDE 84

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE(m) pls Amazon: reE m

d

N What can Eve now do? reE m

d

redmed rm N Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-85
SLIDE 85

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE(m) pls Amazon: (reE(m))d (mod N) What can Eve now do? reE m

d

redmed rm N Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-86
SLIDE 86

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE(m) pls Amazon: (reE(m))d (mod N) What can Eve now do? reE m

d

redmed rm N Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-87
SLIDE 87

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE(m) pls Amazon: (reE(m))d (mod N) What can Eve now do? (reE(m))d ≡ redmed ≡ rm (mod N) Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-88
SLIDE 88

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE(m) pls Amazon: (reE(m))d (mod N) What can Eve now do? (reE(m))d ≡ redmed ≡ rm (mod N) Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-89
SLIDE 89

Digital Signature Attack

Eve: I choose message to sign to prevent cheating! Amazon: ok... Eve: Sign reE(m) pls Amazon: (reE(m))d (mod N) What can Eve now do? (reE(m))d ≡ redmed ≡ rm (mod N) Uh oh — Eve knows r, so can invert to get m! Moral: don’t sign arbitrary messages

19 / 20

slide-90
SLIDE 90

Fin

Next time: polynomials!

20 / 20