Return-Path: X-Original-To: apmail-pdfbox-dev-archive@www.apache.org Delivered-To: apmail-pdfbox-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D0AB17979 for ; Sat, 1 Nov 2014 06:59:34 +0000 (UTC) Received: (qmail 39649 invoked by uid 500); 1 Nov 2014 06:59:34 -0000 Delivered-To: apmail-pdfbox-dev-archive@pdfbox.apache.org Received: (qmail 39620 invoked by uid 500); 1 Nov 2014 06:59:34 -0000 Mailing-List: contact dev-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list dev@pdfbox.apache.org Received: (qmail 39608 invoked by uid 99); 1 Nov 2014 06:59:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2014 06:59:34 +0000 Date: Sat, 1 Nov 2014 06:59:34 +0000 (UTC) From: "Tilman Hausherr (JIRA)" To: dev@pdfbox.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (PDFBOX-2471) AES encryption failing to write Acroform field names and values MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PDFBOX-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14192989#comment-14192989 ] Tilman Hausherr edited comment on PDFBOX-2471 at 11/1/14 6:59 AM: ------------------------------------------------------------------ Yes we have a problem with AES256, which is apparently JDK related. This was discovered while working on PDFBOX-2456. So you help is most welcome, if successful. Your patch doesn't help on my local system, sadly. Please do this whether it works for you: - update to the current trunk (use a copy because there are rendering problems since last friday) - open the file org.apache.pdfbox.encryption.TestSymmetricKeyEncryption.java in the tests - in the source code replace "test.pdf" with "Acroform-PDFBOX-2333.pdf" - in the source code, look for testProtection() and activate this segment that is commented out {code} document = PDDocument.load(new ByteArrayInputStream(inputFileAsByteArray)); testSymmEncrForKeySize(256, sizePriorToEncryption, document, PASSWORD, permission1); {code} - run the test with your patch (and if this is my lucky day, improve your patch :-) so that it passes the test) was (Author: tilman): Yes we have a problem with AES256, which is apparently JDK related. This was discovered while working on PDFBOX-2456. So you help is most welcome, if successful. Your patch doesn't help on my local system, sadly. Please do this whether it works for you: - open the file org.apache.pdfbox.encryption.TestSymmetricKeyEncryption.java in the tests - in the source code replace "test.pdf" with "Acroform-PDFBOX-2333.pdf" - in the source code, look for testProtection() and activate this segment that is commented out {code} document = PDDocument.load(new ByteArrayInputStream(inputFileAsByteArray)); testSymmEncrForKeySize(256, sizePriorToEncryption, document, PASSWORD, permission1); {code} - run the test with your patch (and if this is my lucky day, improve your patch :-) so that it passes the test) > AES encryption failing to write Acroform field names and values > --------------------------------------------------------------- > > Key: PDFBOX-2471 > URL: https://issues.apache.org/jira/browse/PDFBOX-2471 > Project: PDFBox > Issue Type: Bug > Components: AcroForm, Writing > Affects Versions: 2.0.0 > Reporter: Stephen Hendrix > Labels: AES256, AcroForm > Attachments: PDFBOX-2471_Fix__AES_256_bit_encryption_of_COSString.diff > > > When writing a PDF using AES 256 bit encryption, the field names / values from the Acroform are not being persisted correctly. If I encrypt using RC4 128 bit, they are persisted correctly. I am using snapshot pdfbox:2.0.0-20141023.180319-636. > I dug into this, and it looks to me the problem is with COSWriter.visitFromString, which invokes SecurityHandler.decryptString (there is no SecurityHandler.encryptString). -- This message was sent by Atlassian JIRA (v6.3.4#6332)