Given the last 2 outputs from the rand() function, it can give the next n outputs of the rand() function. First: second-last output, Second: latest output * Currently, only the rand() using msvcrt.dll is supported. (corresponding to those compiled with Microsoft C/C++ compiler)
* Don't use any LCG for random numbers in cryptographic applications * The rand() in msvcrt.dll is a kind of LCG (Linear congruential generator), which is defined as Xₙ₊₁ = (aXₙ + c) mod m, where a = 214013, c = 2531011 and m = 2^31 - 1. The method used here is #MITM, which can crack the function within 2^8 = 256 iterations only. Reference: https://crypto.stackexchange.com/questions/10608/how-to-attack-a-fixed-lcg-with-partial-output #PRNG #LCG