Is there a package to secure rendered pdf with a password?

There used to be a package achieving PDF encryption, but it relied on obsolete pdfTeX patches: pdfcrypt

Nowadays, you need an external tool to encrypt your PDF. Here is an example to encrypt a PDF with pdftk:

pdftk inputfile.pdf output outputfile.pdf encrypt_128bit owner_pw yourownerpw user_pw youruserpw

That said, I guess a LaTeX package could be done to make use of pdftk at compile time.

Just please remember that no PDF encryption is really bullet-proof. Once the user can see the PDF, then he can print it and edit it. It can just require the use of other tools than the Adobe thingies.


In the case of pdfTeX, an external tool, such as pdftk or qpdf, is necessary to encrypt. In the case of XeTeX, we can use a \special supported by xdvipdfmx, for example:

\special{pdf:encrypt ownerpw (abc) userpw (xyz) length 128 perm 2052}
\documentclass{article}
\begin{document}
This is a test.
\end{document}

Tags:

Packages

Drm