1
$\begingroup$

As far as I understand a hash transforms data into a fixed length representation. For example, a random function returns 8-byte numbers and a hash function has a block size of 32-bytes. If I now generate the hash of each random number, would the resulting hashes be an evenly distributed set of random numbers with a length of 32-bytes? I know one could simply multiply the random number by 4, but this would result in the same random entropy as before.

$\endgroup$
1
  • $\begingroup$ It depends what you mean by "evenly distributed". It should be clear that not all values are possible, so if that's what you mean the answer is "no". A deterministic hash function can't introduce entropy. $\endgroup$ Commented Mar 31, 2020 at 20:25

1 Answer 1

1
$\begingroup$

No, actually your 32-bytes would only be a representation of the 8-bytes random (or pseudorandom) number. In this case if I want to attack you system (eg. by brute force) I need only to perform 2^8 attempts instead of 2^32 as someone could expect. This occurs because the 32 hash is only a deterministic representation of a very small 2^8 number.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.