# Searchable symmetric encryption

Searchable symmetric encryption (SSE) is a form of encryption that allows one to efficiently search over a collection of encrypted documents or files without the ability to decrypt them. SSE can be used to outsource files to an untrusted cloud storage server without ever revealing the files in the clear but while preserving the server's ability to search over them.

## Description

A searchable symmetric encryption scheme is a symmetric-key encryption scheme that encrypts a collection of documents $\mathbf {D} =(\mathrm {D_{1}} ,\dots ,\mathrm {D_{n}} )$, where each document $\mathrm {D_{i}} \subseteq \mathbb {W}$ is viewed as a set of keywords from a keyword space $\mathbb {W}$. Given the encryption key $K$ and a keyword $w\in \mathbb {W}$, one can generate a search token $tk$ with which the encrypted data collection can be searched for $w$. The result of the search is the subset of encrypted documents that contain the keyword $w$.

### Static SSE

A static SSE scheme consists of three algorithms ${\mathsf {SSE=(Setup,Token,Search)}}$ that work as follows:
* ${\mathsf {Setup}}$ takes as input a security parameter $k$ and a document collection $\mathbf {D}$ and outputs a symmetric key $K$, an encrypted index $\mathbf {I}$, and an encrypted document collection $\mathbf {ED}$
* ${\mathsf {Token}}$ takes as input the secret key $K$ and a keyword $w$ and outputs a search token $tk$
* ${\mathsf {Search}}$ takes as input the encrypted index $\mathbf {I}$, the encrypted document collection $\mathbf {ED}$ and a search token $tk$ and outputs a set of encrypted documents $\mathbf {R} \subseteq \mathbf {ED}$
A static SSE scheme is used by a client and an untrusted server as follows. The client encrypts its data collection using the ${\mathsf {Setup}}$ algorithm which returns a secret key $K$ and an encrypted document collection $\mathbf {ED}$. The client keeps $K$ secret and sends $\mathbf {ED}$ and $\mathbf {I}$ to the untrusted server. To search for a keyword $w$, the client runs the ${\mathsf {Token}}$ algorithm on $K$ and $w$ to generate a search token $tk$ which it sends to the server. The server runs Search with $\mathbf {ED}$, $\mathbf {I}$, and $tk$ and returns the resulting encrypted documents back to the client.

### Dynamic SSE

A dynamic SSE scheme supports, in addition to search, the insertion and deletion of documents. A dynamic SSE scheme consists of seven algorithms ${\mathsf {SSE=(Setup,Token,Search,InsertToken,Insert,DeleteToken,Delete)}}$ where ${\mathsf {Setup}}$, ${\mathsf {Token}}$ and ${\mathsf {Search}}$ are as in the static case and the remaining algorithms work as follows:
* ${\mathsf {InsertToken}}$ takes as input the secret key $K$ and a new document $\mathrm {D_{n+1}}$ and outputs an insert token $itk$
* ${\mathsf {Insert}}$ takes as input the encrypted document collection EDC and an insert token $itk$ and outputs an updated encrypted document collection $\mathbf {ED'}$
* ${\mathsf {DeleteToken}}$ takes as input the secret key $K$ and a document identifier $id$ and outputs a delete token $dtk$
* ${\mathsf {Delete}}$ takes as input the encrypted data collection $\mathrm {EDC}$ and a delete token $dtk$ and outputs an updated encrypted data collection $\mathbf {ED'}$
To add a new document $\mathrm {D_{n+1}}$ the client runs ${\mathsf {InsertToken}}$ on $K$ and $\mathrm {D_{n+1}}$to generate an insert token $itk$ which it sends to the server. The server runs ${\mathsf {Insert}}$ with $\mathbf {ED}$ and $itk$ and stores the updated encrypted document collection. To delete a document with identifier $id$, the client runs the ${\mathsf {DeleteToken}}$ algorithm with $K$ and $id$ to generate a delete token $dtk$ which it sends to the server. The server runs ${\mathsf {Delete}}$ with $\mathbf {ED}$ and $dtk$ and stores the updated encrypted document collection.
An SSE scheme that does not support ${\mathsf {DeleteToken}}$ and ${\mathsf {Delete}}$ is called semi-dynamic.

## History of Searchable Symmetric Encryption

The problem of searching on encrypted data was considered by Song, Wagner and Perrig though previous work on Oblivious RAM by Goldreich and Ostrovsky could be used in theory to address the problem. This work proposed an SSE scheme with a search algorithm that runs in time $O(s)$, where $s=|\mathbf {D} |$. Goh and Chang and Mitzenmacher gave new SSE constructions with search algorithms that run in time $O(n)$, where $n$ is the number of documents. Curtmola, Garay, Kamara and Ostrovsky later proposed two static constructions with $O(\mathrm {opt} )$ search time, where $\mathrm {opt}$ is the number of documents that contain $w$, which is optimal. This work also proposed a semi-dynamic construction with $O(\mathrm {opt} \cdot \log(u))$ search time, where $u$ is the number of updates. An optimal dynamic SSE construction was later proposed by Kamara, Papamanthou and Roeder.
Goh and Chang and Mitzenmacher proposed security definitions for SSE. These were strengthened and extended by Curtmola, Garay, Kamara and Ostrovsky who proposed the notion of adaptive security for SSE. This work also was the first to observe leakage in SSE and to formally capture it as part of the security definition. Leakage was further formalized and generalized by Chase and Kamara. Islam, Kuzu and Kantarcioglu described the first leakage attack.
All the previously mentioned constructions support single keyword search. Cash, Jarecki, Jutla, Krawczyk, Rosu and Steiner proposed an SSE scheme that supports conjunctive search in sub-linear time in $n$. The construction can also be extended to support disjunctive and Boolean searches that can be expressed in searchable normal form (SNF) in sub-linear time. At the same time, Pappas, Krell, Vo, Kolesnikov, Malkin, Choi, George, Keromytis and Bellovin described a construction that supports conjunctive and all disjunctive and Boolean searches in sub-linear time.

## Security

SSE schemes are designed to guarantee that the untrusted server cannot learn any partial information about the documents or the search queries beyond some well-defined and reasonable leakage. The leakage of a scheme is formally described using a leakage profile which itself can consists of several leakage patterns. SSE constructions attempt to minimize leakage while achieving the best possible search efficiency.
SSE security can be analyzed in several adversarial models but the most common are:
* the persistent model, where an adversary is given the encrypted data collection and a transcript of all the operations executed on the collection;
* the snapshot model, where an adversary is only given the encrypted data collection (but possibly after each operation).

### Security in the Persistent Model

In the persistent model, there are SSE schemes that achieve a wide variety of leakage profiles. The most common leakage profile for static schemes that achieve single keyword search in optimal time is $\Lambda _{\mathrm {opt} }$ which reveals the number of documents in the collection, the size of each document in the collection, if and when a query was repeated and which encrypted documents match the search query. It is known, however, how to construct schemes that leak considerably less at an additional cost in search time and storage.
When considering dynamic SSE schemes, the state-of-the-art constructions with optimal time search have leakage profiles that guarantee forward privacy which means that inserts cannot be correlated with past search queries.

### Security in the Snapshot Model

In the snapshot model, efficient dynamic SSE schemes with no leakage beyond the number of documents and the size of the collection can be constructed. When using an SSE construction that is secure in the snapshot model one has to carefully consider how the scheme will be deployed because some systems might cache previous search queries.

### Cryptanalysis

A leakage profile only describes the leakage of an SSE scheme but it says nothing about whether that leakage can be exploited or not. Cryptanalysis is therefore used to better understand the real-world security of a leakage profile. There is a wide variety of attacks working in different adversarial models, based on a variety of assumptions and attacking different leakage profiles.