In: Advanced Math
Consider these 2 functions (all with domain and codomain (Z/pZ) for some big prime p): h(x) = 1492831*x and h(x) = x3 . Why are these bad cryptographic hash functions? Give different reasons for the two.
Given h(x)=1492831*x=x3 two functions are defined in the Co
prime number theory constructing universal hash functions that is a
bit more efficient than the matrix method given r. In the matrix
method, we viewed the key as a vector of bits. In this method, we
will instead view the key x as a vector of integers [x1,x2,...,xk]
with the only requirement being that each xi is in the range
{0,1,...,M −1}. For example, if we are hashing strings of length k,
then xi could be the ith character (assuming our table size is at
least 256) or the ith pair of characters (assuming our table size
is at least 65536). Furthermore, we will require our table size M
to be a prime number. To select a hash function h we choose k
random numbers r1,r2,...,rk from {0,1,...,M − 1} and define: h(x) =
r1x1 + r2x2 + ... + rkxk mod M.
The proof that this method is universal follows the exact same
lines as the proof for the matrix method. Let x and y be two
distinct keys. We want to show that Prh(h(x) = h(x)) ≤ 1/M. Since x
6= y, it must be the case that there exists some index i such that
xi 6= yi. Now imagine choosing all the random numbers rj for j 6= i
first. Let h′(x) = Pj6=i rjxj. So, once we pick ri we will have h(x)
= h′(x) + rixi. This means that we have a collision between x and y
exactly when h′(x) + rixi = h′(y) + riyi mod M, or equivalently
when
ri(xi − yi) = h′(y) − h′(x) mod M. quotient in h(x) is a high
floating point number hence these both cannot be hashed in the
cyclic redundancy coefficients in the hashing algorithm