RE: Decrypt PDF to edit it then encrypt it

2018-01-09 Thread Hesham Gneady
Thanks Tilman! I have tested your code & it works fine  Best regards, Hesham -- Included Message: here's some code... I'm also adding it to our tests as some extra fun.

Re: Decrypt PDF to edit it then encrypt it

2018-01-04 Thread Tilman Hausherr
here's some code... I'm also adding it to our tests as some extra fun.     PDEncryption encryption = doc.getEncryption();     int revision = encryption.getRevision();     if (revision < 5)     {     StandardSecurityHandler standardSecurityHandler = new

RE: Decrypt PDF to edit it then encrypt it

2018-01-03 Thread Hesham Gneady
Thanks a lot Tilman .. I will try that  Best regards, Hesham -- Included Message: It is possible for older encryption (not AES256): get the source code and have a look at

Re: Decrypt PDF to edit it then encrypt it

2018-01-03 Thread Tilman Hausherr
Am 03.01.2018 um 12:34 schrieb Hesham Gneady: I am asking if there is a way to copy the encryption dictionary(Or whatever you call it) just as it is to re-encrypt the PDF file using it once again. I don't want to reveal any password. Oh. I haven't tried it - what you might try would be to

Re: Decrypt PDF to edit it then encrypt it

2018-01-03 Thread Tilman Hausherr
It is possible for older encryption (not AES256): get the source code and have a look at StandardSecurityHandler.java. There is a segment where "isOwnerPassword()" is called, and a bit later, "computedPassword" is calculated by calling getUserPassword(). I tried this by debugging with out test

RE: Decrypt PDF to edit it then encrypt it

2018-01-03 Thread Hesham Gneady
I am asking if there is a way to copy the encryption dictionary(Or whatever you call it) just as it is to re-encrypt the PDF file using it once again. I don't want to reveal any password. Best regards, Hesham

Re: Decrypt PDF to edit it then encrypt it

2018-01-03 Thread Gilad Denneboom
You can't do that. The library is obviously not going to reveal to you what the password was... On Wed, Jan 3, 2018 at 9:29 AM, Hesham Gneady wrote: > Hello, > > > > I have a PDF file that has an owner password & user password. I'd like to > decrypt it using the owner