A secure
perfect hash function that has properties similar to those of cryptographic hash functions without compromising features of a
perfect hash function such as speed and collision-free outputs is provided. A
cryptographic hash function is utilized to process the set S and the. output is divided into three sub-outputs of required length. Each output can now be treated as a separate
hash function (g(x), f1(x), f2(x)), S is split into r buckets Bi, 0≦i<r, using the
hash function g. Buckets Bi are permuted in a pseudorandom fashion. For each bucket Bi, a displacement pair (d0, d1) is chosen randomly from the sequence {(0,0), (0,1), . . . (0, m−1), (1,,0),(1,1), . . . , (1, m−1), . . . ,(m−1, m−1)} such that each element of Bi is placed in an empty bin given by (f1(x)+d0f2(x)+d1) mod m. The index of this displacement is stored in the sequence.