Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 23: Cryptosystems

David Evans
November 16, 2017

Class 23: Cryptosystems

cs2102: Discrete Mathematics
University of Virginia, Fall 2017

See course site for notes:
https://uvacs2102.github.io

David Evans

November 16, 2017
Tweet

More Decks by David Evans

Other Decks in Design

Transcript

  1. Plan Goal for today: Understand how discrete math enables asymmetric

    cryptography Groups and Fields Symmetric Cryptography Asymmetric Cryptography
  2. Recap: Abelian Group is Abelian (commutative) under the first operation

    (): ∀, , ∈ : associative: = commutative: = identity: ∃ ∈ : = inverse: ∃ ∈ : = = ℕ, = + is not an Abelian group: no additive inverse
  3. Making Addition Abelian ∀, , ∈ : associative: + +

    = + + commutative: + = + identity: + 0 = inverse: ∀ . ∃ ∈ : + = 0 = ℕ, = + is not an Abelian group: no additive inverse
  4. Congruence Prove: ≡ mod iff rem , = rem(, )

    A number is congruent to modulo iff | ( – ). Notation: ≡ mod
  5. Congruence Prove: ≡ mod iff rem , = rem(, )

    A number is congruent to modulo iff | ( – ). Notation: ≡ mod By division theorem, ∃A , A , C , C, such that: = A + A = C + C − = (A −C ) + (A −C )
  6. Preservation of Congruence If ≡ (mod ) and ≡ mod

    , (addition) + ≡ + (mod ) (multiplication) ≡ (mod ) (Proofs by algebra, in book.)
  7. Abelian Addition ∀, , ∈ : associative: + + =

    + + commutative: + = + identity: + 0 = inverse: ∀ . ∃ ∈ : + = 0 ℤL = ( = ℕL , = + mod ) What is the inverse in ℤL of ∈ ℕL?
  8. A ring is a set, , with two binary operations

    (e.g., + and ⋅) that satisfy the ring axioms: 1. is Abelian (commutative) under +: ∀, , ∈ : associative: ( + ) + = + ( + ), commutative: + = + additive identity: + 0 = additive inverse: + (−) = 0 2. is monoid (associative) under ⋅: associative: ⋅ ⋅ = ⋅ ( ⋅ ) multiplicative identity: ⋅ 1 = = 1 ⋅ 3. Distributive: ⋅ + = ⋅ + ⋅ + ⋅ = ⋅ + ( ⋅ ) Note: lots of disagreement about this definition – many versions do not require multiplicative identity.
  9. A ring is a set, , with two binary operations

    (e.g., + and ⋅) that satisfy the ring axioms: 1. is Abelian (commutative) under +: ∀, , ∈ : associative: ( + ) + = + ( + ) commutative: + = + additive identity: + = additive inverse: + (−) = 2. is monoid (associative) under ⋅: associative: ⋅ ⋅ = ⋅ ( ⋅ ) mult. identity: ⋅ = = ⋅ 3. Distributive: ⋅ + = ⋅ + ⋅ + ⋅ = ⋅ + ( ⋅ ) Is ℤL = ( = ℕL , A = + mod , C = ×(mod )) a ring?
  10. Problem Set ⍵ Create an artifact that conveys some idea

    from this class to a selected target audience. Teams of any size, expectations scale as √. Optional: no credit for something of no real value (test is if it is worthwhile for others). One or more PS equivalent for something valuable.
  11. Groups, Rings, and Fields Abelian group:set: , binary operation: +

    associative, commutative, additive identity (), additive inverse (−) Ring: set: , binary operations: +, × Abelian group under + associative, multiplicative identity () under × distributive: × distributes over + Field: set: , binary operations: +, × Ring with multiplicative inverse:
  12. Groups, Rings, and Fields Abelian group:set: , binary operation: +

    associative, commutative, additive identity (), additive inverse (−) Ring: set: , binary operations: +, × Abelian group under + associative, multiplicative identity () under × distributive: × distributes over + Field: set: , binary operations: +, × Ring with multiplicative inverse: ∀ ∈ − 0 . ∃UA ∈ . × UA = Most cryptography is done in finite fields
  13. A field is a set, , with two binary operations

    (e.g., + and ⋅) that satisfy the ring axioms: 1. is Abelian (commutative) under +: ∀, , ∈ : associative: ( + ) + = + ( + ) commutative: + = + additive identity: + = additive inverse: + (−) = 2. is monoid (associative) under ⋅: associative: ⋅ ⋅ = ⋅ ( ⋅ ) mult. identity: ⋅ = = ⋅ mult. inverse: ∀ ∈ − 0 . ∃UA ∈ . × UA = 3. Distributive: ⋅ + = ⋅ + ⋅ + ⋅ = ⋅ + ( ⋅ ) Fields of Dreams Which of these are fields? (1)ℚ, +,× (2){0, 1}, +,× (3)ℕL , +,×
  14. 1. is Abelian under +: associative. commutative, 0, − 2.

    is monoid (associative) under ⋅: associative, , UA 3. Distributive ℚ, +,×
  15. 1. is Abelian under +: associative. commutative, 0, − 2.

    is monoid (associative) under ⋅: associative, , UA 3. Distributive {0, 1}, +,×
  16. 1. is Abelian under +: associative. commutative, 0, − 2.

    is monoid (associative) under ⋅: associative, , UA 3. Distributive {0, 1}, +,× GF(2) Évariste Galois
  17. Is ℤL = ( = ℕL , A = +

    mod , C = × (mod )) a field? 1. is Abelian under +: associative. commutative, 0, − 2. is monoid (associative) under ⋅: associative, , UA 3. Distributive
  18. Is ℤL = ( = ℕL , A = +

    mod , C = × (mod )) a field? 1. is Abelian under +: associative. commutative, 0, − 2. is monoid (associative) under ⋅: associative, , UA 3. Distributive Which of the ℤL rings are fields?
  19. If ∈ ℕL is relatively prime to , has a

    multiplicative inverse in ℤL. (Lemma 9.9.1 in MCS) Definition: is relatively prime to iff gcd (, ) = 1.
  20. If ∈ ℕL is relatively prime to , has a

    multiplicative inverse in ℤL. (Lemma 9.9.1 in MCS) Definition: is relatively prime to iff gcd (, ) = 1. “Pulverizer” Theorem: ∀, ∈ ℕ. ∃, ∈ ℤ . gcd , = +
  21. Is ℤL = ( = ℕL , A = +

    mod , C = × (mod )) a field? 1. is Abelian under +: associative. commutative, 0, − 2. is monoid (associative) under ⋅: associative, , UA 3. Distributive If is prime, ℤL is a field. If ∈ ℕL is relatively prime to , has a multiplicative inverse in ℤL. (Lemma 9.9.1 in MCS)
  22. 29 Active Attacker Encrypt Decrypt Plaintext Ciphertext Plaintext Alice Bob

    Insecure Channel (e.g., the Internet) Mallory (active attacker)
  23. 30 Message Cryptosystem Encrypt Decrypt Plaintext Ciphertext Plaintext Ciphertext Two

    functions: → and → Correctness property: for all possible messages ∈ , = Security property: given = it is “hard” to learn anything interesting about .
  24. 31 It is possible to state the security property precisely

    (and prove a cryptosystem satisfies it given hardness assumptions). Shafi Goldwasser and Silvio Micali 2013 Turing Award Winners (for doing this in the 1980s)
  25. 32 Message Cryptosystem Encrypt Decrypt Plaintext Ciphertext Plaintext Ciphertext Two

    functions: → and → Correctness property: for all possible messages ∈ , = Security property: given = it is “hard” to learn anything interesting about .
  26. 34 “The enemy knows the system being used.” Claude Shannon,

    Communication Theory of Secrecy Systems (1949) Claude Shannon 1916-2001
  27. (Keyed) Symmetric Cryptosystem 35 Encrypt Decrypt Plaintext Ciphertext Plaintext Insecure

    Channel Encrypt Decrypt Plaintext Ciphertext Plaintext Insecure Channel Key Key Only secret is the key, not the E and D functions that now take key as input.
  28. 36 Encrypt Decrypt Plaintext Ciphertext Plaintext Insecure Channel Key Key

    How well can shared key cryptosystems work on the Internet? ∈ , ∈ . F F =
  29. Key Exchange Armadillo Armadillo and Bunny drawings by Sandra Boynton

    Bunny Goal: Armadillo and Bunny want to communicate securely, but have not already established a shared key. Insecure Channel
  30. Diffie-Hellman(-Merkle) Key Exchange f mod h mod Picks secret Picks

    secret Armadillo Armadillo and Bunny drawings by Sandra Boynton Bunny Public values: (primitive root), (large prime)
  31. Diffie-Hellman(-Merkle) Key Exchange f = f mod h = h

    mod Picks secret Picks secret Armadillo Armadillo and Bunny drawings by Sandra Boynton Bunny Public values: (primitive root), (large prime) fh = h f hf = f h
  32. Key Agreement Requirements Correctness: both participants produce the same key,

    Security: an eavesdropper cannot find K from all intercepted values 44
  33. DH(M) Key Exchange: Correctness f = f mod h =

    h mod Picks secret Picks secret Armadillo Bunny Public values: (primitive root), (large prime) fh = h f mod hf = f h mod
  34. DH(M) Key Exchange: Security f = f mod h =

    h mod Picks secret Picks secret Armadillo Bunny Public values: (primitive root), (large prime) fh = h f mod hf = f h mod Eavesdropper cannot learn anything useful about fh from: , , f = f mod , h = hmod
  35. DH(M) Key Exchange: Security Public values: (primitive root), (large prime)

    is a primitive root of p if ∀ ∈ 1, … , − 1 . ∃ ∈ 1, … , − 1 . l = mod What are the primitive roots of 7?
  36. DH(M) Key Exchange: Security Public values: (primitive root), (large prime)

    is a primitive root of p if ∀ ∈ 1, … , − 1 . ∃ ∈ 1, … , − 1 . l = mod Theorem (asserted without proof): If is prime, it has a primitive root.
  37. Public values: (primitive root), (large prime) is a primitive root

    of p if ∀ ∈ 1, … , − 1 . ∃ ∈ 1, … , − 1 . l = mod Theorem (asserted without proof): If is prime, it has a primitive root.
  38. DH(M) Key Exchange: Security f = f mod h =

    h mod Picks secret Picks secret Armadillo Bunny Public values: (primitive root), (large prime) fh = h f mod hf = f h mod Eavesdropper cannot learn anything useful about fh from: , , f = f mod , h = hmod
  39. DH(M) Key Exchange: Security f = f mod h =

    h mod Picks secret Picks secret Armadillo Bunny Public values: (primitive root), (large prime) fh = h f mod hf = f h mod Eavesdropper cannot learn anything useful about fh from: , , f = f mod , h = hmod Given f mod , can the adversary find ?
  40. Discrete Logarithm Problem Given , , = f mod ,

    find . Believed to be “hard” for well chosen values of and , so long as your adversary doesn’t have a large quantum computer.
  41. DH(M) Key Exchange: Security f = f mod h =

    h mod Picks secret Picks secret Armadillo Bunny Public values: (primitive root), (large prime) fh = h f mod hf = f h mod Eavesdropper cannot learn anything useful about fh from: , , f = f mod , h = hmod
  42. DH(M) Key Exchange: Security f = f mod h =

    h mod Picks secret Picks secret Armadillo Bunny Public values: (primitive root), (large prime) fh = h f mod hf = f h mod Eavesdropper cannot learn anything useful about fh from: , , f = f mod , h = hmod
  43. Charge Problem Set 9: will be posted Sunday, due Dec

    1 Tuesday’s class: cryptography in practice