1
$\begingroup$

Suppose I have a set $S$ containing $n$ bit strings, where $n$ is on the order of about 10. Consider

$$\mathfrak{S} = \{ R : R \subseteq S, |R| \geq 2 \},$$

the collection of subsets of $S$ with two or more elements.

Does there exist a hashing function which outputs the same hash for any member of $\mathfrak{S}$?

A potential relaxation in which we order the elements of the subsets in $\mathfrak{S}$ would be acceptable as well.

$\endgroup$
1
  • $\begingroup$ are you interested in a secure hash of some kind? or any hash? Just map all subsets with cardinality more than 1 to 0, map the rest of the sets to 1. Also you haven't even defined the input and output set. as asked this question is absolutely meaningless. $\endgroup$
    – kodlu
    Commented Oct 29, 2022 at 13:27

1 Answer 1

1
$\begingroup$

Does there exist a hashing function which outputs the same hash for any member of $\mathfrak{S}$?

One can certainly define such a hash function.

If we assume $\text{SHA}$ is a standard secure hash function, then one simple $H$ that means your requirements is:

$$H(x) = \begin{cases} \text{SHA}(0) & \quad \text{if } x \in \mathfrak{S} \\ \text{SHA}(1 | x) & \quad \text{if } x \not\in \mathfrak{S} \end{cases}$$

$H$ is a secure hash function, except that it hashes two elements of $\mathfrak{S}$ to the same value; that is, if someone finds a collision in $H$ (not involving two elements of $\mathfrak{S}$), one can immediately find a collision in $\text{SHA}$, which we assumed was secure.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.