Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have recently been asked to add a digital signature to a report (which I wrote using pdflatex). Is there such a mechanism in the TeX/LaTeX world or am I better of using external software to verify the validity of the report.

I don't necessarily want to password protect the document...or prevent people from copying the text as they commissioned the report!

This may not be limited to TeX so my apologies if in the wrong forum...

share|improve this question
Would something like the PDF Toolkit suit your needs? –  Werner Oct 3 '11 at 15:41
from a basic skim through of PDF Toolkit as I was posting my original question I got the impression that it could be password protected with an owner pw and user pw. Would the user then have to enter the password every time they wanted to use/read/print the file? i'd be anxious to avoid this. –  Leeser Oct 3 '11 at 15:45
@Leeser: If you only set the owner pw, every user should be able to view it; you could also restrict other operations like printing. –  Martin Schröder Oct 3 '11 at 21:19
Couldn't you just take an md5 or sha1 hash to prove it had not been altered? It is pretty easy to break PDF passwords by my understanding. Now that is based on 1 PDF I had that I was trying to do a review of, that copy/paste was turned off on. Some tool I found (sourceforge?) made an unprotected copy with ease. So I could be totally wrong here. –  Canageek Oct 3 '11 at 22:01
@Leeser Have you seen this post? tex.stackexchange.com/questions/88754/… –  Nicholas Hamilton Jan 2 '13 at 17:46

4 Answers 4

If you don't want a password-protected PDF, you could just send a GnuPG signature, for example:

$ gpg -sb RaphaelPinson_en.pdf

This produces a file named RaphaelPinson_en.pdf.sig, which you can send along with your original PDF.

To check the signature, use:

$ gpg --verify RaphaelPinson_en.pdf.sig

with the original PDF file in the same directory. Provided your GnuPG key is trusted by the recipient, this is a strong authentication of the content.

share|improve this answer
Can the downvoter explain why? –  ℝaphink Aug 5 '12 at 7:47

Adding a digital signature to a PDF that is recognized by PDF viewers like Adobe Acrobat (are there other viewers that can handle them?) is a relativ esoteric subject; I know only one free software (jPdfSign) that can create them. OTOH there are many programs that can encrypt a PDF (e.g. QPDF).

share|improve this answer
I had a discussion with our IT department and basically I was told that I should use the standard that the commissioner of the report is using. They probably have a digital signature system, and they would supply me with a client to read their content and also encrypt my own. –  Leeser Oct 7 '11 at 13:35

Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. Here's how:

pdftk input.pdf output output.pdf owner_pw foo allow printing

The above commands takes as input input.pdf, sets the owner password to foo and would allow printing on by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.

It is possible to automate the above scripts by adding it to your LaTeX makefile (or as part of a building profile in TeXnicCenter, for example) such that it executes after compiling your document.

share|improve this answer
if I only specify a user password and allow printing, does the user have to type in the password every time they open the file? I'm thinking of the case where the file will be read by numerous people in different departments and then each one having to input a password each time... –  Leeser Oct 4 '11 at 9:20

I've asked question on other side about proving that file has not changed after given time.

It's slightly different than signatures, but IMHO very important aspect of checking validity of report: checking if it has not been changed after creation (and legally provable).

One way of protection are Cryptographic Timestamps.

There are mechanisms based on PKI and digital signatures supported by Adobe PDF.

I've found that Linked Hybrid schemes are most interesting and Keyless Signatures - Cryptographic Timestamps Guard-time Technology looks most intersting and promising with nice cross-platform desktop client and other tools.

share|improve this answer
I think this is the thrust of my original question..how to ensure the file prepared has not altered any way upon transmission etc...but kinda got morphed to file protection, access and printing restrictions... –  Leeser Sep 22 '12 at 16:11
I've addressed your main requirement: "verify validity". I hope external tools I use will be useful for you or other readers if your question. –  Grzegorz Wierzowiecki Sep 24 '12 at 11:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.