Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to reverse a pseudo random number generator?

Is it possible to reverse a pseudo random number generator? For example, take an array of generated numbers and get the original seed. If so, how would this be implemented?

like image 542
Cenregoth Avatar asked Nov 04 '14 19:11

Cenregoth


People also ask

How do you reverse an LCG?

You can also go backwards with an LCG, it is just another LCG using the inverse of the multiplier modulo the modulus, together with a suitable increment. For your small numbers you can just use brute force to search for the inverse, in general it can be computed with an extended GCD algorithm.

Is pseudo random actually random?

Pseudo Random Number Generator (PRNG) Software-generated random numbers only are pseudorandom. They are not truly random because the computer uses an algorithm based on a distribution, and are not secure because they rely on deterministic, predictable algorithms.

Can pseudo random be predicted?

The outcome of the research confirms the possibility that machine learning algorithms can be trained to predict certain PRNGs. Even when trained with a small amount of data, there is evidence that machine learning algorithms can be used to predict the values created by pseudorandom number generators.

How does a pseudo random number generator work?

Instead they rely on algorithms to mimic the selection of a value to approximate true randomness. Pseudo random number generators work with the user setting the distribution, or scope from which the random number is selected (e.g. lowest to highest), and the number is instantly presented.


1 Answers

This is absolutely possible - you just have to create a PRNG which suits your purposes. It depends on exactly what you need to accomplish - I'd be happy to offer more advice if you describe your situation in more detail.

For general background, here are some resources for inverting a Linear Congruential Generator: Reversible pseudo-random sequence generator

pseudo random distribution which guarantees all possible permutations of value sequence - C++

And here are some for inverting the mersenne twister: http://www.randombit.net/bitbashing/2009/07/21/inverting_mt19937_tempering.html http://b10l.com/reversing-the-mersenne-twister-rng-temper-function/

like image 100
Jonathan Basile Avatar answered Oct 27 '22 16:10

Jonathan Basile