ZF-13: Ability for Zend_Pdf to operate with encrypted documents

Issue Type: New Feature Created: 2006-06-16T23:37:44.000+0000 Last Updated: 2012-09-11T08:53:36.000+0000 Status: Open Fix version(s): Reporter: Kevin McArthur (kevin) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Pdf

Related issues: - ZF-305



It has been requested that Zend_Pdf be able to operate with encrypted documents.

From the original Trac issue (TRAC-46): {quote} Hello,

Is it / will it be possible to sign PDFs with Zend_Pdf?

For use with these kinds of files:


private.pem (RSA PRIVATE KEY)

rootcert.crt (A-CERT ADVANCED Selfsigned Zertifikat)


Philipp {quote}


Posted by Jayson Minard (jayson) on 2006-06-17T23:57:03.000+0000

For you to consider

Posted by Willie Alberty (willie) on 2006-06-18T01:57:32.000+0000

Encryption is described in the PDF 1.4 specification, section 3.5. It requires that each of the document's content streams are encrypted using RC4.

RSA owns the copyright to RC4; they've never publicly released the algorithm. It was reverse-engineered in 1994:

We'll need to figure out which RC4 clone implementation to use. PEAR has one and there are a few third-party classes out there (though most have incompatible licenses). Otherwise, Zend would need to arrange a licensing deal with RSA.

This will require some changes to how stream objects are handled as encryption is a document-level feature. The encryption would need to performed just before the stream's content is written to the PDF document. It can't be applied to the stream objects directly because then you couldn't share stream objects between documents.

Probably related to ZF-12.

Posted by Alexander Veremyev (alexander) on 2006-06-20T17:18:01.000+0000

Starting from PDF 1.6 it also uses AES (Advanced Encryption Standard, FIPS PUB 197) algorithm.

Encription is described in a section 3.5 of PDF Reference V1.6

Posted by Kevin McArthur (kevin) on 2006-06-20T17:20:48.000+0000

I'd support a bump to 1.6. It would allow another png type to be supported 16bpp + alpha true color images which are currently not possible in 1.4

Posted by Willie Alberty (willie) on 2006-06-22T17:53:04.000+0000

Added text from original Trac issue to description.

Posted by Jayson Minard (jayson) on 2006-07-09T01:06:41.000+0000

If we do this, moving it back as lower priority.

Posted by Bill Karwin (bkarwin) on 2006-11-13T15:09:46.000+0000

Changing fix version to unknown.

Posted by Bill Karwin (bkarwin) on 2006-11-13T15:26:53.000+0000

Changing fix version to 0.6.0.

Posted by Alexander Veremyev (alexander) on 2007-05-25T02:12:54.000+0000

Postponed to post-1.0 period

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-06-23T15:13:48.000+0000

What is the status of this issue? We are like post-1.0 for quite some time now... ;)

Posted by Tuan Ngo (tuanngo) on 2009-09-21T00:13:13.000+0000

I have written a small lib here… to enable encryption for Zend_Pdf. Let take a look.

Posted by Paul van Brouwershaven (vanbroup) on 2009-09-21T05:16:07.000+0000

Tuan, Nice you ave writen this code, but even with your code it's still not possible to sign PDFs with Zend_Pdf or to do a proper encryption like AES256.

Posted by Marc van de Geijn (mvdgeijn) on 2010-11-24T13:30:27.000+0000

This feature request is already over 4 years old. Any chance it will get implemented some day? I'm a Zend Framework fan, but because there is no encryption/password protection I can not use it. I generate PDF invoices that are sent by e-mail and these need to be protected. I assume I'm not the only one.

Posted by Ashleigh Vincent (avincent) on 2012-09-11T08:53:36.000+0000

Now 6 years old.

Please bump this as it is not minor. The main reason to create a PDF instead of just serving HTML is in order lock the document so it cannot be edited by the recipient.

I know you are all concentrating on ZF2 now but it is going to be at least another 2 years before that is trustworthy enough to use in a commercial project. Please try and backport any PDF locking or encryption into ZF1 too.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.