[pdftex] pdftex-pdfcrypt update

Heiko Oberdiek oberdiek at ruf.uni-freiburg.de
Wed Mar 28 18:22:34 CEST 2001


At 10:13 27.03.2001 +0200, Ricardo Sanchez Carmenes wrote:
>
>I have updated the pdfcrypt version of pdftex to fix a problem
>regarding outlines. Fixed linux binaries are available at
>
><ftp://bioinf.medicina.uniovi.es/pub/pdftex-pdfcrypt.zip>

A very good idea starting support of encryption, because
this feature is asked by many people (despite of the fact,
that the security is not very high).

But it is a hard job to do it in pdfTeX, because pdfTeX
provides low level features, where pdf code is directly
inserted. So _all_ insertions (by \pdfobj, \pdfstartlink, ...)
have to be scanned to detect strings and streams in order
to encrypt them.

For example two test files, that are currently not encrypted
in a correct way:

%%% cut %%% testurl.tex %%% cut %%%
\pdfcompresslevel=0
\pdfcrypt{owner = "test" user = "test" none print}
\nopagenumbers
\font\f=pcrr \f
\noindent
\pdfstartlink
  user{%
    /Subtype /Link
    /A <<
      /Type /Action
      /S /URI
      /URI (http://www.dante.de/)
    >>%
  }%
  www.dante.de
\pdfendlink
\bye
%%% cut %%% testurl.tex %%% cut %%%

The pdf code contains an unencrypted string:
  /URI (http://www.dante.de/)
(and AR will decrypt it to nonsense.)

An example with stream and string:

%%% cut %%% testobj.tex %%% cut %%%
\pdfcompresslevel=0
\pdfcrypt{owner = "test" user = "test" none print}
\nopagenumbers
\hbox{}
\immediate\pdfobj{%
  <<^^J%
    /Type /DummyTest^^J%
    /TestString (FOO BAR)^^J%
    /Length 11^^J%
  >>^^J%
  stream^^J%
  HELLO WORLDendstream%
}
\bye
%%% cut %%% testobj.tex %%% cut %%%

The object is not encrypted at all:

1 0 obj
<<
/Type /DummyTest
/TestString (FOO BAR)
/Length 11
>>
stream
HELLO WORLDendstream
endobj

Perhaps it is easier and safer to write a standalone
program that adds encryption support. Also this has
the advantage that such a program can be used with
pdf files, generated with ghostscript.

Best regards
  Heiko <oberdiek at ruf.uni-freiburg.de>



More information about the pdftex mailing list