Nowadays, more and more users, be it individual persons or organizations, are shifting towards outsourcing the storage of their data — for example, personal photos/videos, medical data, customer data, financial information and so on — to a cloud. As such data are very privacy sensitive, in storage outsourcing applications, it is important not only to hide the content of the data from the untrusted hosting server, but also to hide the data access patterns (that is, the sequence of storage locations accessed by the user) from the storage server since sensitive information can be learned from carefully studying the access patterns (see, for example, [PS10]). While the former can be achieved by using a standard encryption algorithm, the latter can be achieved by using cryptographic protocols such as Private Information Retrieval and Oblivious Transfer, or Oblivious RAM (ORAM). ORAM was first proposed by Goldreich and Ostrovsky as a means for protecting software against piracy [G87, O90, GO96], since it enables the execution of a RAM program while hiding the access pattern to the memory. ORAM can be constructed using Symmetric Encryption or Fully Homomorphic Encryption.
In this blog entry, our focus will be on ORAM. In particular, we explain as clearly as possible how ORAM works in detail and say a few words on their applications to privacy-preserving biometric authentication.
How does it work?
The basic idea behind ORAM is to continuously reshuffle and re-encrypt the data as they are accessed. Even by observing the accessed physical storage locations, the server cannot learn anything about the access pattern. It sounds too good to be true, but far from magic as we show below. ORAM truly does hide access patterns from the server.
At a very high level, an ORAM comprises the following:
- Setup(N): Initially, the user stores N items (or block of data) in the server. In addition, the user also allocates some local memory for storing some information about the N.
- Read(i): This is an interactive process in which the user sends to the server a query to retrieve the i-th item, and the server returns the content of i-th item. This is done obliviously, meaning that the server does not know anything about what is being queried and returned.
- Write(i, D): The server obliviously the content of the i-th item with D.
This high level description lacks many crucial details that are needed to understand how it works in practice, especially how Read(i) and Write(i, D) are done obliviously. So let us now go through step-by-step with a simple example.
Suppose that we have 4 blocks of data; block 0 contains A, block 1 contains B and so on.
| 0 | A |
| 1 | B |
| 2 | C |
| 3 | D |
We store them in a binary tree of depth 2 (in general, the depth is chosen as ⌈log_2(N)⌉, where N is the number of blocks). Each node in the binary tree contains a block (usually, each node contains a small number of blocks) of data. If the number of data blocks is less than the number of nodes, which always is the case, the empty nodes are filled with dummy blocks. For each block index, 0-3, the assigned to a leaf independently and at random. Let us say that the random index to leaf map is as follows:
| index | leaf |
| 0 | 1 |
| 1 | 3 |
| 2 | 3 |
| 3 | 0 |
This map is called position map and we store it locally. Each block of data is first encrypted with a key known only to us (the user) and then stored in a node along the path from the assigned leaf to the root.
With the position map giving above, the resulting ORAM tree can be as follows (let R be a dummy data which is not necessarily the same in each appearance in our description):
Let us say that we want to read the item indexed by 2, which corresponds to C. We first look up the position map to get the assigned leaf, which in our example is 3 (the leafs are counted from left to write). Then we read the data stored in the nodes that are in the path from leaf 3 to the root, this would return Enc(2, C), Enc(1, B), Enc(R). We decrypt these and obtain
| 2 | C |
| 1 | B |
| R | |
We now delete the dummy block R, and store the rest
| 2 | C |
| 1 | B |
in the locally allocated memory, and read off the requested block C. After that, we update the leaf assigned to the index 2 at random. Let us say that the newly assigned leaf to index 2 is 1, so now we have the following position map:
| index | leaf |
| 0 | 1 |
| 1 | 3 |
| 2 | 1 |
| 3 | 0 |
The data blocks in the local memory are re-encrypted, Enc(2, C) and Enc(1, B), with a fresh randomness so as to hide from the server any possible connection with the data previously stored in the path. We then empty the local memory by writing the locally stored Enc(2, C) and Enc(1, B) back to the tree, starting from the assigned leaf of the blocks to the root. So after this, the ORAM may look like this:
If a node is full, the block is written to the immediate parent node, and this is repeated all the way to the root. If all the nodes in the path is full, then the block stays in the local memory.
To update the content of a block, say,
| 0 | A |
to
| 0 | F |
the block is locally updated, encrypted, and then written to the tree in the same way as the local memory is emptied by writing back to the memory by respecting the position map.
This is known as Path ORAM [SDS+13]. You can also read more about it here and even play with the demo here.
Applications to privacy-preserving biometric authentication
Privacy is one of the main concerns in biometric authentication, as mentioned in a previous post. In a remote biometric authentication, there is always a database of biometric data collected from the enrolled users, and the database is hosted either on the service provider side or outsourced to a cloud storage provider. In such authentication system, hiding the access patterns of the users to the biometric database from the untrusted storage server is as important as protecting the privacy of the biometric data itself. Using ORAM in combination with the privacy-enhancing technologies used to protect the biometric data privacy provides much stronger privacy guarantees in biometric authentication.
However, we cannot directly employ ORAM, since now the whole contents of the database do not belong to one user alone; each user only owns one item (that is, his/her own biometric data) in the database. Therefore, some modifications to ORAM are needed to enable its use in this multi-user case. And this will be the subject of a future post.
Thanks to Aysajan Abidin and Enrique Argones Rúa for writing this blog post.




