‹ BackHN Continuity

Thread

Reversing Factorio's RNG

255 points · 48 comments · jheitmann

  1. strstr · · focus · HN ↗
    I did an easier version of this in my college intro class. There was a class competition that involved rock paper scissors as a subcomponent, and ties were broken with randomness. You could rig Java’s prng so you would win all ties.

    The prng was seeded with usec time at first call. I called the rng a bunch of times to harvest entropy, and scanned the plausible usec times to find the seed. Then I primed the prng so I would win ties.

    Frankly, I assume I implemented this wrong, but the theory was there lol.

    1. 3eb7988a1663 · · focus · HN ↗
      I am failing to find the article, but some early online poker systems used the server time as the seed coupled with a weak PRNG. With the information of the hole cards + community cards, after a few hands, could quickly determine exactly what seed was being used and perfectly predict everyone's cards.
      1. e28eta · · focus · HN ↗
        I don&#x27;t think this was the original source, but this paper matches your (&amp; my) recollection: <a href="https:&#x2F;&#x2F;gwern.net&#x2F;doc&#x2F;cs&#x2F;cryptography&#x2F;2006-arkin.pdf" rel="nofollow">https:&#x2F;&#x2F;gwern.net&#x2F;doc&#x2F;cs&#x2F;cryptography&#x2F;2006-arkin.pdf

        google surfaces a couple of HN posts, but the source (cigital.com) seems to be a dead domain at this point:

        <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=288138">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=288138

        <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9914607">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9914607

        It&#x27;s a bad shuffle implementation + using time of day as seed (reducing search space). Using the player&#x27;s 2 cards and the 3 flop cards, it finds the RNG seed in real time, and then future hands (on the same server) are solved in &quot;under one second!&quot;

        1. 3eb7988a1663 · · focus · HN ↗
          Indeed this is not the article I originally read either, but very similar breakdown of the problem.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.