mardi 11 août 2015

pseudo random generator <=> hash function?

I've been thinking about this as a thought experiment to try and understand some hashing concepts. Consider the requirement for a say 128 bit hash function (i.e. it's output is exactly 128 bits in length).

A. You might look at something like MD5. So you input your data to be hashed, and out pops a 128 bit number.

B. Alternatively, you find a magical pseudo random number generator. Some sort of Frankenstein version of the Twister. It seeds itself from all of your input data to be hashed, and has an internal state size >> 128 bits. You then generate 128 pseudo random bits as output.

It seems to me that both A and B effectively produce an output that is determined solely by the input data. Are these two approaches therefore equivalent?




Aucun commentaire:

Enregistrer un commentaire