0
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ "I computed the shannon entropy"; unlikely; Shannon entropy is defined entirely in terms of probability distribution; what probability distribution did you use? $\endgroup$ – poncho Mar 15 '16 at 21:46
  • 1
    $\begingroup$ @poncho, "replacing probability with frequency" $\endgroup$ – user3360601 Mar 15 '16 at 21:53
  • 2
    $\begingroup$ 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. $\endgroup$ – poncho Mar 15 '16 at 21:59
  • $\begingroup$ @poncho, thanks! how I couldn't see that! I just need to enlarge alphabet. $\endgroup$ – user3360601 Mar 15 '16 at 22:11
2
$\begingroup$

What you did in your entropy estimation is effectively modeled 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.

(The comment converted into an answer because, well, it appears to be the answer)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.