Topic: NIST STS 2.1.2
Date: [MM/DD/YYYY]
Source: [NIST SP800-22, Software Documentation, Personal Testing]
Key Points
- NIST STS is used to assess the randomness of binary sequences.
- Includes multiple tests defined in the NIST SP800-22 publication.
- Requires a properly formatted bitstream as input.
- Must be built using
makeandgccon a Unix-like system. - Test results are stored in the
experiments/directory.
Examples & Details
โ Prerequisites
-
Linux/macOS/WSL/Cygwin with:
-
make -
gcc
-
-
Terminal and file access
๐ฆ Download and Extract
unzip sts-2.1.2.zip
cd sts-2.1.2
๐ ๏ธ Build the Suite
make
๐งช Input File Format
-
Pure 0s and 1s, no headers, no whitespace.
-
Example:
01010011010101...
๐ Run the Suite
./assess 1000000
Interactive options:
- Input file
- Select tests
- Run tests
- View results
- Exit
Follow steps: 0 โ 1 โ 2 โ 3 โ 0
๐ Output
Stored in:
experiments/AlgorithmTesting/
โโโ data.epsilon
โโโ results.txt
โโโ stats.txt
Each test result includes logs and summaries.
๐งช Common Test Numbers
| Test # | Name |
|---|---|
| 1 | Frequency (Monobit) |
| 2 | Block Frequency |
| 3 | Runs |
| 4 | Longest Run of Ones |
| 5 | Rank |
| 6 | Discrete Fourier Transform |
| 7 | Non-overlapping Template |
Questions & Clarifications
- How are thresholds for p-values determined across different tests?
- What is the statistical basis for deciding pass/fail?
- Can custom test suites be integrated?
Action Items / Next Steps
- Automate test run with
subprocess/Python - Generate visual summaries of p-value distributions
- Compare test results across multiple RNG implementations
- Read SP800-22 full documentation
Summary
NIST STS 2.1.2 is a powerful suite for validating the statistical randomness of bitstreams. After compiling the suite, a clean binary file of known length can be tested via an interactive CLI. Results are saved for inspection. Automation is possible using scripting, and understanding individual test behavior is key for interpreting results.