Upcoming: Distinguished Lecturer! Upcoming: Distinguished Lecturer! - - PowerPoint PPT Presentation

upcoming distinguished lecturer upcoming distinguished
SMART_READER_LITE
LIVE PREVIEW

Upcoming: Distinguished Lecturer! Upcoming: Distinguished Lecturer! - - PowerPoint PPT Presentation

Upcoming: Distinguished Lecturer! Upcoming: Distinguished Lecturer! Lecture: Self-Reference and Ucomputability. Upcoming: Distinguished Lecturer! Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Upcoming: Distinguished


slide-1
SLIDE 1

Upcoming: Distinguished Lecturer!

slide-2
SLIDE 2

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability.

slide-3
SLIDE 3

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou.

slide-4
SLIDE 4

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author:

slide-5
SLIDE 5

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!)

slide-6
SLIDE 6

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix

slide-7
SLIDE 7

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

slide-8
SLIDE 8

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

slide-9
SLIDE 9

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

Its beautiful.

slide-10
SLIDE 10

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

Its beautiful. Browse it here.

slide-11
SLIDE 11

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

Its beautiful. Browse it here.

Scribd

slide-12
SLIDE 12

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

Its beautiful. Browse it here.

Scribd

Christos says its fine.

slide-13
SLIDE 13

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

Its beautiful. Browse it here.

Scribd

Christos says its fine. But buy the book.

slide-14
SLIDE 14

Upcoming: Distinguished Lecturer!

Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth

Amazon

Its beautiful. Browse it here.

Scribd

Christos says its fine. But buy the book. Its beautiful.

slide-15
SLIDE 15

CS70: Lecture 10. Outline.

  • 1. Cryptography
  • 2. Public Key Cryptography
  • 3. RSA system

3.1 Efficiency: Repeated Squaring. 3.2 Correctness: Fermat’s Theorem. 3.3 Construction.

  • 4. Warnings.
slide-16
SLIDE 16

Cryptography ...

Bob Alice Eve

slide-17
SLIDE 17

Cryptography ...

Bob Alice Eve Secret s

slide-18
SLIDE 18

Cryptography ...

Bob Alice Eve Secret s Message m

slide-19
SLIDE 19

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s)

slide-20
SLIDE 20

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s)

slide-21
SLIDE 21

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s)

slide-22
SLIDE 22

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example:

slide-23
SLIDE 23

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|.

slide-24
SLIDE 24

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s.

slide-25
SLIDE 25

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s.

slide-26
SLIDE 26

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m!

slide-27
SLIDE 27

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m! ...and totally secure!

slide-28
SLIDE 28

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m! ...and totally secure! ...given E(m,s) any message m is equally likely.

slide-29
SLIDE 29

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m! ...and totally secure! ...given E(m,s) any message m is equally likely. Disadvantages:

slide-30
SLIDE 30

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m! ...and totally secure! ...given E(m,s) any message m is equally likely. Disadvantages: Shared secret!

slide-31
SLIDE 31

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m! ...and totally secure! ...given E(m,s) any message m is equally likely. Disadvantages: Shared secret! Uses up one time pad..

slide-32
SLIDE 32

Cryptography ...

Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example: One-time Pad: secret s is string of length |m|. E(m,s) – bitwise m ⊕s. D(x,s) – bitwise x ⊕s. Works because m ⊕s ⊕s = m! ...and totally secure! ...given E(m,s) any message m is equally likely. Disadvantages: Shared secret! Uses up one time pad..or less and less secure.

slide-33
SLIDE 33

Public key crypography.

Bob Alice Eve

slide-34
SLIDE 34

Public key crypography.

Bob Alice Eve Public: K

slide-35
SLIDE 35

Public key crypography.

Bob Alice Eve Public: K Private: k

slide-36
SLIDE 36

Public key crypography.

Bob Alice Eve Public: K Private: k Message m

slide-37
SLIDE 37

Public key crypography.

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

slide-38
SLIDE 38

Public key crypography.

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

slide-39
SLIDE 39

Public key crypography.

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

slide-40
SLIDE 40

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

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

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

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

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

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-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! 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-47
SLIDE 47

Is public key crypto possible?

We don’t really know.

1Typically small, say e = 3.

slide-48
SLIDE 48

Is public key crypto possible?

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

1Typically small, say e = 3.

slide-49
SLIDE 49

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

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

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

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

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

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

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

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

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

Example: p = 7, q = 11.

slide-59
SLIDE 59

Example: p = 7, q = 11. N = 77.

slide-60
SLIDE 60

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60

slide-61
SLIDE 61

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1.

slide-62
SLIDE 62

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60).

slide-63
SLIDE 63

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60

slide-64
SLIDE 64

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7

slide-65
SLIDE 65

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4

slide-66
SLIDE 66

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4 7(9)+60(−1) = 3

slide-67
SLIDE 67

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4 7(9)+60(−1) = 3 7(−17)+60(2) = 1

slide-68
SLIDE 68

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4 7(9)+60(−1) = 3 7(−17)+60(2) = 1

slide-69
SLIDE 69

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4 7(9)+60(−1) = 3 7(−17)+60(2) = 1 Confirm:

slide-70
SLIDE 70

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4 7(9)+60(−1) = 3 7(−17)+60(2) = 1 Confirm: −119+120 = 1

slide-71
SLIDE 71

Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1. egcd(7,60). 7(0)+60(1) = 60 7(1)+60(0) = 7 7(−8)+60(1) = 4 7(9)+60(−1) = 3 7(−17)+60(2) = 1 Confirm: −119+120 = 1 d = e−1 = −17 = 43 = (mod 60)

slide-72
SLIDE 72

Encryption/Decryption Techniques.

slide-73
SLIDE 73

Encryption/Decryption Techniques.

Public Key: (77,7)

slide-74
SLIDE 74

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}.

slide-75
SLIDE 75

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2!

slide-76
SLIDE 76

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2)

slide-77
SLIDE 77

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e

slide-78
SLIDE 78

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27

slide-79
SLIDE 79

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77)

slide-80
SLIDE 80

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77) = 51 (mod 77)

slide-81
SLIDE 81

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77) = 51 (mod 77) D(51) = 5143 (mod 77)

slide-82
SLIDE 82

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77) = 51 (mod 77) D(51) = 5143 (mod 77) uh oh!

slide-83
SLIDE 83

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77) = 51 (mod 77) D(51) = 5143 (mod 77) uh oh! Obvious way: 43 multiplcations. Ouch.

slide-84
SLIDE 84

Encryption/Decryption Techniques.

Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77) = 51 (mod 77) D(51) = 5143 (mod 77) uh oh! Obvious way: 43 multiplcations. Ouch. In general, O(N) multiplications!

slide-85
SLIDE 85

Repeated squaring.

slide-86
SLIDE 86

Repeated squaring.

5143

slide-87
SLIDE 87

Repeated squaring.

5143 = 5132+8+2+1

slide-88
SLIDE 88

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77).

slide-89
SLIDE 89

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of...

slide-90
SLIDE 90

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.?

slide-91
SLIDE 91

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77)

slide-92
SLIDE 92

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77)

slide-93
SLIDE 93

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77)

slide-94
SLIDE 94

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77)

slide-95
SLIDE 95

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77)

slide-96
SLIDE 96

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77) 5132 = (5116)∗(5116) = 37∗37 = 1369 ≡ 60 (mod 77)

slide-97
SLIDE 97

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77) 5132 = (5116)∗(5116) = 37∗37 = 1369 ≡ 60 (mod 77) 5 more multiplications.

slide-98
SLIDE 98

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77) 5132 = (5116)∗(5116) = 37∗37 = 1369 ≡ 60 (mod 77) 5 more multiplications. 5132 ·518 ·512 ·511 = (60)∗(53)∗(60)∗(51) ≡ 2 (mod 77).

slide-99
SLIDE 99

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77) 5132 = (5116)∗(5116) = 37∗37 = 1369 ≡ 60 (mod 77) 5 more multiplications. 5132 ·518 ·512 ·511 = (60)∗(53)∗(60)∗(51) ≡ 2 (mod 77). Decoding got the message back!

slide-100
SLIDE 100

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77) 5132 = (5116)∗(5116) = 37∗37 = 1369 ≡ 60 (mod 77) 5 more multiplications. 5132 ·518 ·512 ·511 = (60)∗(53)∗(60)∗(51) ≡ 2 (mod 77). Decoding got the message back! Repeated Squaring took 9 multiplications

slide-101
SLIDE 101

Repeated squaring.

5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of... Need to compute 5132 ...511.? 511 ≡ 51 (mod 77) 512 = (51)∗(51) = 2601 ≡ 60 (mod 77) 514 = (512)∗(512) = 60∗60 = 3600 ≡ 58 (mod 77) 518 = (514)∗(514) = 58∗58 = 3364 ≡ 53 (mod 77) 5116 = (518)∗(518) = 53∗53 = 2809 ≡ 37 (mod 77) 5132 = (5116)∗(5116) = 37∗37 = 1369 ≡ 60 (mod 77) 5 more multiplications. 5132 ·518 ·512 ·511 = (60)∗(53)∗(60)∗(51) ≡ 2 (mod 77). Decoding got the message back! Repeated Squaring took 9 multiplications versus 43.

slide-102
SLIDE 102

Repeated Squaring: xy

slide-103
SLIDE 103

Repeated Squaring: xy

Repeated squaring O(logy) multiplications versus y!!!

  • 1. xy: Compute x1,
slide-104
SLIDE 104

Repeated Squaring: xy

Repeated squaring O(logy) multiplications versus y!!!

  • 1. xy: Compute x1,x2,
slide-105
SLIDE 105

Repeated Squaring: xy

Repeated squaring O(logy) multiplications versus y!!!

  • 1. xy: Compute x1,x2,x4,
slide-106
SLIDE 106

Repeated Squaring: xy

Repeated squaring O(logy) multiplications versus y!!!

  • 1. xy: Compute x1,x2,x4, ...,
slide-107
SLIDE 107

Repeated Squaring: xy

Repeated squaring O(logy) multiplications versus y!!!

  • 1. xy: Compute x1,x2,x4, ...,x2⌊logy⌋.
slide-108
SLIDE 108

Repeated Squaring: xy

Repeated squaring O(logy) multiplications versus y!!!

  • 1. xy: Compute x1,x2,x4, ...,x2⌊logy⌋.
  • 2. Multiply together xi where the (log(i))th bit of y is 1.
slide-109
SLIDE 109

Always decode correctly?

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

slide-110
SLIDE 110

Always decode correctly?

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

Always decode correctly?

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

Always decode correctly?

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

Always decode correctly?

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

Always decode correctly?

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

Always decode correctly?

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.