I'm trying to figure out the best way to securely seed a rng in C#.
The class I am currently using is the Random
class
https://msdn.microsoft.com/en-us/library/system.random(v=vs.110).aspx#Same
After going through the documentation you can seed it using an Int32
, however and I may be wrong in how i assume this, an Int32
would essentially have only 32 bits of entropy which is much less than the recommended 128 or 256 bits of entropy.
Does anybody know of a better C# RNG or how to property and securely seed it with 128 bits on entropy? I haven't been able to find anything
Thanks for all the help.
EDIT
I'm trying to securely generate random numbers that can repeatable across different machines. Basically I'm trying to find a CSRNG that can be seeded with a hash value or something similar and if I ran that piece of software on a different machine with that hash as the seed, it would produce the same numbers.
is not
and notus bit
. Presumably typing on a mobile device. Similarly5i
-->to
... :-)Random
class is not guaranteed to generate the same output on different .NET versions, which might be a problem for you.