• No results found

CRYPTOGRAPHIC PROTOCOLS 2014, LECTURE 4

N/A
N/A
Protected

Academic year: 2022

Share "CRYPTOGRAPHIC PROTOCOLS 2014, LECTURE 4"

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)

CRYPTOGRAPHIC PROTOCOLS 2014, LECTURE 4

Elgamal. IND-CPA Security. Malleability

Helger Lipmaa

University of Tartu, Estonia

(2)

UP TO NOW

Assumptions, reductions

Basic assumptions in DL family:

DL, CDH, DDH

(DH)KE. Security of KE <=> assumptions

Owners of public keys can agree on joint secret key

(3)

REMINDER: KEY EXCHANGE

I want to send secret information to

Bob, but he is in Jamaica

Let us agree on a joint secret

key for further communication

(4)

SECURE COMPUTATION

I want to

know whether I have more hash than

Bob but I do not want to reveal how

much I have

Let us do secure

computation of

"≥"

Ditto

Millionaires' protocol

(5)

SECURE COMPUTATION

(pk, Encode (pk; a))

c = Encode (pk; f (a, b))

sk,pk,a

2 Compute f(a,b) on

"encoded"

inputs 1 Encode a

by using pk

3 Decode by using sk, obtain

f (a, b)

Million dollar

question: how

(6)

QUIZ: SECURITY OBJECTIVE

(pk, Encode (pk; a))

c = Encode (pk; f (a, b))

sk,pk,a

2 Compute f(a,b) on

"encoded"

inputs 1 Encode a

by using pk

3 Decode by using sk, obtaine f (a, b)

?

(7)

QUIZ: SECURITY OBJECTIVE

(pk, Encode (pk; a))

c = Encode (pk; f (a, b))

sk,pk,a

2 Compute f(a,b) on

"encoded"

inputs 3 Decode by

using sk, obtain f (a, b)

?

Answer: Alice and Bob should not trust each other. Here Alice may want to learn Bob's input, and Bob

may want to learn Alice's input.

Will formalize the next lecture 1 Encode a

by using pk

(8)

THIS LECTURE: MODULARIZATION

Assumption Primitive Protocol

DDH, ... Encrypt,

garble, ...

Millionaires', ...

We have a We find an goal

existing encoding that looks suitable Make the

necessary assumption

Top-down approach: good when

you already know the field, and there are enough primitives/assumptions

available

(9)

THIS LECTURE: MODULARIZATION

Assumption Primitive Protocol

DDH, ... Encrypt,

garble, ...

Millionaires', ...

We know assumption

We build some

encoding on top of it

We build the final protocol

on top of it

Bottom-up approach: good for

teaching, research (easier to start with basics)

and getting papers published

(10)

THIS LECTURE: MODULARIZATION

Assumption Primitive

DDH Encrypt

We know assumption

We build some

encoding on top of it

Bottom-up approach: good for

teaching, research (easier to start with basics) and getting papers published

Elgamal

(homomorphic encryption)

(11)

REMINDER: KEY EXCHANGE

h

f

s, h = gˢ t, f←gᵗ

sk=SK(s,f) = sk=SK(t,h)

sk

(12)

REMINDER: ONE-TIME PAD

c ← m ⊕ sk

sk, m sk

m←c⊕sk

(m⊕sk)⊕sk=m⊕(sk⊕sk)=m

(13)

HOW TO COMBINE

We have key-exchange Returns secret key sk1 ... and one-time pad

Returns ciphertext, given sk2

However, they work in different domains

sk1 is a group element, sk2 is a bit-string

(14)

ONE-TIME PAD IN A GROUP

c ← m · sk

sk, m∈G sk

m←c / sk m?

?

m*

(15)

SECURITY INTUITION

If sk is uniformly distributed in G, then m · sk is also uniformly distributed

For all m ∈ G*, c ∈ G:

Pr [m · sk = c] = Pr [sk = c / m] = 1 / q

Thus, an adversary who only sees c, has no

information about m

(16)

ELGAMAL ENCRYPTION

r, gʳ, m

public key h

s, h=gˢ

sk←SK(r,h)

sk←SK(s,gʳ) m ← c1 / sk

One-time keys

Long-time keys h

(c1, c2) ← (m · sk, gʳ )

(17)

ELGAMAL ENCRYPTION

r,h←gˆr

(c1, c2) ← (m · sk, h)

sk,pk

sk←SK(r,pk)

One-time keys

Long-time keys hb

Elgamal.Setup (κ):

1. Choose a group G of order q where breaking DDH has complexity 2^κ 2. Choose a generator g of G

3. Return gk ← desc (G) = (..., q, g)

Elgamal.Keygen (gk):

1. s ← ℤq

2. pk = h ← gˢ

3. Return (s, h) /* secret key, public key */

Elgamal.Enc (gk, h; m, r):

1. /* Assumes r ← R: randomized alg. */

2. (c1,c2)←(mhʳ, gʳ) 3. Return (c1,c2)

Elgamal.Dec (gk, s; c1, c2):

1. m ← c1 / c2ˢ 2. Return m

For the sake of simplicity, we assume that gk is a fixed system parameter, shared by all participants.

Will not mention gk unless explicitly needed

(18)

CORRECTNESS: FORMALLY

Key generation: h = gˢ

Encryption: (c1, c2) = Enc (h; m, r) = (mhʳ, gʳ) Decryption: c1 / c2ˢ = m gʳˢ / gʳˢ = m

Thus decryption is always successful

(19)

SECURITY: INTUITION

Elgamal = DHKE + one-time pad

DHKE is whatke-secure under X assumption one-time pad is unconditionally secure

=> Elgamal is whatenc-secure under X assumption

But how to formalize?

(20)

QUIZ: SECURITY

r,h←gʳ,m

pk

s,h=gˢ

m ← c1 / c2ˢ

h

?

(c1, c2) ← (mhʳ, gʳ )

(21)

ENCRYPTION SECURITY: ISSUES

Message recovery security:

Eve should not be able to compute m

Just difficulty of computing m is not good enough Like KR security was not enough in KE

Need indistinguishability again

(22)

QUIZ: SECURITY

r,h←gʳ,m

pk

s,h=gˢ

m ← c1 / c2ˢ

h

m*=m or garbage

?

(c1, c2) ← (mhʳ, gʳ )

m*

(23)

REAL-RANDOM / LEFT-RIGHT

Real-Random indistinguishability:

Adversary cannot distinguish the real plaintext m from a random plaintext

Even if she has chosen m herself Left-Right indistinguishability:

Adversary cannot distinguish a random ciphertext of m0 from a random ciphertext of m1

Even if she has chosen both m0 and m1 herself

Encrypt "I owe Eve 100$"or else

He encrypted

"start a battle"or "do not start a battle". Which

one?

(24)

QUIZ: WHICH NOTION IS STRONGER

Left Right

Random

Answer: equal

1 (RR =>LR) If can distinguish left from right, then one of them must

be distinguishable from random 2 (LR => RR) Assume we can distinguish real from random. This

means the ciphertext distribution of every fixed plaintext must be

different from the ciphertext distribution of a random plaintext.

Thus there must exist two plaintexts that have different

ciphertext distributions

Notions are equal, but RR => LR argumentation is easier.

Standard approach: assume RR security

(25)

QUIZ: IND-CPA SECURITY

r,h←gʳ e←{0,1}

pk

s,h=gˢ

mₑ ← c1 / c2ˢ

h

e* = e

?

(c1, c2) ← (mₑhʳ, gʳ ) e*

(m0 ,m1 )

Chosen-Plaintext Attack

(26)

IND-CPA SECURITY

Π = (Setup, Keygen, Enc, Dec)

Adv[IND] := | Pr[IND = 1] - 1 / 2 |

A ε -breaks IND-CPA security of Π iff Adv[IND] ≥ ε

Π is (τ,ε)-IND-CPA secure iff no PPT adversary ε -breaks IND-CPA security of Π in time ≤ τ

Π is IND-CPA secure iff it is

(poly(κ),negl(κ))-IND-CPA secure

Game IND(κ,Π,A)

gk ← Setup (κ)

(s, h) ← Keygen (κ) (m0, m1) ← A (h) e ← {0, 1}

r ← R

c ← Enc (h; mₑ, r) e* ← A (h, c)

Return e = e* ? 1 : 0

(27)

ELGAMAL IS IND-CPA SECURE

Theorem. If G is a (≈τ, ≈ε)-DDH group, then Elgamal is (τ,ε)-IND-CPA secure in G.

Proof idea. Reduction to absurd: we show that if Elgamal is not secure in G, then DDH must be easy in G.

Elgamal is not secure => there exists an adversary D that breaks Elgamal We show DDH is easy by constructing an adversary C that breaks DDH C can use help from adversary D , by sending inputs to D and receiving outputs

Simple, a home exercise

(28)

... TAUTOLOGY

Theorem. If Elgamal is (τ + small,ε)-IND-CPA

secure, then G is (τ,ε)-DDH group. (Thus, equivalent)

Proof idea. Reduction to absurd: we show that if DDH is not secure in G, then breaking Elgamal must be easy in G.

DDH is not secure => there exists an adversary D that breaks DDH

We show Elgamal is easy by constructing an adversary C that breaks Elgamal C can use help from adversary D , by sending inputs to D and receiving

outputs

(29)

REDUCTION: DDH <= ELGAMAL

(m0, m1) ← (1,random)

s← ℤq; h ← gˢ

/* some comp */

return e*

if e* = e return 1 else

return 0

(desc(G),h)

(desc(G),g,h,c2,c1)

e*

e*

Challenger C D

Correct distribution for DDH (?)

(m₀,m₁) e ← {0, 1}; r← ℤq;

(c1,c2) ← (mₑhʳ, gʳ )

/* just forward */

(c1,c2)

Need to construct

(30)

REDUCTION: DDH <= ELGAMAL

(m0, m1) ← (1,random)

s← ℤq; h ← gˢ

/* some comp */

return e*

if e* = e return 1 else

return 0

(desc(G),h)

(desc(G),g,h,c2,c1)

e*

e*

Challenger C D

Correct distribution for DDH (?)

(m₀,m₁) e ← {0, 1}; r← ℤq;

(c1,c2) ← (mₑhʳ, gʳ )

/* just forward */

(c1,c2)

Need to construct

Assume D works in time τ and is successful with prob. ε + 1 / 2

If D is successful then C is successful and takes time τ* =τ + small

If D is unsuccessful then C is

successful with prob. 0, and takes time τ*

Pr[C successful] = ε + 1 / 2

Thus, if Elgamal is (τ*, ε)-IND-CPA secure, then G is a (τ, ε)-DDH group

(31)

IND-CPA AND BEYOND

Actual security requirements even more stringent IND-CPA security only demonstrates basic

concepts

Bob must be sure c really came from Alice Authentication, non-malleability

In protocol design, malleability is very useful

(32)

MALLEABILITY

m f(m)

Modifying ciphertexts, without knowing the secret key, so that the plaintext

changes predictably

Essential for secure computation

(33)

MALLEABILITY OF ELGAMAL

Recall: Enc (h; m, r) = (c1, c2) = (mhʳ,gʳ)

Enc (h; m, r) · Enc (h; n, t) = Enc (h; m · n, r + t) (mhʳ, gʳ) (nhᵗ, gᵗ)= (mnhʳ ⁺ᵗ, gʳ ⁺ᵗ)

Componentwise multilication

(34)

HOMOMORPHIC ENCRYPTION

( M,M) M

( C,C) C

·

·

(Enc, Enc)

Enc

efficient

efficient

efficient

efficient

Similar to isomorphism, except randomized

(35)

SOME COROLLARIES

Recall: Enc (m, r) · Enc (n, t) = Enc (m · n, r + t) We omit h for brevity

1. Πᵢ Enc (mᵢ; rᵢ) = Enc (Πᵢ mᵢ; Σᵢ rᵢ)

2. Enc (m, r)ˢ = Enc (mˢ, sr) for public s ∈ ℤq

3. Πᵢ Enc (xⁱ; rᵢ)^fᵢ = Πᵢ Enc (fᵢxⁱ; fᵢrᵢ) = Enc (Πᵢ fᵢxⁱ; Σᵢ fᵢrᵢ) evaluating public "polynomial" at secret point

Polynomials have a sum

(36)

QUIZ: ENCRYPTING INTEGERS

Elgamal makes it possible to encrypt group elements Question: how to encrypt (short) integers?

Answer:

Lifted Elgamal: use exponentiation (isomorphism) Enc' (m, r) = Enc (gᵐ, r)

Dec' (c1, c2) = dlog

g

(Dec (c1, c2))

(37)

SOME COROLLARIES

1. Πᵢ Enc' (mᵢ; rᵢ) = Enc' (Σᵢ mᵢ; Σᵢ rᵢ)

2. Enc' (m, r)ˢ = Enc' (sm, sr) for public s ∈ ℤq

3. Πᵢ Enc' (xⁱ; rᵢ)^fᵢ = Πᵢ Enc' (fᵢxⁱ; fᵢrᵢ) = Enc' (Σᵢ fᵢxⁱ; Σᵢ fᵢrᵢ)

evaluation of public polynomial at secret point

4. Πᵢ Enc' (xᵢ; rᵢ)^yᵢ Enc'(z; t) = Enc' (Σᵢ xᵢ yᵢ + z; Σᵢ yᵢrᵢ + t) -

arbitrary affine functions with public yᵢ, z

(38)

LIFTED ELGAMAL: MORE

Enc, Dec --- efficient

Enc' efficient, Dec' inefficient

Dec' can be computed in time Θ (√ L) when input is from {0, ..., L - 1}

Lifted Elgamal useful when L is small: L ≤ 2^40?

G₁

G Enc G2

Dec

efficient

efficient

ℤq dlog

exp

inefficient

efficient

(39)

SUMMARY

One can "compute" on Elgamal ciphertexts Plaintexts are group elements

More useful: lifted Elgamal

However, only efficient for small plaintexts Secret computation of arbitrary affine functions in ℤq that have small outputs

limited malleability

(40)

WHAT NEXT?

Examples of concrete protocols

non-trivial stuff can be done within given limitations

Formalization and proof of their security

(41)

STUDY OUTCOMES

Secure computation: idea Modularization

Elgamal

IND-CPA security

Malleability, homomorphic encryption

Lifted Elgamal, its limitations

References

Related documents

In this our study we were able to establish a linear relationship between birth weight and placental weight and also derived regression equations to estimate either

So in this study it is concluded that large number of females with breast pathologies present with benign lesions like fibro-adenoma at the age of 20-39 years.. It

If the oblivious transfer protocol ot is computationally private in the shared setup model and the list commitment scheme lc is binding and equivocal, then Prot.. For the proof, we

This project focuses on the impact of experimental parameters; laser energy and gate delay on the SA coefficient of emission lines which depends on two plasma parameter

It was therefore decided to make the device wearable as a wristband with embedded miniature electronic circuits so as to achieve continuous monitoring of the

Here we have discussed some mostly used feature extraction techniques like Mel frequency Cepstral Co-efficient (MFCC), Linear Predictive Coding (LPC) Analysis,

In normal fetus, blood enters the fetus through the umbilical vein and exits through the umbilical artery, while in acardiac twin, blood enters via the umbilical

lots of complexes of different metal salts with different ligands have been synthesized and.. evaluated their anti diabetic