Solved

iText encryption doesn't allow normal opening

Posted on 2008-10-12
7
1,417 Views
Last Modified: 2012-05-05
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.EncryptPdf output2.pdf encrypted_output.pdf user master 00000000 128

Please advice.
Thanks from now!
0
Comment
Question by:CSecurity
  • 4
  • 2
7 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 22697322
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?
0
 
LVL 9

Expert Comment

by:mbodewes
ID: 22698154
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.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 22699119
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.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 9

Expert Comment

by:mbodewes
ID: 22699170
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.
0
 
LVL 17

Author Comment

by:CSecurity
ID: 22700536
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
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 22701060
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)?
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 22701071
And, if you just want to assign security, without messing around with Java, or with your own program, take a look at PdfTk (http://www.accesspdf.com/pdftk/), which is based on iText. It's a command line program that's available compiled for different architectures, but you can also get the source code and compile it yourself.

It does allow to set a user password independently from the owner password.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why pdf file doesn't open ? 7 76
Tomcat: Unable to run tomcat service. 2 23
Adobe Reader DC printing black lines 4 29
Java 8 to Java 6 8 20
Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question