View Source

h2. Description
PDF permits the use of encryption as a means of restricting access or (re-)use of content. This may range from documents that can only be opened after providing a password, to disabling specific functionality (e.g. printing, copying content).

h2. Risks
* Content may become inaccessible if passwords are not known (even though "cracking" is often technically possible, institutions may not be legally permitted to do this)
* Printing / copy restrictions may complicated any future preservation actions

h2. Assessment

The _Preflight_ component of [Apache PDFBox] (an open source _PDF/A_ validator) is able to detect encryption in a PDF (_any_ PDF, doesn't have to be _PDF/A_!). The following table shows the combinations of error codes and descriptions (_details_ element of _Preflight_'s XML output) for 4 different types of password protection. Results obtained with _Preflight_ 2.0.0:

|*Reference file*|*Description*|*Error Code(s)*|*Details*|
|[encryption_openpassword.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_openpassword.pdf]|Requires password to open the file|1.0|Syntax error|
|[encryption_nocopy.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_nocopy.pdf]|Requires password to copy document contents|1.0|Syntax error|
|[encryption_noprinting.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_noprinting.pdf]|Requires password for printing|1.0|Syntax error|
|[encryption_notextaccess.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_notextaccess.pdf]|Requires password to enable text access for screen reader devices for the visually impaired|1.0|Syntax error|

Note that these results aren't particularly helpful. However, previous work with an earlier version of *Preflight* (1.8.0) produced notably different results:

|*Reference file*|*Description*|*Error Code(s)*|*Details*|
|[encryption_openpassword.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_openpassword.pdf]|Requires password to open the file|1.0|Syntax error, Error (CryptographyException) while creating security handler for decryption: Error: The supplied password does not match either the owner or user password in the document|
|[encryption_nocopy.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_nocopy.pdf]|Requires password to copy document contents|1.4.2|Trailer Syntax error, The trailer dictionary contains Encrypt|
|[encryption_noprinting.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_noprinting.pdf]|Requires password for printing|1.4.2|Trailer Syntax error, The trailer dictionary contains Encrypt|
|[encryption_notextaccess.pdf|http://www.opf-labs.org/format-corpus/pdfCabinetOfHorrors/encryption_notextaccess.pdf]|Requires password to enable text access for screen reader devices for the visually impaired|1.4.2|Syntax error|

So the _Preflight_ 2.0.0 results look like a bug, for which the following [bug report|https://issues.apache.org/jira/browse/PDFBOX-1659] was submitted.


h2. References
[Van der Knijff, J.M., Adobe Portable Document Format - Inventory of long-term preservation risks KB/ National Library of the Netherlands, 2009|http://www.openplanetsfoundation.org/system/files/PDFInventoryPreservationRisks_0_2_0.pdf]