CSecurity
asked on
iText encryption doesn't allow normal opening
Hi
I use iText to modify PDF files, encrypt them to block printing, modifying or copying text from it. I can do that with Acrobat Professional, but I want to do that with iText.
iText does it but it also protects entire file and doesn't allow OPENING file normally, I tried everything but again it encrypt the file and do not let opening file.
Please advice, I want to disable printing, modifying etc. but I don't want to disable opening...
Here is how I call iText
java -cp itext.jar;bcprov.jar com.lowagie.tools.EncryptP df output2.pdf encrypted_output.pdf user master 00000000 128
Please advice.
Thanks from now!
I use iText to modify PDF files, encrypt them to block printing, modifying or copying text from it. I can do that with Acrobat Professional, but I want to do that with iText.
iText does it but it also protects entire file and doesn't allow OPENING file normally, I tried everything but again it encrypt the file and do not let opening file.
Please advice, I want to disable printing, modifying etc. but I don't want to disable opening...
Here is how I call iText
java -cp itext.jar;bcprov.jar com.lowagie.tools.EncryptP
Please advice.
Thanks from now!
Try to provide an empty user password (e.g. in your example, instead of user, just put "" on your command line). Does that change how the file can be opened?
Just as a hint: Don't forget that your settings can be safely ignored by anyone not wanting to adhere to them. There are literally tens of shareware programs that remove this protection from PDF files again. So it is only useful as a warning to users\ (and irritate the hell out of them). Actually, the same iText can be used to remove the protection again.
As far as I know, you can only remove protection with iText if you know the master password - it's not a tool to crack the PDF files.
Absolutely, you need some cracking tool (and a weak passport) to pull that off, however the author was just trying to protect against printing, modifying and copying, which are really just settings for the Adobe reader (and compliant readers I suppose), not much else. Anyway, it was not a solution, just a general piece of information.
ASKER
Hey, I tried null password, but not worked... I don't care about crackers or anyone want to remove my protection, just I want my PDF have protection and don't need password for opening
What happens when you use a null password? According to the iText documentation, that should work. Have you thought about creating your own Java program (or to modify the one that comes with the toolbox)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.