Imagine a secure protocol designed to let two companies find common customers without revealing their entire lists. Cryptographically, the contents of their databases are perfectly hidden inside encrypted envelopes. However, when one party hands over their stack of envelopes, the other party can easily count them.
Even if the content of the data is completely secure, the metadata—specifically the cardinality (or size) of the dataset—is out in the open.
In many real-world scenarios, dataset size is highly sensitive. It can reveal the scale of a company's operations, a patient's privilege level in a clinical trial, or the exact number of active participants in a private group. Furthermore, knowing the size of an input or the exact count of an intersection creates a powerful side-channel that adversaries can exploit to reconstruct private information.
To close this gap, researchers have developed size-hiding and cardinality-private protocols. These techniques ensure that cryptographic operations hide not only what the data is, but also how much data exists.
The Side-Channel of Scale
Why is revealing the size of a dataset dangerous? In standard Private Set Intersection (PSI), protocols often leak the total number of items in a participant's dataset (Stefanov et al.; Tsudik et al.). This leakage manifests in three primary ways:
- Input Size Leakage: The total number of records a user holds can expose proprietary business metrics or individual activity scales (Nissim et al.).
- Intersection/Volume Leakage: Even if a protocol only outputs the size of an intersection (PSI-CA) or the number of matching records in a search, this number acts as a side-channel (Trieu et al.; Choi et al.). As demonstrated by Du et al., an adversary can leverage intersection sizes alongside auxiliary data to execute Set Membership Inference Attacks (SMIA), deducing whether a specific individual belongs to a target group.
- Execution Traces: In hardware-isolated environments like Trusted Execution Environments (TEEs), the physical length of an execution trace or memory access pattern can inadvertently betray the dataset's size to an observer (Allen et al.).
To mitigate these risks, size-hiding protocols break the mathematical and physical dependencies between a dataset's true cardinality and the observable artifacts of the computation.
Mechanism 1: Algebraic Blinding
One way to hide the size of a dataset is to compress its representation into a fixed-size cryptographic structure and then mathematically "blind" it so that its contents cannot be counted.
For example, Tsudik et al. introduced a Size-Hiding PSI (SHI-PSI) protocol based on RSA accumulators. Instead of sending individual encrypted elements, the client hashes their inputs into a single accumulator. Crucially, the client blinds this accumulator with a random secret before sending it to the server. Because the accumulator is a single algebraic element regardless of how many items it contains, the server learns nothing about the client's dataset size.
Standard PSI: [Item 1] [Item 2] [Item 3] ---> Server counts 3 items
Size-Hiding: [Item 1, 2, 3 -> Accumulator] x [Random Blind] ---> Server sees 1 blinded value
This approach has been expanded to stateful and reactive settings. Cerulli et al. designed a practical SHI-PSI protocol in the standard model that restricts a client's input size within a single execution, preventing "oracle attacks" where a malicious party probes a database over multiple sessions. Similarly, Kerschbaum leveraged homomorphic encryption combined with Bloom filters to achieve complete client set size independence when outsourcing computations to untrusted cloud servers.
Mechanism 2: Dummy Padding and Noise
When algebraic compression is not viable—such as when a protocol must return individual matching records or handle dynamic group updates—the primary defense is padding.
If a protocol requires a fixed-size input or output to prevent leakage, participants insert dummy elements into their datasets.
- In dynamic group signatures, public updates can reveal when members join or leave. To obscure this group cardinality, protocols introduce dummy participants (Backes et al.).
- In zero-knowledge proof systems, proving subset membership or range queries without leaking total database size requires structuring the proofs to accommodate a fixed maximum capacity rather than the true count (Naor et al.; Ghosh et al.; Gao et al.).
The Efficiency Tradeoff
The challenge with dummy padding is overhead. If a user has 10 items but the protocol pads up to a maximum capacity of 1,000, they waste significant computation and communication bandwidth on useless data.
To balance this tradeoff, modern protocols integrate Differential Privacy (DP). Instead of padding to a massive, static worst-case maximum, protocols inject a calibrated, random number of dummy items. Peng et al. demonstrated that adding dummy items drawn from specific discrete noise distributions effectively masks the intersection count against side-channel de-anonymization while preserving high data utility and reducing communication costs by over 20x compared to traditional heavy encryption methods.
Mechanism 3: Decoupling Output Lengths
A foundational insight in this field is that output length is an inherent side-channel. If a function's output naturally grows or shrinks based on the size of its inputs, an observer can deduce the input size simply by looking at the result (Nissim et al.).
To achieve true input-size hiding in secure two-party computation, Nissim et al. proved that protocols must explicitly mask or pad the output size itself. By utilizing Fully Homomorphic Encryption (FHE), computations can be evaluated over encrypted bit-lengths, ensuring that the execution flow remains identical regardless of whether a database holds 10 records or 10,000.
In decentralized architectures like Federated Learning, this dependency manifests at the population level: servers often need to know the exact total number of participants to calculate precise privacy guarantees. Balle et al. bypassed this requirement entirely by introducing "Random Check-Ins." By allowing clients to make local, independent decisions about when to participate, the server can compute accurate global privacy guarantees without ever knowing or tracking the total population size.
Key Foundational Work
(If) Size Matters: Size-Hiding Private Set Intersection (2011) — contributed 5 concept elements to this direction.
Policy-Enhanced Private Set Intersection: Sharing Information While Enforcing Privacy Policies (2012) — contributed 1 concept elements to this direction.
Outsourced private set intersection using homomorphic encryption (2012) — contributed 1 concept elements to this direction.