Password protecting a PDF sounds trivial, but building it client-side has a few gotchas. Users expect to type a password, hit a button, and get a locked file. They don't expect their file to upload to a server.

I built en.sotool.top/encrypt/ to do exactly that. Here's how it works with Vue 3 and @pdfsmaller/pdf-encrypt-lite.

Why Client-Side Encryption?

PDFs often contain sensitive information. Contracts, financial statements, medical records. Password protecting a file on a server means trusting someone else with your password and your document.

Client-side benefits: