MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture - - PowerPoint PPT Presentation

โ–ถ
mit 6 875 berkeley cs276
SMART_READER_LITE
LIVE PREVIEW

MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture - - PowerPoint PPT Presentation

MIT 6.875 & Berkeley CS276 Foundations of Cryptography Lecture 2 Administrivia o Piazza Time-zone Survey & Office hours o PS1 Released, due Sept 15 The Secure Communication Problem m Key k Key k Bob Alice Eve o Alice and Bob have a


slide-1
SLIDE 1

MIT 6.875 & Berkeley CS276

Lecture 2 Foundations of Cryptography

slide-2
SLIDE 2

Administrivia

  • Piazza Time-zone Survey & Office hours
  • PS1 Released, due Sept 15
slide-3
SLIDE 3

The Secure Communication Problem

Alice Key k

  • Alice and Bob have a common key k

Bob Key k Eve

  • Algorithms (Gen, Enc, Dec)
  • Correctness: Dec(k, Enc(k,m)) = m
  • Security: No Eve learns anything about m.

m

slide-4
SLIDE 4

How to Define Security

Perfect secrecy: A Posteriori = A Priori Perfect indistinguishability: The two definitions are equivalent! For all ๐‘›, ๐‘‘: Pr ๐‘ = ๐‘› ๐น ๐ฟ, ๐‘ = ๐‘‘] = Pr[๐‘ = ๐‘›] For all ๐‘›!, ๐‘›", ๐‘‘: Pr[๐น ๐ฟ, ๐‘›! = ๐‘‘] = Pr[๐น ๐ฟ, ๐‘›" = ๐‘‘]

slide-5
SLIDE 5

Is there a perfectly secure scheme?

  • One-time Pad: ๐น ๐‘™, ๐‘› = ๐‘™โจ๐‘›
  • However: Keys are as long as Messages
  • WORSE, Shannonโ€™s theorem:

for any perfectly secure scheme, |key|โ‰ฅ|message|.

Can we overcome Shannonโ€™s conundrum?

slide-6
SLIDE 6

Letโ€™s first rewriteโ€ฆ

Perfect indistinguishability: as a Turing test For all ๐‘›!, ๐‘›", ๐‘‘: Pr[๐น ๐ฟ, ๐‘›! = ๐‘‘] = Pr[๐น ๐ฟ, ๐‘›" = ๐‘‘] World 0: World 1: ๐‘‘ = ๐น ๐‘™, ๐‘›! ๐‘‘ = ๐น ๐‘™, ๐‘›" is a distinguisher. For all EVE and all ๐‘›!, ๐‘›": Pr ๐‘™ โ† K; ๐‘‘ = ๐น ๐‘™, ๐‘›! : ๐น๐‘Š๐น ๐‘‘ = 0 = Pr ๐‘™ โ† K; ๐‘‘ = ๐น ๐‘™, ๐‘›" : ๐น๐‘Š๐น ๐‘‘ = 0 k โ† K k โ† K

slide-7
SLIDE 7

Letโ€™s first rewriteโ€ฆ

Perfect indistinguishability: as a Turing test For all ๐‘›!, ๐‘›", ๐‘‘: Pr[๐น ๐ฟ, ๐‘›! = ๐‘‘] = Pr[๐น ๐ฟ, ๐‘›" = ๐‘‘] World 0: World 1: ๐‘‘ = ๐น ๐‘™, ๐‘›! ๐‘‘ = ๐น ๐‘™, ๐‘›" is a distinguisher. For all EVE and all ๐‘›!, ๐‘›": Pr ๐‘™ โ† K; ๐‘ โ† 0,1 ; ๐‘‘ = ๐น ๐‘™, ๐‘›# : ๐น๐‘Š๐น ๐‘‘ = ๐‘ = 1/2 k โ† K k โ† K

slide-8
SLIDE 8

The Axiom of Modern Crypto

Feasible Computation = Probabilistic polynomial-time*

(p.p.t. = Probabilistic polynomial-time) So, Alice and Bob are fixed p.p.t. algorithms. (e.g., run in time n^2) Eve is any p.p.t. algorithm. (e.g., run in time n^4, or n^100, or n^10000,โ€ฆ)

* in recent years, quantum polynomial-time

(polynomial in a security parameter n)

slide-9
SLIDE 9

Computational Indistinguishability

World 0: World 1: ๐‘‘ = ๐น ๐‘™, ๐‘›! ๐‘‘ = ๐น ๐‘™, ๐‘›" is a p.p.t. distinguisher. For all p.p.t. EVE and all ๐‘›!, ๐‘›": Pr ๐‘™ โ† K; ๐‘ โ† 0,1 ; ๐‘‘ = ๐น ๐‘™, ๐‘›# : ๐น๐‘Š๐น ๐‘‘ = ๐‘ = 1/2 k โ† K k โ† K Still subject to Shannonโ€™s impossibility!

(take 1)

slide-10
SLIDE 10

Still subject to Shannonโ€™s impossibility! c

Set of messages consistent with c = {D(k,c): all k} Messages n+1 bits

๐‘›! ๐‘›"

ciphertexts

Consider Eve that picks a random key k and

  • utputs 0 if D(k,c) = ๐‘›!
  • utputs 1 if D(k,c) = ๐‘›"

and a random bit if neither holds. w.p โ‰ฅ ๐Ÿ/๐Ÿ‘๐’ w.p = 0 Bottomline: Pr[EVE succeeds] โ‰ฅ 1/2 + 1/2%

slide-11
SLIDE 11

New Notion: Negligible Functions

Functions that grow slower than 1/p(n) for any polynomial p. Definition: A function ๐œˆ: โ„• โ†’ โ„ is negligible if for every polynomial function p, for all sufficiently large n: ๐‚(n) < 1/p(n) there exists an ๐‘œ! s.t. for all ๐‘œ > ๐‘œ!: Key property: Events that occur with negligible probability look to poly-time algorithms like they never occur.

slide-12
SLIDE 12

New Notion: Negligible Functions

Functions that grow slower than 1/p(n) for any polynomial p. Definition: A function ๐œˆ: โ„• โ†’ โ„ is negligible if for every polynomial function p, for all sufficiently large n: ๐‚(n) < 1/p(n) there exists an ๐‘œ! s.t. for all ๐‘œ > ๐‘œ!: Question: Let ๐‚ ๐’ = ๐Ÿ/๐’๐ฆ๐ฉ๐ก ๐’. Is ๐‚ negligible?

slide-13
SLIDE 13

New Notion: Negligible Functions

Functions that grow slower than 1/p(n) for any polynomial p. Definition: A function ๐œˆ: โ„• โ†’ โ„ is negligible if for every polynomial function p, for all sufficiently large n: ๐‚(n) < 1/p(n) there exists an ๐‘œ! s.t. for all ๐‘œ > ๐‘œ!: Question: Let ๐‚ ๐’ = ๐Ÿ/๐’๐Ÿ๐Ÿ๐Ÿ if n is prime and ๐‚ ๐’ = ๐Ÿ/๐Ÿ‘๐’ otherwise. Is ๐‚ negligible?

slide-14
SLIDE 14

Computational Indistinguishability

World 0: World 1: ๐‘‘ = ๐น ๐‘™, ๐‘›! ๐‘‘ = ๐น ๐‘™, ๐‘›" is a distinguisher. For all p.p.t. EVE, there is a negligible function ๐‚ s.t. for all ๐‘›!, ๐‘›": Pr ๐‘™ โ† K; ๐‘ โ† 0,1 ; ๐‘‘ = ๐น ๐‘™, ๐‘›# : ๐น๐‘Š๐น ๐‘‘ = ๐‘ โ‰ค 1 2 + ๐œˆ(๐‘œ) k โ† K k โ† K

slide-15
SLIDE 15

Our First Crypto Tool: Pseudorandom Generators (PRG)

slide-16
SLIDE 16

PRG Definition

A function ๐ป: {0,1}%โ†’ {0,1}%+" is a pseudorandom generator if for no p.p.t. EVE can distinguish between ๐ป(๐‘‰%) and ๐‘‰%+". ๐‘‰%= uniform distribution on n bits. ๐‘‰%+"= uniform distribution on n+1 bits.

slide-17
SLIDE 17

PRG Definition

A function ๐ป: {0,1}%โ†’ {0,1}%+" is a pseudorandom generator if for for all p.p.t. EVE, there is a negligible function ๐œˆ s.t. |Pr ๐‘ง โ† ๐‘‰%+": ๐น๐‘Š๐น ๐‘ง = 0 โˆ’ Pr[๐‘ฆ โ† ๐‘‰%; y = G x : EVE y = 0]| โ‰ค ๐œˆ(n) Question: What happens to this de_inition if EVE is unbounded?

slide-18
SLIDE 18

PRG โŸน Overcoming Shannonโ€™s Conundrum

๐ป๐‘“๐‘œ 1% : Generate a random ๐‘œ-bit key k. ๐น๐‘œ๐‘‘ ๐‘™, ๐‘› where ๐‘› is an (๐’ + ๐Ÿ)-bit message: Expand k into a (n+1)-bit pseudorandom string k, = ๐ป(k) One-time pad with k,: ciphertext is ๐‘™โ€ฒโจ๐‘› ๐ธ๐‘“๐‘‘ ๐‘™, ๐‘‘ outputs G(๐‘™)โจ๐‘‘ (or, How to Encrypt n+1 bits using an n-bit key) ๐ƒ๐ฉ๐ฌ๐ฌ๐Ÿ๐๐ฎ๐จ๐Ÿ๐ญ๐ญ: ๐ธ๐‘“๐‘‘ ๐‘™, ๐‘‘ outputs G ๐‘™ โจ๐‘‘ = G ๐‘™ โจ๐ป ๐‘™ โจm = m

slide-19
SLIDE 19

PRG โŸน Overcoming Shannonโ€™s Conundrum

Suppose for contradiction that there is a p.p.t. EVE, a polynomial function ๐‘ž and ๐‘›!, ๐‘›" ๐‘ก. ๐‘ข. Pr ๐‘™ โ† K; ๐‘ โ† 0,1 ; ๐‘‘ = ๐น ๐‘™, ๐‘›# : ๐น๐‘Š๐น ๐‘‘ = ๐‘ โ‰ฅ 1 2 + 1/๐‘ž(๐‘œ)

Security: by contradiction.

slide-20
SLIDE 20

PRG โŸน Overcoming Shannonโ€™s Conundrum

Suppose for contradiction that there is a p.p.t. EVE, a polynomial function ๐‘ž and ๐‘›!, ๐‘›" ๐‘ก. ๐‘ข. ฯ = Pr ๐‘™ โ† {0,1}% ; ๐‘ โ† 0,1 ; ๐‘‘ = ๐ป(๐‘™)โจ๐‘›#: ๐น๐‘Š๐น ๐‘‘ = ๐‘ โ‰ฅ 1 2 + 1/๐‘ž(๐‘œ)

Security: by contradiction.

Let ฯ, = Pr ๐‘™โ€ฒ โ† 0,1 %+" ; ๐‘ โ† 0,1 ; ๐‘‘ = ๐‘™โ€ฒโจ๐‘›#: ๐น๐‘Š๐น ๐‘‘ = ๐‘ = "

  • This will give us a distinguisher EVEโ€™ for G, contradicting the

assumption that G is a pseudorandom generator. QED.

slide-21
SLIDE 21

PRG โŸน Overcoming Shannonโ€™s Conundrum

Get as input a string y, run EVE(yโจ๐‘›#) for a random b, and let EVEโ€™s

  • utput be bโ€™. Output โ€œPRGโ€ if b=bโ€™ and โ€œRANDOMโ€ otherwise.

Distinguisher EVEโ€™ for G.

Pr ๐น๐‘Š๐น,๐‘๐‘ฃ๐‘ข๐‘ž๐‘ฃ๐‘ข๐‘ก โ€œ๐‘„๐‘†๐ปโ€ ๐‘ง ๐‘—๐‘ก ๐‘ž๐‘ก๐‘“๐‘ฃ๐‘’๐‘๐‘ ๐‘๐‘œ๐‘’๐‘๐‘›] = ฯ โ‰ฅ "

  • + 1/๐‘ž(๐‘œ)

Pr ๐น๐‘Š๐น,๐‘๐‘ฃ๐‘ข๐‘ž๐‘ฃ๐‘ข๐‘ก โ€œ๐‘„๐‘†๐ปโ€ ๐‘ง ๐‘—๐‘ก ๐‘ ๐‘๐‘œ๐‘’๐‘๐‘›] = ฯ, = 1 2 Therefore, Pr ๐น๐‘Š๐น,๐‘๐‘ฃ๐‘ข๐‘ž๐‘ฃ๐‘ข๐‘ก โ€œ๐‘„๐‘†๐ปโ€ ๐‘ง ๐‘—๐‘ก ๐‘ž๐‘ก๐‘“๐‘ฃ๐‘’๐‘๐‘ ๐‘๐‘œ๐‘’๐‘๐‘›] โˆ’ Pr ๐น๐‘Š๐น,๐‘๐‘ฃ๐‘ข๐‘ž๐‘ฃ๐‘ข๐‘ก โ€œ๐‘„๐‘†๐ปโ€ ๐‘ง ๐‘—๐‘ก ๐‘ ๐‘๐‘œ๐‘’๐‘๐‘›] โ‰ฅ 1/๐‘ž(๐‘œ)

slide-22
SLIDE 22

PRG โŸน Overcoming Shannonโ€™s Conundrum

๐‘น๐Ÿ:

Do PRGs exist? (or, How to Encrypt n+1 bits using an n-bit key)

๐‘น๐Ÿ‘:

(Exercise: If P=NP, PRGs do not exist.) How do we encrypt ๐‘œ"!! message bits with ๐‘œ key bits? (Length extension: If there is a PRG that stretches by one bit, there is one that stretches by polynomially many bits)

slide-23
SLIDE 23

Constructing PRGs: Two Methodologies

The Practical Methodology

  • 1. Start from a design framework

(e.g. โ€œappropriately chosen functions composed appropriately many times look randomโ€)

slide-24
SLIDE 24

Constructing PRGs: Two Methodologies

The Practical Methodology

  • 1. Start from a design framework

(e.g. โ€œappropriately chosen functions composed appropriately many times look randomโ€)

  • 2. Come up with a candidate construction

MA MATH TH Rijndael (now the Advanced Encryption Standard)

slide-25
SLIDE 25

Constructing PRGs: Two Methodologies

The Practical Methodology

  • 1. Start from a design framework

(e.g. โ€œappropriately chosen functions composed appropriately many times look randomโ€)

  • 2. Come up with a candidate construction
  • 3. Do extensive cryptanalysis.
slide-26
SLIDE 26

Constructing PRGs: Two Methodologies

The Foundational Methodology (much of this course) Reduce to simpler primitives. OWF well-studied, average-case hard, problems โ€œScience wins either wayโ€ โ€“Silvio Micali PRG PRF

Hashing Digital Signatures

slide-27
SLIDE 27

Constructing PRGs: Two Methodologies

The Foundational Methodology (much of this course) A PRG Candidate from the hardness of Subset-sum: G(๐‘", โ€ฆ , ๐‘%, ๐‘ฆ", โ€ฆ , ๐‘ฆ%) = (๐‘", โ€ฆ , ๐‘%,โˆ‘./"

%

๐‘ฆ.๐‘. mod 2%+") where ๐‘. are random (n+1)-bit numbers, and ๐‘ฆ. are random bits. Beautiful Function: If G is a one-way function, then G is a PRG (Pset 1). If lattice problems are hard on the worst-case, G is a PRG (6.876 Fall18 / CS294-168 Spring20)

slide-28
SLIDE 28

PRG โŸน Overcoming Shannonโ€™s Conundrum

๐‘น๐Ÿ:

Do PRGs exist? (or, How to Encrypt n+1 bits using an n-bit key)

๐‘น๐Ÿ‘:

(Exercise: If P=NP, PRGs do not exist.) How do we encrypt ๐‘œ"!! message bits with ๐‘œ key bits? (Length extension: If there is a PRG that stretches by one bit, there is one that stretches by polynomially many bits)

slide-29
SLIDE 29

Length extension: One bit to Many bits

Let G: {0,1}% โ†’ {0,1}%+" be a pseudorandom generator. Goal: use G to generate many pseudorandom bits.

slide-30
SLIDE 30

Let G: {0,1}% โ†’ {0,1}%+" be a pseudorandom generator. Goal: use G to generate poly many pseudorandom bits.

Length extension: One bit to Many bits

slide-31
SLIDE 31

Let G: {0,1}% โ†’ {0,1}%+" be a pseudorandom generator. G ๐‘ฆ! ๐‘ฆ" = ๐ป(๐‘ฆ!) Construction of Gโ€™(๐‘ฆ!) Goal: use G to generate poly many pseudorandom bits.

Length extension: One bit to Many bits

slide-32
SLIDE 32

Let G: {0,1}% โ†’ {0,1}%+" be a pseudorandom generator. G ๐‘ฆ! ๐‘ฆ" Construction of Gโ€™(๐‘ฆ!) Goal: use G to generate poly many pseudorandom bits.

Length extension: One bit to Many bits

๐‘"๐‘ง"

slide-33
SLIDE 33

Let G: {0,1}% โ†’ {0,1}%+" be a pseudorandom generator. G ๐‘ฆ! ๐‘" Construction of Gโ€™(๐‘ฆ!) Goal: use G to generate poly many pseudorandom bits.

Length extension: One bit to Many bits

๐‘ง" G ๐‘ง- ๐‘- G ๐‘ง01" ๐‘01" โ€ฆ Output ๐‘" ๐‘- ๐‘2 ๐‘3 ๐‘4 โ€ฆ ๐‘ง0. Also called a stream cipher by the applied people. G ๐‘0 ๐‘ง0

slide-34
SLIDE 34

Are we all set with encryption?

To encrypt the i-th bit, use the i-th pseudorandom bit.

  • 1. Runtime (an efficiency issue)
  • 2. Need to remember state (a security issue)

In a couple of weeks, Shafi will solve both problems in one shot. Two problems:

slide-35
SLIDE 35

Next Lecture:

Define one-way functions (OWF), Hardcore bits (HCB), Goldreich-Levin Theorem: every OWF has a HCB. Show that OWF โ‡’ PRG (how to construct a PRG from any OWF*)