I am creating a web app that applies Python's random
algorithm (Mersenne Twister) to generate random 12-bit integers. I am concerned as to how a user can predict future results by recording the needed number of sequence using API calls
import random
def rand12bits():
return random.randint(0, 4095)
How many of these outputs do i need to predict the future sequence?
I am aware that with enough (624) observed outputs of 32 bit integers, it can be reversed. But in this case, the RNG is only giving off 12 bit integers. Am I missing something? Pardon me for my naivity I am new at this.
random
rather than python'ssecrets
, reportedly available since 3.6 and generating cryptographically strong random numbers? $\endgroup$