Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.3
-
None
-
Windows 7 x64, JVM 1.8.0_101
Description
On the attached document, which opens fine with Adobe Reader, the PDDocument.load() throws an error:
java.io.IOException: javax.crypto.BadPaddingException: Given final block not properly padded
at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptDataAESother(SecurityHandler.java:296)
at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptData(SecurityHandler.java:153)
at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptStream(SecurityHandler.java:454)
at org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:784)
at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:741)
at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:672)
at org.apache.pdfbox.pdfparser.COSParser.parseDictObjects(COSParser.java:632)
at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:217)
at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:252)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:966)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:922)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:870)
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:966)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:824)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:436)
at javax.crypto.Cipher.doFinal(Cipher.java:2048)
at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptDataAESother(SecurityHandler.java:276)
... 12 more