File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes iText: security Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "iText: security" Watch "iText: security" New topic
Author

iText: security

Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 975
Hello Bruno,

How does iText help/support in the pdf security aspects?

Thank you,

Gian


"Eppur si muove!"
Bruno Lowagie
author
Ranch Hand

Joined: Oct 23, 2006
Posts: 88
Gian Franco wrote:Hello Bruno,
How does iText help/support in the pdf security aspects?


That's explained in chapter 12.

Table 13.1 in the book lists the different PDF versions along with the most important functionality that was introduced in these versions.

  • 40-bit encryption were introduced in Acrobat 2 (PDF 1.1).
  • 128-bit encryption was introduced in Acrobat 5 (PDF 1.4).
  • AES encryption was introduced in Acrobat 7 (PDF 1.6). The algorithm used for the above encryption is (alleged) RC4.


  • All these types of encryption are supported in iText:

    12.3 Encrypting a PDF document
    12.3.1 Creating a password encrypted PDF
    -> table 12.2 Overview of the permission parameters
    -> table 12.3 Overview of the encryption parameters:
    * 40-bit ARC4 encryption
    * 128-bit ARC4 encryption
    * 128-bit AES encryption
    12.3.2 Public-key encryption
    * this is also known as certificate encryption

    Please understand that password protection in PDF isn't real security. It's very easy to crack a password, and since PDF became an ISO standard Adobe no longer has any legal basis to pursue companies that provide cracking software.
    The ElcomSoft/Sklyarov case is something of the past.
    Whoever is asking for PDF password protection should know that this concept is purely psychological, and that iText can't be blamed if somebody succeeds in decrypting a PDF that was password encrypted by iText.

    Certificate encryption is a better means to protect the document, but this concepts has its flaws too: you can use certificate (aka public-key) encryption to add restrictions (for instance: the user is not allowed to print the PDF), but these restrictions can be removed by the person owning the private key corresponding with the public key that was used to encrypt the document. As a matter of fact, I explain how to remove these restrictions in the book (after I checked with Adobe and with a lawyer if I was allowed to describe how to do this).

    iText doesn't offer any DRM solution as DRM is not part of ISO-32000-1.

    Note that chapter 12 also discusses digital signatures. I'm not sure if your question about security was only about encryption or if you also wanted to know about digital signatures to protect the integrity of a PDF document.

    12.4: Digital signatures, OCSP and timestamping
    * 12.4.1: Creating an unsigned signature field
    * 12.4.2: Signing a PDF
    * 12.4.3: Adding multiple signatures
    * 12.4.4: Verifying the signatures in a document
    * 12.4.5: Creating the digest and signing externally
    * 12.4.6: CRLs, OCSP, and timestamping
    * 12.4.7: PDF Advanced Electronic Signature profiles (PAdES)

    iText supports both author and recipient signatures. All of the technologies mentioned in the above TOC are supported, except for PAdES.
    Some developers have already created PDFs that are compliant with the different ETSI standards regarding PAdES, but as PAdES is only supported in Acrobat X, we've only just begun developing high-level methods. These will probably be available in 11Q1.
    Gian Franco
    blacksmith
    Ranch Hand

    Joined: Dec 16, 2003
    Posts: 975
    Thank you for your reply.

    Yes, I'm also interested in digital signatures, because one of the recurring business requirements
    is paperless and besides of getting rid of paper procedures digital signatures need to replace
    blue ink signatures...

    Cheers,

    Gian

    Zhang Ye
    Greenhorn

    Joined: Feb 06, 2011
    Posts: 3
    Bruno,

    I am working on a project that requires password-based encryption for PDF file. The PDF file contains sensitive data, and the requirement is to add a open-level password. I have been thinking that using PDF Password Protection (choose AES128) is the same as encrypting the file itself using AES128, until I saw your post here:

    "Whoever is asking for PDF password protection should know that this concept is purely psychological, and that iText can't be blamed if somebody succeeds in decrypting a PDF that was password encrypted by iText."

    Here is my question:

    Option 1: Use a symmetric encryption (password already communicated and satisfies desired complexity rule) to encrypt a PDF file. This way, I would have to require the recipient install the same software I use to decrypt the file.
    Option 2: Use the built-in PDF "user password" a.k.a. "open password" (password already communicated and satisfies desired complexity rule)

    The only difference between option 1 and 2 may be the length of the password (Option 2 built-in PDF password has to be less than 32 chars - but 32 chars are plenty for me). So, are there any other difference between option 1 and option 2, from a security perspective?

    If there is no difference, I think the concept of asking for PDF password protection is NOT purely psychological then because it is very hard to crack the password.

    I bought your book (second edition), and read chapter 12.3 "Protecting your PDF". As far as I understand, the
    "user password" is quite secure, as long as you have a strong password...

    Thanks.


    Bruno Lowagie
    author
    Ranch Hand

    Joined: Oct 23, 2006
    Posts: 88
    Zhang Ye wrote:As far as I understand, the "user password" is quite secure, as long as you have a strong password...

    That's a misconception. Any PDF encrypted with a "user password" and/or "owner password" can easily be decrypted (not by using brute force, just because password security in PDF is... flawed).
    It's a mystery why there are still people who think it makes sense to password protect a PDF.
    Zhang Ye
    Greenhorn

    Joined: Feb 06, 2011
    Posts: 3
    Bruno,

    Thanks a lot for your reply.

    I am quite shocked (clearly, you are very knowledgeable on this) because I read a lot of companies are sending password-protected PDFs containing sensitive data such as Credit Card number. Yet you just said the whole user/owner password for PDF is flawed and cracking the password requires NO brutal force.

    Here are two companies (one of them, Arcot, was just acquired by CA for $200Million) doing this:

    http://arcot.com/saas/electronic-notification.html

    http://www.striata.com/solutions/technical-overview/authentication-and-security.html

    Do they do much more than the user/owner password protected PDF?
    Both of them claim that the only thing needed for the recipient is the freely available Adobe PDF Reader.

    Thanks.









    Zhang Ye
    Greenhorn

    Joined: Feb 06, 2011
    Posts: 3
    Bruno,

    I read a little more here

    http://elcomsoft.com/apdfpr.html

    ElcomSoft clearly says that they use Dictionary and Brutal Force attack "If the PDF is protected with a strong 128-bit or 256-bit key"

    It also says "If the password does not fall into any dictionary, Advanced PDF Password Recovery attempts all possible combinations of passwords by performing the brute force attack."

    From there, I think PDF open-level password can not be broken without brutal force attack if you use a complex enough password.

    Am I missing something obvious? Or, the "flawed" protection only exists in older version (prior to 9.x) of Adobe Reader?

    Thanks.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: iText: security
     
    Similar Threads
    Welcome Bruno Lowagie
    FOP vs. iText
    Different PDF version & iText Capability
    Create A Report
    Disable PDF access permissions like Save/Save As/Print