Score:3

Practical implementations of Private Set Membership

cn flag

Problem Statement

Imagine you have a set (no duplicate elements) e.g. S1 = {'a', 'b', 'c'}.

You wish to share a private (and ideally both small in size and integrity protected) representation of this set with another party (who could have pre-shared keys with you) where they can verify (yes or no) if some element of their choice e.g. 'b' is a part of the set S1.

What is the most simple combination of cryptographic primitives that you can use to solve this?

Directions so far

It would seem that hashing the set would be ideal (as opposed to simply encrypting) due to the size constraints.

If we wish to do opaque membership checks some sort of homomorphic encryption is likely needed.

I've read up on Private-Set-Intersection and Private-Set-Membership, however the implementations I found are not minimal and have other "kitchen-sink" functionality that is not desirable.

Some reading so far

knaccc avatar
es flag
An easy-to-implement method is to use EC El Gamal and "scalaring" as described in sections 2.1 and 3 in this paper https://eprint.iacr.org/2005/043.pdf (Just look at the private set intersection parts and ignore the 0/1-encoding parts)
Score:3
us flag

You just need an oblivious PRF. Alice computes and sends $F_k(x)$ for all $x \in S$, where $F$ is a PRF. Alice and Bob use an OPRF protocol to let Bob learn $F_k(y)$ for a value $y$ of his choice. If $y \in S$ then Bob will see a match with the values sent by Alice. If $y \not\in S$ then the pseudorandomness of $F$ implies that $\{ F_k(x) \mid x \in S \}$ all look random even given $F_k(y)$. In other words, these values leak nothing about the specific values of $x$ in $S$.

There is a simple semi-honest OPRF protocol for the PRF $F_k(x) = H(x)^k$, where $H$ is a random oracle. It works like this:

  • Bob chooses random $r$ and sends $Y = H(y)^r$ to Alice.
  • Alice sends $Z = Y^k = H(y)^{rk}$ to Bob.
  • Bob computes output $Z^{1/r} = H(y)^k = F_k(y)$.

Malicious-secure OPRFs are not much more expensive. You can find a few here and here.

cn flag
Thanks, I will go read up on this. One immediate question (before reading more) is whether a PRF constructed from elgammal will meet preimage length information leakage constraint? e.g. Think SHA is constant size output, but my understanding of elgammal is it will be a based upon the input size? I don't actually need this property for security here but do want the constant size.
cn flag
A second question about this, is there some precompute option for `bob` such that it can be done in only 2 steps?
us flag
Regarding question 1: If $F$ is a PRF and $H$ is collision-resistant, then $F(H(x))$ is also a PRF. So just hash first. Regarding question 2: the OPRF protocol is just one message sent in each direction, so it can't be any better in terms of round complexity (unless I misunderstand the question).
Score:0
nc flag

This is something I've been working on.

I would like "small" below to be much smaller than what follows. But this would work for your purposes for a set of binary strings $S$, cryptographic hash $H(x)$, and pre-shared key $k$.

$H(S)=\text{sort} \{H(x) | x \in S\}$. Call this the public witness for $S$. You can hide the size of the set by including random hashes to a given length modulus. This would be a public witness with no integrity, but gives the basic idea.

Assuming the size of $x$ is generally much larger than $H(x)$, the representation of the witness $H(S)$ for $S$ is small compared to the representation for $S$.

If you want to restrict this to those with a pre-shared symmetric key k: (I use $+$ for append to distinguish from the set "such that")

$H^2(k+S)=\text{sort} \{H(k+H(k+x)) | x \in S\}$. Append a keyed-checksum for an integrity check.

$\text{witness for S}: H^2(k+S) + H(k+H^2(k+S))$

Again, to hide the size of $S$ you could always add random hashes to a max size or (imperfectly) to a size modulus.

Checking for membership: send $(n,H(k+n) \bigoplus H(k+x))$ where $n$ is an incrementing number (it may be implied such as a timestamp). The recipient can uncover $H(k+x)$ and then compute $H(k+H(k+x))$ to see if it is in the witness set.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.