Take a look at the RNGCryptoServiceProvider class within the System.Security.Cryptography namespace.
-----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of SHEATHER,Kristoffer Sent: Thursday, 11 November 2004 14:11 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Random number generation. Is a random number calculated by known parameters ever truly random?.. :) -----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Vijay M Sent: Thursday, 11 November 2004 12:07 To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Random number generation. Hi all, I am trying to create a monte carlo code for some computational work in predicting the path of photons ! I have worked on .NET for the past two years but havent really pushed the random number generator to know a lot about it. A successful monte carlo code depends on a true random number generator and the efficieny of the generator is prime. I tried searching to determine any benchmarks as to whether the .NET Random object is truly random ! But there aren't that many articles in the net about it ( Maybe i was just blind ?! Feel free to throw some good links if you find ) I could have used Fortran to do it because for ages, people have been using Fortran to do Monte carlo code and it has been reliable. But i want to try it in .NET and hoped to settle this matter soon. If anyone has worked on cryptographic applications or monte carlo codes which depend solely on random numbers, help me out ! All right. All the ramble apart, the question is whether .NET can be used to create a successful Monte carlo code ?! If yes, then which class, System.Random or the System.Security.Cryptography.RandomNumberGenerator, do i use to get better results ? Also, i am planning to implement the algorithm as a multithreaded app. The online help specifies that both the classes are thread safe is declared static but instance variables are not ! Are there any issues in doing so ? Are there any best practices that can be followed while using Random numbers in a multithreaded app ?? These are some of the question that have stalled my work for now. Throw in your advice from experience. Would be glad to hear 'em ! Thanks. Vijay =================================== This list is hosted by DevelopMentor(r) http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building applications and components with C# November 29 - December 3, in Los Angeles http://www.develop.com/courses/edotnet View archives and manage your subscription(s) at http://discuss.develop.com Notice: The information contained in this e-mail message and any attached files may be confidential information, and may also be the subject of legal professional privilege. If you are not the intended recipient any use, disclosure or copying of this e-mail is unauthorised. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete all copies of this transmission together with any attachments. =================================== This list is hosted by DevelopMentor(r) http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building applications and components with C# November 29 - December 3, in Los Angeles http://www.develop.com/courses/edotnet View archives and manage your subscription(s) at http://discuss.develop.com Notice: The information contained in this e-mail message and any attached files may be confidential information, and may also be the subject of legal professional privilege. If you are not the intended recipient any use, disclosure or copying of this e-mail is unauthorised. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete all copies of this transmission together with any attachments. =================================== This list is hosted by DevelopMentorŪ http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building applications and components with C# November 29 - December 3, in Los Angeles http://www.develop.com/courses/edotnet View archives and manage your subscription(s) at http://discuss.develop.com