问题描述:

I recently read that you can predict the outcomes of a PRNG if you:

- Know what algorithm is being used.
- Have consecutive data points.

Is it possible to figure out the seed used for a PRNG from only data points?

I managed to find a paper by Kelsey et al which details the different types of attack and also summarises some real-world examples. It seems most attacks rely on similar techniques to those against cryptosystems, and in most cases actually taking advantage of the fact that the PRNG is used in a cryptosystem.

With "enough" data points that are the absolute first data points generated by the PRNG with no gaps, sure. Most PRNG functions are invertible, so just work backwards and you should get the seed.

For example, the typical `return seed=(seed*A+B)%N`

has an inverse of `return seed=((seed-B)/A)%N`

.

It's always theoretically possible, if you're "allowed" to brute force all possible values for the seed, and if you have enough data points that there's only one seed that could have produced that output. If the PRNG was seeded with the time, and you know roughly when that happened, then this might be very fast since there aren't many plausible values to try. If the PRNG was seeded with data from a truly random source having 64 bits of entropy, then this approach is computationally infeasible.

Whether there are other techniques depends on the algorithm. For example doing this for Blum Blum Shub is equivalent to integer factorization, which is generally believed to be a hard computational problem. Other, faster PRNGs might be less "secure" in this sense. Any PRNG used for crypto purposes, for example in a stream cipher, pretty much needs there to be no known feasible way of doing it.

您可能感兴趣的文章：

- c++ - read arguments from variadic template
- if statement - jQuery if element contains something, do stuff
- jquery - cross-domain ajax request - XD security errors on re-submission
- c# - Can as 2D byte array be made one huge continuous byte array?
- c - Memory Optimization for child processes
- php - Reading a specific line from a text file
- clr - Any implementation of an Unrolled Linked List in C#?
- Finding Hudson Log Files
- Forward to a payment-gateway together with POST data using cURL (or any other PHP server side solution)
- WCF in Winforms app - is it always single-threaded?

随机阅读：

**推荐内容**-

**热点内容**