24.11.2016 Views

Not So Random

Not%20So%20Random%20-%20Exploiting%20Unsafe%20Random%20Number%20Generator%20Use

Not%20So%20Random%20-%20Exploiting%20Unsafe%20Random%20Number%20Generator%20Use

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Untwister Brute Force Algorithm 101<br />

5. For each PRNG, generate output, checking against your known good input:<br />

uint32_t matchesFound = 0;<br />

for(uint32_t index = 0; index < m_depth; index++)<br />

{<br />

uint32_t nextRand = generator->random();<br />

uint32_t observed = m_observedOutputs->at(matchesFound);<br />

if(observed == nextRand)<br />

{<br />

matchesFound++;<br />

if(matchesFound == m_observedOutputs->size())<br />

{<br />

break; // This seed is a winner if we get to the end<br />

}<br />

}<br />

<strong>Not</strong> <strong>So</strong> <strong>Random</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!