Encrypted Database Cracking with Data-Independent Pivots

An encrypted range index today is built all at once. The data owner sorts or bucketizes every record, encrypts the resulting structure, and uploads it before the first query runs. That costs time, and it also leaks information. Once the structure exists, the untrusted server can see how every record is ordered relative to every other record, at the index's granularity, including records nobody will ever query. We propose building the encrypted index lazily, the way database cracking does. Cracking is a technique in which each query physically reorders only the part of a column it touches, so that an index appears gradually wherever queries go. The twist is that the split points are never taken from the queries themselves. Queries decide where the data gets reorganized. A random-sample rank statistic decides how it gets split. As a result, the sizes of the pieces the server sees carry no information about the data values.

The resulting claim is stronger than "adaptive indexing is cheaper." It is that adaptivity can shrink leakage. Order information is released only for regions that queries actually visit, down to a minimum piece size fixed in advance. Never-queried "dark" data stays one opaque, unordered blob. Up to 70% of data in modern data lakes is reported to be dark (Cracking Vector Search Indexes), so the scheme could simultaneously avoid most index-construction work and withhold most of the order leakage that static encrypted indexes hand to the server.

Core Claim

Classic cracking (Database Cracking) splits a column at the query's own bounds. A query BETWEEN 20 AND 30 leaves behind pieces whose sizes are the number of records below 20, between 20 and 30, and above 30.

Transplanted naively onto ciphertexts, this is exactly the leakage that searchable-encryption attacks exploit. Each split reveals query-dependent ranks. The accumulated partition sequence converges toward a total order, which is the leakage profile of order-preserving encryption. The ESEDS paper reports that snapshot attacks on order-preserving encryption recover up to 95% of plaintexts (An Efficiently Searchable Encrypted Data Structure for Range Queries).

Our central observation comes from the "mediocre" pivot rule of Revisiting the Theory and Practice of Database Cracking. That work splits a piece at the median of a small random sample (sample size logarithmic in the piece) to avoid both costly exact medians and the skew of random pivots. It uses this rule for speed. We use it for security. If values are distinct (enforced by a record-id tiebreak), the rank of a sample median within its piece depends only on the random sample, not on the values. So the size of every child piece the server observes is drawn from a data-independent distribution. The shape of the partition tree then reveals only which pieces were refined. That is the piece-level access pattern, which any bucketized encrypted index leaks anyway.

The informal security statement we will prove is as follows. After any query sequence, the server's view is simulatable from three things: the piece-level access pattern, the set of refined pieces, and the value-order of pieces at leaf size at least $B$. This is never more than the leakage of a static equal-depth bucket index with bucket size $B$ restricted to the queried region, and strictly less on dark regions.

Research Program

The system is deliberately built from ordinary cryptography, so that any gain comes from the indexing strategy rather than a new primitive.

The server stores the column as a sequence of pieces. Each piece is a contiguous array of records encrypted under a semantically secure cipher (AES-GCM), and each piece is internally randomly permuted. The client keeps the cracker index locally: the plaintext pivot values separating pieces, as in the auxiliary tree of classic cracking. Its size is proportional to the number of pieces, not the number of records. As a reference point, εpsolute reports client storage under 30 MB for 1M records (εpsolute).

A range query $[a, b]$ proceeds in four steps. The client looks up the pieces that overlap $[a,b]$, fetches them, decrypts them, and filters locally. For each fetched piece larger than $B$ that straddles $a$ or $b$, the client may spend part of a per-query refinement budget to crack it. Following the budget-based cost model of CrackIVF, this budget is capped at a fixed fraction of query cost. Cracking takes two streaming passes. The first pass draws a sample of size about $\log n$ and takes its median as the pivot. The second pass writes each record, re-encrypted with fresh randomness, into one of two output streams, which are shuffled before upload.

Client memory stays bounded by the sample plus two write buffers, so pieces larger than client RAM are handled. The first query pays one pass over only the pieces it touches. Initially that is the whole column, so the first-query penalty matches the "about 30% slower than a full scan" reported for plaintext cracking, plus encryption overhead. Every later query touches progressively smaller pieces. Refinement stops at size $B$, which is the knob that trades query cost against the finest order granularity the server ever learns.

Inserts are appended to an encrypted buffer attached to the leaf that the client's cracker index says they belong to, and are absorbed at that leaf's next crack. Deletes are handled as tombstones that are purged during recracking. This addresses the deletion support that ESEDS leaves unimplemented, at the cost of leaking which leaf received an update.

The analysis has three parts. The first is the simulation proof above, including the tie-breaking argument and the leakage of refinement timing. The second is an amortized cost bound. Refining a hot region of $H$ records to leaves of size $B$ costs $O(H \log(H/B))$ record transfers, from about $\log(H/B)$ halving levels of linear passes; the dark region costs zero. The third is a characterization of when the adaptive scheme loses. Under uniform queries over all data it does roughly the same total work as a static bucketed build, but with a constant-factor overhead from its two-pass splits and from being spread over many rounds.

The first target is one-dimensional numeric range search, the setting of ESEDS, Arx, and εpsolute. We will consider extending the same "queries choose where, randomness chooses how" rule to multidimensional adaptive KD-trees (Benchmarking Adaptive Multidimensional Indices) only after the one-dimensional results hold.

Baselines

The naive reference point is a secure linear scan. Every query downloads or scans all ciphertexts, which leaks nothing beyond total size. We run it on the same encrypted records with the same cipher and hardware. It anchors the cost axis and the zero-leakage end of the security axis. εpsolute reports that its indexed approach outperforms secure linear scans by 18x, so a useful indexed scheme should land in that regime or better on repeated workloads.

The most important baseline is a static equal-depth bucket index with the same bucket size $B$. The client sorts all data at load time, cuts it into buckets of $B$ records, and encrypts and shuffles each bucket. Queries use exactly the same protocol as ours. This is the ablation that isolates adaptivity. The two systems share cipher, client code, and leaf size, differing only in whether structure is built upfront everywhere or lazily where queried. Beating it means lower cumulative time and client bandwidth until the query count at which the static build pays off. It also means measurably lower attack recovery on never-queried data. The comparison should show at least parity in steady-state per-query latency on hot regions.

The second ablation isolates the pivot rule. It is query-bound cracking on encrypted pieces, using the same client-assisted re-encryption but splitting at $a$ and $b$ as classic cracking does. We expect it to converge slightly faster, since pieces align with queries. We expect it to leak far more, and the comparison quantifies that gap.

The strongest existing encrypted range structures are ESEDS and εpsolute. ESEDS (An Efficiently Searchable Encrypted Data Structure for Range Queries) is a fully indexed interactive encrypted sorted list with frequency hiding and modular rotation. It reports a "negligible 10-millisecond latency overhead" over unencrypted search on a one-million-entry database. εpsolute (εpsolute) places a static B+ tree in ORAM with differentially private volume padding. It reports being "only 4–8x slower" than unencrypted MySQL/PostgreSQL. We run both on DBLP and the synthetic sets ESEDS used, and on the California Employee Pay and PUMS data εpsolute used, reporting their build time separately from query time.

We do not expect to beat εpsolute's security. It also hides access patterns and volumes, which we do not. We also do not expect to beat ESEDS's steady-state latency. We expect to beat both on time-to-first-answer and on cumulative cost when data is substantially dark. The leakage comparison against εpsolute will be reported honestly as a different point on the tradeoff, not a win.

Arx's ArxRange (Arx) is included where feasible as a reference for per-traversal cost. It reports about 3 ms per traversal and 1.9x storage inflation.

Plaintext mediocre cracking (Revisiting the Theory and Practice of Database Cracking) serves as the unencrypted performance ceiling, isolating the cost of encryption itself.

Why not just…?

Why not just build the static bucket index upfront? This is the real threat. When queries cover the whole domain, the static index does comparable total work, reaches steady state immediately, and leaks the same piece-level access pattern our scheme leaks. Our scheme wins only if a meaningful fraction of the data is dark, or if the owner values withholding order information on unqueried data. The experiments therefore sweep the dark fraction from 0% to 90% and report the crossover. If the adaptive scheme shows no leakage advantage on dark regions and only a cost advantage below, say, a 30% dark fraction, the honest conclusion is that static bucketization suffices. We will say so.

Why not just run a secure linear scan on every query? It leaks nothing, but its cost never drops. εpsolute's 18x gap over linear scans, and Engorgio's reports of seconds to tens of seconds for 10K-row relational and hybrid queries under fully homomorphic encryption (Engorgio), show why scans are not viable for repeated interactive workloads. Our cumulative-time curves on the 160,000-query SkyServer workload make this concrete.

Why not just put a flat array in ORAM, or use εpsolute directly? ORAM hides which pieces are touched, which we do not. But εpsolute notes that ORAM alone does not hide result sizes efficiently, and it relies on a fully pre-built tree. It also lists adaptive workloads as an open problem. Our scheme is compatible with it, since each piece could live in ORAM. The comparison we run quantifies what that extra protection costs relative to leaf-granularity bucket leakage.

Why not just crack at query bounds and add noise? Padding split sizes with differential-privacy noise, as εpsolute does for result volumes, would blur the leaked ranks. Our sample-median rule makes sizes data-independent at zero padding cost. The query-bound ablation, with and without noise, tests whether noise is ever needed.

Proposed Experiments

We evaluate on four workloads. SkyServer, with 500 million tuples and 160,000 real queries, is the most realistic skewed workload with dark regions. TPC-H Query 6 connects to plaintext cracking's reported convergence: a cracked column matches a pre-sorted one after roughly 100,000 random queries. DBLP and synthetic sets of up to one million entries match ESEDS's setting. California Employee Pay and PUMS match εpsolute's setting. On each, synthetic query generators sweep the dark fraction and the degree of skew.

Performance metrics are first-query latency, per-query latency over time, cumulative time, client bandwidth, client storage, and server storage. Leakage is measured two ways. The first is the fraction of records whose value rank the server can bound to within $w$ records. The second is plaintext recovery by an order-reconstruction attack. That attack sorts pieces by their inferred order and assigns values using an auxiliary distribution drawn from the same dataset, and it is run separately on queried and never-queried regions.

Three checks decide whether the idea holds. First, on uniformly and heavily skewed value distributions, the observed split-size distribution must be statistically indistinguishable (two-sample Kolmogorov–Smirnov test) across datasets. If it is not, the core security argument fails. Second, attack recovery on never-queried data must be at the chance level of the auxiliary-distribution guess for our scheme, while being substantially higher for the static bucket index. Third, cumulative cost must beat the static bucket index across a nontrivial range of dark fractions and remain within a small constant factor of it at 0% dark. The query-bound ablation should show sharply higher attack recovery at similar convergence speed, confirming that the pivot rule, not adaptivity per se, carries the security.