Penguin
Diff: RandomNumberGenerator
EditPageHistoryDiffInfoLikePages

Differences between version 7 and predecessor to the previous major change of RandomNumberGenerator.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 7 Last edited on Thursday, March 25, 2004 9:23:55 pm by StuartYeates Revert
Older page: version 6 Last edited on Thursday, March 25, 2004 2:15:01 pm by AristotlePagaltzis Revert
@@ -9,9 +9,9 @@
 A pseudo random number generator such as offered by the random(3) and rand(3) functions of the standard [C] library generates numbers using mathematical [Algorithm]s. 
  
 ;: ''Anyone attempting to produce random numbers by purely arithmetic means is, of course, in a state of sin.'' --JohnVonNeumann 
  
-An inevitable consequence is that such a generator has a "period", which means that it produces a repeating sequence of numbers. With a good algorithm though, the period length can well reach billions of numbers. 
+The proof of this derives from the fact that computers are [FiniteStateMachine]s. An inevitable consequence is that such a generator has a "period", which means that it produces a repeating sequence of numbers. With a good algorithm though, the period length can well reach billions of numbers. 
  
 However, designing such an algorithm is difficult terrain which requires thorough understanding of statistics and very sharp math skills. __Do not attempt to roll your own.__ Most naive attempts at handrolled pseudorandom number generators have alarmingly short period lengths. Often, hapless programmers will try to make a "better" generator by lumping together two different algorithms with decent period lengths each -- but the result is almost invariably a generator with a ''shorter'' period! 
  
 Another problem in cryptographical applications of pseudorandom numbers is that the algorithm is known. If you know a long enough sequence of generated numbers, you can simply solve the resulting equations yourself and then predict the numbers the generator will be producing next. There is an obvious solution: the algorithm must include enough hidden state so that a solvable set of equations cannot be formulated just by looking at a number sequence it generated. 
@@ -21,5 +21,5 @@
 So there are many areas where pseudorandom numbers are actually more desirable than truly random ones. 
  
 !!! Hybrids 
  
-In [Unix] systems, there's commonly a __/dev/random__ device to access a pseudorandom number generator. This generator however includes a twist that lets it generate higher quality random numbers than otherwise expected: its seed is periodically perturbed using using low-level timing information from the network, mouse, keyboard, and possibly other entropy sources, which only the [Kernel] has proper access to. It is generally considered a sufficiently good generator for everything except the random numbers to be used in cryptographic suituations PublicKey generation. 
+In [Unix] systems, there's commonly a __/dev/random__ device to access a pseudorandom number generator. This generator, however, includes a twist that lets it generate higher quality random numbers than otherwise expected: its seed is periodically perturbed using using low-level timing information from the network, mouse, keyboard, and possibly other entropy sources, which only the [Kernel] has proper access to. This generator is also a FiniteStateMachine but it has access to unique inputs which are hard to predict and very hard to spy on. The weakness of this approach can be seen by imagining the [Kernel] running as UserModeLinux and the underlying kernel manipulating the value of the ''hardware'' clock---in such a situation it would be possible to force /dev/random to produce the same results repeatedly . It is generally considered a sufficiently good generator for everything except the random numbers to be used in cryptographic suituations PublicKey generation.