Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Our encrypted PDF got hacked

We are encrypting our PDF with the following iText code. However, someone was able to edit our pdf (I am not sure how).

pdfWriter.setEncryption(null, null, PdfWriter.ALLOW_SCREENREADERS
    | PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING,
    PdfWriter.ENCRYPTION_AES_128);

Is there a better way for us to secure the pdf to prevent this?

like image 825
James Young Avatar asked Dec 12 '22 15:12

James Young


1 Answers

PDF Encryption and restriction of information relies purely on the goodwill of the authors of the viewer software to enforce that restriction.

Generally speaking, every application that has enough information to display the PDF has enough information to print the PDF, there's nothing really you can do about it.

Since there are plenty of open-source PDF viewers out there, it's very easy to produce a viewer that simply ignores those restrictions.

See this explanation of the PDF encryption mechanism for more detail.

like image 112
Joachim Sauer Avatar answered Dec 28 '22 08:12

Joachim Sauer