Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

16
votes
1answer
1k views

Why did NIST remove The Lempel-Ziv Compression test from the Statistical Test Suite?

NIST removed "The Lempel-Ziv Compression" test from the Statistical Test Suite in revision 2008 and above and has not incorporated it since – see revision 2010. Why was it removed? Does it no longer ...
16
votes
2answers
6k views

Shannon confusion and diffusion concept

I read the document(not the whole document) from Shannon where he speaks about the concepts of confusion and diffusion. I read in many places(not in the document but around the internet) that ...
13
votes
4answers
562 views

Tactics available to help prove security of a new system?

I believe that the accepted tactic to "prove" a system as secure is to allow the crypto-community to review it and if no vulnerabilities are found over a long period of time (5 or 6 years), then a new ...
11
votes
2answers
2k views

Measuring entropy for a ciphertext only attack

When bruteforcing a password (e.g. the common attacks on DES), where you have ciphertext only, you need a way to assess whether a decrypted plaintext is the right one. I believe the EFF DES machine ...
10
votes
5answers
2k 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?
9
votes
3answers
654 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), ...
7
votes
1answer
3k views

Example of CHI Square test on Caesar Cipher?

I am trying to get my head round the chi square test, when used with the Caesar cipher. I started off using this formula, $$ X = \sum_{i = 1}^k \frac{f_i · f'_i}{n · n'} $$ Where $...
5
votes
2answers
129 views

How does one measure the decrease in security, if any, of RC4 when mapping to a specific range of values?

For a project using RC4, the output is to be mapped to values of 0 to 35. Thus, only 36 unique output values representing the letters A to Z and 0 to 9. To avoid bias, the RC4 byte output (with a ...
5
votes
2answers
5k 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 ...
5
votes
0answers
490 views

Odds of false error detection in a randomness test using the chi-squared test?

Common Criteria classifies the requirements for true Random Number Generators, and specifies how these should be tested against failures (these can occur accidentally, or following deliberate attack, ...
4
votes
4answers
866 views

Given $n$ bits, how many “truly random” sequences/numbers can be constructed?

Suppose we have $n$ bits, so we can have $2^n$ different bit sequences. Some sequences don't look random, say, all $1$ or $0$. There are also other patterns like $10101010…$, $11001100…$ and such. I'...
4
votes
1answer
279 views

What problems with “random” data would cause this result from Ent?

I'm playing around with a novel kind of source of "random" data and Ent is currently giving me results like this: Entropy = 7.977080 bits per byte. Optimum compression would reduce the size of this ...
4
votes
1answer
130 views

Statistical tests for pseudorandom permutations

I'm implementing a format-preserving encryption scheme similar to those described in the literature. I want to sanity test my PRP using some statistical tests like TestU01. However, I'm not sure how ...
4
votes
1answer
2k views

How to test distribution of a hash function?

From what I've found, it is generally accepted a cryptographic hash function like SHA-2 has an evenly, randomly distributed output. Is there a way to test this without running through the entire 2^...
4
votes
1answer
87 views

Sequence test for an image cipher

I am reading a paper on security analysis of a cipher image using the paper at the following URL: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8306512&tag=1 It indicates some ...
4
votes
1answer
254 views

Statistical tests for PRNG that generates a sequence which is not binary

Is there a pratical application to PRNG that generates a sequence which is not a binary one? A ternary, quaternary sequence, for instance. If so, how can we test this? Is there any alternative test ...
4
votes
0answers
147 views

Using machine-learning techniques for data-dependent operations in ciphers

From 'Methods of Symmetric Cryptanalysis' by Dmitry Khovratovich, The data-dependent operations are one of the most controversial design concepts. We say that an operation is data-dependent, if it ...
4
votes
0answers
168 views

Feasible way to check n-dimensional equidistribution of PRNGs

I am currently gathering some test methods and test suites for random number generator qualities, and am a bit stuck at finding something feasible to test for n-dimensional equidistribution. As input ...
3
votes
2answers
500 views

Is the RC4 keystream random or not?

I have cause to use the PRNG half of RC4, but am seriously confused as to the randomness of its output. (Only the PRNG half.) On the one hand, there is a large body of literature finding ever ...
3
votes
2answers
594 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$ ...
3
votes
1answer
528 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 ...
3
votes
3answers
138 views

Is it correct to concatenate (pseudo-)random byte values before testing them with the NIST suite or tools like dieharder?

Let's assume I have thousands of (pseudo-)random 4-byte values. The values are 4 byte random values which a blackbox device gave me. I got these values by requesting them. In between others might have ...
3
votes
1answer
155 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
1answer
101 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 ...
3
votes
1answer
159 views

Is my implementation of a PRG at least intuitively secure?

I've devised a PRG using Bezier curves , constructed with Bernstein polynomials, and I was wondering if you guys could help me with some suggestions or constructive criticism. Basicly I take a random ...
3
votes
2answers
85 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 ...
3
votes
1answer
180 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 ...
3
votes
1answer
413 views

Avalanche effect sample size

With a fixed key size – key has 128 bits, while block size is 8 byte – how do I calculate how many different keys and texts I have to test for an cryptanalytic statistics study? Differently worded: ...
2
votes
1answer
247 views

How can I calculate non-linearity of an s-box element wise?

First i transform the s-box into row matrix like if i have 4×4 s-box having 16 elements into 1×16 row matix then substitute the binary values in column . multiply the matrix by mobius trasformation ...
2
votes
2answers
917 views

What values constitute failing for ENT tests?

The dieharder tests give a clear PASSED, WEAK, etc and I'm wondering what those thresholds ...
2
votes
1answer
59 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 ...
2
votes
1answer
87 views

adaptation of NIST sp800-22 for short sequences

I would like to ask about the NIST test suite for randomness evaluation. The test suite consists of 15 subtests which evaluate the particular property of the sequence. In fact, each test has an ...
2
votes
1answer
186 views

run length testing [closed]

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 ...
2
votes
2answers
255 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 ...
2
votes
0answers
44 views

Statistical test strange behaviour [closed]

Hi I'm running the dieharder test suite (this) to test an algorithm, but I've found somethings that I don't understand. This is the command that I run to test my binary file ...
2
votes
0answers
100 views

Infer encoding mechanism from $n$-grams distance?

I have a series of obfuscated strings which across the set of strings have regions of high variance and regions of low variance – implying some encoding mechanism as opposed to an encryption procedure ...
2
votes
0answers
506 views

Chi-Squared Step of Vigenere Cipher Decryption [duplicate]

So, I have been assigned an assignment where I had to solve a Vigenere cipher. Following along with this webpage I managed to get all the way to the chi-squared step. But, that is the problem. Upon ...
1
vote
2answers
98 views

Is it possible to test 15-bit PRNG with the library TestU01?

The library TestU01 inconvenient for generators that don't produce 32-bit outputs. But is it possible to somehow test say a 15-bit generator with it? How could that be done? For instance, the ...
1
vote
1answer
129 views

Plaintext for randomness evaluation of cryptographic algorithms?

I’m running an experiment to test the randomness output of many cryptographic algorithms based on INST test suite to measure the randomness of their outcome. However I’m searching to a sample data ...
1
vote
1answer
580 views

Quality test for an hardware source of randomness

Say that I developed an hardware source of randomness, which I would like to use to seed a cryptographically secure random number generator. How would I go about testing it? Are there standardized ...
1
vote
2answers
54 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
2answers
116 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 ...
1
vote
1answer
623 views

Testing implementation of cryptography algorithms: Brainstorm

I wonder what kind of techniques can be used to validate implementation of cryptography algorithms? The obvious one is to run specific algorithms against publically known test vectors (i.e. from ...
1
vote
1answer
101 views

Available programs that can verify the working of a simple substitution cipher

Is there any tool available that can test whether a simple substitution cipher is working. I will put my scenario in detail. Lets say I built a simple substitution cipher that maps 8 bit data to 16 ...
1
vote
1answer
69 views

Determining the degree of freedom for a chi-squared test on a strict avalanche criterion matrix

I have read that the degree of freedom is calculated by subtracting 1 from the number of states a random variable can be in. I am performing a goodness of fit test on a 64*32 strict avalanche ...
1
vote
1answer
40 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 ...
1
vote
0answers
48 views

How to perform Black box testing of a key exchange protocol?

Though obviously not an alternative for proper cryptanalysis, I was wondering about statistical/black box analysis. Should I produce a new key exchange protocol. With the same shape as Diffie-Hellman: ...
1
vote
0answers
156 views
1
vote
0answers
95 views

LIL (PRNG) statistical test does not appear to be in a stable state [closed]

I am trying to run the LIL statistical testing tool that can be found here http://webpages.uncc.edu/yonwang/liltest/ When I execute the jar with: ...