# Why does AES ciphertext entropy always close to 8?

I have three binary files: 31744 byte length (1), 5712980 byte length (2) and 10806008 byte length (3).

The alphabet is all 256 symbols from 00 to ff. I compute the shannon entropy, replacing probability with frequency.

(1) H = 4.291334237835409

(2) H = 7.999155088532762

(3) H = 7.993862849926811

Then I encrypted all three files with AES. Alphabet is still the same. I computed the shannon entropy.

(1)' H = 7.255697988479884

(2)' H = 7.999970021706294

(3)' H = 7.999829860973214

Ok, I see the difference and the entropy of encrypted data is higher, it is expected.

But why entropy of encrypted data close to 8 and doesn't grow up? Entropy of plaintext bytecode is growing up with the size of data, but entropy of encrypted bytecode doesn't grow up with the size of data. Please, give me answer and some links if they exsist.

• "I computed the shannon entropy"; unlikely; Shannon entropy is defined entirely in terms of probability distribution; what probability distribution did you use? – poncho Mar 15 '16 at 21:46
• @poncho, "replacing probability with frequency" – user3360601 Mar 15 '16 at 21:53
• So, what you did is effectively modelled the process of selecting a random byte from the file, and computed the entropy that would be in that byte? You can do that (and, since you have the exact probability distribution, you could compute the Shannon entropy). However that would also answer your question - such a process would give you an 8 bit value; of course the entropy in that byte can't go beyond 8. – poncho Mar 15 '16 at 21:59
• @poncho, thanks! how I couldn't see that! I just need to enlarge alphabet. – user3360601 Mar 15 '16 at 22:11