pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arjun Kaushal <kaushal.arj...@gmail.com>
Subject BadPaddingException in PDFBox 2.0.1
Date Mon, 27 Jun 2016 13:44:57 GMT
Hi,

I am using PDFBox 2.0.1 and when I tried to decrypt file using the load
method I am getting BadPaddingException.
-----
java.io.IOException: javax.crypto.BadPaddingException: Given final block
not properly padded
at
org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptDataAESother(SecurityHandler.java:291)
at
org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptData(SecurityHandler.java:152)
at
org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptStream(SecurityHandler.java:449)
at org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:764)
at
org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:721)
at
org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:652)
at
org.apache.pdfbox.pdfparser.COSParser.parseDictObjects(COSParser.java:612)
at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:215)
at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:249)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:972)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:908)
....
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:271)
-----

Thanks and Regards,
Arjun Kaushal

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message