Equi-Joins over Encrypted Data for Series of Queries

Masoumeh Shafieinejad, Suraj Gupta, Jin Yang Liu, Koray Karabina, Florian Kerschbaum

In the world of cloud computing, outsourcing database management is a standard move. But for privacy-conscious organizations, sending sensitive data to a third-party provider is a security nightmare. Encryption is the obvious shield, but it creates a massive hurdle: how do you perform complex operations like equi-joins (linking tables based on matching values) without giving the cloud provider the keys to the kingdom?

A new paper from researchers at the University of Waterloo and the National Research Council Canada, titled "Equi-Joins over Encrypted Data for Series of Queries," proposes a novel encryption scheme that hits a sweet spot between security and performance.

TL;DR

The authors present a new encryption scheme for performing equi-joins on encrypted data that significantly reduces "leakage"—the metadata an attacker can glean from seeing queries executed. By leveraging function-hiding inner product encryption and polynomial encoding, they prevent "super-additive leakage," ensuring that a series of queries doesn't reveal more information than the sum of its parts.

What Problem Does This Paper Address?

When you join two encrypted tables, the database management system (DBMS) needs to know which rows match. Most existing schemes reveal the "equality pattern"—they show which rows have the same values in the join column.

The problem is that this leakage is often cumulative. In many state-of-the-art schemes, if you run Query A and then Query B, the server might learn more than just the results of A and B; it might learn relationships between rows that weren't even part of the same query. This is called super-additive leakage. For example, if Query A reveals that Row 1 matches Row 2, and Query B reveals that Row 2 matches Row 3, a poorly designed system might inadvertently leak that Row 1 matches Row 3 across the entire database, even for rows that didn't meet the query's selection criteria (like a WHERE clause).

Furthermore, many existing secure join methods are either prohibitively slow (using $O(n^2)$ nested-loop joins) or only work for specific types of joins (like Primary Key to Foreign Key).

Methods

The researchers built their solution on two main pillars:

  1. Function-Hiding Inner Product Encryption (IPE): They adapted a cryptographic technique from Kim et al. that allows a server to compute the inner product of two encrypted vectors. If the result is zero, it "unlocks" a specific value.
  2. Polynomial Encoding for Selection: To handle WHERE clauses (e.g., WHERE Role = 'Tester'), they encode the selection criteria as roots of a polynomial. The client sends the coefficients of this polynomial as part of the query token. The server then evaluates this polynomial using the encrypted data; if the result is zero, the row matches the selection criteria.

By combining these, they created a scheme where the server can only "see" equality for rows that both match the selection criteria and have matching join keys. Crucially, they modified the IPE process so that each query uses fresh, randomized keys, which prevents the server from linking equality patterns across different, unrelated queries.

Datasets

The authors evaluated their implementation using the TPC-H benchmark, a standard industry dataset for decision support systems. Specifically, they used the Orders and Customers tables, scaling them from 1,500 to 150,000 rows (scale factors 0.01 to 0.1) to test how the system handles increasing data volumes.

Key Insights and Ideas

  • The Transitive Closure Limit: The authors argue that their scheme reaches a "natural lower bound" for leakage in non-interactive, single-server joins. It only reveals the transitive closure of the equality of rows that actually satisfy the query's selection criteria.
  • Efficiency via Hash-Joins: Unlike previous secure schemes that forced the server into slow nested-loop joins, this construction allows for hash-based joins. This brings the expected time complexity down to $O(n)$, making it much more scalable for large databases.
  • Fresh Keys for Every Query: By re-encrypting or using randomized tokens for every query, they effectively "reset" the server's knowledge, preventing the build-up of leaked metadata that leads to super-additive leakage.

Key Results

  • Security: The scheme is provably "SIM-secure," meaning an adversary learns nothing beyond the defined leakage profile.
  • Performance: While cryptographic operations add overhead, they remain practical. A single row decryption takes between 21ms and 53ms, depending on the complexity of the WHERE clause (the "IN" clause size).
  • Scalability: The experiments confirmed that the join runtime increases linearly with the database size. For a TPC-H scale factor of 0.1 (roughly 150,000 rows), a join took about 35 seconds—comparable to other state-of-the-art secure schemes but with significantly better security guarantees.

Limitations and Future Work

While this paper represents a major step forward, the authors acknowledge some limitations:

  • Minimum Leakage: The scheme still leaks the transitive closure of equality for matching rows. While this is a "lower bound" for this type of architecture, it is still more information than a perfectly "oblivious" join (which would leak only the final result size but requires much more expensive multi-party computation or specialized hardware).
  • Single-Server Focus: The work focuses on a non-interactive, single-server setting. Future work could explore how these techniques might be adapted to multi-server or interactive environments to further reduce leakage.
  • Parallelization: The current evaluation was single-threaded. The authors note that their hash-join approach is highly parallelizable, which would likely lead to massive speedups in a production environment.

Summary updated

BibTeX
@inproceedings{shafieinejad2022equi,
  author = {Masoumeh Shafieinejad and Suraj Gupta and Jin Yang Liu and Koray Karabina and Florian Kerschbaum},
  title = {{Equi-Joins over Encrypted Data for Series of Queries}},
  booktitle = {ICDE},
  year = {2022},
  doi = {10.1109/icde53745.2022.00168},
}
Figure