# Do the NIST tools on GitHub measure entropy reliably? [closed]

There is a supposed NIST tool called SP800-90B_EntropyAssessment on that Git thing. It's designed to be used in accordance with NIST's Recommendation for the Entropy Sources Used for Random Bit Generation. Essentially the tools measure entropy in datasets from entropic data sources. It's meant to output 0 - 8 bits/byte, (but be warned that the Python tests take many hours to complete).

I don't know if that Git repository is officially sanctioned by the US Department of Commerce, or if these tools have been written by hobbyists during their lunch breaks.

• The C++ IID tool doesn't compile at all (bzlib.h: No such file or directory)

• The C++ non-IID tool gives the included 1.2MB $\pi$ sequence an entropy of 0.08 bits/byte, which is based on a Compression Test Estimate. That's a tenth of what I measure it at, and it's hard to reconcile with the scientific consensus that the constant is perfectly random. The expected value should be ~1 bit/byte give or take the min-entropy variance.

• It's not clear as to whether their $\pi$ sequence is IID or non-IID as it's an odd file format and the definition of IID is vague regarding the degrees of a Markov sequence.

• For some combinations of test and data source, you can get entropy > 8 bits/byte which infers a very good entropy generator or poorly validated code (definitely missing assert statements).

Does anyone have experience of this tool? I've never read any TRNG paper that's ever mentioned using it to estimate their entropy. And I've read a lot of them. Perhaps I've misunderstood what the tool does. Can this tool be relied upon to measure entropy correctly and securely?

## closed as off-topic by e-sushiMar 31 '18 at 4:45

• This question does not appear to be about cryptography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• @e-sushi Err, how is this different to the recent crypto.stackexchange.com/q/57869/23115? That question is entirely about electronics, programming and even has a circuit diagram /KICAD PCB and a lot of C++ code. This question is about reliable entropy measurement, an issue that is regularly discussed here. It's exactly like use of similar NIST tools in crypto.stackexchange.com/q/57911/23115. It's not a programming question at all! – Paul Uszak Mar 30 '18 at 20:34
• It asks (a) for opinion on the github repo you linked to Can this tool be relied upon to measure entropy correctly and securely? (hint: NIST provides a manual/documentation) and (b) the Q msinly complains about not being able to compile it… ending up attracting coding-related answers which you sign off with a comment going You've helped but made it more confusing :-) It compiles now. Thanks, but now I can't get a sensible h value for π with either Python or C++ tools . Must just be me :-( – So, how is this not coding related? – e-sushi Mar 31 '18 at 0:32
• Wrapping it up, both those other Qs ask about statistical and mathematical problems / issues / things related to TRNG output analysis. You are asking for help using the NIST test suite you found at github — Does anyone have experience of this tool? I've never read any TRNG paper that's ever mentioned using it to estimate their entropy. And I've read a lot of them. Perhaps I've misunderstood what the tool does. Can this tool be relied upon to measure entropy correctly and securely? (Repeating my hint: NIST provides a manual / documentation) – e-sushi Mar 31 '18 at 0:55
• @valerio_new It's not my point of view, but rather the community consensus. See, depending on the individual kind of software, there are ample SE sites handling software usage, ranging from sites like Superuser down to the more general ones like AskUbuntu. Related to this, let me bluntly quote our help center: If your question is about usage of a specific cryptographic software (not its cryptographic internals), Super User is the right site. Based on this, even your interpretation of the question would mean the question is off-topic. – e-sushi Mar 31 '18 at 1:18
• For now I have to agree with the current on-hold reason. This question literally asks "Does anyone have experience of this tool?" which is fishing for opinions and thus off-topic and it asks "Can this tool be relied upon to measure entropy correctly and securely?" which asks to review the given tool to give an assessment of its functional correctness, which is also not on-topic on Crypto.SE. So please re-formulate your question such that it actually is "about mathematical entropy assessment, IID and security". – SEJPM Mar 31 '18 at 9:05

The C++ IID tool doesn't compile at all (bzlib.h: No such file or directory)

From the code:

 #include "bzlib.h" // sudo apt-get install libbz2-dev


Authors are indicating to install the bzip2 development package from your package manager, since is not installed by default. Their command will work on Debian-based distros.

You just need to install the package.
For me worked installing sudo eopkg install bzip2-devel (i'm on Solus), but it will vary upon OS and distro. Search for the bzip2 development package.

• You've helped but made it more confusing :-) It compiles now. Thanks, but now I can't get a sensible h value for $\pi$ with either Python or C++ tools . Must just be me :-( – Paul Uszak Mar 31 '18 at 0:16
• You can still edit /add if you have further insights... – Paul Uszak Mar 31 '18 at 2:01