• No results found

Computing on Encrypted Data

N/A
N/A
Protected

Academic year: 2021

Share "Computing on Encrypted Data"

Copied!
40
0
0

Loading.... (view fulltext now)

Full text

(1)

Computing on Encrypted Data

Secure Internet of Things Seminar

David Wu January, 2015

(2)

New Applications in the Internet of Things

Smart Homes

report energy consumption aggregation +

analytics

usage statistics and reports

(3)

The Power of the Cloud

BIG DATA

analytics

recommendations personalization

lots of user information = big

incentives

Question: provide service, preserve

privacy

(4)

Secure Multiparty Computation (MPC)

Multiple parties want to compute a joint function on private inputs

private input: individual power consumption at end of computation,

each party learns the average power

consumption privacy guarantee: no party

learns anything extra about other parties’ inputs

(5)

Two Party Computation (2PC)

• Simpler scenario: two-party computation (2PC)

• 2PC: Mostly “solved” problem: Yao’s circuits [Yao82]

• Express function as a Boolean circuit

garbled version of circuit

oblivious transfer to obtain garbled inputs output of garbled circuit

Party A Party B

(6)

Two-Party Computation (2PC)

• Yao’s circuits very efficient and heavily optimized [KSS09]

• Evaluating circuits with 1.29 billion gates in 18 minutes (1.2 gates / µs) [ALSZ13]

• Yao’s circuit provides semi-honest security: malicious security via cut-and-choose, but not as efficient

(7)

Going Beyond 2PC

• General MPC also “solved” [GMW87]

secret share inputs with all parties

jointly evaluate circuit, gate-by- gate

(8)

Secure Multiparty Computation

• General MPC suffices to evaluate arbitrary functions

amongst many parties: should be viewed as a feasibility result

• Limitations of general MPC

• many rounds of communication / interaction

• possibly large bandwidth

• hard to coordinate interactions with large number of parties

• Other considerations (not discussed): fairness, guaranteeing output delivery

(9)

This Talk: Homomorphic Encryption

Interaction

GMW Protocol and General MPC

Homomorphic Encryption Custom Protocols

Many rounds of interaction Boolean circuits (typically)

Few rounds of interaction Arithmetic circuits

General methods for secure computation

(10)

Homomorphic Encryption

Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Comprises of three functions:

Enc

m c

pk

c

Dec m

sk

Must satisfy usual notion of semantic security

(11)

Homomorphic Encryption

Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Comprises of three functions:

Dec𝑠𝑘 Eva𝑙𝑓 𝑒𝑘, 𝑐1, 𝑐2 = 𝑓 𝑚1, 𝑚2

𝑐1 = Enc𝑝𝑘(𝑚1)

Eval𝑓 𝑐3

𝑐2 = Enc𝑝𝑘(𝑚2) 𝑒𝑘

(12)

Fully Homomorphic Encryption (FHE)

Many homomorphic encryption schemes:

• ElGamal: 𝑓 𝑚0, 𝑚1 = 𝑚0𝑚1

• Paillier: 𝑓 𝑚0, 𝑚1 = 𝑚0 + 𝑚1

Fully homomorphic encryption: homomorphic with

respect to two operations: addition and multiplication

• [BGN05]: one multiplication, many additions

• [Gen09]: first FHE construction from lattices

(13)

Privately Outsourcing Computation

encrypted data encrypted results of

computation

Leveraging

computational power of the cloud

(14)

Machine Learning in the Cloud

report energy consumption aggregation +

analytics

1. Publish public key

2. Upload encrypted values

3. Compute model homomorphically 4. Decrypt to obtain model

(15)

Machine Learning in the Cloud

• Passive adversary sitting in the cloud does not see client data

• Power company only obtains resulting model, not individual data points (assuming no

collusion)

• Parties only need to

communicate with cloud (the power of public-key

encryption)

(16)

Big Data, Limited Computation

• Homomorphic encryption is expensive, especially compared to symmetric primitives such as AES

• Can be unsuitable for encrypting large volumes of data

(17)

“Hybrid” Homomorphic Encryption

Enc𝑝𝑘 𝑘 , AES𝑘 𝑚

Homomorphically evaluate the AES decryption circuit

AES𝑘 𝑚 Enc𝑝𝑘 AES𝑘 𝑚

Enc𝑝𝑘 𝑘 Enc𝑝𝑘 𝑚

encrypt

evaluate AES decryption

Enc𝑝𝑘 𝑓 𝑚

homomorphic evaluation

Encrypt AES key using homomorphic encryption (expensive), encrypt data using

AES (cheap)

Current performance: ≈ 400 seconds to decrypt 120 AES-128 blocks (4 s/block)

[GHS15]

(18)

Constructing FHE

• FHE: can homomorphically compute arbitrary number of operations

• Difficult to construct – start with something simpler:

somewhat homomorphic encryption scheme (SWHE)

• SWHE: can homomorphically evaluate a few operations (circuits of low depth)

(19)

Gentry’s Blueprint: SWHE to FHE

• Gentry described general bootstrapping method of achieving FHE from SWHE [Gen’09]

• Starting point: SWHE scheme that can evaluate its own decryption circuit

(20)

Gentry’s Blueprint: From SWHE to FHE

Homomorphism Remaining many operations

remaining

no operations remaining

𝑚 𝑚

ciphertext

𝑠𝑘

encryption of secret key encrypt the

ciphertext

𝑚 homomorphically evaluate the decryption function

recrypt functionality

(21)

Bootstrappable SWHE

• First bootstrappable construction by Gentry based on ideal lattices [Gen09]

• Tons of progress in constructions of FHE in the ensuing years [vDGHV10, SV10, BV11a, BV11b, Bra12, BGV12, GHS12,

GSW13], and more!

• Have been simplified enough that the description can fit in a blog post [BB12]

(22)

Conceptually Simple FHE [GSW13]

• Ciphertexts are 𝑛 × 𝑛 matrices over ℤ𝑞

• Secret key is a vector 𝑣 ∈ ℤ𝑞𝑛

𝐶

× 𝑣 = 𝑚 × 𝑣 + 𝑒

ciphertext secret key message noise

Encryption of 𝑚 satisfies above relation

𝑣 is a “noisy”

eigenvector of 𝐶

(23)

Conceptually Simple FHE [GSW13]

• Suppose that 𝑣 has a “large” component 𝑣𝑖

• Can decrypt as follows:

𝐶𝑖, 𝑣

𝑣𝑖 = 𝑚𝑣𝑖 + 𝑒𝑖

𝑣𝑖 = 𝑚

𝐶

× 𝑣 = 𝑚 × 𝑣 + 𝑒

ciphertext secret key message noise

𝐶𝑖 is 𝑖th row

of 𝐶 Relation holds if 𝑒𝑖

𝑣𝑖 < 1

2

(24)

Conceptually Simple FHE [GSW13]

Homomorphic addition

𝐶1 × 𝑣 = 𝑚1 × 𝑣 + 𝑒1 𝐶2 × 𝑣 = 𝑚2 × 𝑣 + 𝑒2

𝐶1 + 𝐶2 × 𝑣 = 𝑚1+ 𝑚2 × 𝑣 + 𝑒1 + 𝑒2

homomorphic addition is

matrix addition noise terms also add

(25)

Conceptually Simple FHE [GSW13]

Homomorphic multiplication

𝐶1 × 𝑣 = 𝑚1 × 𝑣 + 𝑒1 𝐶2 × 𝑣 = 𝑚2 × 𝑣 + 𝑒2

𝐶1𝐶2 𝑣 = 𝑚1𝑚2 𝑣 + 𝐶1𝑒2 + 𝑚2𝑒1

homomorphic multiplication

is matrix multiplication noise could blow up if 𝐶1 or 𝑚2 are not small

(26)

Conceptually Simple FHE [GSW13]

• Basic principles: ciphertexts are matrices, messages are approximate eigenvalues

• Homomorphic operations correspond to matrix addition and multiplication (and some tricks to constrain noise)

• Hardness based on learning with errors (LWE) [Reg05]

(27)

The Story so Far…

• Simple FHE schemes exist

• But… bootstrapping is expensive!

• At 76 bits of security: each bootstrapping operation requires 320 seconds and 3.4 GB of memory [HS14]

• Other implementations exist, but generally less flexible / efficient

• SWHE (without bootstrapping) closer to practical: can evaluate shallow circuits

(28)

Application: Statistical Analysis

• Consider simple statistical

models: computing the mean or covariance (for example, average power consumption)

• Problem: given 𝑛 vectors 𝑥1, … , 𝑥𝑛, compute

• Mean: 𝜇 = 1

𝑛 𝑖=1𝑛 𝑥𝑖

• Covariance: Σ𝑋 = 1

𝑛2 (𝑛𝑋𝑇𝑋 −

(29)

Application: Statistical Analysis

• Can also perform linear

regression: given design matrix 𝑋 and response vector 𝑦,

evaluate normal equations 𝜃 = 𝑋𝑇𝑋 −1𝑋𝑇𝑦

• Matrix inversion (over ℚ) using Cramer’s rule

• Depth 𝑛 for 𝑛-dimensional data

(30)

Batch Computation [SV11]

Algebraic structure of some schemes enable encryption + operations on vectors at no extra cost

Plaintext Space: ring 𝑅

𝑅𝔭1 𝑅𝔭2 𝑅𝔭𝑘

Chinese Remainder Theorem: 𝑅 ≅⊗𝑖=1𝑘 𝑅𝔭𝑖

(31)

Batch Computation [SV11]

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 One homomorphic

operation

(32)

20 25 30 35 40 45 50 55 60 65 70

2,000 20,000 200,000 2,000,000

Time (minutes)

Number of Datapoints

Time to Compute Mean and Covariance over Encrypted Data (Dimension 4)

Multiplications dominate

Few ciphertexts due to batching

Based on implementation of Brakerski’s scheme [Bra12]

(33)

0 10 20 30 40 50 60 70 80

1000 10000 100000 1000000

Time (minutes)

Number of Datapoints

Time to Perform Linear Regression on Encrypted Data (2 Dimensions)

Few ciphertexts due to batching

Multiplications dominate

(34)

Application: Private Information Retrieval

I want to see record 𝑖…

???

PIR protocol

client learns record 𝑖, server learns nothing

cloud database

(35)

PIR from Homomorphic Encryption [KO97]

𝑣11 𝑣12 𝑣13 𝑣21 𝑣22 𝑣23 𝑣31 𝑣32 𝑣33

1 0 0

represent database as matrix

query is an encrypted basis

vector

×

𝑣11 𝑣21 𝑣31

=

server evaluates inner product

response

database components in the clear: additive homomorphism suffices

𝑂( 𝑛)

communication

(36)

PIR from Homomorphic Encryption

• 𝑂 𝑛 communication with additive homomorphism alone

• Naturally generalizes:

• 𝑂 3 𝑛 with one multiplication

• 𝑂 𝑘 𝑛 with degree 𝑘 − 1 -homomorphism

• Benefits tremendously from batching

database

𝑟1, … , 𝑟𝑁 𝑟1, … , 𝑟𝑁/3

𝑟1+𝑁/3, … , 𝑟2𝑁/3

𝑟1+2𝑁/3, … , 𝑟𝑁

split database into many small

databases, query in parallel

(37)

1 10 100 1,000 10,000 100,000 1,000,000

1 10 100 1000 10000

Response Time (s)

Number of Records (Millions)

FHE-PIR Timing Results (5 Mbps)

FHE-PIR (d = 2) FHE-PIR (d = 3) FHE-PIR (d = 4) Trivial PIR

(38)

PIR from Homomorphic Encryption

• Outperforms trivial PIR for very large databases

• However, recursive KO-PIR with additive homomorphism is still state-of-the-art

(39)

Concluding Remarks

• Internet of Things brings many security challenges

• Many generic cryptographic tools: 2PC, MPC, FHE

• 2PC/MPC work well for small number of parties

• SWHE/FHE preferable with many parties (IoT scale)

• FHE still nascent technology – should be viewed as a “proof-of- concept” rather than practical solution

• SWHE closer to practical, suitable for evaluating simple (low- depth) functionalities

• Big open problem to develop more practical constructions!

(40)

Questions?

References

Related documents

for the Protection of Cultural Property in the Event of Armed Conflict 5 (“Hague Convention of 1954”), and its two subsequent protocols signed in 1954 (“First Protocol”) and

groups in cell blocks: 34 of 51 cases were diagnosed as NCC; 17 had more glandular cells in cytology smear or positive MUC2 immunostain in cell block to make diag- nosis in

In summary, we find that our foreign aid information treatment has statistically significant positive effects on the confidence that our respondents express in three of the

For example, although the precise insertion site of all 36 insertions detected in the RAL- 492 genome by hemi-specific PCR were identified, 5 of these insertion sites were absent

However, his superiors viewed Ames as an exceptional talent, a superior officer, and even though he had yet to command his regiment in battle, the young officer received

• The largest fleet by number is the light single category - mainly utility helicopters • The medium and heavy helicopters fleet is. small in comparison but is growing faster

Condition b) is checked by simple visual inspection of the re- sulting images. Condition c) is verified by comparison of com- ponent positions at different epochs and flux

The design of a ( n, d )-multi-party circuit from BGW’s protocol is merely based on the following remark: the d -privacy for a set of n semi-honest players evaluating a function