Use coins, dice and cups to create cryptographically secure random numbers



When you want to create random numbers manually, there is a risk that just thinking about them will cause a bias, or that some rules will be included and the numbers will be predicted. However, we know that there is a clever mathematical trick that allows you to create cryptographic-grade random numbers with just a coin, a cup, and a pen to take notes. It seems difficult, but if you get used to it, even children can easily create random numbers.

Generating Cryptographically Secure Random Numbers With Coins and A Cup | by David Vorick | Dec, 2020 | Sia Blog

https://blog.sia.tech/ generating-cryptographically-secure-random-numbers-with-coins-and-a-cup-4e223899509e



This method is introduced by David Bolic of

Skynet , a distributed CDN for developers and a file sharing platform.

As a method of randomly deciding whether to '0' or '1', for example, a coin toss can be performed, and the front side is set to '0' and the back side is set to '1'. , There is a technique called 'von Neumann trick'.

The von Neumann trick throws coins twice and does not count when it is 'front / front' or 'back / back', when it is 'front / back' it is 'front', and when it is 'back / front' it is 'back'. It is treated as. However, this trick is mathematically okay, but in the real world it cannot be used for safe random number generation because it involves elements such as 'what kind of coin' and 'who does the coin toss'.

Therefore, Mr. Bolic advocates a generation method using five coins and a large cup. It's easy to do, just put a coin in the cup and shake it to mix well. After shaking, check the condition of the front and back of the coin, and record '0' if the number of fronts is even, and '1' if the number of fronts is odd. The cryptographically secure random number is at least 128 bits, so repeating this 128 times is OK. In addition, it seems that it is better to make all coins different shapes and sizes.



With a coin toss, you will be able to control the number of rotations in the air while you are doing it, but with this method, the coin will bounce randomly in the cup, so the advantage is that you can not control it. Also, by setting a large number of times to shake the cup and counting firmly, it is possible to prevent the number of times to shake the cup gradually from decreasing with each trial.

In addition, since the coin has only the front and back, it will not be different unless it is turned over 180 degrees, but if it is a dice, another side will come out if it rolls 90 degrees, so it is recommended to use the dice. When using dice, the total of the five dice rolls is '0' if it is even, and '1' if it is odd.

in Note, Posted by logc_nt