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 10 Today: Constructions of Public-Key Encryption 1: Trapdoor Permutations (RSA) composite N/factoring 2: Quadratic Residuosity/Goldwasser-Micali composite N/factoring 3:


slide-1
SLIDE 1

MIT 6.875 & Berkeley CS276

Lecture 10 Foundations of Cryptography

slide-2
SLIDE 2

Today: Constructions of Public-Key Encryption

1: Trapdoor Permutations (RSA) 2: Quadratic Residuosity/Goldwasser-Micali 3: Diffie-Hellman/El Gamal 4: Learning with Errors/Regev

composite N/factoring composite N/factoring prime p/discrete log small numbers, large dimensions

slide-3
SLIDE 3

F

domain range Easy to compute Hard to invert Easy to invert given a trapdoor

Trapdoor One-way Functions

range

Trapdoor One-way Permutations

Domain = Range

slide-4
SLIDE 4

Review: Number Theory

Let’s review some number theory from L7-8. Let 𝑂 = π‘žπ‘Ÿ be a product of two large primes. Fact: π‘Ž!

βˆ— = {𝑏 ∈ π‘Ž!: gcd a, N = 1} is a group.

  • group operation is multiplication mod 𝑂.
  • inverses exist and are easy to compute (how so?)
  • the order of the group is Ο• 𝑂 = π‘ž βˆ’ 1 (π‘Ÿ βˆ’ 1)

Lecture 8: The map 𝐺 𝑦 = 𝑦# mod 𝑂 is a 4-to-1 trapdoor function, as hard to invert as factoring 𝑂.

slide-5
SLIDE 5

The RSA Trapdoor Permutation

Today: Let 𝑓 be an integer with gcd 𝑓, Ο•(𝑂) = 1. Then, the map 𝐺

!,% 𝑦 = 𝑦% mod 𝑂 is a trapdoor permutation.

{𝐺

!,%: gcd 𝑓, 𝑂 = 1}

Key Fact: Given 𝑒 such that 𝑓𝑒 = 1 mod Ο• 𝑂 , it is easy to compute 𝑦 given 𝑦%. Proof: (𝑦%)& = 𝑦'( ! )* = (𝑦( ! )' = 𝑦 = 𝑦 mod 𝑂

(for some integer k)

This gives us the RSA trapdoor permutation collection. Trapdoor for inversion: 𝑒 = 𝑓+*mod Ο• 𝑂 .

slide-6
SLIDE 6

The RSA Trapdoor Permutation

Today: Let 𝑓 be an integer with gcd 𝑓, Ο•(𝑂) = 1. Then, the map 𝐺

!,% 𝑦 = 𝑦% mod 𝑂 is a trapdoor permutation.

Hardness of inversion without trapdoor = RSA assumption We know that if factoring is easy, RSA is broken (and that’s the only known way to break RSA) Major Open Problem: Are factoring and RSA equivalent? given 𝑂, 𝑓 (as above) and 𝑦% mod N, hard to compute 𝑦.

slide-7
SLIDE 7

The RSA Trapdoor Permutation

Today: Let 𝑓 be an integer with gcd 𝑓, Ο•(𝑂) = 1. Then, the map 𝐺

!,% 𝑦 = 𝑦% mod 𝑂 is a trapdoor permutation.

Hardcore bits (galore) for the RSA trapdoor one-way perm:

  • The Goldreich-Levin bit GL 𝑠; 𝑠, =

𝑠, 𝑠′ mod 2

  • The least significant bit LSB 𝑠
  • The β€œmost significant bit” 𝐼𝐡𝑀𝐺

! 𝑠 = 1 iff 𝑠 < 𝑂/2

  • In fact, any single bit of 𝑠 is hardcore.
slide-8
SLIDE 8

RSA Encryption

  • π»π‘“π‘œ 1- : Let 𝑂 = π‘žπ‘Ÿ and 𝑓, 𝑒 be such that

𝑓𝑒 = 1 𝑛𝑝𝑒 𝜚(𝑂). Let π‘žπ‘™ = (𝑂, 𝑓) and let 𝑑𝑙 = 𝑒.

  • πΉπ‘œπ‘‘ π‘žπ‘™, 𝑐 where 𝑐 is a bit: Generate random 𝑠 ∈

π‘Ž!

βˆ— and output 𝑠% mod 𝑂 and LSB 𝑠 ⨁𝑛.

  • 𝐸𝑓𝑑 𝑑𝑙, 𝑑 : Recover 𝑠 via RSA inversion.

IND-secure under the RSA assumption: given 𝑂, 𝑓 (as above) and 𝑠% mod N, hard to compute 𝑠.

slide-9
SLIDE 9

Today: Constructions of Public-Key Encryption

1: Trapdoor Permutations (RSA) 2: Quadratic Residuosity/Goldwasser-Micali 3: Diffie-Hellman/El Gamal 4: Learning with Errors/Regev

slide-10
SLIDE 10

Quadratic Residuosity

Let’s review some more number theory from L7-8. Let 𝑂 = π‘žπ‘Ÿ be a product of two large primes. 𝐾𝑏𝑑+* 𝐾𝑏𝑑)* π‘Ž!

βˆ—

{𝑦: 𝑦 𝑂 = βˆ’1} {𝑦: 𝑦 𝑂 = +1}

Jacobi symbol .

! = . / . 0 is +1 if 𝑦 is a square mod

both π‘ž and π‘Ÿ or a non-square mod both π‘ž and π‘Ÿ.

slide-11
SLIDE 11

Quadratic Residuosity

Let’s review some more number theory from L7-8. Let 𝑂 = π‘žπ‘Ÿ be a product of two large primes. 𝐾𝑏𝑑+* 𝐾𝑏𝑑)* π‘Ž!

βˆ—

{𝑦: 𝑦 𝑂 = βˆ’1} {𝑦: 𝑦 𝑂 = +1}

Surprising fact: Jacobi symbol .

! = . / . 0 is

computable in poly time without knowing π‘ž and π‘Ÿ.

slide-12
SLIDE 12

Quadratic Residuosity

Let’s review some more number theory from L7-8. Let 𝑂 = π‘žπ‘Ÿ be a product of two large primes. 𝐾𝑏𝑑)* 𝑅𝑆! is the set of squares mod 𝑂 and 𝑅𝑂𝑆! is the set

  • f non-squares mod 𝑂 with Jacobi symbol +1.

𝑅𝑆! 𝑅𝑂𝑆!

So: 𝑅𝑆! = {𝑦:

" # = " $ = +1}

𝑅𝑂𝑆! = {𝑦:

" # = " $ = βˆ’1}

slide-13
SLIDE 13

Quadratic Residuosity

Let’s review some more number theory from L7-8. Let 𝑂 = π‘žπ‘Ÿ be a product of two large primes. Quadratic Residuosity Assumption (QRA) Let 𝑂 = π‘žπ‘Ÿ be a product of two large primes. No PPT algorithm can distinguish between a random element of 𝑅𝑆! from a random element of 𝑅𝑂𝑆! given only 𝑂.

slide-14
SLIDE 14

Goldwasser-Micali (GM) Encryption

π»π‘“π‘œ 1- : Generate random π‘œ-bit primes π‘ž and π‘Ÿ and let 𝑂 = π‘žπ‘Ÿ. Let 𝑧 ∈ 𝑅𝑂𝑆! be some quadratic non- residue with Jacobi symbol +1. Let π‘žπ‘™ = (𝑂, 𝑧) and let 𝑑𝑙 = (π‘ž, π‘Ÿ). πΉπ‘œπ‘‘ π‘žπ‘™, 𝑐 where 𝑐 is a bit: Generate random 𝑠 ∈ π‘Ž!

βˆ— and output 𝑠# mod 𝑂 if

𝑐 = 0 and 𝑠#𝑧 mod 𝑂 if 𝑐 = 1. 𝐸𝑓𝑑 𝑑𝑙, 𝑑 : Check if c ∈ π‘Ž!

βˆ— is a quadratic residue

using π‘ž and π‘Ÿ. If yes, output 0 else 1.

slide-15
SLIDE 15

Goldwasser-Micali (GM) Encryption

πΉπ‘œπ‘‘ π‘žπ‘™, 𝑐 where 𝑐 is a bit: Generate random 𝑠 ∈ π‘Ž!

βˆ— and output 𝑠# mod 𝑂 if

𝑐 = 0 and 𝑠#𝑧 mod 𝑂 if 𝑐 = 1. IND-security follows directly from the quadratic residuosity assumption.

slide-16
SLIDE 16

GM is a Homomorphic Encryption

πΉπ‘œπ‘‘ π‘žπ‘™, 𝑐 where 𝑐 is a bit: Generate random 𝑠 ∈ π‘Ž!

βˆ— and output 𝑠#𝑧< mod 𝑂.

Given a GM-ciphertext of 𝑐 and a GM-ciphertext of 𝑐′, I can compute a GM-ciphertext of 𝑐 + 𝑐,𝑛𝑝𝑒 2. without knowing anything about 𝒄 or 𝒄′! Claim: πΉπ‘œπ‘‘ π‘žπ‘™, 𝑐 = πΉπ‘œπ‘‘(π‘žπ‘™, 𝑐,) is an encryption of 𝑐⨁𝑐, = 𝑐 + 𝑐,𝑛𝑝𝑒 2.

slide-17
SLIDE 17

Today: Constructions of Public-Key Encryption

1: Trapdoor Permutations (RSA) 2: Quadratic Residuosity/Goldwasser-Micali 3: Diffie-Hellman/El Gamal 4: Learning with Errors/Regev

slide-18
SLIDE 18

Diffie-Hellman Key Exchange

(𝑕.)= = (𝑕=). Commutativity in the exponent: So, you can compute 𝑕.= given either 𝑕. and 𝑧, or 𝑕= and 𝑦. Hard to compute 𝑕.= given only 𝑕, 𝑕. and 𝑕= Diffie-Hellman Assumption (DHA): (where 𝑕 is an element of some group)

slide-19
SLIDE 19

Diffie-Hellman Key Exchange

Hard to compute it given only 𝑕, 𝑕. and 𝑕= Diffie-Hellman Assumption (DHA): We know that if discrete log is easy, DHA is false. Major Open Problem: Are discrete log and DHA equivalent?

slide-20
SLIDE 20

Diffie-Hellman Key Exchange

Pick a random number 𝑦 ∈ π‘Ž/+* 𝑕. mod π‘ž π‘ž, 𝑕: Generator of our group π‘Ž!

βˆ—

Pick a random number y ∈ π‘Ž/+* 𝑕= mod π‘ž Shared key K = 𝑕.= mod π‘ž = (𝑕=). mod π‘ž Shared key K = 𝑕.= mod π‘ž = (𝑕.)= mod π‘ž

slide-21
SLIDE 21

Diffie-Hellman/El Gamal Encryption

  • π»π‘“π‘œ 1- : Generate an π‘œ-bit prime π‘ž and a generator

𝑕 of π‘Ž/

βˆ—. Choose a random number 𝑦 ∈ π‘Ž/+*

Let π‘žπ‘™ = (π‘ž, 𝑕, 𝑕.) and let 𝑑𝑙 = 𝑦.

  • πΉπ‘œπ‘‘ π‘žπ‘™, 𝑛 where 𝑛 ∈ π‘Ž/

βˆ—: Generate random 𝑧 ∈

π‘Ž/+* and output (𝑕=, 𝑕.= = 𝑛)

  • 𝐸𝑓𝑑 𝑑𝑙 = 𝑦, 𝑑 : Compute 𝑕.= using 𝑕= and 𝑦 and

divide the second component to retrieve 𝑛.

Is this Secure?

slide-22
SLIDE 22

The Problem

Claim: Given p, g, 𝑕. mod π‘ž and 𝑕= mod π‘ž, adversary can Corollary: Therefore, additionally given 𝑕.= = 𝑛 mod π‘ž, the adversary can determine whether 𝑛 is a square mod π‘ž, violating β€œIND-security”. compute some information about 𝑕.= mod π‘ž. determine if 𝑕.= mod π‘ž is a square mod π‘ž.

slide-23
SLIDE 23

The Problem

Claim: Given p, g, 𝑕. mod π‘ž and 𝑕= mod π‘ž, adversary can determine if 𝑕.= mod π‘ž is a square mod π‘ž. 𝑕.= mod π‘ž is a square ⟺ 𝑦𝑧 (mod π‘ž βˆ’ 1) is even ⟺ 𝑦𝑧 is even ⟺ 𝑦 is even or 𝑧 is even ⟺ 𝑦 (𝑛𝑝𝑒 π‘ž βˆ’ 1) is even or 𝑧 (mod p βˆ’ 1) is even ⟺ 𝑕. 𝑛𝑝𝑒 π‘ž or 𝑕= 𝑛𝑝𝑒 π‘ž is a square This can be checked in poly time!

slide-24
SLIDE 24

Diffie-Hellman Encryption

Claim: Given p, g, 𝑕. mod π‘ž and 𝑕= mod π‘ž, adversary can Lesson: Best to work over a group of prime order. Such groups have no subgroups. More generally, dangerous to work with groups that have non-trivial subgroups (in our case, the subgroup of all squares mod p) An Example: Let π‘ž = 2π‘Ÿ + 1 where π‘Ÿ is a prime itself. Then, the group of squares mod π‘ž has order

/+* #

= π‘Ÿ. determine if 𝑕.= mod π‘ž is a square mod π‘ž.

slide-25
SLIDE 25

Diffie-Hellman/El Gamal Encryption

  • π»π‘“π‘œ 1- : Generate an π‘œ-bit β€œsafe” prime π‘ž = 2π‘Ÿ + 1

and a generator 𝑕 of π‘Ž/

βˆ— and let β„Ž = 𝑕#mod π‘ž be a

generator of 𝑅𝑆/ . Choose a random number 𝑦 ∈ π‘Ž0 . Let π‘žπ‘™ = (π‘ž, β„Ž, β„Ž.) and let 𝑑𝑙 = 𝑦.

  • πΉπ‘œπ‘‘ π‘žπ‘™, 𝑛 where 𝑛 ∈ 𝑅𝑆/ : Generate random 𝑧 ∈

π‘Ž0 and output (𝑕=, 𝑕.= = 𝑛)

  • 𝐸𝑓𝑑 𝑑𝑙 = 𝑦, 𝑑 : Compute 𝑕.= using 𝑕= and 𝑦 and

divide the second component to retrieve 𝑛.

slide-26
SLIDE 26

Decisional Diffie-Hellman Assumption

Hard to distinguish between 𝑕.= and a uniformly random group element, given 𝑕, 𝑕. and 𝑕= Decisional Diffie-Hellman Assumption (DDHA): That is, the following two distributions are computationally indistinguishable: (𝑕, 𝑕., 𝑕=, 𝑕.=) β‰ˆ (𝑕, 𝑕., 𝑕=, 𝑣) DH/El Gamal is IND-secure under the DDH assumption.

slide-27
SLIDE 27

Today: Constructions of Public-Key Encryption

1: Trapdoor Permutations (RSA) 2: Quadratic Residuosity/Goldwasser-Micali 3: Diffie-Hellman/El Gamal 4: Learning with Errors/Regev (post-quantum secure, as far as we know)

slide-28
SLIDE 28

Solving Linear Equations

Find π’•πŸ π’•πŸ‘

π’•πŸ π’•πŸ‘ πŸ” 𝟐 πŸ’ πŸ• πŸ‘ 𝟐 = 11 3 9

Find βƒ— 𝑑 How about:

(e1,e2,e3) are β€œsmall” numbers Easy!

π’•πŸ π’•πŸ‘ πŸ” 𝟐 πŸ’ πŸ• πŸ‘ 𝟐 + 𝑓* 𝑓# 𝑓@ = 11 3 9

Very hard! in large dimensions

Solving Noisy Linear Equations

slide-29
SLIDE 29

Learning with Errors (LWE)

Find 𝒕

(A, 𝒕A+e)

𝒇 ∈ π‘Ž!

": random β€œsmall” error vector)

Decisional LWE: LWE:

(A, b) (A, sA+𝑓)

(b uniformly random)

β‰ˆ

c

(A ∈ π‘Ž!

"#$

s ∈ π‘Ž!

" random β€œsmall” secret vector

[Regev05, following BFKL93, Ale03]

β€œDecisional LWE is as hard as LWE”.

very hard!

slide-30
SLIDE 30

Basic (Secret-key) Encryption

  • Secret key sk = Uniformly random vector s Î π‘Ž%

&

  • Encryption Encs(m): // mÎ {0,1}

– Sample uniformly random a Î π‘Ž%

&, β€œshort” noise e Î π‘Ž

– The ciphertext c = (a, b = Γ‘a, sΓ± + e + m π‘Ÿ/2 )

n = security parameter, q = β€œsmall” prime [Regev05]

  • Decryption Decsk(c): Output Roundq/2(b βˆ’ Γ‘a, sΓ± mod q)

// correctness as long as |e| < q/4

slide-31
SLIDE 31

Basic (Secret-key) Encryption

[Regev05]

This is an incredibly cool scheme. In particular, additively homomorphic.

𝒅 = (a, b = Γ‘a, sΓ± + e + m π‘Ÿ/2 ) 𝒅′ = (aβ€² , bβ€² = Γ‘aβ€², sΓ± + eβ€² + mβ€² π‘Ÿ/2 ) 𝒅 + 𝒅′ = (a+aβ€² , b+ bβ€² = Γ‘ a +aβ€², sΓ± + (e+eβ€²) + (m+mβ€²) π‘Ÿ/2 )

+ In words: 𝑑 + 𝑑′ is an encryption of m+mβ€² (mod 2)

slide-32
SLIDE 32

Public-key Encryption

[Regev05]

Here is a crazy idea. Public key has an encryption of 0 (call it 𝑑A) and an encryption of 1 (call it 𝑑*). If you want to encrypt 0, output 𝑑A and if you want to encrypt 1, output 𝑑*. Well, turns out to be a crazy bad idea. If only we could produce fresh encryptions of 0 or 1 given just the pk…

slide-33
SLIDE 33

Public-key Encryption

[Regev05]

Here is another crazy idea. Public key has many encryptions of 0 and an encryption

  • f 1 (call it 𝑑*).

This one turns out to be a crazy good idea. If you want to encrypt 0, output a random linear combination of the 0-encryptions. If you want to encrypt 1, output a random linear combination of the 0-encryptions plus 𝑑*.

slide-34
SLIDE 34

Public-key Encryption

  • Secret key sk = Uniformly random vector s Î π‘Ž%

& [Regev05]

  • Public key pk: for 𝑗 𝑔𝑠𝑝𝑛 1 𝑒𝑝 𝑙 = π‘žπ‘π‘šπ‘§(π‘œ)

π’…πŸ = (π’ƒπŸ, π’ƒπŸ, 𝒕 + 𝑓( + π‘Ÿ 2 ), 𝒅𝒋 = (𝒃𝒋, 𝒃𝒋, 𝒕 + 𝑓*) Security: decisional LWE + β€œLeftover Hash Lemma”

  • Encrypting a bit 𝑛: pick 𝑙 random bits 𝑠

+, … , 𝑠,

D

*-+ ,

𝑠*𝒅𝒋 + 𝑛 E π’…πŸ Correctness: additive homomorphism

slide-35
SLIDE 35

We saw: Constructions of Public-Key Encryption

1: Trapdoor Permutations (RSA) 2: Quadratic Residuosity/Goldwasser-Micali 3: Diffie-Hellman/El Gamal 4: Learning with Errors/Regev

slide-36
SLIDE 36

Practical Considerations

I want to encrypt to Bob. How do I know his public key? Public-key Infrastructure: a directory of identities together with their public keys. Needs to be β€œauthenticated”:

  • therwise Eve could replace Bob’s pk with her own.
slide-37
SLIDE 37

Practical Considerations

Public-key encryption is orders of magnitude slower than secret-key encryption.

  • 1. We just showed how to encrypt bit-by-bit! Super-

duper inefficient.

  • 2. Exponentiation takes 𝑃(π‘œ#) time as opposed to

typically linear time for secret key encryption (AES).

  • 3. The π‘œ itself is large for PKE (RSA: π‘œ β‰₯ 2048)

compared to SKE (AES: π‘œ = 128). Can solve problem 1 and minimize problems 2&3 using hybrid encryption.

slide-38
SLIDE 38

Hybrid Encryption

To encrypt a long message 𝑛 (think 1 GB): Pick a random key K (think 128 bits) for a secret- key encryption Encrypt K with the PKE: 𝑄𝐿𝐹. πΉπ‘œπ‘‘(π‘žπ‘™, 𝐿) Encrypt m with the SKE: SKE. πΉπ‘œπ‘‘(𝐿, 𝑛) To decrypt: recover 𝐿 using 𝑑𝑙. Then using 𝐿, recover 𝑛

slide-39
SLIDE 39

Next Lecture: Digital Signatures