SHA1PRNG Seed size - Entropy for Shuffling Cards
843810May 23 2002 — edited May 28 2002I am trying to write a secure card shuffling algorithm. A large amount of random entropy is required to deliver all possible shuffling sequences - a minimum of a 226 bit number just to cover the 52!(factorial) possible orderings of a pack of cards. Does anybody know how many bits are used for the internal seed of the SHA1PRNG implementation provided as standard. My idea is to repeatedly shuffle the pack, reseeding the generator between each shuffle until there is enough randomness in the shuffle e.g. if require 500 bits of randomness and PRNG uses 100 bit internal seed, reseed and shuffle the pack 5 times.
I used an alternate algorithm (Blum Blum Shub) for which I obtained the source and discovered it used a 200 bit seed but this was far too slow as it went through a prime number testing routine after every reseeding (20-30 seconds for 1 shuffle). The SHA algorithm clearly doesn't do anything as complex as this so it is much faster.
Alternatively, if anybody can point me to another fast PRNG for which the internal seed size is known I would be grateful. Obviously the generator should be "Good" statistically and preferably cryptographically secure.
Thanks
Rob