# Protect PDF

> Add an AES password, or unlock a PDF when you already know the password.

Free protect and unlock PDF tool. Set a user password and optional owner password, and choose print, copy, and edit permissions. Unlock writes a copy that opens without the password. The password has to be one you know. The file stays in this browser.

- Page: https://benchline.fabwaseem.com/t/pdf-protect-unlock
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: One PDF, protect or unlock, a password you know, and optional permissions.
- Output: A PDF. Protect marks it encrypted. Unlock removes the password.
- Keywords: protect pdf, unlock pdf, pdf password
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Add a PDF.** Drop one PDF. It stays in this browser.
2. **Choose protect or unlock.** Enter the user password. For protect, set permissions and an optional owner password.
3. **Download.** Protect downloads an encrypted PDF. Unlock downloads a copy that opens without a password.

## Use it from an AI agent

MCP tool name: `protect_pdf`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/pdf-protect-unlock with the input as the JSON body
This call fetches a public URL on the server. Private addresses are refused.

Protect a PDF with AES-256, or unlock one when the password is known. action is protect or unlock. password is the user password. ownerPassword is optional. permissions cover printing, copying, modifying, annotating, filling forms, accessibility, and assembly. Send base64 or a public URL. Private addresses are refused.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "data": {
      "description": "PDF bytes as base64 or a data URI. Decoded size is capped at 10 MB. Provide data or url.",
      "type": "string"
    },
    "url": {
      "description": "Public URL of a PDF. Private and local addresses are refused. Provide data or url.",
      "type": "string"
    },
    "filename": {
      "type": "string"
    },
    "mimeType": {
      "type": "string"
    },
    "action": {
      "default": "protect",
      "type": "string",
      "enum": [
        "protect",
        "unlock"
      ]
    },
    "password": {
      "default": "",
      "description": "User password. Required to protect or unlock. Unlock only works when this is the known password.",
      "type": "string"
    },
    "ownerPassword": {
      "default": "",
      "description": "Owner password. Blank uses the user password.",
      "type": "string"
    },
    "permissions": {
      "default": {
        "printing": true,
        "copying": false,
        "modifying": false,
        "annotating": false,
        "fillingForms": true,
        "contentAccessibility": true,
        "documentAssembly": false
      },
      "type": "object",
      "properties": {
        "printing": {
          "default": true,
          "type": "boolean"
        },
        "copying": {
          "default": false,
          "type": "boolean"
        },
        "modifying": {
          "default": false,
          "type": "boolean"
        },
        "annotating": {
          "default": false,
          "type": "boolean"
        },
        "fillingForms": {
          "default": true,
          "type": "boolean"
        },
        "contentAccessibility": {
          "default": true,
          "type": "boolean"
        },
        "documentAssembly": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "printing",
        "copying",
        "modifying",
        "annotating",
        "fillingForms",
        "contentAccessibility",
        "documentAssembly"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "action",
    "password",
    "ownerPassword",
    "permissions"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "protect_pdf",
    "arguments": {
      "url": "https://example.com/file",
      "action": "protect",
      "password": "",
      "ownerPassword": "",
      "permissions": {
        "printing": true,
        "copying": false,
        "modifying": false,
        "annotating": false,
        "fillingForms": true,
        "contentAccessibility": true,
        "documentAssembly": false
      }
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### Can this remove a password I do not know?

No. Unlock only works with the password that already opens the file.

### What encryption is used?

AES-256. The user password opens the file. The owner password is the same unless you set a different one.

### Is the PDF uploaded?

No. Encryption and decryption run in this browser.

### Can I protect a file that already has a password?

Unlock it first, then protect the unlocked copy.

## Related tools

- [Merge PDF](https://benchline.fabwaseem.com/t/pdf-merge): Combine PDFs in the browser. Reorder them, keep a page range from each file, and download one document.
- [Compress PDF](https://benchline.fabwaseem.com/t/pdf-compress): Shrink a PDF in the browser. Pick a preset or a target size and compare the file before and after.
- [Split PDF](https://benchline.fabwaseem.com/t/pdf-split): Extract a page range, or split a PDF into single pages or chunks, then download a PDF or a ZIP.
- [Rotate PDF](https://benchline.fabwaseem.com/t/pdf-rotate-organize): Reorder, rotate, or drop pages, then download the PDF.
