Can somebody tell me, where is possible to hide some data into PDF file? In other words, steganography in PDF files. Is there any algorithm to do this?
Asked
Active
Viewed 2.2k times
7
-
It should be possible. After all, Adobe provides watermarking capabilities in some of its pdf products. – Stephan Branczyk Apr 19 '13 at 18:47
-
PDF supports embedding JPEG graphics. And photorealistic pictures in JPEG are very good for steganography, so you have at least 1 easy way to go. And I suspect that other methods (not using graphics) will be too easy to detect. – Display Name Apr 19 '13 at 18:58
-
3Voting to reopen. Too often I have a hard time understanding the rationale behind the close-voting crowds in SO. – yms May 16 '13 at 16:46
3 Answers
4
There are lots of ways to do this, including
- Embed the info into an image using traditional image steganography tools then embed the image into the PDF
- Set the text color to white and make sure you are not using a colored background
- Superimpose a white rectangle over your text.
- Using the appropriate low level tools, create the text objects of your secret text then mark those objects as deleted. As long as no one tries to compact your PDF (Pitstop is one such compression/cleaning tool), your data will exist.
- If you're really feeling optimistic, start reading the PDF Specification (I'm not sure if this is the most recent one, it's been a few years). There is/was a cross-ref table that would list the parts of the file that were "currently in use". It would be easy enough to add a few holes to that.

Dan Pichelman
- 2,312
- 2
- 31
- 42
-
thanks for your answer. Do you know some diagram or scheme, which can describe process of embending? – user2144425 Apr 20 '13 at 12:03
-
3Such a scheme would fill volumes... PDF is so versatile that there are very many ways to hide information in a PDF, too many to conclusively enumerate them. – mkl Apr 20 '13 at 13:32
4
The easiest place to hide information is at the beginning of the file before %PDF
. Acrobat will allow up to about 1024 bytes of arbitrary data (as long as it doesn't contain %PDF) and still render the file properly.

Kevin Borders
- 2,933
- 27
- 32
-
2That's generally a bad idea - Acrobat may allow this but it's certainly not supported by all PDF readers / consumers. And it's not supported by the ISO standards building on PDF (such as PDF/X, PDF/A...) – David van Driessche May 16 '13 at 19:41
-
Yes, not as robust as hidden streams, but definitely fast and simple. – Kevin Borders May 16 '13 at 23:57
-
1Can this be considered a steganography? If yes then this would be an extremely simple case of steganography. It is so easy to detect such data in front of `%PDF`. – pabouk - Ukraine stay strong Nov 07 '13 at 12:36
2
Going deeper on the last point of Dan Pichelman's answer, you can include stream objects into any PDF file,and add a reference to them in the cross reference table. A stream object can be compressed, or encrypted, and if it is not referenced from any other object of the file, then PDF readers will safely and silently ignore it.
-
1If you are sure, the PDF won't be cleaned afterwards, you do not even need to add that object to the cross references... probably this would even be "more hidden." ;) – mkl Apr 20 '13 at 13:30
-
But any tool that does a simple garbage collection on the PDF file would easily detect this. I imagine such a tool would just print the byte ranges of unused parts of the file, and there you go. – Roland Illig Sep 13 '16 at 00:37