Predicting the next number generated by C (glibc) rand ()

Given the series of numbers generated by rand (), how can I predict the following value? Brute force is out of the question. I know that rand () is basically a linear congruent generator, but also does a bit offset. What theory can I use for hacking? Any tips would be most welcome :)

+4
source share
1 answer

@unwind: thanks for the tip! I was wrong in some places, and the documentation led me on the right track.

In fact, a prediction is a piece of cake when you know a sequence of 30 (or so) numbers. The "calculated" answer will be correct in 50% of cases. More detailed information is provided in the link provided by the unwinding, or in a simplified code: http://www.mathstat.dal.ca/~selinger/random/

+4
source

All Articles