Skip to content

feat: add PDF password protection - #209

Merged
mithun-srinivas merged 1 commit into
mithun-srinivas:mainfrom
Pawankumar3210:feature/protect-pdf
Sep 1, 2026
Merged

feat: add PDF password protection#209
mithun-srinivas merged 1 commit into
mithun-srinivas:mainfrom
Pawankumar3210:feature/protect-pdf

Conversation

@Pawankumar3210

Copy link
Copy Markdown
Contributor

Which issue does this close?

Closes #83

What changed

Added a new Protect PDF operation at src/operations/protect-pdf/.

The tool lets users select a PDF, enter and confirm a password, and download an encrypted PDF. It uses qpdf-run with locally bundled qpdf WebAssembly and runs entirely in the browser.

The implementation follows DoxDock's plugin pattern and reuses the shared Dropzone, Progress, Note, DownloadButton, and useJob components.

Acceptance criteria

  • Encrypting with a password produces a PDF that requires that password to open.
  • Wrong/empty password is handled with clear validation.
  • Works fully offline with no external network requests during encryption.

Checklist

  • Runs fully offline: no network calls, no CDNs, no external assets (strict CSP connect-src 'self').
  • Follows the plugin pattern and reuses shared components where relevant.
  • npm run build passes locally.

Proof

Tested the generated PDF with a real PDF reader using a real PDF file:

  • Correct password → PDF opens successfully.
  • Wrong password → PDF is rejected and does not open.
  • Empty/mismatched password → Protect PDF action remains disabled.
  • Playwright offline E2E → 2/2 tests passed.
  • No external network requests detected during encryption.
  • npm test → 40/40 tests passed.
  • npm run build → passed.
  • ESLint → passed.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Pawankumar3210 is attempting to deploy a commit to the Mithun Srinivas' projects Team on Vercel.

A member of the Team first needs to authorize it.

@mithun-srinivas

Copy link
Copy Markdown
Owner

This is a big one @Pawankumar3210, thank you. Password-protecting a PDF fully in the browser is exactly the kind of thing most tools do server-side, and you did it right: qpdf compiled to WebAssembly with the worker and wasm served from our own origin, AES-256 encryption, no CDN. Loading the engine through new URL(..., import.meta.url) keeps it same-origin, and the zero-external-network E2E check proves it actually stays local while encrypting.

This closes the biggest gap we had, the whole Security category. Merging now since every check is green.

One tiny thing for a future pass, not blocking: a couple of the progress messages have a stray character where an ellipsis should be. Worth a quick tidy next time. Thanks for taking on a hard one!

@mithun-srinivas
mithun-srinivas merged commit 4ac1b61 into mithun-srinivas:main Sep 1, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protect PDF — password-protect / encrypt a PDF

2 participants