# 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: 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?

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.