Cryptopals Challenge 23: Clone an MT19937 RNG from its output
I've recently gotten the cryptography bug. I would highly recommend working through the challenges at http://cryptopals.com . The challenges give insight and practice into real attacks on weak cryptosystems. Personally, I'm onto set 4, but I skipped the Mersenne Twister (MT) RNG to get there. Today I went back to those challenges and in this blog post I present my solution to challenge 23. The Mersenne Twister generates Pseudo Random Numbers. It would be nice as an attacker to be able to predict future numbers by looking only at the earlier output of the MT Random Number Generator. Firstly, an earlier challenge is to simply get an MT RNG working. I stole the code from https://github.com/james727/MTP . Is it bad that I copied the code? No. You will see there is much work needed to be done to break the MT RNG. The key insight to the MT1997 RNG is that the complete internal state consists of 624 32-bit integers. If you can clone these integers, you can predict any futu