CryptDB : Protecting Confidentiality with Encrypted Query Processing

27
CryptDB: Protecting Confidentiality with Encrypted Query Processing Raluca Ada Popa, Catherine M. S. Redfield, Nickolai Zeldovich, and Hari Balakrishnan MIT CSAIL

description

CryptDB : Protecting Confidentiality with Encrypted Query Processing. Raluca Ada Popa , Catherine M. S. Redfield, Nickolai Zeldovich , and Hari Balakrishnan MIT CSAIL. Problem. Confidential data leaks from databases - PowerPoint PPT Presentation

Transcript of CryptDB : Protecting Confidentiality with Encrypted Query Processing

Page 1: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

CryptDB: Protecting Confidentiality with Encrypted Query Processing

Raluca Ada Popa, Catherine M. S. Redfield, Nickolai Zeldovich, and Hari Balakrishnan

MIT CSAIL

Page 2: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

ApplicationDB ServerSQL

User 1

User 2

User 3

Confidential data leaks from databases E.g., Sony Playstation Network, impacted 77 million

personal information profiles

Problem

System administrator

Threat 1: passive DB server attacks

Threat 2: any attacks on all servers

Hackers

Page 3: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

CryptDB in a nutshell Goal: protect confidentiality of data

1. Process SQL queries on encrypted data2. Use fine-grained keys; chain these keys to user

passwords based on access control

ApplicationDB ServerSQL

Threat 1: passive DB server attacks

Threat 2: any attacks on all servers

on encrypted data

User 1

User 2

User 3

Page 4: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

1. First practical DBMS to process most SQL queries on encrypted data

Hide DB from sys. admins., outsource DB

2. Protects data of users logged out during attack, even when all servers are compromised

Limit leakage from compromised applications

3. Modest overhead: 26% throughput loss for TPC-C

Contributions

4. No changes to DBMS (e.g., Postgres, MySQL)

Page 5: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Threat 1: Passive attacks to DB Server

DB Servertransformed queryProxyplain query

Stores schema, master key No data storage No query execution

Under attack

Applicationdecrypted results encrypted results

Trusted

Process queries completely at the DBMS, on encrypted database

Process SQL queries on encrypted data

Encrypted DB

Page 6: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

col1/rank col2/name

table1/emp

SELECT * FROM emp WHERE salary = 100

x934bc1x5a8c34

x5a8c34

x84a21c

SELECT * FROM table1 WHERE col3 = x5a8c34

Proxy

?x5a8c34x5a8c34

?x5a8c34x5a8c34

x4be219

x95c623

x2ea887

x17cea7

col3/salary

Application

60

100

800

100

Randomized encryption

Deterministic encryption

Page 7: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

col1/rank col2/name

table1 (emp)

x934bc1x5a8c34

x5a8c34

x84a21cx638e54

x638e54x922eb4

x1eab81

SELECT * FROM table1 WHERE col3 ≥ x638e54Proxy

x638e54x922eb4x638e54

col3/salary

Application

60

100

800

100

Deterministic encryption

SELECT * FROM emp WHERE salary ≥ 100

OPE (order)encryption

Page 8: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

1. Use SQL-aware set of encryption schemes

Two techniques

Most SQL uses a limited set of operations

2. Adjust encryption of database based on queries

Page 9: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Encryption schemes

e.g., =, !=, IN, COUNT, GROUP BY, DISTINCT

Scheme

RND

HOM

DET

SEARCH

JOIN

OPE

Function

none

+, *

equality

join

word search

order

Construction

AES in CBC

AES in CMC

Paillier

our new scheme

Song et al.,‘00

Boldyreva et al.’09

first implementation

e.g., >, <, ORDER BY, SORT, MAX, MIN

restricted ILIKE

Highest

Security

see paper

e.g., sum

Page 10: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

How to encrypt each data item? Encryption schemes needed depend on queries May not know queries ahead of time

Leaks order!

rank

ALL?

col1-RND

col1-HOM

col1-SEARCH

col1-DET

col1-JOIN

col1-OPE

‘CEO’

‘worker’

Page 11: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

int valueHOM

Onion Add

Onions of encryptions

value JOIN

DETRND

Onion Equality

Onion Search

Same key for all items in a column for same onion layer Start out the database with the most secure encryption

scheme

OReach value

value OPE-JOIN

OPERND

Onion Order

text valueSEARCH

Page 12: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Adjust encryption

Strip off layers of the onions Proxy gives keys to server using a SQL UDF

(“user-defined function”) Proxy remembers onion layer for columns

Do not put back onion layer

Page 13: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Example:

SELECT * FROM emp WHERE rank = ‘CEO’;

emp:

rank name salary

‘CEO’‘worker’

‘CEO’

JOINDETRND

Onion Equality

col1-OnionEq

col1-OnionOrder

col1-OnionSearch

col2-OnionEq

table 1:

………

RND

RND

SEARCH RND

SEARCH RND

RND

RND

Page 14: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Example (cont’d)

UPDATE table1 SET col1-OnionEq = Decrypt_RND(key, col1-OnionEq);

‘CEO’

JOINDETRND

SELECT * FROM table1 WHERE col1-OnionEq = xda5c0407;

DET

Onion Equality

RND

RND

SELECT * FROM emp WHERE rank = ‘CEO’;

DET

DET

col1-OnionEq

col1-OnionOrder

col1-OnionSearch

col2-OnionEq

table 1

………

RND

RND

SEARCH RND

SEARCH RND

Page 15: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

• aggregation on a column HOM nothing

Confidentiality level

• equality predicate on a column DET repeats

• Never reveals plaintext

Queries encryption scheme exposed

common in practice

• no filter on a column RND nothing

amount of leakage

Encryption schemes exposed for each column are the most secure enabling queries

Page 16: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Application protection

DB ServerSQLProxyApplication

User 1

User 2

User 3

Arbitrary attacks on any servers

Passive attacks

User password gives access to data allowed to user by access control policy

Protects data of logged out users during attack

Page 17: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Challenge: data sharing

3. Process queries on encrypted data

msg_id sender receiver msg_id message

5 “secret message”5 Alice Bob

SPEAKS_FOR msg_id

SPEAKS_FOR msg_id ENC_FOR msg_id

2. Capture read access policy of application at SQL level?Annotations

Key chains from user passwords

Km5Km5 Km5

1. How to enforce access control cryptographically?

Alice-pass Bob-pass

Page 18: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Implementation

CryptDB Proxy

Unmodified DBMS

CryptDB SQL UDFs

(user-defined functions)

Server

query

results

transformed query

encrypted results

SQL Interface

No change to the DBMS Portable: from Postgres to MySQL with 86 lines

Application

One-key: no change to applications Multi-user keys: annotations and login/logout

Page 19: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Evaluation

1. Does it support real queries/applications? 2. What is the resulting confidentiality?3. What is the performance overhead?

Page 20: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Queries not supported

More complex operators, e.g., trigonometry Operations that require combining incompatible

encryption schemes e.g., T1.a + T1.b > T2.c

Extensions: split queries, precompute columns, or add new encryption schemes

Page 21: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Real queries/applications

Application Total columns

Encrypted columns

phpBB 563 23HotCRP 204 22grad-apply 706 103TPC-C 92 92sql.mit.edu 128,840 128,840

Annotations + lines of code changed

3831

11300

Multi-userkeys

One-key

# cols not supported

0000

1,094

SELECT 1/log(series_no+1.2) … … WHERE sin(latitude + PI()) …

Page 22: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Resulting confidentiality

Application Total columns

Encrypted columns

phpBB 563 23HotCRP 204 22grad-apply 706 103TPC-C 92 92sql.mit.edu 128,840 128,840One-key

Min levelis RND

21189565

80,053

Min level is DET

116

1934,212

Min level is OPE

1228

13,131

Most columns at RND Most columns at OPE analyzed

were less sensitive

Multi-userkeys

Page 23: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

PerformanceDB server throughput

CryptDB Proxy

Encrypted database

Application 1

CryptDB:

Plain database

Application 1

MySQL:

CryptDB Proxy

Application 2

Application 2

Latency

Hardware: 2.4 GHz Intel Xeon E5620 – 8 cores, 12 GB RAM

Page 24: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

TPC-C performance

Throughput loss 26%

Latency (ms/query): 0.10 MySQL vs. 0.72 CryptDB

Page 25: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

TPC-C microbenchmarks

Encrypted DBMS is practical

No cryptography at the DB server in the steady state!

Homomorphic addition

Page 26: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Cryptography proposals Fully homomorphic encryption (starting with [Gentry’10]) Search on encrypted data (e.g., [Song et al.,’00])

Systems proposals (e.g., [Hacigumus et al.,’02]) Lower degree of security, rewrite the DBMS, client-side

processing

Query integrity (e.g., [Nguyen et al.,’07], [Sion’05])

Related work

Page 27: CryptDB :  Protecting Confidentiality with Encrypted Query Processing

Conclusions

1. The first practical DBMS for running most standard queries on encrypted data

Thanks!

2. Protects data of users logged out during attack even when all servers are compromised

3. Modest overhead and no changes to DBMS

CryptDB:

Website: http://css.csail.mit.edu/cryptdb/Demo at poster session!