1
$\begingroup$

Thank you for the answers, I have edited my questions.

It is a known fact that encrypting the files increases the file entropy. You can see the average entropy values of encrypted and non-encrypted versions of the different files in this paper (see figure 2). After I read this paper I check out my encryption algorithm and I notice that I was using base64 encoding while overwriting the file and that was decreasing the file entropy. So my problem is solved.

$\endgroup$
8
  • 2
    $\begingroup$ Welcome to Cryptography.SE. What are the sources? Do they execute an average and if so on how many files? What kind of encryption is used? External or the PDF's internal encryption? What is their entropy method what is yours? Did you try the same files? There are so many missing points that we cannot provide an answer to your question. $\endgroup$
    – kelalaka
    Commented Mar 11, 2021 at 19:23
  • 1
    $\begingroup$ Even assuming your measurement is correct, if you didn't measure the entropy before encryption you can't conclude that it went down. Estimates are estimates and different documents can have different values. $\endgroup$
    – bmm6o
    Commented Mar 11, 2021 at 23:42
  • 1
    $\begingroup$ pdflib.com/pdf-knowledge-base/pdf-password-security/…. $\endgroup$
    – kelalaka
    Commented Mar 12, 2021 at 16:22
  • $\begingroup$ Rather than closing (and shooing off another new user), perhaps we can wait a little? That's what the comments thingie is for... $\endgroup$
    – Paul Uszak
    Commented Mar 12, 2021 at 17:22
  • $\begingroup$ @PaulUszak you are right, however, the OP was here 18 hours ago. Even closed, they may edit the question and ask for a re-open. $\endgroup$
    – kelalaka
    Commented Mar 12, 2021 at 17:36

1 Answer 1

1
$\begingroup$

As bmm60 comments, its not clear that the entropy has gone down. There are many forms of encryption that still preserve some level of information about the input (the encrypted version of a bitmap under a block cipher using ECB is a good example). It's also possible that your encryption product adds unencrypted metadata to a file and if there's a large amount of metadata relative to the file size and the metadata is of a very stereotyped form (such as English readable ASCII) then this will have less entropy than the pdf format.

Without more detail on the input and encryption method, there is a limit to what can be said.

UPDATE: According to the description of PDF encryption in this Black Hat talk 256-bit AES-CBC is used. For lengthy plaintexts this should remove bytewise structure and the bytewise entropy should tend towards 8-bits for larger texts. However, the talk also says that PDF encryption only encrypts some of the objects in PDF's Carousel Object Structure and the other objects are unencrypted, largely human readable, markup language which might have a bytewise entropy of only 4-5 bits (English language words have a bytewise entropy in this range). Therefore if the input file is quite short or has a lot of object structures that are neither stream nor strings, the entropy will be closer to this figure. For pdfs with more pages (and hence larger string and streams sections) the entropy should be closer to 8-bits.

Thanks to kelalaka for pointing out the Black Hat talk.

$\endgroup$
2
  • $\begingroup$ Is there any evidence that PDF uses ECB or any encryption that keeps or lovers the entropy? $\endgroup$
    – kelalaka
    Commented Mar 12, 2021 at 16:29
  • 1
    $\begingroup$ That is over inference with a lack of evidence. PDF is never used AES in ECB mode! page 30. This question, actually, is not answerable without any further clarification from the OP. $\endgroup$
    – kelalaka
    Commented Mar 12, 2021 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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