Oblivious RAM Constructions and Applications
Kate Highnam, Samee Zahur, Matthew Irvine
Server
Client
Server
Client
Server
Client
I don’t trust him….
Client
Server
80% of search string
ORAM
Server
Client
Goal of ORAM
In this situation, the server is unable to determine the difference between any given sequence of requests from the protocol and some random sequence of requests.
Server
?
Naive Approach
1. Grab each block
2. Edit (if need to)
3. Fresh re-encrypt
4. Push back
Server
Client
Here’s the Plan...
Types of ORAM:
Application of ORAM
3. Garbled RAM
Path ORAM: An Extremely Simple Oblivious RAM Protocol
Emil Stefanov , Marten van Dijk , Elaine Shi , T-H. Hubert Chan, Christopher Fletcher , Ling Ren , Xiangyao Yu , Srinivas Devadas
Notations
Stash
&
Position Map
Binary Tree with Buckets
(See next slide)
Client
Server
Block = B bits
N blocks
TREE!
L levels
Z blocks
P(x)
x
dummy data
dummy data
dummy data
Server Side
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
……..
……..
N leaves
0 | block data
2 | block data
1 | block data
9 | block data
3 | block data
Stash and Position Map
0 1 2 3 4 5 6 7 8 9 10 ……………...
0 3 1 2 … ... … … … … … … … ...
Stash (usually empty after access)
Position Map
Index representing Path where block lies
Array Index = Address of block
Client Side
Let’s get started…….
Server
Client
Big Picture
Server
Client
Read block…
Write block...
Path ORAM
Protocol
Path ORAM Protocol (1/4)
1. Store current position of block a, remap block to new random position
0 1 2 3 4 5 ……………………………………………..
0 3 1 2 ... ... … … … … … … … ...
x = 1
0
Path ORAM Protocol (2/4)
2. Read all blocks along P(x) into client’s stash (decrypting along the way)
Server
6442875487 83978 74395 74387 59792 35849
Stash (usually empty after access)
Client
ORAM Protocol Overview (3/4)
3. If the original instruction was to write in a block, do so in the data stored within the client’s stash.
64428 75487 83978 74395 74387 59792 35849
Stash (usually empty after access)
Client
12345
ORAM Protocol Overview (4/4)
4. Write the blocks from the path back into the tree in the server while shifting blocks between buckets.
Server
64428 75487 83978 74395 12345 59792 35849
Stash (usually empty after access)
Client
1
3 | block data
1 | block data
0 | block data
2 | block data
0
2
3
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
dummy data
1
3 | block data
1 | block data
0 | block data
2 | block data
0
2
3
Problems…...
Client
Recursive Option
Remember: Client has limited memory…..
Client
?
Recursive Option
Remember: Client has limited memory…..
FIX: store position map on server encrypted with smaller recursive ORAM protocol.
Client
Bucket Overflow
What happens if all nodes go to the root or leaves?
Client
?
Bucket Overflow
What happens if all nodes go to the root or leaves?
FIX: Eviction process and overflow into the Stash in the Client
Srinivas Devadas, Marten van Dijk, Christopher W. Fletcher, Ling Ren, Elaine Shi, Daniel Wichs
Server-side Selection
Previous Approach
Client fetches multiple blocks from server, then selects the one needed.
OnionORAM
Let the server select the one client wants, without requiring client to reveal its choice. Use homomorphic selection.
Comparison with Notable Prior Work
Selection with Additive HE
A
B
C
D
Server-side
Client-side
Enc(0)
Enc(0)
Enc(1)
Enc(0)
A Enc(0) + B Enc(0) + C Enc(1) + D Enc(0)
Enc(C)
Doesn’t quite work:
Reducing Data Transfer : Chunks
E(0)
Ai E(0) + Bi E(0) + Ci E(1) + Di E(0)
Server-side
Client-side
E(0)
E(1)
E(0)
chunk
block
Doesn’t quite work:
Selecting Blocks
Ax
Selecting Ax
Using notation 𝛿xi = 1 if x = i, 𝛿xi = 0 if x ≠ i
∑iAi E(𝛿xi) = E(∑iAi𝛿xi) = E(Ax)
∑iE(Ai)E(𝛿xi) = E(∑iE(Ai)𝛿xi) = E(E(Ax)) = E2(Ax)
∑iEl(Ai)E(𝛿xi) = E(∑iEl(Ai)𝛿xi) = E(El(Ax)) = El+1(Ax)
Layers during ORAM Ops
3 block data
0 block data
1 block data
2 block data
Layers during ORAM Ops
3 block data
0 block data
1 block data
2 block data
Layers during ORAM Ops
3 block data
0 block data
⊥ block data
2 block data
1 block data
Layers during ORAM Eviction
3 block data
0 block data
⊥ block data
2 block data
1 block data
ORAM in Θ(1) Bandwidth
B bandwidth overhead per access.
Server performs select(). Enough for
How to Garble RAM Programs: Secure Multi-Party Computation with ORAM
Steve Lu and Rafail Ostrovsky
Secure Two-Party Computation
Two parties Alice and Bob
Program 𝜋
Private inputs IA and IB
Output Z
Alice
𝜋
Bob
?
Z
IA
IB
ORAM and Two-Party Computation
Client
Server
ORAM
Secure Two-Party Computation
Alice
𝜋
Bob
?
Z
IA
IB
Secure Two-Party Computation
Usual approach: Yao’s Garbled Circuits
Problem: Conversion from program to circuit
RAM Program (Runtime) O(T) | Circuit (Size) - From RAM O(T3 log T) |
Cost of conversion from RAM program to Circuit via Turing Machine
Overview of Garbled RAM
Goal: Secure Two-Party Computation with lower overhead
Restriction: No conversion to circuit, no interactivity
How? ORAM and
Garbled Circuits
Runtime of interactive Garbled RAM scheme
(Gordon, et al. 2012)
A Brief Introduction to Garbled Circuits
Building Block of Garbled RAM
Step 1: Convert program to circuit
Inputs come from the parties
Step 2: Randomly relabel the wires
Name | Original | New Value |
WX0 | 0 | be8961fe |
WX1 | 1 | e9d99c9a |
X
Y
Z
Step 3: Modify gates to match new labels
X
Y
Z
Input X | Input Y | Output |
WX0 | WY0 | WZ0 |
WX0 | WY1 | WZ1 |
WX1 | WY0 | WZ1 |
WX1 | WY1 | WZ1 |
Problem...
Computing output labels without revealing inputs
Input | Input | Output | Garbled Output |
WX0 | WY0 | WZ0 | EWx0(EWy0(WZ0) |
WX0 | WY1 | WZ1 | EWx0(EWy1(WZ1) |
WX1 | WY0 | WZ1 | EWx1(EWy0(WZ1) |
WX1 | WY1 | WZ1 | EWx1(EWy1(WZ1) |
Z
X
Y
Yao’s Garbled Circuits Overview
Two Parties: Gen and Eval
Gen
Eval
𝛤, X
𝛤 ← G(C)
X ← GI(x)
z
Y ← GI(y)
z ← GE(𝛤, X, Y)
1/3
Yao’s Garbled Circuits Overview
Two Parties: Gen and Eval
Three algorithms: G, GI, GE
Gen
Eval
𝛤, X
𝛤 ← G(C)
X ← GI(x)
z
Y ← GI(y)
z ← GE(𝛤, X, Y)
2/3
Yao’s Garbled Circuits Overview
Two Parties: Gen and Eval
Three algorithms: G, GI, GE
Output: z
Gen
Eval
𝛤, X
𝛤 ← G(C)
X ← GI(x)
z
Y ← GI(y)
z ← GE(𝛤, X, Y)
3/3
Garbled Circuits and Garbled RAM
How do we construct these algorithms for Garbled RAM?
Garbled Circuits | Garbled RAM |
Algorithms: (G, GI, GE) | Algorithms: (G, GI, GE) |
G(C) → 𝛤 | G(𝜋t) → garbled program 𝛱t |
GI(x) → garbled input X | GI(x) → garbled input X |
GE(𝛤, X) evaluates circuit 𝛤 on input X | GE(𝛱t, X) evaluates 𝛱t on X |
Correctness: C(x) = GE(G(C), GI(x)) | Correctness: 𝜋t(x) = GE(G(𝜋t), GI(x)) |
Algorithm for G (Program Garbling)
Main Idea: Create a virtual machine with corresponding CPU and ORAM client
1/2
Algorithm for G (Program Garbling)
Main Idea: Create a virtual machine with corresponding CPU and ORAM client
For each time step i = 1 … t:
CORAM
CCPU
CORAM
CORAM
CCPU
CCPU
0
1
t
...
Time
2/2
Previous Garbled ORAM Schemes
Problem: Communication between ORAM client and server requires interactivity
Solution: Evaluating party acts as ORAM server
CORAM
CCPU
CORAM
CORAM
CCPU
CCPU
0
1
t
...
Time
ORAM Server
Constructing CORAM
Input: Read/write query V
Output: Garbled circuit GCORAM
GCORAM executes ORAM query
CORAM
CCPU
GCORAM
X
V
Constructing CCPU
Inputs: (𝛴, X) the CPU state and last memory contents read
Outputs: New state 𝛴’, next read/write query V’
CCPU
X
𝛴
𝛴’
V’
Algorithms for GI and GE
GI: Map inputs to proper encodings
GE: For each time step i = 1 … t:
GI
x
GE
X
C(x)
𝛱
CORAM
CCPU
X
ORAM and Garbled RAM
Client
Server
ORAM
Garbled RAM
Gen
Eval
𝛱, X
𝛱 ← G(𝜋)
X ← GI(x)
z
Y ← GI(y)
z ← GE(𝛱, X, Y)
Garbled Circuits and Garbled RAM
Garbled RAM
Gen
Eval
𝛱, X
𝛱 ← G(𝜋)
X ← GI(x)
z
Y ← GI(y)
z ← GE(𝛱, X, Y)
Gen
Eval
𝛤, X
𝛤 ← G(C)
X ← GI(x)
z
Y ← GI(y)
z ← GE(𝛤, X, Y)
Garbled Circuits
Results
Mirrors Yao’s garbled circuits
Runs in O(t ∙ polylog(t))
No need for interactivity
Secure 2-party computation through ORAM
S. Lu and R. Ostrovsky. How to Garble RAM Programs. Cryptology ePrint Archive, Report 2012/601 (2012)
z
Gen
𝛱, X
Eval
The End