I had an idea of creating a pseudo-random binary sequence with that code:
import random as rd
p=[]
k=10**6
for i in range(k):
p.append(rd.getrandbits(1))
s=''
for i in p:
s+=str(i)
a=p.count(0)
b=p.count(1)
f = open('s.txt', 'w')
f.write(s)
f.close()
And on the stage of testing it with NIST tests there came a question of choosing right parameters for launching them. If I set the length of the sequence for this file for 100000 and number of bitstreams for 1, will it mean that from this file i will have only first 100000 bits tested as one sequence? Should the data in file be separated in some way?
I have also checked this question on crypto.stackexchange, but to be honest it didn't help me. Reading the official docs for NIST package didn't bring no understanding of bitstreams parameter too.
I will be very grateful if you explain me, how to set number of bitstreams parameter correctly and explain the meaning of it in this situation and the way the input data should be given to the tests.
random
module does not make a good PRNG, because it uses the Mersenne twister, but the NIST tests won't tell you that—the NIST tests were written without knowledge of how Python'srandom
module works. $\endgroup$