Brandon's Cryptographically Secure Pseudorandom Number Generator

View as PDF

Submit solution

Points: 30 (partial)
Time limit: 39.0s
Memory limit: 1G

Author:
Problem type

blin00 is trapped in Japan! His website is down, and in order to bring it back up he needs to ssh into his server. Because blin00 is extremely security-conscious, he has enterprise-grade 2FA enabled. His security token is a hardware token that he has locally which will generate a random integer uniformly at random within the range configured on the token.

blin00 has logged the last 25K outputs of his security token and suspects that his token does not generate cryptographically secure pseudorandom numbers. Can you prove this?

Your job is to write a program to print the following file. Your score will be inversely correlated to the length of your program.

To ensure you have the correct output, the following hashes have been provided:

  • MD5: afc0d1a05b19dc77cfccea5e8970c05e
  • SHA1: b41d5a13a6ca7bff9fff8c73e9a877487f709772
  • SHA256: 219a85683a21cb1992939b1a1e00efe063fec44f963e584b4456e37fb5f78fc1
  • SHA512: b315ac23e786aa868f43b2ec375be188b72bdbea04ebe1dc1e2905be789e651d701e4f6fd729a72bb7acd0af27942ac5a08d8da562b255b76d517b0f10f47145
  • SHA512/256: bffb575239b1e903a143b43e9e8ba95510c9c254fb585d5aa53641d42afc4866
  • SHA3-256: 09a8f34b79b66e5e6b6a5f208a7d0c104cb73956e966a34827e7efe4b5b56b67
  • SHA3-512: 66502bd239c6a2fd227ef5750a861f8f86b758b81d08fd06f7f1864b42dfb1b4656333d98efad7ca35e71013f461492b18aa91e406d4f5518460f08ae3f93939

Comments


  • 0
    maxcruickshanks  commented on March 29, 2026, 8:55 p.m.

    The file (along with its associated hashes) has been updated as C++ runtime behaviour seems to have changed.


    • 0
      Dingledooper  commented on April 1, 2026, 2:04 a.m. edited

      BTW, it is much harder to solve this challenge (at least with my method) using the updated file vs. the original one (for reasons related to the runtime behaviour change). Here is a gist of the original file for others who are trying to solve it.


  • 0
    lunamothluna  commented on March 1, 2026, 2:46 a.m.

    ok i knew my first thought of solving this problem wouldn't get too many points but i found out DMOJ won't even let me upload more than 65k characters


  • 2
    dmojme  commented on Feb. 26, 2021, 1:18 a.m.

    Is there a pattern to what you need to output?


  • 37
    DaniellTa  commented on June 12, 2020, 10:42 p.m.

    you what


    • 14
      anthony_  commented on Dec. 29, 2021, 8:08 a.m.

      This question is a clever disguise for the fact that blin00 actually lost his security token. This is a very serious issue, as he is extremely security-conscious and has enterprise-grade 2FA enabled on all of his accounts.

      Since he is locked out, he used all of his cash to send a letter to his good friend Xyene—explaining his predicament and listing the last 25,000 outputs from memory. They are hoping that someone can prove that the CSPRNG is not random, so they can derive the next output and unlock blin00's accounts.

      Hurry, because blin00 is still stuck in Japan. You see, his return plane ticket is protected by 2FA.