Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2522

javax.crypto.IllegalBlockSizeException in ExtractText

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.8
    • Fix Version/s: 1.8.8
    • Component/s: Parsing, Text extraction
    • Labels:
      None

      Description

      The attached file can be viewed, but ExtractText is not possible:

      Exception in thread "main" java.io.IOException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher
      	at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptData(SecurityHandler.java:361)
      	at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptStream(SecurityHandler.java:448)
      	at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decrypt(SecurityHandler.java:413)
      	at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptObject(SecurityHandler.java:389)
      	at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.proceedDecryption(SecurityHandler.java:178)
      	at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.decryptDocument(StandardSecurityHandler.java:164)
      	at org.apache.pdfbox.pdmodel.PDDocument.openProtection(PDDocument.java:1224)
      	at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:265)
      	at org.apache.pdfbox.tools.ExtractText.startExtraction(ExtractText.java:241)
      	at org.apache.pdfbox.tools.ExtractText.main(ExtractText.java:84)
      	at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:55)
      Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher
      	at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:750)
      	at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
      	at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:313)
      	at javax.crypto.Cipher.doFinal(Cipher.java:2145)
      	at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptData(SecurityHandler.java:343)
      	... 10 more
      

        Attachments

        1. 474863.pdf
          12 kB
          Tilman Hausherr

          Issue Links

            Activity

              People

              • Assignee:
                lehmi Andreas Lehmkühler
                Reporter:
                tilman Tilman Hausherr
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: