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, and rngtest operates 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 πŸ”₯


πŸ‘‘ 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 πŸ’…βœ¨