Upcoming: Distinguished Lecturer! Upcoming: Distinguished Lecturer! - - PowerPoint PPT Presentation
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 2
Upcoming: Distinguished Lecturer!
Lecture: Self-Reference and Ucomputability.
SLIDE 3
Upcoming: Distinguished Lecturer!
Lecture: Self-Reference and Ucomputability. Christos Papadimitriou.
SLIDE 4
Upcoming: Distinguished Lecturer!
Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author:
SLIDE 5
Upcoming: Distinguished Lecturer!
Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!)
SLIDE 6
Upcoming: Distinguished Lecturer!
Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix
SLIDE 7
Upcoming: Distinguished Lecturer!
Lecture: Self-Reference and Ucomputability. Christos Papadimitriou. Book Author: (three novels!) Logicomix: An epic search for Truth
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
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
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
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
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
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
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
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
Cryptography ...
Bob Alice Eve
SLIDE 17
Cryptography ...
Bob Alice Eve Secret s
SLIDE 18
Cryptography ...
Bob Alice Eve Secret s Message m
SLIDE 19
Cryptography ...
Bob Alice Eve Secret s Message m E(m,s)
SLIDE 20
Cryptography ...
Bob Alice Eve Secret s Message m E(m,s)
SLIDE 21
Cryptography ...
Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s)
SLIDE 22
Cryptography ...
Bob Alice Eve Secret s Message m E(m,s) m = D(E(m,s),s) Example:
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
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
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
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
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
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
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
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
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
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
Public key crypography.
Bob Alice Eve
SLIDE 34
Public key crypography.
Bob Alice Eve Public: K
SLIDE 35
Public key crypography.
Bob Alice Eve Public: K Private: k
SLIDE 36
Public key crypography.
Bob Alice Eve Public: K Private: k Message m
SLIDE 37
Public key crypography.
Bob Alice Eve Public: K Private: k Message m E(m,K)
SLIDE 38
Public key crypography.
Bob Alice Eve Public: K Private: k Message m E(m,K)
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
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
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
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
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
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
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
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
Is public key crypto possible?
We don’t really know.
1Typically small, say e = 3.
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
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
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
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
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
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
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
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
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
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
Example: p = 7, q = 11.
SLIDE 59
Example: p = 7, q = 11. N = 77.
SLIDE 60
Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60
SLIDE 61
Example: p = 7, q = 11. N = 77. (p −1)(q −1) = 60 Choose e = 7, since gcd(7,60) = 1.
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
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
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
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
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
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
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
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
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
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
Encryption/Decryption Techniques.
SLIDE 73
Encryption/Decryption Techniques.
Public Key: (77,7)
SLIDE 74
Encryption/Decryption Techniques.
Public Key: (77,7) Message Choices: {0,...,76}.
SLIDE 75
Encryption/Decryption Techniques.
Public Key: (77,7) Message Choices: {0,...,76}. Message: 2!
SLIDE 76
Encryption/Decryption Techniques.
Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2)
SLIDE 77
Encryption/Decryption Techniques.
Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e
SLIDE 78
Encryption/Decryption Techniques.
Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27
SLIDE 79
Encryption/Decryption Techniques.
Public Key: (77,7) Message Choices: {0,...,76}. Message: 2! E(2) = 2e = 27 ≡ 128 (mod 77)
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
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
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
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
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
Repeated squaring.
SLIDE 86
Repeated squaring.
5143
SLIDE 87
Repeated squaring.
5143 = 5132+8+2+1
SLIDE 88
Repeated squaring.
5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77).
SLIDE 89
Repeated squaring.
5143 = 5132+8+2+1 = 5132 ·518 ·512 ·511 (mod 77). 4 multiplications sort of...
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
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
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
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
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
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
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
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
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
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
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
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
Repeated Squaring: xy
SLIDE 103
Repeated Squaring: xy
Repeated squaring O(logy) multiplications versus y!!!
- 1. xy: Compute x1,
SLIDE 104
Repeated Squaring: xy
Repeated squaring O(logy) multiplications versus y!!!
- 1. xy: Compute x1,x2,
SLIDE 105
Repeated Squaring: xy
Repeated squaring O(logy) multiplications versus y!!!
- 1. xy: Compute x1,x2,x4,
SLIDE 106
Repeated Squaring: xy
Repeated squaring O(logy) multiplications versus y!!!
- 1. xy: Compute x1,x2,x4, ...,
SLIDE 107
Repeated Squaring: xy
Repeated squaring O(logy) multiplications versus y!!!
- 1. xy: Compute x1,x2,x4, ...,x2⌊logy⌋.
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
Always decode correctly?
Fermat’s Little Theorem: For prime p, and a ≡ 0 (mod p),
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
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
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
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
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