On 12/13/2018 10:27 PM,
jman...@gmail.com wrote:
> Hi,
>
> We are using MersenneTwister.h V1.1 C++ class MTRand implemented by Richard J. Wagner.
>
> We need the clarifications on the below,
>
> 1. Is there any newer version available after MersenneTwister.h V1.1?
> 2. Is there any SV issues reported on this version? If so,
> 3. What is the alternative?
> Note: For the current being we can't move to the ++11 standard mersenne_twister_engine.
>
>
> // MersenneTwister.h
> // Mersenne Twister random number generator -- a C++ class MTRand
> // Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
> // Richard J. Wagner v1.1 28 September 2009
wag...@umich.edu
>
> // The Mersenne Twister is an algorithm for generating random numbers. It
> // was designed with consideration of the flaws in various other generators.
> // The period, 2^19937-1, and the order of equidistribution, 623 dimensions,
> // are far greater. The generator is also fast; it avoids multiplication and
> // division, and it benefits from caches and pipelines. For more information
> // see the inventors' web page at
> //
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
>
> // Reference
> // M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
> // Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on
> // Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
>
> // Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
> // Copyright (C) 2000 - 2009, Richard J. Wagner
> // All rights reserved.
> //
Fwiw: It really does not create "true" random numbers. Instead, it
outputs pseudo random numbers. If you are interested in a crypto safe
(e.g., wrt a good crypto safe hash, sha384?) HMAC based generation of
pseudo random numbers, look here:
http://funwithfractals.atspace.cc/ct_cipher
Here is a sample C impl with a hardcoded in-memory secret key of
"Password" and sha256 for the hash used with the HMAC:
https://groups.google.com/d/topic/comp.lang.c/a53VxN8cwkY/discussion
(please, read _all_ if interested...)
The ciphertext can actually be used for crypto safe pseudo-random numbers.
The PRNG stream would be password protected such that different
passwords will produce radically different streams. Also, the random
numbers are actually encrypting files. So, we can encrypt files created
from the output of an actual TRNG. The seed for the CSPRNG is the
password and the hash algo.
Interested?