I am trying to use the statistical test suite software from NIST SP800-2.

First it asks for bitstream length.

Usage: ./assess <stream length>
   <stream length> is the length of the individual bit stream(s) to be processed

After file is given to program, it asks for;

How many bitstreams?

How can I determine that values? Let's say I have 1000000 32-bit ASCII sequence of 0s and 1s in a file like;


Which values will be appropriate for this?

  • 2
    $\begingroup$ This question should have been alive, why closed? $\endgroup$
    – Ender
    Apr 24, 2020 at 11:00
  • 2
    $\begingroup$ @Ender I agree. Anybody that knows anything about cryptography knows that random number theory is extremely relevant to the subject. In fact, the title of the paper talking about the test suite is "A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications". I am severely unimpressed with whomever thought it was a good idea to close this as "off-topic." Nothing could be further from the truth. $\endgroup$ Oct 29, 2020 at 20:20
  • 1
    $\begingroup$ I tried to edit it and add a context sentence in the hope that the moderators will re-open it. $\endgroup$
    – DurandA
    May 22, 2021 at 1:25
  • $\begingroup$ Given that this question has +5 votes associated with it, I vote to re-open... @DurandA $\endgroup$
    – Paul Uszak
    May 22, 2021 at 14:28

1 Answer 1


Look for the document "NIST Randomness Testing SP800-22b.pdf" (or more recent updates if available) in the NIST website.

My guess is that your sequences are way too short (32 bits long) and no kind of statistical convergence can be expected to occur, which is necessary for the test to work. I presume this may be the reason why you get the error message.

The section "sequence length", p.102 in the NIST document states:

The determination as to how long sequences should be taken for the purposes of statistical testing is difficult to address. If one examines the FIPS 140-1 statistical tests, it is evident that sequences should be about 20,000 bits long.

Coupled with this, you have 1 million such outputs. Depending on the conditions of how these outputs were obtained, you may want to concatenate them into longer outputs, in some principled manner.

  • $\begingroup$ I read several parts of this pdf but I might have been skipped that part. Then I have to find an optimal sequence length. $\endgroup$
    – ctulu
    Oct 24, 2016 at 7:51
  • $\begingroup$ As I've read thru all test details, each sequence to be tested should consist of a minimum of 1,000,000 bits to conduct all the test, otherwise it might fail in some tests. At page 102, it says that: " Value is undefined if less than 10 sequences are processed. As noted Section 4.2 at least 55 sequences must be processed to derive statistically meaningful results for the uniformity of p-value" $\endgroup$
    – Ender
    Feb 14 at 11:39

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