lundi 12 juin 2017

How to generate provably fair dice rolls in C#?

I looked into provably fair random numbers, and came across this website: http://ift.tt/2bIg60I

First off, what class should be used for the server sided hash? There are so many hash algorithms like SHA512, SHA256 or SHA384Cng and I do not understand the difference between them.

Second off, what method would be used to convert from the unhashed seed to the hashed seed, and what method would be used to take the string for the seed provided by the user into account during the hash creation. Also, is the nonce simply added at the end of the string provided by the user in order to prevent duplicate hashes?

Third off, I do not understand why the hashed server seed is originally a SHA256 hash but is later used to calculate a HMAC SHA512 hash.

Lastly, what would be used to convert the first 5 characters of the final generated hash to a roll number?

I have had no luck in finding any examples of any random number generators that use a server seed and client seed, only things like System.Security.Cryptography.RandomNumberGenerator.




Aucun commentaire:

Enregistrer un commentaire