[ 
https://issues.apache.org/jira/browse/PDFBOX-5866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17872179#comment-17872179
 ] 

Tilman Hausherr edited comment on PDFBOX-5866 at 8/9/24 7:34 AM:
-----------------------------------------------------------------

This code change fixes it:
{code}
        if (dicRevision == REVISION_5 || dicRevision == REVISION_6)
        {
            passwordCharset = StandardCharsets.UTF_8;
            ue = Arrays.copyOf(encryption.getUserEncryptionKey(), 32);
            oe = Arrays.copyOf(encryption.getOwnerEncryptionKey(), 32);
        }
{code}
Of course that's all dumb and brute force, I'll have to find out why this works 
and read the spec 😂

Update: the spec mentions 32 bytes.


was (Author: tilman):
This code change fixes it:
{code}
        if (dicRevision == REVISION_5 || dicRevision == REVISION_6)
        {
            passwordCharset = StandardCharsets.UTF_8;
            ue = Arrays.copyOf(encryption.getUserEncryptionKey(), 32);
            oe = Arrays.copyOf(encryption.getOwnerEncryptionKey(), 32);
        }
{code}
Of course that's all dumb and brute force, I'll have to find out why this works 
and read the spec 😂

> Unable to load  password protected pdf
> --------------------------------------
>
>                 Key: PDFBOX-5866
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5866
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Charles D
>            Priority: Major
>         Attachments: pdfbox_invalid_pwd.pdf
>
>
> PDFBox is unable to load password protected pdf. Error is "Invalid AES key 
> length: 48 bytes."
> Adobe and qpdf are able to successfully open it , but many other applications 
> I've tried are unable to do so.
> The pdf is created by a third party scanner so unfortunately we have no 
> insight/control over its creation. 
> [^pdfbox_invalid_pwd.pdf] . Please let me know the best way to provide the 
> password. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to