RNGTEST(1)
π RNGTEST(1) β like, the vibe check for your random data π
okay bestie, so this is rngtest, section 1 of the General Commands Manual, and she is literally here to check whether your data is actually random. No cap. Grab a snack π, we're doing FIPS 140-2 today.
β¨ NAME β¨
rngtest β Check the randomness of data using FIPS 140-2 tests
π SYNOPSIS π
rngtest [-c n | --blockcount=n] [-b n | --blockstats=n] [-t n |
--timedstats=n] [-p | --pipe] [-?] [--help] [-V] [--version]
π¦ DESCRIPTION π¦
So here's the tea: rngtest works on blocks of 20000 bits at a time, and it runs the FIPS 140-2 tests (specifically the errata of 2001-10-10, iykyk) on each block to verify that the data is actually random. She's thorough. She's iconic. π
She takes input from stdin, and sends statistics out to stderr. Optionally? She'll echo the blocks that passed the FIPS tests to stdout β but only when she's operating in pipe mode. Errors go to stderr too, obviously.
Now bestie, listen, at startup rngtest will throw away the first 32 bits of data when operating in pipe mode. Then it uses the next 32 bits of data to bootstrap the FIPS tests (yep, even when it's not operating in pipe mode). Those bits do not get tested for randomness. They're just the little starter bits, the appetizer, the pregame. π«Ά
Statistics get dumped to stderr when the program exits. Periodt.
π OPTIONS π
-p,--pipeβ Enable pipe mode. Every data block that passes the FIPS tests gets echoed to stdout, andrngtestoperates in silent mode. π€«-c n,--blockcount=n(default:0) β Exit after processing n input blocks, if n is not zero.-b n,--blockstats=n(default:0) β Dump statistics every n blocks, if n is not zero.-t n,--timedstats=n(default:0) β Dump statistics every n seconds, if n is not zero.-?,--helpβ Give a short summary of all program options. The little cheat sheet, the sparknotes. β¨-V,--versionβ Print program version.
πΈ STATISTICS πΈ
rngtest will dump statistics to stderr when it exits, and also whenever it's told to by blockstats or timedstats. She's not shy, she will read you the numbers. π
FIPS 140-2 successes and FIPS 140-2 failures count the number of 20000-bit blocks either accepted or rejected by the FIPS 140-2 tests. The other statistics show a breakdown of the FIPS 140-2 failures, sorted by which FIPS 140-2 test they failed. For more info, go read the FIPS 140-2 document itself β and heads up, these tests are defined on FIPS 140-1 and the FIPS 140-2 errata of 2001-10-10. They were removed in the FIPS 140-2 errata of 2002-12-03. Yes bestie, they're gone-gone. π
The speed statistics are taken for every 20000-bit block transferred or processed. Every single one. She's keeping receipts.
π EXIT STATUS π
0β if no errors happen, and no blocks fail the FIPS tests. Flawless. No notes. π1β if no errors happen, but at least one block fails the FIPS tests. Oop. π10β if there are problems with the parameters.11β if an input/output error happens.12β if an operating system or resource starvation error happens.
π₯ SEE ALSO π₯
random(4),rngd(8)- FIPS PUB 140-2 Security Requirements for Cryptographic Modules, NIST,
http://csrc.nist.gov/groups/STM/cmvp/standards.html
π AUTHORS π
Henrique de Moraes Holschuh <hmh@debian.org> β the main character who made all this happen. We stan. π«Ά
and that's the whole page bestie!! rng-tools 6.17, from way back in March 2004 β yeah, she's vintage, she's a classic, and she still ate. mwah π β¨
π¦ where this page comes from
- alpine 3.22: rng-tools-doc 6.17-r0 Β· GPL-2.0-or-later
- alpine 3.23: rng-tools-doc 6.17-r0 Β· GPL-2.0-or-later
- alpine 3.24: rng-tools-doc 6.17-r2 Β· GPL-2.0-or-later
- arch rolling: rng-tools 6.17-3 Β· GPL-2.0-or-later
- fedora 43: rng-tools 6.17-7.fc43 Β· GPL-2.0-or-later
- fedora 44: rng-tools 6.17-8.fc44 Β· GPL-2.0-or-later
- nixos 26.05: rng-tools 6.17
- nixpkgs unstable: rng-tools 6.17
- opensuse-leap 16.0: rng-tools 6.17-bp160.1.10 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rng-tools 6.17-bp160.1.10 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rng-tools 6.17-bp160.1.10 Β· GPL-3.0-or-later
- ubuntu stonking: rng-tools 6.17-3 Β· GPL-2.0-or-later
- Copyright (c) 2004 Henrique de Moraes Holschuh -- hmh@debian.org
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms