There is an analog method of using 2 or 3 dice rolls to "unbias" any biased dice rolls. Then you can use that as your RNG. Of course, for 256 bit equivalent, instead of rolling 100 times, you would roll 200 or 300 times. Or more. Not sure of the math.
Footgun alert!
Here is a complementary idea: mix the result
Extending the proposal: Use the hash function thousands of times. Not only you ensure that a dice bias isn't enough to betray you, but you also make it much harder for an attacker to find your entropy.
...
Recommendations:
3. Read the HKDF paper, to better understand the “extract and expand” model. Not that it’s the canonical source of all wisdom: I simply find it a good guide to
start learning about this subject matter. Then, review the literature about
entropy extractors. You are seeking an
entropy extractor, without knowing what you seek.
2. 6-sided dice rolls output results from a uniform random distribution. If your dice are physically perfect, you do not need any fancy-pants entropy extractor. Assuming unbiased dice, you can use a simple algorithm to transform your base-6 dice rolls into uniformly distributed binary numbers,
without modulo bias. At this point, you will probably mess it up and utterly annihilate your own security; so...
1.
Leave cryptography to the cryptographers. Seriously. Please. For your safety and the safety of others.Generating your own random numbers is low-level crypto. >99% of programmers should never, ever touch low-level crypto directly. This is not to insult your intelligence: The smartest programmers in this space all either study up on their cryptography, or leave cryptography to the cryptographers. Studying cryptography takes lots of smarts; knowing the limits of your own knowledge also takes lots of smarts.
(I am not a cryptographer. You will see security wonks who are not cryptographers say this often:
I am not a Real Cryptographer(TM). But at least, I am aware of entropy extraction, probability distributions, etc.; and I know enough cryptography to know that “a little knowledge is a dangerous thing”!)
I don't agree with the premise that dice will be "random enough" without testing that. If you don't trust the randomness of your OS, which has been designed, built, and tested by experts in the field of cryptography, and want to do things manually, then just picking up a bunch of random dice and shrugging your shoulders is irresponsible. If you don't test your dice, how can guarantee your min-entropy is sufficient? How can you guarantee your Shannon entropy is sufficient? How can you be sure whatever randomness extraction algorithm you choose won't amplify your weak entropy?
Keywords that I have rendered in bold indicate that this is someone who will
not be blowing his own security away with a random footgun.
But I doubt that the quality of randomness from physical dice is the problem here. The problem is that people who don’t even know the difference between min-entropy and Shannon entropy tend to destroy their own security by fetishizing “true randomness” or “physical randomness”. A belief that randomness from physical dice is somehow better than CSPRNG output is itself a warning sign that someone should not mess with random number generation.
Random number generation is subtle and counterintuitive. Get it just a little bit wrong, and you don’t even know that you just wrecked your security: Everything still works, and everything still looks just fine to you. Please, people, use a CSPRNG designed and implemented by cryptographers!