Pardon me for this newbie-ish question. I'm still a novice in cryptography . I have an application that outputs random numbers from 0 - 12 (endpoints inclusive) unsequentially (some outputs are thrown off) using the mersenne twister algorithm and i would like to break and predict its seed in Python but i don't know what to program?

Once again please pardon my little knowledge in this space.

  • $\begingroup$ Are you taking the twister outputs modulo 13? $\endgroup$ – Adrian Self Jun 16 at 3:51
  • $\begingroup$ Or if you don't know implementation, what method call are you making in python? $\endgroup$ – Adrian Self Jun 17 at 15:14
  • $\begingroup$ i use random.randint(0, 12) $\endgroup$ – Ozichukwu Jun 21 at 11:49

If you can identify which outputs are revealed and which are thrown off (ex. every other output is thrown off), you may be able to successfully analyze the twister so that you can predict future outputs.

However, the bigger problem here is that you are limiting outputs to the range [0,12]. With a 32 or 64 bit word length, a set of numbers in that range will not reveal nearly enough information about the state (even if none were discarded and all outputs were revealed to you).

| improve this answer | |
  • $\begingroup$ it's not just one number. it's a series of unsequential outputs in range 0 - 12 $\endgroup$ – Ozichukwu Jun 16 at 14:35
  • $\begingroup$ Yes, this answer takes that into account. I will edit the wording so it is more clear. Do you understand the issues at hand? $\endgroup$ – Adrian Self Jun 17 at 15:12
  • $\begingroup$ I have 1665 of such outputs which is enough. My problem in all this is that i understand the theory (beginner level) but i have no idea what to code $\endgroup$ – Ozichukwu Jun 21 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.