In many cases, an attacker can easily recover the state of a (non-cryptographic) random number generator from a few output values – without knowing anything about the seed. After that, it's trivial to predict all future and all previous random numbers.
How many outputs are required for this depends on the algorithm. In the case of a linear congruential generator, such as Java's java.util.Random
, the state can be recovered from two outputs. For Mersenne Twister, used in PHP and Python among others, you need to obtain 624 outputs. I'm not familiar with .NET, but I'd think it's a similar story.
There is no complex math involved at all. See for yourself:
Conclusion: Use a cryptographically secure random number generator for anything that has to do with security.