I want to generate a seed using CSPRNG. I then want to shuffle a standard pack of playing cards (52) using said seed, however, I want the shuffle to be accurate enough that it covers all the possible shuffle outcomes which is 52 factorial. I read from a blog post online that I need at least 226 bits of entropy to cover this. Here is the post for more information.
How would I go about implementing a CSPRNG seed that can shuffle a deck of cards in the same pattern each time given that the seed is the same? I am happy enough to take pseudo code as an explanation, or NodeJS/TypeScript code if possible.
Any help would be greatly appreciated, I'd like to understand exactly how this is achieved. If it is possible, and would still be considered a CSPRNG?
[0..N)
that uses 1.7 bits of overhead on average. Basically you only compare the most significant bits with N and then regenerate only those bits if the number is higher. See here – Maarten Bodewes Sep 30 '22 at 23:08Myria and others, much appreciated for your responses. I actually just built a small prototype between posting this question and this comment. Thank you!
– Kieron Wiltshire Oct 01 '22 at 00:14