An RNG cloning attack reconstructs a stateful pseudorandom number generator from observed outputs, allowing its future outputs to be predicted. Against MT19937, each generated value corresponds to one internal-state value after tempering; reversing that transformation with untemper recovers the state. section 3.1.2
The MT19937 attack proceeds by:
- Collecting N generated values from the original RNG. section 3.1.2
- Untempering each value by reversing the XOR, shift, and AND operations used by temper. section 3.1.2
Cloning and verifying MT19937
CloneMT19937 untempers N outputs, initializes a generator with the recovered state, and checks 100 later outputs against the original; the test passes with matching values.
