40
Computing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015

Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Computing on Encrypted Data

Secure Internet of Things Seminar

David Wu

January, 2015

Page 2: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

New Applications in the Internet of Things

Smart Homes

report energy consumption

aggregation + analytics

usage statistics and reports

Page 3: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

The Power of the Cloud

BIG DATA

analyticsrecommendations

personalization

lots of user information = big

incentives

Question: provide service, preserve

privacy

Page 4: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 5: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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 ofcircuit

oblivious transfer to obtain garbled inputs

output of garbled circuit

Party A Party B

Page 6: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 7: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Going Beyond 2PC

ā€¢ General MPC also ā€œsolvedā€ [GMW87]

secret share inputs with all parties

jointly evaluate circuit, gate-by-gate

Page 8: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Secure Multiparty Computation

ā€¢ General MPC suffices to evaluate arbitrary functions amongst many parties: should be viewed as a feasibilityresult

ā€¢ 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

Page 9: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

This Talk: Homomorphic Encryption

Interaction

GMW Protocol and General MPC

Homomorphic Encryption

Custom Protocols

Many rounds of interactionBoolean circuits (typically)

Few rounds of interactionArithmetic circuits

General methods for secure computation

Page 10: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Homomorphic Encryption

Homomorphic encryption scheme: encryption scheme that allows computation on ciphertexts

Comprises of three functions:

Encm

c

pk

c

Decm

sk

Must satisfy usual notion of semantic security

Page 11: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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)

š‘’š‘˜

Page 12: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 13: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Privately Outsourcing Computation

encrypted data

encrypted results of computation

Leveraging computational power

of the cloud

Page 14: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 15: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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)

Page 16: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 17: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

ā€œ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]

Page 18: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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)

Page 19: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 20: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

recryptfunctionality

Page 21: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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]

Page 22: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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 š¶

Page 23: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 24: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 25: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 26: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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]

Page 27: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 28: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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(š‘›š‘‹š‘‡š‘‹ āˆ’

Page 29: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 30: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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š‘˜ š‘…š”­š‘–

Page 31: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 32: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

2025303540455055606570

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

Tim

e (

min

ute

s)

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]

Page 33: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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)

Few ciphertexts due to batching

Multiplications dominate

Page 34: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Application: Private Information Retrieval

I want to see record š‘–ā€¦

???

PIR protocol

client learns record š‘–, server learns nothing

cloud database

Page 35: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

PIR from Homomorphic Encryption [KO97]

š‘£11 š‘£12 š‘£13

š‘£21 š‘£22 š‘£23

š‘£31 š‘£32 š‘£33

100

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

Page 36: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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

Page 37: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

1

10

100

1,000

10,000

100,000

1,000,000

1 10 100 1000 10000

Re

spo

nse

Tim

e (

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

Page 38: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

PIR from Homomorphic Encryption

ā€¢ Outperforms trivial PIR for very large databases

ā€¢ However, recursive KO-PIR with additive homomorphism is still state-of-the-art

Page 39: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

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!

Page 40: Computing on Encrypted DataComputing on Encrypted Data Secure Internet of Things Seminar David Wu January, 2015 New Applications in the Internet of Things Smart Homes report energy

Questions?