practical somewhat homomorphic encryption · 2014-02-06 · practical. homomorphic encryption...

28
Somewhat Homomorphic Encryption David Wu (joint work with Dan Boneh) Practical

Upload: others

Post on 06-Jul-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Somewhat Homomorphic

Encryption

David Wu

(joint work with Dan Boneh)

Practical

Page 2: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Homomorphic Encryption

Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Comprises of three functions:

Enc

mc

pk

c

Decm

sk

Must satisfy usual notion of semantic security

Page 3: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Homomorphic Encryption

Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Comprises of three functions:

Dec�� Eva�� ��, ��, �� = � ��,��

�� = Enc��(��)

Eval���

�� = Enc��(��)

��

Page 4: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Fully Homomorphic Encryption (FHE)

Many homomorphic encryption schemes:• ElGamal: � ��,�� = ����

• Paillier: � ��,�� = �� +��

• Goldwasser-Micali: � ��,�� = �� ⊕��

Fully homomorphic encryption: homomorphic with respect to two operations: addition and multiplication

• Can evaluate Boolean and arithmetic circuits

• [BGN05]: one multiplication, many additions

• [Gen09]: first FHE construction from lattices

Page 5: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Fully Homomorphic Encryption

�� = Enc��(��)

Eval ��

�� = Enc��(��)

��

�(�)

� � : circuit for some function �

Correctness: Dec�� Eva�� ��, ��, �� = � ��,��

Circuit Privacy: Enc�� � ��,�� ≈ Eval�(��, ��, ��)

Compactness: Decryption circuit has size at most poly(�)

Page 6: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

In Theory: Secure Computation using FHE

Google

Enc(pk,"cat")

Enc(pk, Search("cat"))

Represent “Search” function as a circuit and evaluate homomorphically

Page 7: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

In Practice: Secure Computation using FHE

Google

Enc(pk,"cat")

Request timed out

FHE schemes have tremendous overhead

Page 8: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Somewhat Homomorphic Encryption (SWHE)

FHE supports arbitrary number of operations

Compromise: Support a limited number of operations (e.g., evaluate circuits of a certain depth)

• Somewhat/leveled homomorphic encryption

Page 9: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Brakerski’s SWHE [Bra12]

Operates over a polynomial ring: � = ℤ � /Φ�(�)

Plaintext and ciphertext are vectors of ring elements

Homomorphic multiplication much more expensive than homomorphic addition

• Can evaluate low degree polynomials over encrypted data

Page 10: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Application: Statistical Analysis

Cloud

Medical researcher

investigating a

disease outbreak

Local hospitals submit encrypted

patient data

Cloud aggregates and summarizes

patient data

Local hospitals

Model

Page 11: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Security Model

Cloud

Cloud does not learn patient data

or model

Researcher does not learn individual patient data other than what is

explicitly leaked by model

(Semantic Security)

(Circuit Privacy)

Page 12: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Application: Statistical Analysis

Given � vectors ��, … , �� (e.g., patient profiles), define � to be the matrix with rows ��, … , ��

• Mean: � =�

�∑ ������

• Covariance: Σ� =�

������ − �� �� �

Division difficult to support, so represent as rationals

Depth 0 circuit for mean, depth 1 for covariance

Page 13: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Application: Statistical Analysis

Can also perform linear regression on encrypted data

Given design matrix � and response vector �, evaluate normal equations:

� = ��� �����

Invert over ℚ using Cramer’s rule

Depth � for � dimensional data

Page 14: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Computation [SV11]

Encrypt + process array of values at no extra cost

Main intuition: Chinese Remainder Theorem

Plaintext Space: �� = ℤ� � /Φ�(�)

���� ⋯ ��

Choose � such that �� splits into smaller rings: �� ≅⊗���� ��

Page 15: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Computation

Encrypt + process array of values at no extra cost:

1 2 3 4

7 5 3 1

+

8 7 6 5

In practice: ≥ 5000 slots

Page 16: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Computation

Can also permute slots (via Frobenius automorphisms) [BGV12,

GHS12]

1 2 3 4

2 3 4 1

Page 17: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Inner Products

Statistical analysis reduces to computing inner products:

1

2

3

4

1

0

0

1

= 1 ⋅ 1 + 2 ⋅ 0 + 3 ⋅ 0 + 4 ⋅ 1 = 5

Naïve method: Encrypt each component separately.

Requires 4 multiplications!

Page 18: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Inner Products

1

2

3

4

×

1

0

0

1

1

0

0

4

Batch inner product:

encrypt multiple

components in each

ciphertext.

Requires 1 multiplication!

Not quite what

we wanted!

Page 19: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Inner Products

1

0

0

4

Result of batch multiplication:

Desired result: 5

Page 20: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Inner Products

1

0

0

4

Use automorphisms to sum up components:

0

0

4

1

��

1

0

0

4

0

0

4

1

+

1

0

4

5

� +

� + �

Page 21: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Inner Products

Use automorphisms to sum up components:

1

0

4

5

� +

� + �

4

5

1

0

1

0

4

5

4

5

1

0

+

5

5

5

5

��

Page 22: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Batch Inner Products

� multiplications

1 multiplication

log�

automorphisms

log� additionsBatches of size �

Page 23: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

20

30

40

50

60

70

2000 20000 200000 2000000

Tim

e (

min

ute

s)

Number of Datapoints

Time to Compute Mean and Covariance over

Encrypted Data (Dimension 4)

Automorphisms

dominate Multiplications

dominate

Page 24: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

0

100

200

300

400

500

600

700

800

900

1000

0 5 10 15 20 25

Tim

e (

min

ute

s)

Data Dimension

Time to Compute Mean and Covariance over Encrypted

Data (4096 Data Points)

Runtime grows

as � ��

Page 25: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

0

10

20

30

40

50

60

70

80

1000 10000 100000 1000000

Tim

e (

min

ute

s)

Number of Datapoints

Time to Perform Linear Regression on Encrypted Data

(2 Dimensions)

Automorphisms

dominate

Multiplications

dominate

Page 26: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

0

100

200

300

400

500

600

700

1 2 3 4 5

Tim

e (

min

ute

s)

Dimension of Data

Time to Perform Linear Regression on Encrypted Data

(260,000 Data Points)

Runtime grows

as � �!

Page 27: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Conclusions

SWHE allows computation of circuits of low-depth

Batching enables scaling to nontrivial datasets

Can perform statistical analysis on encrypted data with “reasonable” overhead

Page 28: Practical Somewhat Homomorphic Encryption · 2014-02-06 · Practical. Homomorphic Encryption Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Open Source FHE Implementation:

https://github.com/dwu4/fhe-si