Search-and-Compute on Encrypted Data

Jung Hee Cheon, Miran Kim, Myungsun Kim

This paper, authored by Jung Hee Cheon, Miran Kim, and Myungsun Kim, presents a significant step toward making private database queries practical using homomorphic encryption.

TL;DR

The authors propose a unified framework for "Search-and-compute" (filtering and aggregating) on fully encrypted databases using a single Somewhat Homomorphic Encryption (SWHE) scheme. By optimizing circuit primitives with SIMD techniques and large integer rings, they achieve massive speedups for additions and make complex private SQL-like queries feasible on thousands of encrypted records.

What Problem Does This Paper Address?

In the world of privacy-preserving data, there is a classic "two-system" problem. If you want to search an encrypted database (e.g., WHERE age > 30), you typically use Searchable Encryption (SE). If you want to compute on it (e.g., SUM(salary)), you use Homomorphic Encryption (HE).

The gap is that maintaining two different encryption systems for the same data is computationally expensive and architecturally complex. While Fully Homomorphic Encryption (FHE) theoretically allows both, it has historically been far too slow for practical use. This paper tackles the challenge of building a single, efficient system that can handle both "search" and "compute" operations without decrypting data or switching between different cryptographic contexts.

Methods

The researchers built their "Private Search-and-compute" (PSnC) framework on a variant of the BGV (Brakerski-Gentry-Vaikuntanathan) somewhat homomorphic encryption scheme. Their novel approach relies on three main pillars:

  1. Optimized Circuit Primitives: They redesigned the fundamental building blocks of database queries—equality tests, "greater-than" comparisons, and integer addition—to minimize "multiplicative depth" (the number of sequential multiplications, which is the most expensive part of HE).
  2. SIMD and Automorphisms: They utilized Single-Instruction-Multiple-Data (SIMD) techniques to pack multiple data elements into a single ciphertext. By using "automorphisms" (cyclic rotations of these data slots), they could perform parallel operations and reduce the complexity of equality checks from $O(\mu)$ to $O(\log \mu)$.
  3. Large Integer Rings ($Z_{2^t}$): Most HE schemes operate on bits ($Z_2$). The authors transitioned to larger integer rings. This allows for "lazy carry" operations: you can add many numbers together without worrying about the carry bit until the very end, drastically reducing the circuit depth for aggregate functions like SUM.

Datasets

The paper does not use a specific real-world public dataset. Instead, the authors evaluated their framework using synthetic database tables to rigorously test scalability.

  • Scale: They varied the number of tuples ($N$) from $10^2$ to $10^4$.
  • Attributes: They tested 10-bit keyword attributes (for searching) and 30-bit numeric attributes (for computing).
  • Selectivity: They tested various query selectivity ratios (the percentage of rows matching a search) from 5% to 40%.

Key Insights and Ideas

  • The SIMD Speedup: Traditionally, SIMD is used to do the same thing to different data. Here, the authors use it to speed up a single operation. By rotating bits within a single ciphertext and multiplying them against themselves, they can evaluate an equality predicate much faster than bit-by-bit.
  • The Power of $Z_{2^t}$: Moving from a binary message space to a large integer ring is a game-changer for aggregation. In their experiments, performing an addition in the $Z_{2^{14}}$ space was roughly 500,000 times faster than doing it bitwise in $Z_2$.
  • Unified Context: By staying within one SWHE context, the "search" result (a 0 or 1 ciphertext) can be directly multiplied by the "compute" attribute. If the row doesn't match the search, the result becomes an encryption of 0, effectively filtering the data homomorphically.

Key Results

The authors implemented their system using Shoup’s NTL library and the Halevi-Shoup HE library.

  • Search-and-Sum Performance: For a database of 10,000 tuples, a "Search-and-Sum" query (Case I: Single Equality) took approximately 1,089 seconds (about 18 minutes).
  • Search-and-Count: These were even faster; a single equality count on 10,000 rows took about 961 seconds.
  • Join Queries: The framework also supports private joins. A join of two 100-row tables (N=M=100) with a search-and-compute condition took about 680 seconds.
  • Communication Efficiency: The communication cost remained very low, typically under 15 KB for small queries and around 1.25 MB for complex joins, making it practical for client-server architectures.

Limitations and Future Work

  • Latency: While a massive improvement over previous FHE attempts, 18 minutes for 10,000 rows is still too slow for real-time interactive applications. It is better suited for batch background processing.
  • Join Scalability: The complexity of join operations is $O(NM)$, meaning it scales poorly as both tables grow large.
  • Parameter Sensitivity: The performance is highly dependent on choosing the right "radix" and plaintext modulus. If the parameters are too small, the noise grows too fast; if too large, the individual operations slow down.
  • Future Directions: The authors suggest that further refinements in SIMD packing and more advanced "bootstrapping" techniques could push these timings from minutes into seconds.

Summary updated

BibTeX
@inproceedings{cheon2015search,
  author = {Jung Hee Cheon and Miran Kim and Myungsun Kim},
  title = {{Search-and-Compute on Encrypted Data}},
  booktitle = {Financial Cryptography Workshops},
  year = {2015},
  doi = {10.1007/978-3-662-48051-9\_11},
}
Figure