Home > OS >  Is it possible to obfuscate PDF file binary data?
Is it possible to obfuscate PDF file binary data?

Time:10-16

Is it possible to obfuscate the bytes that are visible when a PDF file is opened with a hex editor? Also, I wonder if there is any problem in viewing the contents of the PDF file even if it is obfuscated.

CodePudding user response:

You will always be able to see whatever bytes are within a file using a hex editor. There might be ways to generate your pdf pages using methods that don't involve directly writing the text into the pdf (for example using javascript that's obfuscated).

CodePudding user response:

Like answered above, the bytes of the file are always visible when being viewed with a hex-editor. However there are some options to hide/protect data in the file:

  • You could encrypt either the whole pdf or partial datasets. Note that an encryption/decryption always requires a secret. When the file is fully encrypted you can't read it without the key.
  • You can add additional similiar dataframes but set them invisible in the pdf. Note that this technique blows up the size of the file.
  • You can use scripting languages which dynamicly build up your pdf. Be aware that this could look suspicious to users or any anti-virus software.
  • You can use tools steganography to hide your data. For example a tool you could use is steghide
  • You can simply compress datastreams in the pdf, e.g. using gzip or similiar compression tools. That way you can't read it directly. However that is easy to recognize and to uncompress for anyone.
  • Related