Manuscript Offprint
arXiv:2611.05779Private Vulnerability Testing for User Oversharing
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Alexander Boyd
University of Surrey
Guildford, United Kingdom
Nishanth Sastry
University of Surrey
Guildford, United Kingdom
Daniel Gardham
University of Surrey
Guildford, United Kingdom
Suparna De
University of Surrey
Guildford, United Kingdom
Abstract
Users can inadvertently increase their vulnerability to privacy attacks by oversharing personal information. In particular, the combination of individually innocuous attributes can place a user in a sufficiently small population to enable linkage or re-identification attacks. We present a privacy-preserving mechanism that allows users to determine whether the information they disclose places them below a predefined population threshold, without revealing their query or the data of other users. Our setting presents several practical challenges: users contributing data may be offline when queries are made, queries may select arbitrary subsets of attributes, and neither server should learn the queried population or its size. We address these challenges using secret-shared data and queries, private equality testing, and secure threshold computation. Our protocol provides computational privacy against a malicious client and semi-honest, non-colluding servers, while supporting arbitrary queries and dynamic database updates. We define reactive f-privacy for a dynamically evolving database and prove that our construction satisfies it, with the sequence of permitted threshold outputs defining the information available to the adversary across an execution. We optimise the protocol using oblivious-transfer extensions and pre-computation, achieving sub-second online query times for 96-bit queries on datasets of up to one million records.
1 Introduction
Despite a majority of Internet users having concerns about privacy online, many struggle to translate this into actionable privacy protection measures [28]. An important reason for this is that users may not understand the extent to which they may be oversharing or the dangers involved in such [12, 26]. Individuals disclose information about themselves over time (across multiple posts) and often across multiple online and offline sources. For example, a user may publicly reveal their approximate age, location, employer, and university through social media and professional profiles. While each attribute may be relatively non-identifying in isolation, their intersection may correspond to only a small number of individuals, making the user vulnerable to linkage with a sensitive dataset. Similar risks arise in health and mobility data, where combinations of demographic, geographic, and behavioural attributes can be sufficient to distinguish individuals.
By linking all the attributes shared, adversaries might be able to identify individuals. The power of linkage attacks has been demonstrated through examples such as Narayanan and Shmatikov's [24]
classic de-anonymisation, using IMDb, of a Netflix dataset with 500,000 users' ratings in order to learn sensitive information, and the reidentification of taxi trips by Pandurangan [25]—a huge dataset of taxi trips granted from a Freedom of Information request, which contained hashed personally identifiable information (PII).
Although linkage attacks have often targeted high-profile individuals, people belonging to small or under-represented populations may also face heightened risk, since relatively few additional attributes may be sufficient to distinguish them from the wider population. For example, if transgender individuals constitute a very small proportion of a population, they may be singled out in a database using only a few additional attributes. Such individuals may therefore need to consider carefully whether disclosing additional information could make them more identifiable.
In this paper, we define the vulnerability of a user for a given database to be the size of the population determined by the publicly available information of that user. Thus, an attribute does not have an intrinsic level of linkage risk, which depends on what other information is available and on the distribution of those attributes in the population. The core functionality is simple: given a user's disclosed attributes, the system uses two non-colluding servers to privately count the number of users whose records match those attributes and returns only whether this count is below a predefined threshold . Neither server learns the user's attribute values, the resulting count, nor any individual user's record. Unlike state-of-the-art private aggregation such as Prio [6] and Prio+ [1], where the aggregate function is specified as part of the data-collection process, our setting allows users to privately query arbitrary subsets of attributes after data collection and determine the frequency of the corresponding joint attribute combination, even when the users contributing to the database are offline.
Moreover, the privacy guarantee must hold across the system's entire lifetime, rather than for each query considered in isolation. A querying client may adapt its next query to previous threshold outcomes, while insertions and updates may change the population against which subsequent queries are evaluated. Consequently, even if each individual execution reveals only its permitted output, the sequence of outputs may reveal additional information about the evolving dataset. We capture this stateful setting through reactive f-privacy: the adversary's view across an adaptive sequence of queries and database operations must reveal no more than is permitted by the corresponding ideal functionality. Our definition therefore makes explicit the leakage arising from the allowed outputs and the evolution of the database.
We represent each user's record as a vector of encoded attribute values. Categorical attributes can be represented by enumerating their possible values (e.g., male, female, transgender), while numerical attributes, such as age, can be discretised into buckets, again creating an enumeration of possible values (e.g., 20–30, 30–40, etc.). A client's query consists of an attribute-selection vector , indicating which attributes are being queried, together with the corresponding attribute values . For example, a client may query whether the population matching their age, location, and sexuality is below a predefined threshold, without querying or revealing their other attributes. This representation allows users to select an arbitrary subset of attributes when making a query, while the underlying records remain fixed in the database.
Two non-colluding servers are required to maintain privacy. Organisationally, non-collusion might require that these servers are operated by two competing social media platforms or perhaps two charities, such as ACLU and EFF that care about privacy and civil liberties. Technically, non-colluding servers enable privacy of the users' attribute values by maintaining secret shares of users' records. Similarly, privacy of user queries is ensured by having the user's client secret-share its query between the servers. The servers privately perform equality tests between the query and each database record, aggregate the resulting matches, and securely determine whether the resulting count is below the threshold .
Within the above framework, it is still challenging to perform a private intersection across arbitrary combinations of attributes without incurring an exponential blow up. We tackle this by using a secret-shared enumeration of the user's data and computing over it when needed. We utilise Beaver triples for secret multiplication that allows us to offload as much pre-computation as possible. This approach also allows us to very cheaply hide the query using a clever yet simple extension.
Our Contributions. We present a privacy-preserving vulnerability testing system that allows users to determine whether their disclosed attributes place them in a population below a predefined threshold, while keeping both the underlying user data and the querying user's attributes private. Our construction supports arbitrary attribute-subset queries, offline users, and a dynamically evolving database. We achieve practical online performance by moving computationally expensive operations to a pre-computation phase. Our contributions are as follows:
(1) Private vulnerability testing. We provide a formal construction for privately determining whether a user's attributes identify a population below a predefined threshold, where the query may select an arbitrary subset of attributes and users contributing to the database need not be online when the query is issued. Our construction provides computational privacy against malicious clients and semi-honest, non-colluding servers.
(2) Reactive privacy. We define reactive -privacy for our stateful setting, capturing the security of an adversary's view across an arbitrary sequence of queries and database updates. We prove that our construction satisfies reactive -privacy, with the permitted threshold outputs characterising the information revealed across the execution.
(3) Extensions and optimisations. We show how the construction can support client opt-out and data updates, and formulate the equality-testing component as a replaceable interface, allowing alternative equality-testing techniques to be incorporated without modifying the remainder of the protocol. We additionally develop a more efficient variant that trades a modest amount of information leakage for improved performance.
(4) Implementation and evaluation. We implement the proposed protocols in and evaluate their performance on datasets of up to ten million records. We additionally implement an alternative equality-testing protocol and compare its performance with our baseline construction.
Differential Privacy. Differential privacy provides a well-established approach to protecting individuals when releasing aggregate statistics, including under repeated queries through privacy accounting and composition [10, 11]. However, it introduces a privacy-accuracy trade-off through the addition of noise, whereas our application requires an exact threshold decision. This trade-off becomes particularly significant when many attribute constraints must be evaluated, as the added noise can obscure whether the matching population lies above or below the threshold. Stronger, more recent proposals [3, 13] mitigate this drawback, but in any case, the record of a client must inherently be similar to the ground truth. Differential privacy also provides robustness against malicious clients, but this does not address our requirement for exact, post-hoc threshold queries over secret-shared data.
Fully Homomorphic Encryption. FHE may seem like a natural approach to achieve PPM, and there are indeed several works that take advantage of the inherent security offered by FHE [19, 20, 27]. However, despite possessing strong confidentiality properties, it has its own drawbacks. Supporting malicious clients would require additional verifiable computation techniques or mechanisms for enforcing valid inputs [18]. Such mechanisms introduce further computational and communication overhead. Combined with the relatively high cost of FHE evaluation, this makes FHE unattractive under the resource and latency constraints of our system.
Sketching Protocols. Since we need only deal with counts, the advances in sketching protocols may seem alluring [5, 21, 22]. However, the challenge is not simply computing a count, but supporting counts over arbitrary intersections of attribute values. Consequently, representing every possible query as an element of the input domain leads to a combinatorial explosion as the number of attributes grows (i.e. the power set excluding overlap). Even with
¹Available at: https://anonymous.4open.science/r/privateintersect-26D7/ sub-linear space complexity of the codomain from sketch compression, we see an explosion as the system scales (for reasonable error values), and the approach becomes impractical. For example, an input domain of 64 bits has an upper bound of outputs before sketch compression.
Secret Sharing. Secret-shared aggregation systems such as Prio [6] and Prio+ [1] support private frequency estimation, but are designed around a measurement and aggregation function specified during data collection. Our setting instead requires clients to issue arbitrary intersection queries after the database has been populated, without requiring contributing clients to participate in subsequent queries. Encoding every possible attribute combination as a separate value, as in a one-hot representation, incurs combinatorial space complexity. We therefore store secret shares of the underlying attribute vectors and evaluate equality with the query at query time, allowing arbitrary post-hoc intersections without exposing the queried values.
3 Technical Preliminaries
This section introduces the cryptographic primitives used by our construction. In particular, we describe a two-party secret-sharing multiplication protocol, and show how it yields distributed AND and equality testing. Finally, we describe the Boolean-to-arithmetic (B2A) conversion used to aggregate equality-test outputs.
Notation and Assumptions. We define various mathematical notation used throughout this paper. is the -dimensional finite field of size . Bitstrings (bitvector or vector similarly) are defined from the domain . Logical operators are taken as their bitwise counterparts when invoked on a vector. denotes the Boolean-share of variable , such that . We additionally define the function which takes a bitvector and returns . The number of parties assumed for a Multiparty Computation (MPC) is 2 unless otherwise stated. To publish, in the context of MPC, means to inform all other parties of the corresponding message.
Dataset Format. A dataset or database is structured by an ordered set of attributes . Each attribute has an associated finite domain of values, denoted for attribute . A record is then a tuple of values where each value comes from each attribute exactly once, , for all . A dataset can naturally be viewed as a set of records .
The bitlength of an attribute is then denoted
and the bitlength of a full record is . The structure of a dataset is defined with the tuple
.
Secret-sharing. Secret-sharing works by decomposing a secret into shares, such that , for an arbitrary function . Notably, we consider the Boolean secret sharing scheme, which takes as bitwise XOR (exclusive OR) and secrets in , and the arithmetic secret sharing scheme, which takes as field addition and secrets in . If we give each party the share , then it is clear to see that these schemes are perfectly secure, in the sense that if a malicious party were to recover all but
one of all shares, they would gain no information about the actual secret x.
Arithmetic for Secret Shares. With addition and multiplication, it is possible to define a large class of functions. Addition of shares with a constant or another share is straightforward and requires no communication. To calculate the addition of two secrets , each server locally computes .
Multiplication by a constant is also easy and similarly only requires local multiplication with the constant. Multiplication between secrets, however, is less trivial and requires communication. Although there are several ways to compute multiplication of secrets, for this paper we use the approach used by Beaver [2]. In this approach, the multiplication is pre-computed using a random collaboratively computed multiplication, called a Beaver triple. The triple is 'mixed' with the share of the secret which is to be multiplied, then published to the other parties. The parties then perform a computation that multiplies the secrets while removing the parts of the Beaver triple, as we shall now describe in detail.
Generation of Beaver Triples. A Beaver triple is of the form , where . At the end of the generation, party should have . A triple in can be generated via oblivious linear evaluation, which uses instances of oblivious transfer (OT). For the Boolean field used throughout this paper, we need only use 2 OTs. The exact protocol used is detailed in Section B.
Evaluation of Multiplications. In order to evaluate the multiplication of two secrets and a Beaver triple , each party begins by computing intermediate values and . Each party then publishes their share, such that they can reconstruct the real values of and . Revealing these shares does not compromise the security of the secrets and since they are the addition of two secrets in a finite field, whose security argument is identical of that to an arithmetic secret sharing (they are indistinguishable from random). Finally, is calculated as for party 1 and for party 2. Proof of correctness is seen in Section B.
B2A Conversion. Once in this form, the shares of the outputs from many equality tests cannot be aggregated, due to the possibility that the modulus be overflowed upon aggregation. In general, the shares need to be in a field of size at least , for n outputs to be aggregated. Conveniently, the work of [1] demonstrates how to utilise B2A conversions for data aggregation.
The approach of B2A conversions follows exactly that of secret multiplication - an expensive pre-computation is performed on random inputs, using OTs to generate a correlated pair (a 'daBit', a double-authenticated bit) corresponding to a conversion from a Boolean field to a larger one - which is then used to perform another conversion later on, but with chosen inputs and much cheaper computation and communication. More concretely, the pre-computation requires just one OT in the offline phase and one bit of communication in the online phase. The protocols for generation and evaluation can be seen in Section C.
Distributed AND and Private Equality Testing. A distributed AND function with arbitrary number of inputs can be trivially built using distributed multiplication. Consider that the AND function is equivalent to multiplication for Boolean inputs, then, the AND function can be computed over several inputs by sequentially multiplying all bits. An equality testing protocol can then be built using the distributed AND function. To test whether a shared bitstring is the vector of all 1s, one can run the distributed AND function over as previously defined. For a test vector , this protocol can be extended to arbitrary equality testing by providing the bitmask before testing, and it is easily verified that if and only if .
4 System Model and Security Goals
We consider a system consisting of two non-colluding servers and a set of clients. Clients may independently submit records to the system or issue queries at any time. Each server stores a secret share of every submitted record, such that no individual server can reconstruct an honest client's data.
A key requirement of our system is that clients are offline after submitting their data. In particular, a client who contributes a record is not required to remain online, respond to server requests, or participate in subsequent queries. Queries must therefore be evaluated entirely from the data already held by the servers. This requirement is important in our target setting, where clients may be intermittently connected, unavailable when a query is issued, or unwilling to participate in repeated computations. Consequently, the cost of answering a query must not depend on the availability or computational resources of the clients whose data contributes to the result.
Let denote the current database. A query specifies a subset of attributes and corresponding attribute values . Let denote the number of records in whose values agree with on the attributes selected by . The system evaluates the vulnerability predicate
The client learns only this Boolean result. In particular, neither the client nor either server learns the exact value of . Numerical attributes can be represented using publicly defined buckets, allowing the representation to trade precision for both computational efficiency and privacy. Categorical attributes can be represented directly using the same enumeration mechanism.
The threshold is a public system parameter selected by the system operator. It represents the minimum population size considered sufficiently large under the system's privacy policy. Clients cannot select an arbitrary threshold for individual queries, since doing so would permit an adversary to recover population sizes by repeatedly querying with different thresholds. A system may instead expose a fixed set of predefined thresholds, if required. Our system is designed to provide the following properties:
Correctness. For an honestly generated database and honestly generated query, the client receives the correct value of , except with negligible probability.
Robustness. A malicious client should be unable to affect the protocol or the records of other clients beyond the effect achievable by submitting an arbitrary valid record on its own behalf.
Privacy. An adversary controlling one server should learn no information about the records of honest clients or the values of a client's query beyond the public parameters and the outputs permitted by the security definition. In particular, the servers should not learn either the queried attribute values or the exact matching population size. Since the database may evolve and queries may be issued repeatedly, we require this privacy guarantee to hold across an arbitrary sequence of queries and database updates. We formalise this stateful security requirement as reactive -privacy in Section 7.2.
Threat Model. We consider an adversary that may corrupt one of the two servers and an arbitrary number of clients. The corrupted server is semi-honest: it follows the prescribed protocol but may inspect its complete internal state and execute any additional efficient computation on its view. The two servers are assumed not to collude.
Corrupted clients may deviate arbitrarily from the protocol, including submitting malformed or adversarially chosen records and issuing arbitrary queries. We require that such clients cannot compromise the privacy of honest clients or affect the database beyond their own permitted contributions.
We assume authenticated, confidential communication between all parties. We do not consider collusion between the two servers or malicious deviation by either server. Consequently, correctness and robustness are guaranteed against arbitrary malicious clients provided that both servers follow the protocol, while privacy is guaranteed against an adversary controlling at most one server together with any number of clients.
Formal security definitions, including -privacy and its reactive extension, are given in Section 7.2.
5 System Design
Our construction is based on a simple observation: the desired query can be expressed as a private intersection between the client's query and the secret-shared database. Each server holds only a share of every client record and of the query, allowing the servers to determine whether each record matches the query without reconstructing either input.
At a high level, the protocol proceeds in three stages. First, the servers perform a private equality test between the query and each database record. Second, the resulting equality bits are converted and aggregated to obtain a secret-shared count of matching records. Finally, the servers privately compare this shared count with the public threshold , revealing only the resulting Boolean vulnerability decision.
A key design requirement is that clients are offline after submitting their records. Consequently, all computation required to answer a query is performed by the two servers using the data already stored in their secret-shared databases. Unlike interactive private aggregation protocols in which clients participate in each computation, our construction separates data submission from query execution. A client participates only when submitting, updating, or removing its own record. Once the record has been secret-shared between the servers, subsequent queries can be evaluated without any interaction with that client.
The equality tests produce a secret-shared count rather than a public count. Reconstructing this count would violate the intended privacy guarantee: an adversary could use repeated queries to identify individual records. For example, if an adversary knows that a particular individual belongs to the database, a query that fixes all but one attribute could reveal the unknown attribute if the resulting population has size one. We therefore require the threshold comparison itself to be performed without reconstructing the count. The servers use a garbled circuit (GC) to evaluate whether the secret-shared count satisfies the vulnerability predicate, revealing only a masked Boolean value of the vulnerability predicate. The mask prevents either server from learning the comparison result directly. We therefore arrange the output-sharing mechanism so that the result is delivered to the client, who is entitled to learn the vulnerability decision, while neither server obtains the result individually. The equality tests produce a secret-shared count rather than a public count. Reconstructing this count would violate the intended privacy guarantee: an adversary could use repeated queries to identify individual records. For example, if an adversary knows that a particular individual belongs to the database, a query that fixes all but one attribute could reveal the unknown attribute if the resulting population has size one. We therefore require the threshold comparison itself to be performed without reconstructing the count. The servers use a garbled circuit (GC) to evaluate whether the secret-shared count satisfies the vulnerability predicate, revealing only a masked Boolean value of the vulnerability predicate. The mask prevents either server from learning the comparison result directly. We therefore arrange the output-sharing mechanism so that the result is delivered to the client, who is entitled to learn the vulnerability decision, while neither server obtains the result individually.
Our design admits two variants. The first avoids some computation by allowing the query's attribute-selection vector to be revealed to the servers, while the second hides this information at additional computational cost. We refer to these as and , respectively. The detailed protocols and their trade-offs are given in section 6.
6 Protocol Construction
This section is divided into two parts. We first present , a simpler variant that is linearly faster than the full construction but permits limited information leakage. We then present the full construction, , which eliminates this leakage. Both variants comprise insertion and query protocols.
6.1 : Attribute-Selective Variant
This section presents two variants of our construction. The first, , is an attribute-selective variant that reveals which attributes are queried but hides their values, allowing servers to avoid computation on unselected attributes and thus achieves a more efficient protocol. The second, , is a query-private variant that additionally hides the queried attributes to maximise user privacy. Both variants comprise insertion and query protocols.
Insertion. To insert a record , the client samples a random Boolean share and computes . The two shares are sent to the respective servers. The client is then not required to
participate in subsequent queries. We arbitrarily reserve the vector of all 0s to mean undefined. When a user joins the system for the first time, they are asked for their personal data. The client then splits the vector into two shares and by first randomly choosing and then calculating , such that neither server can learn the user's data without both parts. The servers collect records from other clients in the same way. The formal protocol can be found in the Section A as Algorithm 4.
Query. A query consists of an attribute-selection vector and a value vector . In , is sent to both servers in the clear, while is secret-shared as . Server 2 negates its share of .
For each database record , each server applies its query share as a bitmask to the corresponding record. The servers then perform distributed multiplication across the selected bits. The resulting Boolean shares , satisfy
Thus, one secret-shared equality bit is obtained for every database record. The equality results are converted to arithmetic shares using and locally summed. The resulting count remains secret-shared; reconstructing it would violate the privacy goal. For example, a server that knows an individual belongs to the database could issue a query fixing all known attributes and vary an unknown attribute across successive queries, thereby recovering the individual's value from exact population counts. We therefore evaluate only the predicate count using a garbled circuit, revealing the Boolean result but not the count.
Finally, the distributed multiplications are evaluated using the multiplication protocol described in Section 3. Multiplications can be arranged as a balanced tree, reducing the number of sequential communication rounds to for an -bit test vector. Concretely, consists of and , while consists of the subroutines (XOR data with ), (equality testing), (share conversion) [1], and . The full protocol is detailed in Section A.1, and a walk-through use case is presented in Section J.
Leakage and efficiency. The primary limitation of is that is revealed to the servers. This does not reveal the queried values, but may nevertheless leak information about the client's interests. In return, equality testing is performed only for selected attributes. Thus, if a query selects a fraction of the attributes, the equality-testing work is approximately of that required by the full construction. The precise benefit depends on the query workload. Section 6.2 removes the leakage of at additional computational cost.
6.2 : Query-Private Variant
Our protocol removes the aforementioned leakage of the query by secret-sharing and evaluating the equality test independently for each attribute.
To facilitate this, the construction requires a publicly reserved value for each attribute that cannot occur in a valid record. We arbitrarily use the all-ones vector . This value acts as a guaranteed non-match when an attribute is excluded from a query. Consequently, its equality result can be used to neutralise the excluded attribute without revealing whether that attribute was selected. During insertion, the servers therefore reject any record containing the reserved value. This verification is performed using the same equality-testing primitive as the query protocol.
For a query , the client secret-shares both the selection vector and the query values. For each attribute , the servers receive shares corresponding to
respectively. The equality test is then performed separately on each attribute. The result is a Boolean share for each attribute.
For a selected attribute, and the equality test is evaluated on the client's supplied value , so exactly when the database value matches the query. For an unselected attribute, the protocol replaces the query value with the publicly reserved all-ones value, which cannot occur in a valid database record and hence its equality test always returns 0. The servers then incorporate the secret selection bit into the result, causing the final value for an unselected attribute to be 1. Thus, after this step,
Multiplying the resulting shares across all attributes therefore produces 1 exactly when the database record matches the query on every selected attribute. The remainder of the protocol is identical to : the resulting equality bits are converted to arithmetic shares, aggregated over the database, and compared privately with the threshold T.
The main cost of hiding is that equality testing must be performed for every attribute, including attributes that are not selected by the query. This removes the query-structure leakage of at the cost of additional computation. The equality tests are also performed separately within each attribute, which may increase the number of sequential distributed-AND operations. Nevertheless, using a balanced multiplication tree, the full construction requires at most one additional communication round compared with . Similarly to , consists of and , while consists of the subroutines , , [1], and . The full protocol is detailed in Section A.2
6.3 Optimisations and Additional Features
Equality Testing. The equality testing (ET) protocol within our system can be considered as a black box and can easily be replaced by another one, so long as the result is returned as a Boolean share to each server. In particular, we consider the work of [7], which showcases an equality testing protocol optimised for the offline phase. The protocol consists of two parts - an iterative size-reducing routine, and a routine for evaluating equality on small strings. We implement this alternative ET protocol, as well as a hybrid protocol that uses the size-reducing part of [7] and the normal ET protocol using distributed AND on the remaining small strings. All of these options are compared in the evaluation (see Section 8).
Client Opt-out/Update. A practical addition to the system is the ability for a user to opt out of the system, such that their data be removed from the dataset. This can be realised using a digital
signature scheme, where a client is issued a secret pseudonym. A client can present their pseudonym along with a valid signature when it wishes to opt out, and both servers can remove the record from the database. A client can effectively update their entry by removing it and then replacing it with a new one.
Parallel Preprocessing. The offline phase can be scaled horizontally by using additional non-colluding server pairs to generate Beaver triples in parallel and forward them to the two online servers. This increases preprocessing throughput without changing the online protocol, provided that the additional servers satisfy the same non-collusion assumptions.
6.4 Complexity Analysis
We break down the complexity analysis based on the offline and online phases of the protocol. Here, the offline phase denotes all server-side computation that can be performed before the query is known, including Beaver-triple generation.
Offline Phase. The cost of computation in the proposed system is dominated by the generation of Beaver triples. In the offline phase, privately computing the AND function over two random secrets (equivalent to multiplying over a Boolean field) has a cost of one OT per server. The number of multiplications required is , where n is the number of clients and l is the bitlength of the query. However, thanks to the work of Ishai et al. [16], it is known that a constant number of OTs can be ‘extended’ to produce more OTs using cheap alternatives—namely invocations of a PRNG. Since many multiplications are needed (e.g. over 3 million for a 32-bit query over 100,000 clients), this optimisation has significant impact in this amortised setting. Ultimately, the complexity is dominated by the number of multiplications, . Additionally, we saw multiplications optimised to reduce the number of round-trips, which is burdened with a tradeoff with space complexity. In particular, the offline phase requires round-trips and a space complexity dominated by copying the entire dataset. Note that it is quite possible to entertain this tradeoff in the case of having a very large dataset with small l or round-trip delay, for example by computing over sections of the dataset in series, or by adjusting the order of multiplications.
Online Phase. During the multiplication protocol, each server sends one bit to the other for each multiplication. This occurs after the servers mix their secrets with the Beaver triple, i.e. when they publish and . Multiplication can be done mostly in parallel—namely, multiplications whose inputs do not require the result of a previous one. The total online communication is linear in the database size and query length, i.e., bits, while the number of online rounds grows only logarithmically with the attribute bitlength. This separation is important for the intended setting: once records have been inserted and the preprocessing has been performed, queries can be executed without any interaction with the contributing clients.
7 Security Analysis
In this section we concretely analyse the security of . We use a simulation-based proof strategy, in which we define what an ideal

Figure 1: System architecture featuring additional optional BTG (Beaver Triple Generator) servers, arranged as above. If using 'Couteau' [7] for equality testing, the additional servers perform a similar routine requiring the same architecture
functionality means in our context, and define reactive f-privacy, that captures dynamic databases, as is realistic in deployed settings.
7.1 Security Model
Threat Model. We adopt the threat model defined in Section 4.1. The adversary may corrupt at most one of the two servers and an arbitrary subset of clients. The servers are assumed to be semi-honest and non-colluding, while corrupted clients may deviate arbitrarily from the protocol. Communication between all parties is assumed to use secure channels.
Our privacy guarantee therefore protects the inputs of honest clients against a corrupted server, even when that server colludes with corrupted clients. Correctness and robustness against arbitrary malicious clients are guaranteed provided that neither server is corrupted.
Reactive f-privacy. We now introduce an extended notion of f-privacy [1, 6] to account for the stateful nature of the system due to the dataset . Intuitively, f-privacy states that an adversary against a protocol computing the function is unable to learn any information beyond what is leaked by the evaluation of . We extend this notion to reactive f-privacy to additionally capture multiple evaluations over a changing data-set. More precisely, an adversary may observe the outputs of multiple, adaptively chosen queries over a changing dataset and therefore the privacy guarantee must hold across the entire sequence of insertions and queries, rather than only for a single query executed on a fixed dataset. This is particularly important in practical settings such as social media, where large numbers of users may issue repeated, adaptive queries over a continuously changing population.
DEFINITION 1 (REACTIVE f-PRIVACY). A stateful protocol is reactively f-private if, for any adversary controlling at most one server and an arbitrary subset of clients, there exists a Probabilistic Polynomial Time (PPT) simulator that, given the public parameters, the identities of corrupted participants, and the sequence of outputs
permitted by the ideal functionality, produces a view computationally indistinguishable from the adversary's view in the real execution.
Ideal Functionality and Leakage. We define the ideal functionality to capture exactly the information that may be revealed by the protocol. Intuitively, for a query over dataset , the functionality computes the vulnerability predicate:
The resulting bit is returned only to the querying client; neither server receives any query-dependent output.
For insertion, the functionality accepts a record provided that no attribute contains the reserved all-ones, , value used by . The validity result is revealed to the servers, since they must determine whether the record can be inserted. For an honest client, this result is always valid and therefore reveals no information about the record.
Thus, apart from public parameters and the identities of corrupted parties, the ideal functionality reveals only the sequence of threshold results returned to clients and the validity of submitted records. In particular, it reveals neither the contents of the database nor the selection vector , query values , or intermediate equality-test results.
The protocol ideal functionality comprises of two functions representing the actions of a user: and . We start by describing the ideal functionality of the Insert algorithm. Formally defined in Definition 2 functionality takes as input a client vector and returns if contains the all-ones vector, and 0 otherwise. The outcome of this functionality is given to the servers, and not the client. If , then the vector is added to the database.
Then, for a client query, we define the ideal functionality in Definition 3. This is a stateful protocol that receives the negation of the client's query and the stateful dataset held jointly by the servers. It computes if and only if the count of the query is less than the public threshold , and returns to the client only. The servers receive no output.
DEFINITION 2. (). The ideal functionality behaves as follows:
-
receives the client's submitted vector (via its Boolean shares from server , ).
-
computes the bit if contains an all-one subvector (i.e. is malformed), and otherwise.
-
returns to both servers. The client receives no output.
-
If , updates the stateful dataset ; if , is left unchanged.
REMARK 1. Note that never leaks information about an honest client's private data: for an honest client, deterministically, independent of , since honest clients never submit malformed vectors. For a malicious client, is already known to the adversary. In both cases, no information about or about any other client's data is revealed by .
DEFINITION 3. (). The ideal functionality behaves as follows:
-
receives the negation of the client's query and the stateful dataset held jointly by the servers.
-
counts how many entries in are equal to the client's query (formed with ), and computes if and only if the count of the query is less than the public threshold .
-
returns to the client only.
The ideal functionality exposes only the information that is necessarily available to the corresponding parties. The servers learn the public parameters and, for each insertion, the validity bit ; they receive no query-dependent output. A querying client learns only the threshold bit . A malicious client additionally knows its own submitted record or query and may adapt its future actions based on the outputs it receives. No party learns the honest clients' records, the query values or selection vector of an honest querying client, or any intermediate equality-test or aggregation values. The sequence of insertion-validity bits and query-output bits constitutes the complete non-public leakage permitted by .
REMARK 2. Definition 1 characterizes the leakage of each query as exactly the threshold bit for the dataset state at that time. When the dataset changes between two queries of the same pair, an adversary can combine the two outputs to learn whether an intervening change moved the count across the threshold—information not obtainable from either query alone. This is an instance of the differencing/reconstruction phenomenon well known in the aggregate statistics literature (e.g. [9]), and is an inherent consequence of offering exact, deterministic query answers over a mutable dataset; it is not specific to and would apply to Prio-like schemes under a reactive dataset model. In fact, our construction leaks strictly less information by only revealing the result of the threshold test, rather than the exact sum. Mitigating this consequence further (e.g. via differentially-private noise addition, rate-limiting, or restricting repeat queries) is out of scope for this work, which targets exactness and cryptographic (not statistical/output) privacy.
7.2 Security Proof
We prove security in two stages. First, we show that a single query or insertion can be simulated using only the outputs specified by the ideal functionalities. We then extend this result to an arbitrary sequence of adaptive insertions and queries using a standard hybrid argument.
LEMMA 1 (SINGLE-ROUND PRIVACY). For any single query invocation, is computationally indistinguishable from an execution of ideal functionality against the adversary structure of Section 7.1.
PROOF. We now build an efficient simulator for and show it is indistinguishable from the real protocol. The protocol begins with a local secret XOR and secret multiplication. Since the XOR only incorporates local secrets, we argue that each share that any corrupted party sees is uniformly random and independent of the underlying secret. As such, the simulator simply samples shares uniformly at random. Then, the Beaver multiplication protocol securely realises the ideal multiplication functionality [2], so this step may be treated as a call to (defined in Section 1). As such, the simulator also samples uniformly at random for these outputs.
Similarly, the Boolean-to-arithmetic conversion protocol [1] securely realises , so the simulator can once again sample uniformly at random. For step 4, the simulator uses the ideal functionality (). Such a construction is proven to be secure by Lindell and Pinkas [23]. In the real protocol, the adversary learns if controlling server 1 and 2) if controlling server 2. For 1), the simulator outputs by calculating , and for 2), the simulator already knows . Thus, the output of the simulator preserves the mathematical relation.
To summarise, by the standard composition Lemma 2, and since Beaver's protocol securely realises [2], the share conversion protocol of Addanki et al. [1] securely realises , and semihonest Yao's protocol securely realises [23], the realises the ideal functionality and is indistinguishable from the real protocol.
COROLLARY 1 (INSERT PRIVACY). For any single insert invocation, is computationally indistinguishable from an execution of ideal functionality against the adversary structure of Section 7.1.
PROOF. The verification subroutine of invokes exactly the same machinery as steps 1-2 (secret sharing and Beaver multiplication) analysed in Lemma 1; by the identical argument, each share seen by a corrupted party is uniformly random and independent of the underlying secret, so the simulator samples these uniformly, treating Step 2 as a call to as before.
Unlike the query flow, the resulting comparison bit here is revealed in the clear directly between the two servers, rather than routed through a garbled circuit visible only to the client. Since one party's share of an additively/XOR-shared value is uniformly random and independent of the secret, the simulator samples a uniformly random share for the honest party's message and sets the corrupted party's share to be consistent with the known value of (obtained from ). By Lemma 2, composing this with the -hybrid argument for Steps 1-2 gives real-model security.
THEOREM 1 (REACTIVE -PRIVACY). satisfies reactive -privacy against the adversary defined in Section 7.1, i.e. is computationally indistinguishable from the ideal functionality .
PROOF. Let be the number of query/insert invocations in the run. Define hybrids , where simulates the first invocations and executes invocations as in the real protocol. The simulator maintains the same dataset state as the ideal functionality and processes each invocation in order. For each query it uses only the threshold bit returned by , while for each insertion it uses only the validity bit returned by .
Since each round's randomness (shares, Beaver/B2A pre-computation, GC garbling) is freshly and independently sampled, Lemma 1 gives for negligible , for each where denotes the advantage in distinguishing its inputs. By the triangle inequality, , which is negligible since is polynomial in the security parameter. Hence (fully simulated) and (fully real) are indistinguishable, as required.
7.3 Correctness
We establish the correctness based on the cryptographic building blocks.

Figure 2: Benchmarks for offline phase for INTERSECT, COUTHYBRID, and COUTFULL
THEOREM 2 (CORRECTNESS). For a dataset and query , outputs
to the querying client except with negligible probability.
PROOF. We prove correctness for honest servers when the dataset contains only valid records, i.e. are accepted by . We begin with the observation that an AND function on multiple inputs evaluates to 1 if and only if all inputs are 1, by definition. By the same logic, a bitstring evaluates to 1 when all its bits are multiplied together, if and only if all bits are set to 1. We also observe the commutative and associative property of , such that for vectors (or bitstrings) of equal length. Since Boolean shares are built from XORs , it is easy to verify that, for a secret-shared record and secret-shared query (test vector) , one can test for equality by taking the negation of the test vector and XORing the corresponding shares, . Therefore, it suffices to perform the equality test by performing distributed AND on the masked records, i.e. for server 1 and for server 2. Proof of correctness for distributed multiplication using Beaver Triples is found in Section B.
At the conclusion of the distributed multiplication protocol, each server has one one-bit share of the equality predicate per record. At this point, the servers would like to aggregate homomorphically, that is, where indicates addition in the field of . The equality bits must be converted from to an arithmetic field with , ensuring that the aggregate count does not wrap modulo . This is due to a classic observation popularised by [6]. Performing this conversion is a similar process to using Beaver Triples, and the proof of correctness can be found in Section C. Finally, the system concludes by having the servers
privately test whether their homomorphic aggregate shares will exceed the threshold when combined. This can be done straightforwardly with garbled circuits, a standard technique whose proof of correctness is omitted. Hence the output is equal to (recall ), except with negligible probability due to the underlying cryptographic primitives.
The addition of is purely semantic. In the view of the client, it is used to indicate whether a section of the query should be considered or not, which is equivalent to letting it always pass the ET for that section. By taking that result and XORing it by , mathematically speaking, this simply computes the truth value of whether the corresponding section of was not in the record. Paired with letting the client set to a subvector that is never in the record, this achieves the semantics required of the client above.
8 Implementation and Evaluation
The goal of the following section is to present and discuss the viability of the real system we have built. We aim to compare the main scheme based on ‘intersect’, the distributed AND function, with the alternative system that uses the equality testing protocol ‘Couteau’ [7] as well as the hybrid method (using the size-reducing routine within [7] followed by ‘intersect’ on the reduced strings) in both the offline and online phase. For the evaluation we call these INTERSECT, COUTFULL and COUTHYBRID respectively.
Implementation We implement the system in C and C++, using the Sodium library in C for random number generation, libOTe in C++ for OT extensions [14], and the emp-sh2pc library for the garbled circuit [15]. The implementation is available at https://anonymous.4open.science/r/privateintersect-F711/.
The implementation includes 3 programs: server 1, server 2, and the client. Communication is properly constructed using sockets such that all programs can be run from any machine and target any IP and port, and any number of clients can connect. We also implement the other variants of the protocol: COUTFULL, COUTHYBRID,

Online phase (96-bit)
Online phase for 100,000 records
Figure 3: Benchmarks for online phase for INTERSECT, COUTHYBRID, and COUTFULL
and INTERSECTMINUS which is the alternative scheme presented in Section 6.1 (for INTERSECT only). The implementation is optimised for space and can thus run queries of up to 10 million records and 128 bits of query length with just 8GB of RAM. We leverage space optimisations such as efficient data storage, array reuse, and performing the data-prep roles simultaneously inside .
We present benchmarks for 32-bit, 64-bit, and 96-bit queries for the 3 variants of ET in the offline phase (Figure 2) and online phase (Figure 3) – showing how efficiency scales with the number of records that are computed over in the dataset. We include an additional plot that shows how efficiency scales with bitlength for a fixed number of records.
Hardware We tested our system on Linux Debian 12 using 2 OpenNebula VMs that are on physically separate machines. Both machines possess an Intel(R) Xeon(R) Silver 4316 CPU@2.3GHz, while the VMs ran at 2.2GHz. Machine 1 ran server 1 and the benchmarks and Machine 2 ran server 2 and a client. As such, the client did not benefit from being locally connected to server 2. Although the setup exhibited low latency < 1ms, we did not leverage any special data-centre optimisations. CPU cycles were measured using the hardware performance counter
perf stat -e cycles -p <IDs>
where IDs is the list of threads that do computation (i.e. excludes socket listener thread).
How to Read the Data Online cost is measured in wall-clock time. That is, the realistic time for the measured code to complete. We use this metric because much of the cost comes from round trip latency. One can estimate the response time for a high latency setup by multiplying the number of round trips for a certain query (see Section E) by the given latency and adding it to the corresponding data point.
Offline cost is measured in CPU cycles per server. We use this metric due to the facts that 1) computational cost dominates and 2) pre-computation is infinitely parallelisable up to the granularity of 1 Beaver triple (or equivalent for Couteau ET) – we can achieve practically any completion time for a given query using sufficient numbers of Beaver-Triple servers to pre-generate enough Beaver triples for the observed query volume. To estimate the CPU time for a data point, we can simply divide by the clock speed of the CPU. For the sake of comparison, we include Figure 4 in Section D which shows plots for offline phase in wall-clock time and online phase in CPU cycles.
Client Cost Clients suffer little cost, as they are required only to generate shares of their data for and for , for the 2 servers . The client must compute a single 1-bit XOR at the end of .
Online Server Costs Figure 3 shows online query latency as the database size up to records. At records for , the complete online query requires , and of computation for COUTHYBRID, COUTFULL and INTERSECT respectively. Increasing from 1,000,000 to 10,000,000 increases latency time by , consistent with the complexity of the construction. Our results show our INTERSECT protocol dominate in the online phase. We observe that the performance gap of INTERSECT initially is more performant when the bitlength is 32, but gives way to COUTHYBRID and COUTFULL at approximately , which is consistent with the fact that [7] is a recursive, logarithmic shrinking function.
Offline Server Costs For records and , preprocessing requires Boolean multiplications. In our implementation, this corresponds to cycles for all COUTHYBRID, COUTFULL and INTERSECT. This increases to cycles when , again consistent with the complexity of the construction. As with the online phase, we observe that the performance gap of INTERSECT decreases marginally as the bitlength increases. We conclude that INTERSECT is overall superior for realistic bitlengths used in our targeted context, but note that the COUTFULL approach could be desirable in the case of very large bitlengths.
Cost Results for can be found by taking the lowest data point on its line, since all the verification is doing is the main protocol on only 1 client.
8.1 System Goals Assessment
In this section we revisit the system goals from Section 4 and assess whether they have been satisfied.
Robustness Recall that the system is robust if an adversary cannot corrupt the system any more than misreporting their information. An adversary often achieves this goal in private systems that use an arithmetic secret-sharing scheme, since the servers cannot trivially verify the validity of the submission without breaking the privacy of the user. Such systems must then use rather complex techniques to maintain robustness. On the contrary, Prio+ [1] and indeed this work enjoy the benefit of using a Boolean secret-sharing scheme. That is, each attribute has a pre-defined length. The servers can then reject any submissions that deviate from the expected length. Note that this means that the range of values is only enforceable upon powers of 2. Since the submission is the only point the client can influence the server, the robustness argument is complete.
Scalability We now assess scalability by considering the limit of what could be considered a reasonable cost for offline and online phase. Let us consider an example scenario of a medium-sized dataset of 1,000,000 records and a moderate 64-bit query. The example setup has 4 pairs of pre-computation servers, working at 4.5GHz. Then, our results show an offline phase of 1.8 seconds and an online phase of 0.38 seconds. If the pairs of servers have 50ms latency between them, the online phase would still only be 0.38+ ( seconds.
Offline Despite being a very restrictive constraint, the offline property comes simply from the fact that data is fetched from a database stored by the servers rather than the users, which clearly does not require the users to be online.
8.2 Adequacy of Bitlength
In this section, we analyse the bitlength required for realistic queries. The appropriate bitlength depends on the number and granularity of attributes: values should be sufficiently fine-grained to capture meaningful differences between individuals, while avoiding unnecessary domain sizes. For example, age may be represented in 10-year buckets rather than individual years when this better reflects the information available to an adversary. Excessive generalisation, however, reduces the usefulness of the resulting uniqueness estimates. Thus, bitlength is ultimately a semantic design choice determined by the intended linkage-attack model.
There is no clear empirical basis for determining a universally appropriate bitlength; existing work on characterising individuals typically uses more sophisticated, AI-based similarity measures rather than discrete attributes. We therefore consider two representative case studies.
In the work of [17], Jangra et al. extract 19 PII-revealing attributes to study user oversharing on Reddit. Each attribute varies greatly in the number of values, ranging from just 2 for 'gender' and thousands for 'location'. We estimate (through communication with the authors) an average of roughly values per attribute for a total of 133 bits. [29] on the other hand characterise Reddit users with
only 5 attributes, using binary predicates (1 bit) for gender and family status, 90 values of age (7 bits), 832 values for profession (10 bits) and 336 values for hobby (9 bits), for a total of 28 bits. The authors also discuss levels of generalisation for profession and hobbies and perform analysis on the correlation between attributes by generalising profession to only 30 values (5 bits), suggesting that the total bits required could be reasonably reduced to just 19 bits (even fewer if generalising age into buckets).
Ultimately, the choice of maximum query bitlength is a balance between usefulness and efficiency. We believe that the case studies combined with the performance analysis suggest that a bitlength of 16, 32, 64 or 128 are all strong choices, and the optimal of these will depend on the number of records in the dataset as well as more nuanced implementation requirements.
9 Discussion and Future Work
Despite continued incremental advances, the overhead of privacy-enhancing technologies may limit their adoption in large-scale platforms, where efficiency and scalability are critical requirements. In the absence of substantial advances or stronger incentives for privacy-preserving data practices, highly efficient solutions may therefore be more likely to see widespread deployment.
In our context, the system goal of 'offline users' proved challenging for this work, as it excludes many successful lines of work, such as Verifiable Distributed Aggregation Functions (VDAFs) [8] and sketching [5, 21, 22] protocols. In particular, we are not aware of any works in the field of PPM which explore the property of offline clients.
Nonetheless, our results suggest show that the overhead of the proposed system is considerably less restrictive for smaller-scale applications, where the flexibility of supporting arbitrary post-hoc queries may offer a more attractive trade-off. Our future work will focus on further improving performance; for instance, leveraging intermediate values for new computations without needing to begin from scratch. An important limitation of this work is the need to compute from scratch for every new query when using the base scheme. This could be mitigated with a caching system and would provide meaningful efficiency improvements.
9.1 Conclusion
We presented , a privacy-preserving vulnerability testing system that allows a client to privately determine whether their data is sufficiently rare to pose a data-linkage risk. The key challenge is supporting arbitrary, post-hoc queries while allowing clients to be offline after contributing their data. We address this using secret-shared database records and a two-server computation that reveals only the threshold predicate, providing reactive -privacy against a semi-honest server and malicious clients.
We introduced two constructions that trade query-structure privacy for efficiency, and showed how Beaver-triple preprocessing, parallelised multiplication, and alternative equality-testing techniques reduce the cost of the full construction. We introduced a dynamic notion of security, reactive -privacy, and proved that our construction meets based on the ideal functionality of its building blocks. Our implementation demonstrates that the approach scales to datasets of up to 1 million records while retaining practical online query latency, with further parallelism available for the offline phase.
More broadly, this work demonstrates that private vulnerability testing can be performed without requiring users to remain online or disclose their query or exact population count. We view the resulting system as a foundation for more efficient privacy-preserving testing of data-linkage risks, particularly in settings where the flexibility of post-hoc queries and the ability to support offline users are important.
References
[1] Surya Addanki, Kevin Garbe, Eli Jaffe, Rafael Ostrovsky, and Antigoni Polychroniadou. 2022. Prio+: Privacy preserving aggregate statistics via boolean shares. In International Conference on Security and Cryptography for Networks. springer, Cham, 516–539.
[2] Donald Beaver. 1992. Efficient Multiparty Protocols Using Circuit Randomization. In Advances in Cryptology — CRYPTO '91, Joan Feigenbaum (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 420–432.
[3] Andrea Bittau, Ulfar Erlingsson, Petros Maniatis, Ilya Mironov, Ananth Raghunathan, David Lie, Mitch Rudominer, Usharas Code, Julien Tines, and Bernhard Seefeld. 2017. Procho: Strong privacy for analytics in the crowd. In Proceedings of the 26th symposium on operating systems principles. 441–459.
[4] Ran Canetti. 2000. Security and composition of multipartity cryptographic protocols. Journal of CRYPTOLOGY 13, 1 (2000), 143–202.
[5] Graham Cormode and S. Muthukrishnan. 2005. An improved data stream summary: the count-min sketch and its applications. Journal of Algorithms 55, 1 (2005), 58–75. https://doi.org/10.1016/j.jalgor.2003.12.001
[6] Henry Corrigan-Gibbs and Dan Boneh. 2017. Prio: Private, Robust, and Scalable Computation of Aggregate Statistics. In 14th USENIX Symposium on Networked Systems Design and Implementation (NSDI 17). USENIX Association, Boston, MA, 259–282. https://www.usenix.org/conference/nsdi17/technical-sessions/presentation/corrigan-gibbs
[7] Geoffroy Couteau. 2018. New Protocols for Secure Equality Test and Comparison. In Applied Cryptography and Network Security, Bart Preneel and Frederik Vercauteren (Eds.). Springer International Publishing, Cham, 303–320.
[8] Hannah Davis, Christopher Patton, Mike Rosulek, and Philipp Schoppmann. 2023. Verifiable Distributed Aggregation Functions. Cryptology ePrint Archive, Paper 2023/130. https://eprint.iacr.org/2023/130
[9] Irit Dinur and Kobbi Nissim. 2003. Revealing information while preserving privacy. In Proceedings of the Twenty-Second ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (San Diego, California) (PODS '03). Association for Computing Machinery, New York, NY, USA, 202–210. https://doi.org/10.1145/773153.773173
[10] Cynthia Dwork. 2006. Differential Privacy. In Automata, Languages and Programming, Michele Bugliesi, Bart Preneel, Vladimir Sassone, and Ingo Wegener (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 1–12.
[11] Cynthia Dwork, Guy N. Rothblum, and Salil Vadhan. 2010. Boosting and Differential Privacy. In 2010 IEEE 51st Annual Symposium on Foundations of Computer Science. IEEE, Las Vegas, NV, USA, 51–60. https://doi.org/10.1109/FOCS.2010.12
[12] Edy Susilo, Muhammad, Prayudi, Prayudi, and Yanu Florestiyanto, Mangaras. 2025. Oversharing Behavior in Gen Z on Social Media. SHS Web Conf. 212 (2025), 04022. https://doi.org/10.1051/shsconf/202521204022
[13] Ulfar Erlingsson, Vasyl Pihur, and Aleksandra Korolova. 2014. Rappor: Randomized aggregatable privacy-preserving ordinal response. In Proceedings of the 2014 ACM SIGSAC conference on computer and communications security. 1054–1067.
[14] Peter Rindal et al. 2024. A fast and portable C++20 library for Oblivious Transfer extension. https://github.com/osu-crypto/libOTe/tree/master. Accessed: 2026-08-23.
[15] Xiao Wang et al. 2026. Efficient Multi-Party computation toolkit. https://github.com/emp-toolkit/emp-sh2pc. Accessed: 2026-08-23.
[16] Yuval Ishai, Joe Kilian, Kobbi Nissim, and Erez Petrank. 2003. Extending Oblivious Transfers Efficiently. In Advances in Cryptology - CRYPTO 2003, Dan Boneh (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 145–161.
[17] Shalini Jangra, Suparna De, Nishanth Sastry, and Saeed Fadaei. 2025. Protecting Vulnerable Voices: Synthetic Dataset Generation for Self-Disclosure Detection. In International Conference on Advances in Social Networks Analysis and Mining. Springer, 3–18.
[18] Christian Knabenhans, Alexander Viand, Antonio Merino-Gallardo, and Anwar Hithnawi. 2024. vFHE: Verifiable Fully Homomorphic Encryption. In Proceedings of the 12th Workshop on Encrypted Computing & Applied Homomorphic Cryptography (Salt Lake City, UT, USA) (WAHC '24). Association for Computing Machinery, New York, NY, USA, 11–22. https://doi.org/10.1145/3689945.3694806
[19] Mukesh Kumar, Monika Sethi, Shalli Rani, Dipak Kumar Sah, Salman A. AlQah-tani, and Mabrook S. Al-Rakhami. 2023. Secure Data Aggregation Based on End-to-End Homomorphic Encryption in IoT-Based Wireless Sensor Networks. Sensors 23, 13, Article 6181 (2023), 17 pages. https://doi.org/10.3390/s23136181
[20] Xing Li, Dexin Chen, Chunyan Li, and Liangmin Wang. 2015. Secure Data Aggregation with Fully Homomorphic Encryption in Large-Scale Wireless Sensor Networks. Sensors 15, 7 (2015), 15952–15973. https://doi.org/10.3390/s150715952
[21] Ying Li, Xiaodong Lee, Botao Peng, Themis Palpanas, and Jingan Xue. 2023. PrivS-ketch: A Private Sketch-Based Frequency Estimation Protocol for Data Streams. In Database and Expert Systems Applications, Christine Strauss, Toshiyuki Amagasa, Gabriele Kotsis, A. Min Tjoa, and Ismail Khalil (Eds.). Springer Nature Switzerland, Cham, 147–163.
[22] Ying Li, Xiaodong Lee, Botao Peng, Themis Palpanas, and Jingan Xue. 2024. Streaming Data Collection With a Private Sketch-Based Protocol. IEEE Internet of Things Journal 11, 15 (2024), 25950–25967. https://doi.org/10.1109/IJT.2024.3397908
[23] Yehuda Lindell and Benny Pinkas. 2009. A proof of security of Yao's protocol for two-party computation. Journal of cryptology 22, 2 (2009), 161–188.
[24] Arvind Narayanan and Vitaly Shmatikov. 2008. Robust De-anonymization of Large Sparse Datasets. In 2008 IEEE Symposium on Security and Privacy. IEEE, Oakland, CA, USA, 111–125. https://doi.org/10.1109/SP.2008.13
[25] Vijay Pandurangan. 2014. On Taxis and Rainbows: Lessons from NYC's improperly anonymized taxi logs. https://medium.com/vijay-pandurangan/of-taxis-and-rainbows-f6bc289679a1. Accessed: 2025-10-01.
[26] Reza Shabahang, Hyejin Shim, Mara S. Aruguate, and Ágnes Zsila. 2024. Oversharing on Social Media: Anxiety, Attention-Seeking, and Social Media Addiction Predict the Breadth and Depth of Sharing. Psychological Reports 127, 2 (2024), 513–530. https://doi.org/10.1177/00332941221122861arXiv:https://doi.org/10.1177/00332941221122861 PMID: 35993372.
[27] Elaine Shi, T-H. Hubert Chan, Eleanor Rieffel, Richard Chow, and Dawn Song. 2011. Privacy-preserving aggregation of time-series data. In Annual Network & Distributed System Security Symposium (NDSS). Internet Society, San Diego, CA, USA, 17 pages.
[28] Peter Story, Daniel Smullen, Yaxing Yao, Alessandro Acquisti, Lorrie Cranor, Norman Sadeh, and Florian Schaub. 2021. Awareness, Adoption, and Misconceptions of Web Privacy Tools. Proceedings on Privacy Enhancing Technologies 2021 (04 2021), 308–333. https://doi.org/10.2478/popets-2021-0049
[29] Anna Tignunova, Paramita Mirza, Andrew Yates, and Gerhard Weikum. 2020. RedDust: a Large Reusable Dataset of Reddit User Traits. In Proceedings of the Twelfth Language Resources and Evaluation Conference. European Language Resources Association, Marseille, France, 6118–6126. https://aclanthology.org/2020.lrec-1.75/1
A Full Protocol Description
A.1
consists of 5 parts. , , [1], , which together form , then additionally . We present the pseudocode for each sequentially, excluding .
A.2
The main variant of the scheme follows the same pattern as , reusing exactly the same GC, B2A, and Data-Prep protocols.
B Beaver Triples [2]
B.1 Beaver-triple Generation
Beaver triples can be generated with oblivious transfers. To generate a triple in with two servers, both servers start by randomly sampling . The servers wish to calculate such that and . Server 1 chooses a random bit and acts as the sender of an OT with input . Server 2 selects with , and thus learns . This process is then repeated in the opposite direction, such that server learns . Server 1 calculates and server 2 calculates , and it is easily seen that:
Algorithm 1
1: Input: dataset structure , dataset share per server , client query share per server , algorithm choice , bank of Beaver triples
2: Output: prepped data
3: for all do
4:
5: for do
6: if then
7:
8: if then
9:
10: end if
11:
12: end if
13: end for
14: end for
15: return
Recalling that XOR-ing is equivalent to addition in :
and hence . It is also possible to extend these triples to larger fields by using oblivious linear evaluation.
B.2 Beaver-triple Evaluation
Each server starts with , and , and wishes to calculate such that . Server begins by calculating and . The servers publish their shares of and such that they are known in the clear, which is safe information to share, due to the randomness at which the Beaver triple was calculated. Then, is evaluated as . Correctness is easily verified:
As an intuition, this approach relies on the random Beaver triple to hide the cross products and , meanwhile the triple itself is eliminated in the calculation of .
C B2A Conversion [1]
daBit Generation. To generate a daBit share where is a Boolean share and is an arithmetic share in the field , the servers perform the following protocol, taken directly from [1]:
Algorithm 2
1: Input: data shares per server , query bitlength , choice of algorithm , bank of Beaver triples
2: Output: share of equality test results per server per record
3: if
4: Employ Private ET scheme detailed in [7]
5: else if
6: Employ Private ET scheme detailed in [7] but replace 'product-sharing' function with on the size-reduced strings
7: else
8:
9:
10:
11: for do
12:
13:
14:
15:
16: for do
17:
18:
19: for all do
20:
21:
22:
23:
24:
25: end for
26: end for
27:
28: Servers publish D and E shares
29: for do
30:
31:
32: for all do
33:
34:
35:
36:
37:
38: end for
39: end for
40: end for
41: for all do
42:
43: end for
44: return
45: end if

Figure 4: Additional benchmarks showing online and offline phases in alternative metrics
Algorithm 3
1: Input: Arithmetic share , Bob's secret bit , public threshold , public field
2:
3: if then
4:
5: else
6:
7: end if
8: if then
9:
10: else
11:
12: end if
13: if Party = Alice then
14: return
15: else
16: return
17: end if
Algorithm 4
Input: Share of submitted record ,
Output: Updated dataset per server
return
(1) Both servers sample a random bit . Server 1 samples a random integer
(2) Server 1 acts as the OT sender, sending , and sets
(3) Server 2 acts as the OT receiver, using as the choice bit, receiving
(4) Both servers set and .
daBit Consumption. To convert a bit to an arithmetic share, the servers perform the following protocol:
(1) Both servers compute
(2) Both servers publish their shares
(3) Both servers calculate as
(4) Server 1 outputs , and server 2 outputs .
D Further Benchmarks
We include benchmarks for offline phase in wall=clock time and online phase in CPU cycles for the reader who wishes to compare the cost of the phases in the same metric. This can be seen in figure Figure 4. We stress that the metrics for the corresponding phase is not ideal — in solidarity, it paints the online phase in a better light than it should be due to the disregard of communication time and the offline phases in a worse light since it has not been parallelised and the clock speed used in the benchmark is relatively low.
E Round Trip Derivations
E.1
Our first problem is to consider how many round trips are required for an algorithm optimised for round trips on the protocol . When performing the real protocol, communication is required every time we evaluate a multiplication. Fortunately,
Algorithm 5
1: Input: data shares per server , attribute bitlengths , query bitlength , pos, the index where subvector starts, , choice of algorithm , bank of Beaver triples and , the number of records
2: Output: share of equality test results per server per record
3: if " then
4: Employ Private ET scheme detailed in [7]
5: else if " then
6: Employ Private ET scheme detailed in [7] but replace 'product-sharing' function with on the size-reduced strings,
7: else
8:
9:
10:
11: , let behave as a stack
12:
13: while do
14:
15:
16: for do
17: if then
18: for all do
19: Push to stack
20: Push to stack
21:
22: end for
23: else
24:
25:
26:
27:
28: for do
29:
30:
31: for all do
32:
33:
34:
35:
36:
37: end for
38: end for
39: end if
40: end for
41: while do
42: for all do
43:
44:
45:
46:
47:
48:
49: end for
50: end while
▷ if a subvector has been fully evaluated, bring it to the next stage
▷ , the number of pairs
▷ , the spacing between the bits
▷ multiplication setup on stage 1 bits
▷ multiplication setup on stage 2 bits i.e. been XORed with q
51: 52: 53: 54: Servers publish D and E shares 55: for do 56: for do 57: 58: 59: for all do 60: 61: 62: 63: 64: 65: end for 66: end for 67: end for 68: for do 69: for all do 70: 71: 72: Push to 73: Push to 74: 75: end for 76: end for 77: 78: end while 79: return 80: end if
Algorithm 6
1: Input: Share of submitted record , 2: Output: Updated dataset per server if and only if no subvector contains the vector of all 1s 3: for do 4: Compute but with subvector instead of . Set and . 5: Servers publish values 6: if then 7: return 8: end if 9: end for 10: 11: return
we can do this in parallel. It is thus sufficient to say that a round trip (henceforth, a 'round') is required every time the input of the distributed multiplication function (2 fan-in, 1 fan-out) is an output of the function from the same round.
The problem can now be viewed as a recursive size-reducing protocol, where at every round, we take as many pairs of bits as possible and input them to the function (which can now be regarded as a black box) such that we get 1 bit output for every pair. This clearly forms a binary tree, where we merge nodes as early as
possible. Thus, it intuitively follows that the number of round trips for is .
E.2
We now add the constraint that a subvector is to be fully evaluated (only 1 bit remains) before it can be input into the function. A naive approach is to evaluate all subvectors ( rounds) before combining the remaining bits (1 bit per attribute, rounds for attributes), to get . An optimal scheduler can, however, do better by evaluating pairs that are ready (from fully evaluated subvectors) while larger subvectors are still merging.
To tackle this problem, we distinguish 2 different 'views'. is the straightforward view of the binary tree that merges inputs until only the root remains. is then an auxiliary binary tree used to analyse the optimal round count. In the new view, the leaves of the tree are the number of rounds required to fully evaluate each subvector, . We continue building the new view binary tree by merging nodes according to the function for parents and . Our optimisation problem is the min-max problem of minimising , where is the distance from the node to the root. If we require that each leaf node be at the lowest depth before it is merged, enumerates a prefix code (since no node has exactly one child), and thus leverages the Kraft-McMillan theorem which asserts that a uniquely decodable code and a prefix code exists for a given set of codeword lengths if and only if their lengths satisfy , for a binary alphabet and codeword lengths . We arrive at the optimal round count using the following derivations:
(1) Let be the depth of the tree in and the codeword length is the distance between leaf and the root of the tree. It follows that , and thus for any . We use the Kraft inequality to arrive at the lower bound. Letting , we have
which shows that any valid satisfies .
(2) Since every follows this bound, and since and the optimal distance are integers, it follows that .
(3) The Kraft-McMillan theorem asserts that, given a set of non-negative integers satisfying the Kraft inequality, there exists a feasible tree with depths . We propose that a tree exists that has leaves , for all possible . The leaves are guaranteed to be non-negative since . Checking the Kraft inequality, we have , which holds because . Therefore, the optimal distance must follow .
(4) Since and , it follows that .
We now evaluate . Firstly, every scheduler has , therefore . Secondly, the explicit construction is a valid schedule since it satisfies the Kraft-McMillan theorem, and the finishing round is exactly . It follows that . Since and , it follows that , and finally, .
We informally argue that the optimal scheduler greedily merges nodes with the lowest 2 values - intuitively, merging with higher values can only perform worse, since the combining function takes the maximum.
E.3 Bound of Additional Cost
We now prove that . Since , is the smallest integer such that . It also follows that . Combining this with entails . Summing over all subvectors, we get . Since , it follows that .
(1) Since , it follows that , and thus .
(2) Since , it follows that , and thus .
We therefore have that .
F Data Poisoning Attacks
Our correctness, robustness and security properties demonstrate that our system correctly computes the threshold function with the data provided, does not reveal additional information than the query itself, and does not permit users to impact the system more than misreporting their own data. Although the scoping of these properties is in-line with the norm for similar works, the properties should not be considered as all-encompassing. For example, our system guarantees that not more information than the result of the query is leaked, but does not guarantee that the output itself retains privacy in a more generic sense. In this section, we discuss some of the avenues of attack that are not (and should not be) in scope of the above properties. We consider a data poisoning attack to be successful if it causes a user's population to be deemed safe when it is not so in the real population (population excluding poisoned data).
F.1 Junk Poisoning
One trivial attack is to flood the database with random data. As with any data aggregation, the result is only as useful as the data itself. As the dataset gets flooded with junk, a given population with low count will approach the count expected from a random dataset, which may push the count to exceed the threshold. The probability that a randomly generated record increments the count of a query is mathematically negligible in the number of attributes. Moreover, the count needs to increment up to times, while the threshold should scale with the size of the dataset. Even for small queries, an attacker must launch a large number of queries to succeed in their attack. We leave mitigation of this attack to the software level, which may be done through traffic analysis.
F.2 User Attack
We consider an adversary who wishes to cause a targeted user to erroneously be told that their population is safe. We observe that do this effectively, the attacker must already know the populations to which the user belongs. An adversary with this information can succeed in their attack by sending many duplicate queries. This can be mitigated as before with packet analysis. Additionally, an implementation could easily test whether several entries are equal to each other by accumulating a safe amount of entries (say, 100) and performing checks to test for equality. The servers can drop the buffer if there is a suspicious number of equal entries. To test for equalities, the servers go through each entry in the buffer and count how many entries are equal to that entry by using the record itself as the test vector and the threshold sensibly chosen.
Despite these and other possible mitigations, it would be very difficult to entirely stop this type of attack without requiring authentication, which would be too inconvenient for users in the targeted use case. Any data the adversary does not know increases the complexity exponentially, as with junk poisoning. Since our system is intended to be an informative tool for moderately concerned individuals (rather than high-level targets) then an attacker does not have much to gain and we do not expect a high complexity from the adversary. Additionally, the requirement to know a large part of the victim's data reduces the number of viable attackers further. As such, we choose to accept this vulnerability.
F.3 Attribute Attack
We consider an adversary that wishes to corrupt a specific attribute/value. For a targeted value attack, We repeat the same argument as for junk poisoning, except the adversary uses a constant value for one attribute which reduces the complexity exponent by 1 (still exponential). For a targeted attribute attack, the attacker must use every combination of values, which is equivalent to the junk poisoning attack.
G Probabilistic Optimisation with Parity Samples
We can adjust our protocol such that its computational complexity is negligible in the bitlength. In order to do so, we must move to a probabilistic scheme. More specifically, we use random parity samples to give us a scheme that achieves arbitrary accuracy or bitlength complexity. A complexity of gives a false positive rate (with 0% false negative and perfect soundness).
The scheme works by calculating the distributed OR over the output of parity checks. For each parity check, the servers check the parity of a randomly generated list of indices, which can be publicly generated from a PRNG. If the two strings are the same, the parity will always match. If not, there is a 50% chance that the parity matches. If the servers perform many samples, they can compute the distributed OR function over the outputs and conclude that the strings match with confidence if all parity checks are equal or conclude they do not match if any of the checks are not equal. Distributed OR can be performed simply by negating the inputs and outputs of the distributed AND function.
To highlight its effectiveness, consider the following example. For a query of very large bitlength (say, 2048), we could accept a false positive rate of to drastically reduce the computational complexity. The servers must perform many local XORs, but these are cheap and the benefit is that the servers would expend as much pre-computation (Beaver triples). For a dataset of 1m clients where 10 of the records actually match, the probabilistic scheme would output matches on average.
H Query Expressiveness
Our protocol can efficiently answer a wide range of queries. We informally argue functional completeness for our queries. In particular, functional completeness means that our main protocol
can answer a query that is built using any combination of AND, OR, or NOT. In its simplest form, a query is a finite sequence of attribute constraints in conjunctive normal form, using only OR, AND and NOT. Any bracketed parts of the expression can be brought to their simplified equivalent using basic logic algebra, e.g. .
In general, each OR costs an additional query to the dataset, while AND and NOT are free.
H.1 AND
The AND operator between two values within different attributes is the main focus in this paper and has been described at length. In particular, we show proof of correctness in Section 7.3. By construction, an attribute cannot have more than one value, so querying AND between two values within the same attribute is nonsensical.
H.2 NOT
The clever construction of already enables a NOT operator. The value of dictates whether to negate the result of the equality test for a certain attribute, i.e. it tests whether the test vector does not equal the corresponding subvector in the dataset. We thus allow the requesting client to arbitrarily 'disregard' attributes by setting to 1 and to the vector of all . This computes exactly NOT(), which is equivalent to the union of all other values in that attribute. Since no attribute has the vector of all , this always returns true from the equality test, enabling the main functionality of the protocol. A client can then achieve arbitrary NOT by simply choosing and letting .
H.3 OR
A straightforward way to achieve OR between two values within the same attribute is to simply add the count of two queries together. For example, we could evaluate as for attribute , values , and the arbitrary remaining part of the query . This requires computing over all the data twice (+100% overhead). Note that the count shares are summed locally before the GC. The finite field size must be doubled, but the GC remains the same.
Note that a much faster construction exists for , which requires leaking which attributes contain an OR operator in the query. The construction entails performing the ET over every value in the conjunction and simply summing locally the shares of the results. Since a maximum of only 1 value can 'pass', the real sum does not overflow the modulus (2). The resulting construction then has an overhead equal to the cost of computing the additional ETs.
To compute OR between two values within different attributes (for either protocol variant), the client can take the difference between the query with those attribute disregarded and the query that includes the disjunction of each negated attribute. In other words, for , can be computed as \text{count}(\{\Gamma\}) - \text{count}(\{\mathcal{A}_1 \neq A_1 \land \mathcal{A}_2 \neq A_2\} \land \Gamma\). Again, this has a +100% overhead.
I Security of building blocks
Ideal Functionality.
DEFINITION 4. (). The two-party ideal functionality behaves as follows:
-
receives secret shares from server
-
computes
-
returns a fresh random sharing to server
DEFINITION 5. (). The two-party ideal functionality for for Boolean inputs and outputs in the public field behaves as follows:
-
receives secret shares and pre-computation shares from server
-
computes where
-
returns to server (where is an arithmetic share of )
DEFINITION 6. (). The two-party ideal functionality parametrised by public field size FF and public threshold behaves as follows:
-
receives from and from
-
computes (as per the circuit defined in Section A.1)
-
returns the bit to the garbler, server 1
LEMMA 2 (SEQUENTIAL COMPOSITION, SEMI-HONEST [4]). Let be a protocol that invokes ideal functionalities as subroutines and suppose securely computes in the -hybrid model against the adversary structure of Definition 1. Suppose further that each is securely realized, against the same adversary structure, by a real-world sub-protocol . Then the composed protocol , obtained by replacing each ideal call to with an execution of , securely computes in the real model.
J Example Use Case
Suppose we have a user who wishes to query whether the population of people who are heterosexual women aged 30-40 is vulnerable (i.e. whether the count exceeds the threshold) and creates the query as before. The client will choose 2 random shares that XOR to , e.g. , and sends each to the corresponding server. Server 2 additionally negates , and the servers apply the bitmask to each record in the database (taking only the relevant attributes). If we suppose there is a record in the database whose data in the clear would be the same as but with different shares, e.g. and we can apply the bitmasks and to obtain and and observe that the recombination of these values is the vector of all 1s, i.e. , and thus, clearly, equals the vector of all 1s if and only if . After masking the data, the servers then utilise the secret multiplication protocol to compute the AND function of the vector (which is not visible in the clear), which should output 1, as we have a match. In more detail, the normal multiplication function that takes 2 parameters is related to a distributed multiplication protocol in the following way: .
Therefore, to test whether , we perform the following calculation (simplified to
the first 4 bits):
The equality test requires the product of all masked bits. These multiplications can be arranged as either a sequential chain or a balanced tree. The former minimises the number of intermediate values but requires sequential communication rounds, whereas the latter evaluates independent products in parallel and requires only rounds. This choice illustrates the trade-off; we use the balanced ordering in our implementation to minimise online latency.
K Open Science
The implemented code can be found publicly at https://anonymous.4open.science/r/privateintersect-F711/. A list of dependencies and installation instructions can be found in the readme.
L Ethics
This work does not involve human subjects, collection of personal data, or experiments involving individual users. All date used to evaluate our protocol was synthetically created.
The proposed system is intended to reduce privacy risks arising from the combination of attributes across a population by allowing threshold queries to be evaluated without revealing individual records or the queried attributes to the servers. The capability could nevertheless be used to investigate sensitive populations, and therefore has potential for misuse. Our construction does not eliminate this risk: in particular, a querying client learns the threshold outcome for its chosen query and may issue multiple queries. We therefore explicitly model the information revealed by such queries through the ideal functionality and reactive -privacy. Practical deployments should additionally consider appropriate authorisation, query-rate limits, and governance to prevent systematic abuse of the functionality.