I have a large string that I need to shuffle in a secure manner. It will be around 4000 characters. The resulting permutation of such string, must be one in the set of all possible permutations (4000!). The resulting permutations must of course also be evenly distributed between all possible states. I need to reasonably prove that my implementation meets those requirements, but formal methods are not needed.
I was planning on using a simple Knuth-Fisher-Yates for this, but I worry about my RNG. I am bound to implement this in JavaScript, as my application must run in Thunderbird. From (what I can read)[https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues], Mozilla can provide a cryptographically secure random value, and I plan on combining it with (this)[https://github.com/davidbau/seedrandom] to get random numbers in the desired range.
Now, I believe I could have issues with the internal state space of the PRNG. If it has to few, it will "wrap around" and produce a bias for certain numbers. If it has too many, it might apply modulo to scale down, thus also producing a bias for numbers in the lower range.
How long a seed would I need to initialize a PRNG used for KFY-Shuffle a string of 4000 characters? Am I overthinking this, is there something I did not think of?