0

Is it possible to get a secure random number generator from a secure hash function this way

First choose a natural number $n$ as seed, then if we are looking to generate random numbers from $0$ to $F$ (in hex), the first in the sequence is the last digit in the hash of $n$, the second in the sequence is the last digit in the hash of $n+1$, and so on. Does this make a secure PRNG.

  • Note that hexadecimals are mainly used for humans to be able to view binary values. Generally crypto operates on bits or - in practice - bytes as our computers very much operate base 256. One hex digit represents one binary nibble of 4 bits. Hash functions generally generate 256 bits upward to be secure. Internally, they operate on blocks of 512 bits or higher, with sometimes a state that is even larger. In short using only 4 bits from every hash function would make a very slow PRNG. – Maarten Bodewes Mar 01 '19 at 13:08
  • As the other answer seems to explain if this kind of construction is secure I've decided to mark it as a dupe too. If you have any additional issues with the dupe please put them into your question in a new section, so we can reopen it. – Maarten Bodewes Mar 01 '19 at 13:10

0 Answers0