Background

The idea is this:

  • Person provides contact information for online book purchase
  • Book, as a PDF, is marked with a unique hash
  • Person downloads book
  • PDF passwords are easy to circumvent, or share

The ideal process would be something like:

  1. Generate hash based on contact information
  2. Store contact information and hash in database
  3. Acquire book lock
  4. Update an "include" file with hash text
  5. Generate book as PDF (using pdflatex)
  6. Apply hash to book
  7. Release book lock
  8. Send email with book download link

Technologies

The following technologies can be used (other programming languages are possible, but libraries will likely be limited to those supplied by the host):

  • C, Java, PHP
  • LaTeX files
  • PDF files
  • Linux

Question

What programming techniques (or open source software) should I investigate to:

  • Embed a unique hash (or other mark) to a PDF
  • Create a collusion-attack resistant mark
  • Develop a non-fragile (e.g., PDF -> EPS -> PDF still contains the mark) solution

Research

I have looked at the following possibilities:

  • Steganography
  • Natural Language Processing (NLP)
  • Convert blank pages in PDF to images; mark those images; reassemble PDF
  • LaTeX watermark package
  • ImageMagick

Issues

The possible solutions I have researched have the following issues:

  • Steganography. (a) Requires a master copy of the images, which are converted to EPS, which is CPU-intensive and time-consuming; (b) would the watermark survive PDF -> EPS -> PDF, or other types of conversion; (c) most images are drawings or screen captures, not photographs in PNG format.
Edit
Report