Tinkaal Gogoi
Tinkaal Gogoi

Reputation: 4888

Is there any algorithm for random number generation whose pattern cannot be revealed?

Can it be possible to create random number whose pattern of getting the next random number never be repeated even the universe ends.

Upvotes: 0

Views: 123

Answers (4)

Lee Daniel Crocker
Lee Daniel Crocker

Reputation: 13171

At every step in the execution of a computer program, the total internal state determines what the next total internal state will be. This internal state must be represented by some number of bits--all of the memory used by the program, registers of the processor, anything else that affects it. There can only be 2**N possible states given N bits of state information.

Since any given state T will lead to the same state T+1 (that's what "deterministic" means), the algorithm must eventually repeat itself after no more than 2**N steps. So what limits the cycle length of an RNG is the number of bits of internal state. A simple LCG might have only 32 bits of state, and therefore a cycle <= 2^32. Something like Mersenne Twister has 19968 bits of internal state, and its period is 2^19937-1.

So for any deterministic algorithm to be "unrepeatable in the history of the Universe", you'll probably need most of the atoms of the Universe to be memory for its internal state.

Upvotes: 0

SF.
SF.

Reputation: 14049

  bignum getUniqueRandom()
  {
         static bignum sum = 0;
         sum += rand();
         return sum;
  }

That way the next random number will be always greater than the previous (by a random factor between 0 and 1) and as result the numbers returned will never repeat.

edit: The actual approach when randomness requirements are so high is to use a hardware random number generator; there are for example chips that measure atom decays of background radiation generating truly random seeds. Of course the nature or randomness is such that there is never a guarantee a pattern can't repeat, or you'd be damaging the actual randomness of the result. But the pattern can't be repeated by any technical/mathematical means, so the repeats are meaningless.

Upvotes: 0

Ole Sauffaus
Ole Sauffaus

Reputation: 534

I read this security rule-of-thumb:

All processes which require non-trivial random numbers MUST attempt to use openssl_pseudo_random_bytes(). You MAY fallback to mcrypt_create_iv() with the source set to MCRYPT_DEV_URANDOM. You MAY also attempt to directly read bytes from /dev/urandom. If all else fails, and you have no other choice, you MUST instead generate a value by strongly mixing multiple sources of available random or secret values.

http://phpsecurity.readthedocs.org/en/latest/Insufficient-Entropy-For-Random-Values.html

Upvotes: 1

Eugene Stamp
Eugene Stamp

Reputation: 158

In Layman's terms, no; In order to generate a particular data form, such as a string or integer, you must have an algorithm of some sort, which obviously cannot be 100% untraceable...

Basically, the final product myust come from a series of events (algorithm) in which is impossible to keep 'unrevealed'.

Upvotes: 0

Related Questions