[Mono-list] Random seeding on different machines

Matt Calder mvcalder at gmail.com
Tue Oct 4 14:09:05 UTC 2016


Edward,

Thanks this is a non-crypto application. We are doing simulations across
machines and want to know if we can expect identical runs to match. It
sounds like you are saying "no".

Matt

On Tue, Oct 4, 2016 at 10:02 AM, Edward Ned Harvey (mono) <
edward.harvey.mono at clevertrove.com> wrote:

> > From: Mono-list [mailto:mono-list-bounces at lists.dot.net] 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20161004/f59dab4c/attachment.html>


More information about the Mono-list mailing list