2

Looking for guidance/references with/about calculations:

I am designing a widget that creates N-bit binary sequences. My customers target spec for the sequence's minimum entropy is X bits/bit. I plan to count occurrences of run lengths of 1,2,..R in M of the N-bit output strings and compare to min and max thresholds Tmin1,Tmin2,..TminR, and Tmax1,Tmax2,..TmaxR respectively in order to pass/fail each widget on the factory floor.

I am looking for the math to help me determine the parameters M and R as well as the thresholds [Tmin] and [Tmax] in order to have a given level of confidence in my result.

Apologies if I butchered the notation. I am not a mathematician :)

Any tips greatly appreciated.

user16663
  • 21
  • 1

1 Answers1

1

If the sequences are supposed to be perfectly random, you may want to take a look at e.g. the NIST statistical test suite. However, you should be aware that statistical tests don't prove or really even estimate entropy. They are just a sanity check that tells you whether the numbers look random. Non cryptographic PRNGs that are completely predictable can pass them.

If the numbers are meant to be used for cryptographic purposes, I would recommend approaching the problem from the opposite direction: start from real entropy from the OS, use known good primitives to build a CSPRNG. Better yet, find a library that already does all that.

otus
  • 32,462
  • 5
  • 75
  • 167