Questions tagged [statistical-test]

Statistical testing is used to estimate the likelihood of a hypothesis given a set of data. In cryptanalysis, statistical testing is commonly used to detect non-randomness in the data, e.g. distinguish the output of a PRNG from a truly random bitstream or to find the correctly decrypted message among several incorrect decryption attempts.

Filter by
Sorted by
Tagged with
14 votes
5 answers
3k views

How to prove the security of the PRNG?

Are there any realties tests or criterias that prove the security of the PRNG? What kind of tests or criteria?
2 votes
1 answer
59 views

Interpretation of the Result of Dieharder Battrery of Tests: Very High p-value Result in rgb_lagged_sum Test in Dieharder Results in "WEAK" Assesment

I'm currently testing the randomness of using SHA-256 in Hash_DRBG mechanism based on this research. The parameters used in the testing are the default parameters, except for when the PRNG fails a ...
2 votes
1 answer
198 views

What are the expected values of a particular rotational-XOR property of a sequence of random bitstrings?

Assuming that $x$ is a sequence of $l$ bits and $0 \le n < l$, let $R(x, n)$ denote the result of the left bitwise rotation of $x$ by $n$ bits. For example, if $x = 0100110001110000$, then $$\begin{...
2 votes
2 answers
151 views

Interpretation of NIST suite test results with asterisks

I have a question on how to interpret test results of NIST test suite. First, when the asterisk mark appear on the report, what does it mean? I thought it means the random sequence fails the test. ...
0 votes
1 answer
133 views

Discrete Fourier transform (Spectral) test

I am designing a pseudo random bit generator (PRBG) and I am using the NIST SP 800-22 suite to analyze the random characteristics of my PRBG. It turns out that my PRBG passes 14 out of 15 tests, and ...
1 vote
2 answers
81 views

Should I Test A PRNG Using A Fixed Entropy Source For Its Seed?

I want to test a C implementation of Hash_DRBG—which test_demo.c file I will modify to produce random binaries indefinitely to STDOUT as to be used by piping its output—using DIEHARDER for a research. ...
5 votes
4 answers
1k views

How to compute the dataset size required by dieharder tests?

I am trying to use the dieharder random number test suite. However, this suite requires massive amount of data (this paper claims 228GB for no rewinding for every test) for most of the tests. I'd like ...
4 votes
2 answers
197 views

Is it valid to transform the tested sample file and re-test, rather than invent additional randomness tests?

I'm enhancing the venerable ent randomness test suite. And I came across this idea in On Independence and Sensitivity of Statistical Randomness Tests. "To ...
1 vote
1 answer
114 views

Use of PRNG's vulnerability for attacking a cryptographic system

I am investigating a PRNG which fails some of NIST tests (FFT, ApproximateEntropy and Serial). If such a generator is used in cryptography for any purpose, what consequences can it has? How this ...
0 votes
0 answers
153 views

How to use NIST SP 800-22 to check randomness of 128 bits output in AES?

I am trying NIST SP 800-22 to test the randomness of 128 bit output in AES, but i always get igamc: UNDERFLOW or Segmentation fault (core dumped) error. My data file has 128 bit output format, for ...
1 vote
1 answer
149 views

Randomness of recursive sequence generation

How good from a randomness point of view are recursively generated sequences using good encryption algorithms? Let us say I take AES128 which generates good random sequences of outputs for counter ...
2 votes
1 answer
319 views

Walsh-Hadamard transform in randomness testing

I am working on using the Hadamard transform as a way to map randomly generated values and then apply statistical tests as defined by Nist or other institutions. One resource online I found ...
3 votes
0 answers
84 views

Proving that a PRG is predictable

I am attending the video lectures from Prof Dan Boneh. He gives the following example. Let $G:\mathcal K\longrightarrow \Bbb Z_2^n$ be a PRG with the property that from the last $\frac{n}{2}$ digits ...
2 votes
1 answer
191 views

NIST algorithm testing results

I have an algorithm that encrypts large text. I want to test this algorithm on statistical tests. The ciphertext contains ~10,000,000 bits. I decided to test the ...
1 vote
1 answer
149 views

Frequency Monobits Test

As detailed in the paper Statistical test suite for random and pseudorandom number generators for cryptographic applications by NIST, the first test is given as a basic significance test, it uses a ...
2 votes
0 answers
55 views

NIST statistical tests [duplicate]

I'm having trouble testing a not-so-popular algorithm that I haven't found an implementation of, so I wrote it myself and now I'd like to test it with nist tests, but I have a suspicion that I'm doing ...
0 votes
1 answer
59 views

Runs and Autocorrelation test

I have the book "Handbook of applied cryptography". In there we have example for random tests. I have bits sequence ...
2 votes
1 answer
149 views

exact meaning of ntup in dieharder tests

I'm working with the dieharder package to test a PRNG, but I don't quite understand the ntup parameter. I get that the ntuple should be a set of consecutive bits. ...
0 votes
0 answers
63 views

Check security of random byte generator

How can I check if the random number generator library that I am using for my app is cryptographically secure or not?
0 votes
1 answer
53 views

How many $k$-bit words of a random bitstring are we expected to extract before all $2^k$ possible words occur?

Let $C(X)$ denote the cardinality of the set $X$. For example, $C(\{0\}) = 1, C(\{0, 2\}) = 2$ etc. Let $S$ denote a (potentially infinite) sequence of random bits. Split $S$ into $k$-bit words $w_1, ...
0 votes
1 answer
503 views

SHA-256 doesn't follow a uniform distribution?

I have been playing with SHA-2-256 in Julia and I noticed that the hashes produced don't appear to follow a uniform distribution. My understanding of secure hashing algorithms is that they should ...
1 vote
2 answers
181 views

Does Endianness matter in NIST SP800-22 test?

I am curious about Randomness test suite. One of the famous randomness test suite, DIEHARDER, said that Endianness does not matter for a "GOOD" random generator. Note that this is not the ...
1 vote
0 answers
56 views

composition of RLWE distributions

Assume we have the polynomial space $R_q$ defined as $R_q = Z_q/(X^n + 1)$. Additionally, we define the error distribution $\chi$ as a discrete centred Gaussian bounded by $B$. Let $s,t \in R_q$ be ...
3 votes
1 answer
508 views

Why does the NIST Runs Test include a Frequency Test?

In the NIST suite of RNG tests (https://csrc.nist.gov/publications/detail/sp/800-22/rev-1a/final), one of the tests is the Runs Test, which tests counts of runs of 1's and 0's. According to the ...
3 votes
1 answer
2k views

NIST random test suite choosing bitstream length and count [closed]

I am trying to use the statistical test suite software from NIST SP800-2. First it asks for bitstream length. ...
1 vote
1 answer
273 views

Which test suit is better to say if PRNG is CSPRNG:TestU01 or NIST?

Actually my concern is that I am planning to apply xoshiro256+ for implementation of stream cipher https://prng.di.unimi.it/ for my cryptographic application. It passes the BigCrush tests. Will it ...
2 votes
1 answer
203 views

Test the randomness of a random permutations, that was generated without Fisher-Yates?

Overview of the problem Before this gets immediately flagged as duplicate, I'm not interested in testing the Fisher-Yates shuffle for randomness, since this can simply be done by testing the ...
1 vote
4 answers
926 views

Why does mt19937 fail the universal test in NIST SP 800-22?

Update: with the help of @SqueamishOssifrage and @PaulUzdak, we discovered that my NIST SP 800-22 has a broken universal test. So this becomes a moot question. Check this report. It seems to sail ...
2 votes
1 answer
340 views

Tests to distinguish between PRNG and a CSPRNG

What are the tests which a regular PRNG would fail but a CSPRNG would succeed? Is it just the next-bit test or are there multiple other tests which a PRNG which is not a CSPRNG would fail? Would a ...
3 votes
2 answers
2k views

Interpretation of (NIST) Non Overlapping Template Matching Test

Regarding the Non-Overlapping Template test, this test normally gives us a bunch of p-values (148 values). I would like to ask that how do we interpret those values into a single p-value for ...
2 votes
2 answers
408 views

Does Cut-Choose technique for yao garbled circuit provide statistical security?

Yao Garbled circuit is 2 parties secure computation protocol between Semi honest adversaries. However, the cut-and-choose mechanism complies semi-honest garbled circuits into the one secure against ...
4 votes
2 answers
921 views

Why calculate pi to estimate randomness?

Why do testing suites calculate $\pi$ (pi) using the Monte Carlo method to determine if a series of numbers are random? As far as I can tell, the Monte Carlo method can be used to estimate $\pi$ ...
4 votes
1 answer
166 views

Minimum number of independent trials needed to detect a bias [closed]

Suppose, I suspect that the probability of occurrence of a particular bit as $0$ is $.558$. Since, it is not $.5$, so this is possibly a bias. Now, my question is: What is the minimum number of ...
5 votes
2 answers
7k views

Randomness test question from FIPS 140-1 and comparison with 140-2

In FIPS 140-1 there are 4 statistical random number generator tests (The Monobit Test, The Poker Test, The Runs Test and The Long Runs Test. Then FIPS 140-2 came along and supposedly tightened the ...
13 votes
3 answers
1k views

Estimated entropy per bit given P-value of a statistical test, and number of bits tested?

Assume that a certain statistical RNG test (say from the NIST Statistical Test Suite, Dieharder, etc..) gives us a certain P-value (per the definition [*] used in NIST Special Publication 800-22), ...
1 vote
1 answer
689 views

What is the correct way to choose the start parameters for NIST tests? [duplicate]

I had an idea of creating a pseudo-random binary sequence with that code: ...
3 votes
4 answers
832 views

Randomness Testing

Let say I have three sequences: S1 = {1,2,3,4,5,6,7,8,9,10} S2 = {3,7,1,9,4,10,5,8,6,2} S3 = {8,3,10,2,6,7,1,5,9,4} i.e. S2 and S3 are just the permutations of S1. Is there any method to check how ...
3 votes
2 answers
251 views

How can the 'randomness' of a finite sample of binary keys from a finite key space be estimated?

Given a set of bit sequences generated by an extractor, what would be a valid setting for estimating the randomness of these generated keys and what resolutions can be drawn for that extractor in ...
3 votes
1 answer
721 views

Interpretation of certain results of NIST Test Suite

I am using NIST Test suite on a PRNG and have a confusion regarding some specific results. Following is the part of the results: ...
2 votes
1 answer
1k views

NIST random excursion results

NIST specifies so-called random excursions test and random excursions variant test. From the description I can derive that the number of p-values should be 8 in the first case and 18 in the second. ...
1 vote
0 answers
87 views

Randomness Test of Permuted Sequence

As we can generate a permuted sequence using KEY in KSA (Key Scheduling Algo) of RC4. Is there any way to check the randomness of the permuted sequence? Let say I created 100 different permuted ...
2 votes
2 answers
724 views

How to actually compute the statistical distance?

I have an algorithm for discrete sampling that I've defined. This is to say that $A$, upon input some pdf $p(x)$, outputs samples from the pdf $p(x)$. There are some nuances (you have to make the ...
1 vote
2 answers
307 views

Statistical Tests for Pseudorandom Functions

Say I have an implementation of a potential Pseudo-Random function and I want to test whether my implementation does at least not contain any obvious flaws. As far as I understand, in other ...
3 votes
2 answers
195 views

How to make a hypothesis test for a simple statistical test for a certain RNG?

I'm self-studying about hypothesis test in the context of RNGs. I'm building a hypothesis test from scratch. I'm taking the simplest statistical test I can think of: how many $1$s are there in the ...
1 vote
1 answer
213 views

Origin of the Chi-Squared test statistic for serial test (two bit test)

On page 181 of Handbook of Applied Cryptography Chapter Five, it states the following: The purpose of this test is to determine whether the number of occurrences of 00, 01, 10, and 11 as ...
2 votes
1 answer
256 views

NIST STS incorrect results for sample files

So I wanted to check the outcome of a hardware TRNG and see if its entropy is good enough. I downloaded the source files for statistical test suit from nist.gov website, compiled them on my macOS ...
3 votes
2 answers
678 views

Differential privacy definition

Differential privacy defines "privacy" of a mechanism $A$ as the "closeness" of the two distribution $Pr[A(D) \in S]$ and $Pr[A(D') \in S]$ where $D,D'$ differ in one element. And the distance between ...
5 votes
1 answer
1k views

Is there are a metric based on collisions to compare bad hash functions?

Bad hash functions are not so perfect as in the "general collision probability" hypothesis... And a general concept of "collision resistence" not need the constraint of independence between the ...
4 votes
1 answer
1k views

Golomb's Randomness postulates

In Handbook of applied cryptography, Golomb's randomness postulates are given: Let $s$ be a periodic sequence of period $N$. Golomb’s randomness postulates are the following. R1: In the cycle $s_N$ ...
3 votes
1 answer
2k views

How is the inter and the intra distance of a PUF calculated?

I was wondering, if I want to calculate the intra distance of a PUF, and I have already measured $n$ times a response to a challenge. Do I choose one reference value and compare the hamming distance ...