-3

How can I generate a non-pseudo (ie. truly) random number in .Net Framework (latest) running on an Azure Windows 10 Pro virtual machine?

Obviously, it must periodically self-seed by a function of some external variant, such as some counter within the operating system, like Internet event counts, or some count of user action/input, or other.

Doug Null
  • 7,989
  • 15
  • 69
  • 148
  • 2
    Why do you need to seed it if it is a non-prng? If you have a true random number generator, go, and use it. – DanielTuzes Dec 18 '21 at 14:47
  • There is `System.Random()` you can give a seed here to "reset" it. There is `RNGCryptoServiceProvider()` to generate more secure random bytes and numbers. – Charles Dec 18 '21 at 15:37
  • What do you mean by *non-pseudo random number*? Do you mean *A deterministic number*? Or *A truly random number generated from external noise*? Or *A technically psuedo-random number but one of higher quality than `System.Random`?* Did you see [How can I generate truly (not pseudo) random numbers with C#?](https://stackoverflow.com/q/1234094/3744182)? If that doesn't answer your question, is there some specific difficulty when running on an Azure VM, e.g. with getting random seeds? – dbc Dec 18 '21 at 15:57
  • DanielTuzes: I meant non-pseudo must self-seed. dbc: yes, truly random. – Doug Null Dec 18 '21 at 16:48
  • 2
    Duplicate of [How can I generate truly (not pseudo) random numbers with C#?](https://stackoverflow.com/questions/1234094/how-can-i-generate-truly-not-pseudo-random-numbers-with-c) – Mark Benningfield Dec 18 '21 at 17:37
  • If your npRNG self-seeds after a while is it still really random inbetween?? – TaW Dec 18 '21 at 18:49

1 Answers1

0

RNGCryptoServiceProvider() is self-seeding apparently from external variants. I will use it. I hope it's fast.

Doug Null
  • 7,989
  • 15
  • 69
  • 148