cs70 lecture 11 outline
play

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


  1. 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 ) . ( a , b )+( a ′ , b ′ ) = ( 0 , 2 ) . Now consider: What is x where x = 0 ( mod 5 ) and x = 2 ( mod 9 ) ?

  2. 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 ) . ( a , b )+( a ′ , b ′ ) = ( 0 , 2 ) . Now consider: What is x where x = 0 ( mod 5 ) and x = 2 ( mod 9 ) ? Try 43 + 22 = 65

  3. 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 ) . ( a , b )+( a ′ , b ′ ) = ( 0 , 2 ) . Now consider: What is x where x = 0 ( mod 5 ) and x = 2 ( mod 9 ) ? Try 43 + 22 = 65 = 20 ( mod 45 ) .

  4. 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 ) . ( a , b )+( a ′ , b ′ ) = ( 0 , 2 ) . Now consider: What is x where x = 0 ( mod 5 ) and x = 2 ( mod 9 ) ? Try 43 + 22 = 65 = 20 ( mod 45 ) . Isomorphism:

  5. 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 ) . ( a , b )+( a ′ , b ′ ) = ( 0 , 2 ) . Now consider: 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 )

  6. 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 ) . ( a , b )+( a ′ , b ′ ) = ( 0 , 2 ) . Now consider: 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 ) !

  7. Public key crypography. Alice Bob Eve

  8. Public key crypography. Public: K Alice Bob Eve

  9. Public key crypography. Private: k Public: K Alice Bob Eve

  10. Public key crypography. Message m Private: k Public: K Alice Bob Eve

  11. Public key crypography. Message m Private: k Public: K E ( m , K ) Alice Bob Eve

  12. Public key crypography. Message m Private: k Public: K E ( m , K ) Alice Bob Eve

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

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

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

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

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

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

  19. Public key crypography. m = D ( E ( m , K ) , k ) Message m Private: k Public: K E ( m , K ) Alice Bob Eve 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 .

  20. Public key crypography. m = D ( E ( m , K ) , k ) Message m Private: k Public: K E ( m , K ) Alice Bob Eve 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 .

  21. Public key crypography. m = D ( E ( m , K ) , k ) Message m Private: k Public: K E ( m , K ) Alice Bob Eve 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?

  22. Is public key crypto possible? 1 Typically small, say e = 3.

  23. Is public key crypto possible? We don’t really know. 1 Typically small, say e = 3.

  24. Is public key crypto possible? We don’t really know. ...but we do it every day!!! 1 Typically small, say e = 3.

  25. Is public key crypto possible? We don’t really know. ...but we do it every day!!! RSA (Rivest, Shamir, and Adleman) 1 Typically small, say e = 3.

  26. 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 . 1 Typically small, say e = 3.

  27. 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 1 Typically small, say e = 3.

  28. 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 ) . 1 Typically small, say e = 3.

  29. 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! 1 Typically small, say e = 3.

  30. 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! mod ( x e , N ) . Encoding: 1 Typically small, say e = 3.

  31. 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! mod ( x e , N ) . Encoding: mod ( y d , N ) . Decoding: 1 Typically small, say e = 3.

  32. 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! mod ( x e , N ) . Encoding: mod ( y d , N ) . Decoding: Does D ( E ( m )) = m ed = m mod N ? 1 Typically small, say e = 3.

  33. 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! mod ( x e , N ) . Encoding: mod ( y d , N ) . Decoding: Does D ( E ( m )) = m ed = m mod N ? Yes! 1 Typically small, say e = 3.

  34. RSA is pretty fast. Modular Exponentiation: x y mod N .

  35. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time.

  36. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time. Remember RSA encoding/decoding!

  37. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time. Remember RSA encoding/decoding! E ( m , ( N , e )) = m e ( mod N ) .

  38. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time. Remember RSA encoding/decoding! E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) .

  39. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time. Remember RSA encoding/decoding! E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) .

  40. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time. Remember RSA encoding/decoding! E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . For 512 bits, a few hundred million operations.

  41. RSA is pretty fast. Modular Exponentiation: x y mod N . All n -bit numbers. O ( n 3 ) time. Remember RSA encoding/decoding! E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . For 512 bits, a few hundred million operations. Easy, peasey.

  42. Decoding. E ( m , ( N , e )) = m e ( mod N ) .

  43. Decoding. E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) .

  44. Decoding. E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) .

  45. Decoding. E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq

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

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

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

  49. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) .

  50. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) .

  51. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) .

  52. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq

  53. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) .

  54. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want:

  55. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = m ( mod N ) .

  56. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = m ( mod N ) . Another view:

  57. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = m ( mod N ) . Another view: d = e − 1 ( mod ( p − 1 )( q − 1 )) ⇐ ⇒ ed = k ( p − 1 )( q − 1 )+ 1.

  58. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = m ( mod N ) . Another view: d = e − 1 ( mod ( p − 1 )( q − 1 )) ⇐ ⇒ ed = k ( p − 1 )( q − 1 )+ 1. Consider...

  59. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) ,

  60. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) .

  61. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) . ⇒ a k ( p − 1 ) ≡ 1 ( mod p ) =

  62. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) . ⇒ a k ( p − 1 ) ≡ 1 ( mod p ) = = ⇒

  63. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) . ⇒ a k ( p − 1 ) ≡ 1 ( mod p ) = ⇒ a k ( p − 1 )+ 1 =

  64. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) . ⇒ a k ( p − 1 ) ≡ 1 ( mod p ) = ⇒ a k ( p − 1 )+ 1 = a ( mod p ) =

  65. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) . ⇒ a k ( p − 1 ) ≡ 1 ( mod p ) = ⇒ a k ( p − 1 )+ 1 = a ( mod p ) = a k ( p − 1 )( q − 1 )+ 1 = a ( mod pq ) . versus

  66. Always decode correctly? E ( m , ( N , e )) = m e ( mod N ) . D ( m , ( N , d )) = m d ( mod N ) . N = pq and d = e − 1 ( mod ( p − 1 )( q − 1 )) . Want: ( m e ) d = m ed = 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 ) , a p − 1 ≡ 1 ( mod p ) . ⇒ a k ( p − 1 ) ≡ 1 ( mod p ) = ⇒ a k ( p − 1 )+ 1 = a ( mod p ) = a k ( p − 1 )( q − 1 )+ 1 = a ( mod pq ) . versus Similar, not same, but useful.

  67. Correct decoding... Fermat’s Little Theorem: For prime p , and a �≡ 0 ( mod p ) ,

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

Recommend


More recommend