Skip to main content
Tweeted twitter.com/StackCrypto/status/1091124096715419648
tags
Link
kelalaka
  • 49.5k
  • 12
  • 118
  • 205
Source Link
Déjà vu
  • 175
  • 4
  • 9

Using a hash function as a random number generator

Using MD5 or SHA1 for instance, and applying integers (as seed so to speak) to the hash function, in sequence, and only keeping, say, the first 64 bits of the resulting hash, do we always have a probability close to $1/{2^{64}}$ to have $$\text{hash}_{64}(n) = \text{hash}_{64}(n+1)$$ for every $n\in\big[1,2^{64}]$?