There was a recent question answered where the accepted solution was a double Pearson hash. It consisted of the following pseudo code:- h = T1[h ^ x[i]]
followed immediately by h = T2[h ^ x[i]]
so effectively you run one lookup table into the other. Tables T1
and T2
are unique random 8 bit permutations. Output collisions can occur at the classic $ 1 \over e $ rate given the presence of the 2nd table, with the hash behaving as a pseudo random function.
Developing this construction further, assume that the permutation tables are $ \pi $, giving a more general form for hashing a message $m$ with multiple consecutive but unique permutations:-
$$ h_{i} = \pi_j [h_{i-1} \oplus m[i]]; recursive $$
creating a functional composite as in:-
$$ h = \pi_3[(\pi_2[(\pi_1 [h \oplus m[i]]) \oplus m[i])]) \oplus m[i]] $$
if $j=3$ . And let's call each calculation of $h$ for any given $\pi$ a 'step'. Overall, we get $ output = H_N(m) $ for this cool/weird hash consisting of $N$ tables/steps. As an example, it might be that $ H_3(3512)=110 $ for a hash with 3 permutation tables. In the linked question we used 2 tables.
- Can a new $\pi$ or set of $\pi$s be constructed to arrive at an identical output for all messages with $<N$ steps? In other words can multiple $\pi$ permutations be reduced or merged somehow into new ones, even theoretically? Clearly they can in the special and trivial case of $|m| = 1$. What about generally for $|m| > 1$?
- Considering the trivial case mentioned above, is there some relationship between $N$ and $|m|$ that determines the answer?
- If a reduced set of new $\pi$s might theoretically exist, how might it found in practice?
Notes:
- Some of this question is clearly on topic here, but not sure about it's entirely.
I see small parallels with permutations and non linearity, construction of S boxes, and their combinations.
Whilst hallucinating one might assume values of $\pi_j$ be likened to multiple keys $k_j$, so the answer to Security of a block cipher if double encryption $E_{K_2} \circ E_{K_1}$ is always single encryption $E_{f(K_1,K_2)}$ comes to mind as there is an attempt at a similar(?) reduction.
I'm happy to be migrated outa here.