5

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: I am planning to encrypt multiple samples and see how many bits have changed, compared to the input block. Finally I plan to create a Histogram and get conclusions. If the cypher algorithm is good, half of the bits should have changed (50%).

The problem is that I do not know how many samples I have encrypt to gain a good statistical foundation. How many blocks do I have to (or should I) encrypt, and what formula should I be using?

otus
  • 32,462
  • 5
  • 75
  • 167

1 Answers1

2

You can use the Frequency test of the NIST statistical random number test suite. ( see http://csrc.nist.gov/groups/ST/toolkit/rng/documents/SP800-22rev1a.pdf, chapter 2.2).
In that chapter is also stated the recommended sample size.

I would propose to encrypt a block of zeroes with different randomly selected keys.

Another test would be to fix the key and use random plaintexts $t$, encrypt it $c= enc(t)$ and fit $t \oplus c$ to the frequency test.