> From: Mono-list [mailto:[email protected]] On Behalf Of Matt
> Calder
> 
> We are seeing differences in the output of Random.Next,
> Random.NextDouble when run from the same seed but on different
> machines. I am wondering if this is expected.

The implementation of the non-crypto random functions is not to be assumed. 
That is - you should not use it for crypto purposes. You will often have 
predictable results, but you should not count on the results being predictable, 
as the underlying implementation is not in the spec, so the implementation is 
subject to change.

If you require a predictable result from a starting seed, you're looking for a 
DRBG, or PRNG, with a known standard implementation. There are some NIST 
standards out there that define such DRBG's, and there are some implementations 
of those available in some crypto libraries such as bouncycastle, but it would 
basically be a research topic to figure it all out if you want to go that way. 
The really simple way to do it, assuming you want a predictable result, and 
you're not concerned with security, is to just put an AES class into CBC mode, 
and give in a seed for the key and IV. Wrap it in a CryptoStream. You'll have 
predictable random output, fairly low cost.
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.dot.net/mailman/listinfo/mono-list

Reply via email to