&gt; The only way to prevent that is to never output anything, until the number of possible states is large enough (like 2^128 or more) that brute forcing is not viable.<p>Fortunately, it&#x27;s easy to store a value which can take one of 2^128 possible states: it&#x27;s 16 bytes.  That&#x27;s all.  That&#x27;s all you need.  That&#x27;s all you&#x27;ll <i>ever</i> need.<p>Take that one value; use it to key a keyed hash or an HMAC or a stream cypher or a block cypher.  Encrypt the 16-byte value for 0, then 1, then 2 &amp;c.  You will get an effectively infinite sequence of random numbers.<p>&#x27;But wait!&#x27; you say, &#x27;maybe I&#x27;m worried that I might expose some of that state!&#x27;  Then just periodically rekey that keyed hash or HMAC or stream cypher or block cypher.  There are a number of ways to do that: one possibility would be to hash the current key and the new entropy, but there are other, smarter ways to do it as well.<p>That&#x27;s it.  That&#x27;s all you need.