??? 09/11/07 19:49 Read: times |
#144395 - its not a dedicated pRNG algorithm.... Responding to: ???'s previous message |
... it's a block cipher used as a pRNG. You can reveal the full state, i.e. 64 bits, if you make sure the key stays secret.
In other words, the range is [0, 2^64-1]. As I wrote above, you can use any bits of it, i.e. any range [0, 2^n-1], n<=64. JW PS. If you want something computatinally less intensive, have a look into the Knuth book Matthias was referring to - I don't have the book and did not read it, but from the references I have on it Knuth presents a couple of simple linear-congruent pseudorandom generator (LCRNG). It sounds scary, but in fact it is only a multiplication and addition (and mod, but a trivial one: truncating bits). One of the formulas/set of constants lead to: RN = RN-1 * 1664525 + 1 (mod 2^32) where R is the 32-bit "state". Of course, you may not reveal the complete state of such a generator, so use only 8-16 bits of it (and reseed regularly, too). Also, don't use the lowest bit of it, as it alternates between 0 and 1. |