Verify a redaction
How to check that a redaction really removed the text.
A redacted PDF that looks right can still carry everything it was meant to hide. These checks take a couple of minutes and work on files from any tool.
Verify your redaction
Never trust a redacted PDF because it looks right. The classic failure is a black rectangle drawn on top of text that is still in the file: anyone can select, copy or search the text underneath. Run these checks on any redacted PDF, whichever tool made it, before you send it.
- Search for it. Open the redacted file, press Ctrl+F (Cmd+F on a Mac) and search for a word you redacted. A real redaction finds nothing. Search for a nearby word you did not redact: if that is found, the file still has a text layer, so check what else is in it.
- Select and copy. Press Ctrl+A, copy, and paste into a plain text editor. Look for the redacted text in what you pasted.
- Drag the box. In an editor that lets you move objects, try to move or delete the black rectangle. If text appears under it, the redaction was only a cover.
- Read the text with a tool. On a command line,
pdftotext file.pdf - | grep -i "the secret"prints the text layer of every page. Nothing should match. - Check the extras. Open the document properties (title, author, subject, keywords) and look at the comments, attachments, bookmarks and form fields panels. Redaction of the pages does not clean these.
- Look at every page. A box that is a few pixels too small leaves the edge of a letter visible, and an unredacted second copy of a number elsewhere on the page is easy to miss.
Plainsum PDF's output passes checks 1, 2, 4 and 5 by construction: the new file is built from page images only. After each redaction the page also re-opens the new file and reports how many characters of text, annotations and attachments it found (it should say zero). Checks 3 and 6 are yours to do.
What a fake redaction looks like
A fake redaction is a black rectangle laid over live text. On screen it looks identical to a real one. The tell is that the text is still part of the page: searching for it finds it, selecting across the box highlights it, and pasting reveals it. Several well-known leaks of documents that were meant to be secret came from exactly this mistake.
What a real one is
In a real redaction the pixels or characters under the box no longer exist anywhere in the file. There are two ways to get there. A PDF editor can delete the text objects under the box and then draw it. Or the whole page can be turned into a picture with the box drawn into the picture, which is what Plainsum PDF does. The picture method is blunt but easy to verify: after it, the page has no text layer at all.
Try it on a file you made
Use the redactor with its sample document, download the result, and run checks 1, 2 and 4 on it. Then run them on a PDF where you only drew a rectangle in a general-purpose editor, and compare what you find.
Questions
How can I tell if a PDF redaction is real?
Search the file for a redacted word, select all and paste into a text editor, and try to move the black box in an editor. If the hidden text turns up in any of those, the redaction only covered it.
Why do fake redactions happen so often?
Drawing a filled rectangle over text is easy and looks right on screen. Removing the underlying text takes an extra step that many people and some tools skip.
Does a redacted file still hold the document's author and title?
It can. Document properties, comments, attachments and bookmarks are separate from the page content and need cleaning too. Plainsum PDF's output carries none of them, because it is built from page images only.
Can Plainsum PDF prove its own output is clean?
It reads the new file back and shows the count of extractable characters, annotations and attachments, which should all be zero. It cannot judge whether you covered everything you meant to: that is a visual check you must do.
What about redacting a scan?
A scan is already a picture, so a box painted into the pixels removes what is under it. The risk with scans is a hidden text layer added by OCR software, which a rebuild from images also removes.