Protecting and Redacting

This chapter covers keeping a document private: protecting it with a password or for chosen people's certificates, removing hidden information, and redacting, which permanently removes text and pictures (account numbers, Social Security numbers, names) so they can't be recovered.

The Protect tool

Choose Tools ▸ Protect (or click Protect on the tool strip). Its bar has:

The same commands are on the menus: File ▸ Protect Using Password, and Edit ▸ Protection ▸ Encrypt with Password…, Encrypt with Certificate…, and Remove Security.

Note: Protection is applied when you save. Until then it is an ordinary step you can undo, and the status bar reminds you that it will be applied when you save.

Protecting with a password

  1. Click Protect Using Password (or choose File ▸ Protect Using Password).
  2. To require a password to open the document, type it in Password and again in Confirm under Password to open the document.
  3. To limit what people can do, type a Permissions password (twice) and untick what isn't allowed under Allow.
  4. Click OK, then save the document (Ctrl+S).

You can set an open password, a permissions password, or both. The file is encrypted with AES-256. Keep the passwords safe: they can't be recovered.

What each permission means

PermissionWhen it is unticked
PrintingThe document may not be printed.
Copying text and imagesText and pictures may not be copied out of it.
Changing the documentPages and content may not be changed.
Adding commentsComments and markup may not be added.
Filling in formsForm fields may not be filled in.

If you untick anything, you must set a permissions password, so the restrictions can't simply be switched off. Whoever knows the permissions password can change them. Permissions are honored by PDF programs that respect them; they are a request, not a lock, so use an open password (or certificate security) for anything truly confidential.

Opening a password-protected document

When you open a document that needs a password, PlanetPDF asks for it. Saving the document afterwards keeps its protection.

Removing protection

Open the document (with its password), then choose Edit ▸ Protection ▸ Remove Security, or in the Protect tool Advanced Options ▸ Remove Security or Advanced Options ▸ Document Security ▸ No Security. Save the document: the protection is removed when you save.

Advanced Options

The Protect tool's Advanced Options menu holds:

Certificate security: encrypting for chosen people

Instead of a password that has to be passed around, you can encrypt a document so that only certain people can open it, each with their own Digital ID. Nobody shares a password.

  1. Choose Edit ▸ Protection ▸ Encrypt with Certificate… (or Advanced Options ▸ Encrypt with Certificate…).
  2. Build the list under Who can open it:
  3. Under Allow them, untick anything they shouldn't do (the same permissions as for passwords).
  4. Click Encrypt, then save the document.

Important: Keep yourself on the list, or you won't be able to open the file either.

The file is encrypted with AES-256. PlanetPDF keeps the people's public certificates inside the (encrypted) file, so when you change and save it later, it is encrypted for the same people again. For a certificate-encrypted file made by another program, PlanetPDF only knows you, the person who opened it, and warns you about that.

Opening a certificate-encrypted document

When you open a document encrypted for certain people, PlanetPDF first tries the Digital IDs in your Windows certificate store (or Mac Keychain). If none of them fits, the Certificate-Encrypted File window asks for your Digital ID file (.pfx / .p12) and its Password; click Open.

Security Properties

Advanced Options ▸ Security Properties… shows how the open document is protected: the security method, whether a password is needed to open it (or who can open it, for certificate security), the encryption, and whether each permission is allowed. If you have set protection that isn't saved yet, it says so. Change Settings… opens the matching password or certificate window.

Security envelopes

A security envelope packs any files (PDFs, spreadsheets, anything) into one protected PDF, so you can send them safely. The PDF has a cover page listing the files, which travel inside it as attachments.

  1. Choose Advanced Options ▸ Create Security Envelope….
  2. Click Add Files… (or Add This Document) for each file; Remove takes one out.
  3. Optionally type a Note on the cover page.
  4. Choose Protect with a password or Encrypt for certain people (their certificates), and click Next….
  5. Set the password or the people, as described above, and choose where to save the envelope.

The person you send it to opens it in PlanetPDF (or another PDF program) and saves the attachments from the Attachments panel.

Security policies

A security policy saves protection settings to use again, so the same rules go on every document of a kind. Choose Advanced Options ▸ Manage Security Policies…:

Passwords are never stored in a policy. A password policy keeps which things are allowed; when you apply it, you type the passwords. A certificate policy keeps the people's public certificates. Policies are saved in your profile folder.

New files made from a protected document

When you make a new PDF from a protected document (a redacted copy, a sanitized copy, extracted or split pages, a smaller copy, an image-only PDF, or a PDF combined from files of which any is protected), PlanetPDF asks, for example, "Protect the redacted copy too?":

A protected new file is encrypted as it is written, so its folder never holds an unprotected copy, not even for a moment (a redacted copy is checked first in a folder only you can open). On the command line, redact, compress, extract, split, and export --format image_pdf keep a protected file's password on the new files; add --no-protect to leave it off on purpose. Each password keeps its role:

Redacting

Covering text with a black box isn't enough: the text is still in the file and can be copied out. Redacting in PlanetPDF permanently removes everything under the marks you make: text, parts of pictures, drawings, and any comments, links, and form fields they overlap. It works in two stages: first you mark what should go, then you apply the marks, which writes a new, redacted file and checks it.

Open the Redact tool with Tools ▸ Redact, the Redact button on the tool strip, or Edit ▸ Redact Text & Images. The Redaction panel opens beside the page.

Marking areas by hand

  1. Click Redact Text & Images on the Redact bar (or Mark Area in the panel).
  2. Drag a box over anything you want removed: text, part of a picture, a signature, a whole block.
  3. Keep dragging boxes; the tool stays on until you choose the arrow or another tool. Esc drops a box you are still drawing.

Marks show as red outlines. They aren't applied yet: you can still remove or undo them.

Finding text to redact

Choose Redact Text & Images ▾ ▸ Find Text & Redact… (the arrow beside the button); the cursor goes to the panel's Find and mark box.

  1. Type the words to find and choose Exact text or Regular expression. Tick Match case or Whole words if needed. Click Find (or press Enter).
  2. Or, under Common patterns (US formats), tick one or more of SSN (123-45-6789), Phone number ((555) 867-5309), Email address, and Account number (8-17 digits), and click Find Patterns.
  3. The results list each match with its page and the words around it. Double-click one to go to its page. Matches already marked are grayed and unticked.
  4. Untick any you want to keep, then click Mark Checked Results.

On a document of 20 pages or more, a window counts the pages as they're searched ("Pattern 2 of 3: searching page 14 of 80"), with Cancel.

Exact text finds a phrase even when it wraps onto the next line. A regular expression is a search pattern for things that vary, for example Invoice \d+ finds "Invoice" followed by any number.

Redacting whole pages

Choose Redact Text & Images ▾ ▸ Redact Pages…, type the pages (for example 1, 3-5), and click OK. Each page gets one mark covering all of it.

Reviewing marks

The panel's Review marks list shows every mark: its page, its type (Area, SSN, the search, Page…) and the text it will remove. Click a mark to see it on the page. Remove takes away the selected marks (or press Delete), Remove All takes away all of them. Marks are saved with the document as standard redaction marks, so you can save, close, and finish later, and other PDF programs see them too.

Redaction properties

Redact Text & Images ▾ ▸ Properties… shows the panel's Options:

Applying redactions

  1. Click Apply on the Redact bar (or Apply Redactions… in the panel). It is grayed until there are marks.
  2. The Apply Redactions window says how many marks on how many pages will be removed, and lists hidden information to remove as well, all ticked (see Sanitize Document). Untick anything you want to keep. If the document is digitally signed, it warns that the redacted copy won't keep the signatures.
  3. Click Choose File and Apply… and choose where to save. PlanetPDF suggests the document's name with _redacted added.
  4. If the document is protected, PlanetPDF asks whether to protect the redacted copy too (see New files made from a protected document).
  5. The progress window counts the pages as they are redacted, then the copy is checked and the Redaction Verification report appears.

A copy that fails its checks is not saved. If any check fails, nothing is written and nothing is replaced: the report says "The redacted file was not saved" and offers Discard. Fix what it lists and apply again. When the copy was going to a new file, Save Anyway… saves it after a second question (for example, to look at it); a failed copy is never saved over the original.

Your open document doesn't change: it keeps its marks, so you can fix something and apply again. The report's Open Redacted File button opens the result.

Overwriting the original: if you choose the original file's own name, PlanetPDF asks a second time ("Overwrite the Original?"), because the unredacted original is then gone for good and the undo history is cleared. If the checks pass with warnings (for example, a word you marked still appears somewhere you didn't mark), the report comes first and the original isn't replaced unless you click Replace the Original; its default, Don't Replace, keeps it. Saving a separate copy is safer.

The verification report

After applying, PlanetPDF reads the new file back in several independent ways (two different PDF readers, the raw file data, the text under each box, the picture areas under each box) to make sure nothing you marked can still be found. The headline sums it up, and each check is listed with its result:

ResultWhat it means
PASSThat check found nothing left: for example "removed" for each piece of marked text, "no text under N redaction(s)" for each page, image areas blank, a single revision of the file.
WARNINGNot a leak, but worth a look. The most common: the same words "still appear where they weren't marked", elsewhere in the document. Mark those too if they should go, and apply again. Straight level or upright lines and frames that cross a box, such as table lines, are a warning too: they keep their whole outline in the file.
FAILSomething marked can still be read or extracted from the file, for example "text remains under the box", with the page, the box, and the text found; a curved or slanted shape reaching under a box (text drawn as outlines, a signature drawn as lines, a zig-zag); the marked words left somewhere else in the file, such as its information, an attachment, a comment, or a field, even when they also appear unmarked on a page; a page thumbnail; or a check that couldn't run (a picture under a box that couldn't be read, or the second PDF reader couldn't read the file). The headline says "Do not share this file", and the file isn't saved.

Copy Report copies the whole report as text, for your records. Very short marked text (under four characters) is checked on the pages by area only, since searching for it would find it everywhere; elsewhere in the file (its information, bookmarks, attachments, comments, and fields) it is looked for as a whole word, and found there it fails. Page thumbnails, small pictures of the pages as they were, are always removed from redacted pages.

What redaction can't find

Sanitize Document (Remove Hidden Information)

A PDF often carries more than you see: the author's name, earlier titles, attached files, scripts. Sanitize Document removes that from the open document. Choose Remove Hidden Information on the Protect bar or Sanitize Document on the Redact bar, untick anything to keep, and click Sanitize. The status bar says what was found and removed. It is one step you can undo; save the document to keep the change. (When you apply redactions, the same choices are applied to the redacted copy instead.)

OptionWhat it removes
Document informationTitle, author, subject, keywords, creator, and dates.
XMP metadataThe XML metadata packet (often a copy of the above, plus history).
BookmarksThe outline shown in the Bookmarks panel.
AttachmentsEmbedded files and file-attachment comments.
JavaScriptDocument, page, and form-field scripts, including field formatting.
Hidden layersContent in layers that are turned off, or hidden by a layer rule (a rule such as "show only when layer A is on and layer B is off"). It can't be searched, so it's easy to miss. Pictures that only a hidden layer drew leave the file too.
Comments and markupNotes, highlights, drawings, and stamps that haven't been flattened.
Form field valuesEvery field's value and default value, including XFA form data.
Tags and alternate textThe accessibility tags, with the alternate text of pictures and replacement text, wherever it is written: in the tags, in the pages themselves, in the pages' resources, and in comments' and pictures' own content. It can describe what was redacted. Screen readers then read the pages without tags.

Signed documents

A signed PDF is saved by adding the changes to the end of the file, which keeps the signatures valid but also keeps everything before the changes. Removed items would still be in the file's earlier, signed version, where anyone can dig them out. So on a signed document the Sanitize window says that the signatures are removed too, and offers two buttons:

On the command line, planetpdf sanitize refuses a signed file unless you add --remove-signatures.

Hidden layers

PlanetPDF never shows what a hidden layer holds. It follows the layers' own rules, as Adobe Reader does, to know what is hidden. If it can't tell which content belongs to a hidden layer, can't read a layer's rule, or removing the layers would make hidden words appear, it stops, changes nothing, and says so. Untick Hidden layers to remove everything else.