Meeting Cybersecurity Challenges
through Innovative Computer System
Design
Attackers routinely compromise
computer systems
Attackers routinely compromise
computer systems
Attackers routinely compromise
computer systems
Attackers routinely compromise
computer systems
Attackers routinely compromise
computer systems
How to protect ourselves?
No easy answer!
This talk:
Focus on encrypted computation
We either keep our data on trusted computers or
ask untrusted software to compute on our
encrypted data to produce encrypted results that
only we can decrypt
Outline
A Classic Encryption Puzzle
Fully Homomorphic Encryption
Querying an Encrypted Database
Hardware to the Rescue
Secure Communication Through
Encryption
Alice can encrypt her message using a secret key K
If Bob knows K, Mal does not know K and the encryption algorithm is hard to break, communication is secure
Bob Mal
How Is the Key Exchanged?
How do Alice and Bob exchange a secret key?
Alice could whisper the key in Bob’s ear when no one is eavesdropping
Alice could write Bob a letter with a message that serves as the key, but it might be intercepted.
Alice could hide her key in the message somehow
− Bob needs to be able to discover the key
A Pirate Puzzle
Pirates will take away all keys and use them. Pirates will not be able to open a locked box for which they don’t have a key.
Classical Diffie-Hellman Key Exchange
Locks were commutative not nested: Alice put her lock on, Bob put his, and then Alice removed hers
Bob Chooses secret y Computes (gx)y mod N Alice Chooses secret x Computes (gy)x mod N gx mod N gy mod N
Do We Trust the Cloud?
I want to delegate storage and processing of my
data, without giving away access to it.
Application: Secure Cloud Storage
Storing my files on the cloud
• Encrypt them to protect my information
• Later, I want to retrieve the files containing “cloud” within 5
words of “computing”.
• Cloud should return only these (encrypted) files, without
knowing the key
I want to delegate storage and processing of
my data, without giving away access to it.
Application: Secure Cloud Computing
Separating processing from access via encryption:
• I will encrypt my data before sending it to the cloud
• They will apply their processing on the encrypted data,
send me back the processed (still encrypted) result • I will decrypt the result and get my answer
I want to delegate processing of my data,
without giving away access to it.
How do you trust the cloud to do computation on your private data … while keeping your data private?
Users, limited resources Untrusted servers, public programs, many resources Hidden requests:
1.) Do I have Ek(lyme) disease? I’ve been Ek(coughing)? 2.) Compute taxes I owe given my Ek(W2) forms.
Hidden responses:
1.) Ek(Yes, you have lyme disease)
2.) Ek($984.00)
Server cannot learn anything
about encrypted data.
Ek(A) = encryption of A
An Analogy: Alice’s Jewelry Store
Courtesy: C. Gentry
Alice’s workers need to assemble raw materials into jewelry But Alice is worried about theft
How can the workers process the raw materials without having access to them?
An Analogy: Alice’s Jewelry Store
Courtesy: C. Gentry
Alice puts materials in locked glove box
• For which only she has the key
Workers assemble jewelry in the box Alice unlocks box to get “results”
The Analogy
Encrypt: putting things inside the box
• Alice does this using her key
• ci ß Enc(mi)
Decrypt: Taking things out of the box
• Only Alice can do it, requires the key
• m* ß Dec(c*)
Process: Assembling the jewelry
• Anyone can do it, computing on ciphertext
• c* ß Process(c1,…,cn)
A homomorphic symmetric encryption
M. van Dijk et alShared secret key: odd number p
To encrypt a bit m:
• Choose at random small r, large q
• Output c = m + 2r + pq
• Ciphertext is close to a multiple of p
• m = LSB of distance to nearest multiple of p
To decrypt c:
• Output m = (c mod p) mod 2
• m = c – p • [c/p] mod 2 = c – [c/p] mod 2 = LSB(c) XOR LSB([c/p]) Noise much smaller than p The “noise”
Why is this homomorphic?
Homomorphic means that if you sum (multiply) two
encrypted numbers and decrypt the sum
(product) you get the addition (multiplication) of
the two original numbers
This scheme is homomorphic because:
• If you add or multiply two near-multiples
of p, you get another near multiple of p…
Evaluating Polynomials
c1=m1+2r1+q1p, …, ct=mt+2rt+qtpLet f be a multivariate Boolean function where AND is treated as x and OR is treated as +
Let C = f(c1, …, ct)
• f(c1, …, ct) = f(m1+2r1, …, mt+2rt) + Qp
= f(m1, …, mt) + 2r + Qp • Then (C mod p) mod 2 = f(m1, …, mt) mod 2
Assume this noise is much smaller than p
We have accomplished encrypted
computation!
Encrypted computation can thus be achieved using Fully Homomorphic Encryption (FHE) without trusting anything on the server side
• Server does not need to store a secret key
Unfortunately, FHE overheads are about 108 to 109 for
straight-line code and overheads grow if there is complex control in the program
Only usable for simple computations
What About Specialized Tasks?
Application DB Server SQL User 1 User 2 User 3
}
Confidential data leaks from databases (DB)
} 2012: hackers extracted 6.5 million hashed passwords
from the DB of LinkedIn
System administrator
Threat: passive DB server attacks
Hackers
} Process SQL queries on encrypted data
salary 60 100 800 100 100 = query ? index 60 Unencrypted databases fast insecure FHE [Gentry’09], [GHS’12],.. … 100 800 salary xa32601 x8199f3 x62d03b xcef3f7 … circuit C output slow strong security CryptDB fast high degree of security query input x24ab1c
Spectrum
Courtesy: Raluca Popa
DB Server
transformed query
Proxy
plain query
Ø Stores schema, master key
Ø No data storage
Ø No query execution
Under passive attack
Application
decrypted results encrypted results
Trusted Ø Process queries completely at the DBMS, on encrypted database Encrypted DB
System Setup
col1/rank col2/name table1/emp SELECT * FROM emp
WHERE salary = 100
x934bc1 x5a8c34
x5a8c34 x84a21c
SELECT * FROM table1 WHERE col3 = x5a8c34 Proxy ? x5a8c34 x5a8c34 ? x5a8c34 x5a8c34 x4be219 x95c623 x2ea887 x17cea7 col3/salary Application 60 100 800 100
Randomized
encryption
Deterministic
encryption
Simple Example - 1
col1/rank col2/name table1 (emp) x934bc1 x5a8c34 x5a8c34 x84a21c x638e54 x638e54 x922eb4 x1eab81
SELECT * FROM table1 WHERE col3 ≥ x638e54
Proxy x638e54 x922eb4 x638e54 col3/salary Application 60 100 800 100
Deterministic
encryption
SELECT * FROM emp WHERE salary ≥ 100
OPE (order)
encryption
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 Popa ‘12 Song et al.,‘00 BCLO’09 + Popa ‘12 e.g., >, <, ORDER BY, SORT, MAX, MIN, GREATEST restricted ILIKE Highest Security e.g., sum
Encryption Schemes
Ø
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’
int value HOM Onion Add value JOIN DET RND 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 OR each value value OPE-JOIN OPE RND Onion Order text value SEARCH
Onions of Encryptions
Ø
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
SELECT * FROM emp WHERE
rank = ‘CEO’;
emp:
rank name salary ‘CEO’ ‘worker’ ‘CEO’ JOIN DET RND Onion Equality col1-OnionEq col1-OnionOrder col1-OnionSearch col2-OnionEq table 1:
…
…
…
RND RND SEARCH RND SEARCH RND RND RNDExample
UPDATE table1 SET col1-OnionEq =
Decrypt_RND(key, col1-OnionEq);
‘CEO’
JOIN DET RND
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 RNDExample – contd.
Ø
More complex operators, e.g., trigonometry
Ø
Operations that require combining
encryption schemes
Ø
e.g., T1.a + T1.b > T2.c
Extensions:
split queries, precompute
columns, use FHE or other encryption
schemes
Hardware to the Rescue: Secure Processors
What is a secure processor?
• Tamper-resistant chip: server cannot look inside
• Server can monitor chip pins (I/O, power)
• Server knows chip architecture
Secure processors (e.g., Aegis, smartcard,
TPM) assume
trusted programs
.
Processor chip
Tamper-‐resistant
I/O to external memory Power
Security Model & Protocol
2-interactive protocol for a secure processor:
TCB is just the processor chip. No software is trusted.
We only want to leak |Encrypt(x)| and “Time budget T”
Problem: Server specifies P è server can learn about x by applying different P and monitoring the secure processor
User Secure
Processor
2 Encrypt(x), Time budget T (1 interaction)
1 (several interactions)Key sharing
Initialize secure processor
3
Trusted Computing Base
Perform computation 4 O(|T|) interactions 5 Untrusted Server Program P, Public inputs y,
external RAM
“Normal” Secure Processor Untrusted Server External RAM Ek(Inputs), Curious() (1) What is the chip’s pin traffic?
(2) How long until the program completes?
Ek(results) Curious():
while (Memory[0] & 0x1) { send requests to memory }
return;
(2) Program does not enter loop: Ek(result) appears –or– chip powers down
(1) Program enters loop: causes pin traffic
knows k
Encrypted input from client
“Tamper proof”:
The server cannot look
inside the processor
The server can monitor what happens outside
The “time budget” partially solves problem (2)
How can we obfuscate pin behavior? Secure Processor Trusted Computing Base Untrusted Server External RAM Inputs, Curious() (1) What is the chip’s pin traffic?
(2) How long until the program completes?
Curious():
while (x[0] & 0x1) {
send requests to memory }
return;
(2) Completion point (1) Accessing memory causes pin traffic
Key idea: Instruction obfuscation in hardware
Given program P, time budget T, and any two inputs M and M*:
Make running P(M) for time T indistinguishable from running P(M*) for T from the perspective of chip pins
• Pin traffic
– Need to hide what memory addresses were accessed – Oblivious RAM (ORAM)
– Need to hide whether memory was accessed at a
particular time – access ORAM periodically
– Run program P for specified time T regardless of termination
Key idea: Instruction obfuscation in hardware
Given program P, time budget T, and any two inputs M and M*:
Make running P(M) for time T indistinguishable from running P(M*) for T from the perspective of chip pins
• Power at pins
– All internal modules (e.g., functional units, caches,
encryption) exercised periodically independent of instructions or data
– External RAM accessed periodically for on-chip misses
– Assume that internal modules have been designed for
data-independent power draw using logic design
techniques
• Instruction obfuscation in hardware
• Given program P, time budget T, and any two inputs M and
M*:
• Make running P(M) for time T indistinguishable from
running P(M*) for T from the perspective of the chip pins
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux Encrypted Instruction Memory (MB) Encrypted Data Memory (GB) PC Ascend Chip M, P, T Encrypted results
(after T time has passed)
On each instruction fetch:
1.) Scan ENTIRE instruction memory to perform read 2.) Activate all circuits on chip
3.) Scan+re-encrypt ENTIRE data memory to perform read/write
Repeat this T times. (T is known to the server)
All circuits in Ascend must have data-independent power draws
Scan
Scan
On each instruction fetch
1) Read instruction memory 2) Fire all execution units (with real/dummy work) 3) Read/write data memory
(with real/dummy work)
Repeat this T times. (T is known to the server)
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux Instruction Memory (MB) Data Memory (GB) PC
Fire all execution units!
Ascend Chip
Encrypted program inputs Server-‐specified program Time budget T
Encrypted results
(after T time has passed)
Assumption: it is possible to make dummy work look like real work
Why This Won’t Work As Is
1. Problem: We can’t store a program’s memory inside of a chip 2. Problem: Activating all circuits in the chip / instruction is a large
overhead (e.g., DRAM latency for every instruction)
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux Instruction Memory (MB) Data Memory (GB) PC
Fire all execution units!
Implementing Ascend
Incredibly inefficient.
1. Scanning all of memory is as bad as FHE’s data ambiguity
2. Activating all circuits in the chip for each instruction is very energy-inefficient
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux Encrypted Instruction Memory (MB) Encrypted Data Memory (GB) PC Ascend Chip M, P, T Encrypted results
(after T time has passed)
Scan
Adding support for “Path-ORAM” in Ascend
Each (leaf L, addr, data) 3-tuple is encrypted; lives on path from root to X
To access a block with program address A
1. Lookup position map determine that A à leaf X
2. Read path to leaf X into the ORAM interface’s local $
3. Write back as many blocks in local $ (re-)mapped to the path with leaf X as possible
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux
Memory
(16 GB)
PC
Fire all execution units!
Ascend Chip ORAM interface Local $ (27 KB) AES Position map (416 MB) Path to leaf X Level L = 3 Level 2 Level 1 Level 0
Leaf 1 Leaf X = 5 Leaf 2 = 8L
4 blocks per bucket 128 Bytes Bucket data tag a X Total Bytes per path = (L + 1) * 4 * (128+32)
= 16.9 KB (for a 16 GB ORAM)
Trusted Untrusted (under server’s control)
Reducing On-Chip ORAM Storage
Problem: 416 MB position map is too big to store in Ascend
Solution: store the position map in another ORAM
At the end of the day…
• Dedicate hardware storage: 209.4 KB
• Data moved per access: ~86 KB à 5880 cycle delay (54X
overhead)
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux
Memory PC
Fire all execution units!
Ascend Chip
ORAM Interface
Position map for ORAM 3
(~136.5 KB) D ec ry pt En cry pt key Local Cache 1 (~27.1 KB) Local Cache 2 (~24.3 KB) Local Cache 3 (~21.5 KB) ORAM 1 (16 GB) ORAM 2 (416 MB) ORAM 3 (8.5 MB) To access addr A:
1.) lookup position map(A)
yields leaf L3 2.) read/write ORAM3(L3) yields leaf L2 3.) read/write ORAM2(L2) yields leaf L1 4.) read/write ORAM1(L1)
yields (A, data)
Making Ascend efficient
Where we are:
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux
Memory PC
Fire all execution units!
Ascend Chip
ORAM Interface
Position map for ORAM 3
(136 KB) D ec ry pt En cry pt key Local Cache 1 (27 KB) Local Cache 2 (24 KB) Local Cache 3 (21 KB) ORAM 1 (16 GB) ORAM 2 (416 MB) ORAM 3 (8.5 MB)
On each instruction fetch
1.) Read instruction ORAM
2.) Fire all execution units (with real/dummy work)
3.) Read/write data ORAM
(with real/dummy work)
~ 5880 x 2 = ~ 11,760 cycles per instruction
Security level is independent of the rate that the
processor accesses memory as long as this rate
Exploiting common case behavior
Merge instruction ORAM and data ORAM Say “average application” has:
• 25% memory instructions
• 1% L1 I$ miss rate, 10% L1 D$ miss rate, 5% L2 $ miss
rate
Decode Register
File
Exe 1 Exe 2 Exe N Load/ Store mux
Memory
PC
Fire all execution units!
Ascend Chip ORAM Interface ORAM 1 (16 GB) ORAM 2 (416 MB) ORAM 3 (8.5 MB) L1 ICache L1 DCache L2 Cache Access 1 / instr Access 1 / 4 instrs
Access 1 / 100 L1I accesses
Access 1 / 10 L1D accesses
Security Observations
All external requests are periodic
Obfuscation of pin traffic is handled by ORAM
Overall power signature is periodic and data-independent
• Ascend guarantees periodic firing of execution units, cache
memories, control units and interfaces
• We assume that each of these units (e.g., AES, cache) has been
built using techniques to guarantee power draw that is data-independent
Performance Results
Slowdown relative to running programs “in the clear” (in the clear = no encryption/intervals/ORAM)
lower bound (not secure): w/o intervals, w/ ORAM latency of 5880 cycles rather than 108 cycle DRAM latency
ascend: w/ intervals+ORAM 1
6 11 16
bzip2 mcf gobmk sjeng hmmer libq h264 omnet astar perlb gcc Avg
Sl o w d o w n fa cto r X
Impossible to describe all the challenges associated with cybersecurity in a single talk
Focused on a “subfield” of encrypted computation
• Cryptography-based techniques (FHE)
• Protocols + cryptography (CryptDB)
• Hardware mechanisms + cryptography (Ascend)
Meeting cybsercurity challenges will require interdisciplinary efforts in security protocols, cryptography and architecture