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

Description

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:

allcert.crt (TRUSTED CERTIFICATE)

private.pem (RSA PRIVATE KEY)

rootcert.crt (A-CERT ADVANCED Selfsigned Zertifikat)

Regards,

Philipp {quote}

Comments

For you to consider

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: http://en.wikipedia.org/wiki/RC4

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.

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

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

Added text from original Trac issue to description.

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

Changing fix version to unknown.

Changing fix version to 0.6.0.

Postponed to post-1.0 period

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

I have written a small lib here http://tuanngominh.wordpress.com/2009/09/… to enable encryption for Zend_Pdf. Let take a look.

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.

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.

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.