Hello iTexter, i want to make encrypted PDF-files with iText (iText v1.4.2, JDK 1.5.0):
... PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(pdfEncrypted.pdf)); writer.setEncryption(PdfWriter.STRENGTH128BITS, "userPW", "ownerPW", permissions); ... My user password in this example is "userPW". I thougt, that this encryption is secure and that i need the user-password to read the encrypted pdf-File. But now i can open the generated file with iText without user password.... the user password is simple null! ... PdfReader reader = new PdfReader(pdfEncrypted.pdf); PdfEncryptor.encrypt(reader, new FileOutputStream(pdfDecrypted.pdf), null, null, PdfWriter.AllowPrinting, false); ... Now i can save the decrypted file without encryption. Even if i take the encrypted pdf-file from the iText -Tutorial, i don't need a password to open the file with iText... my password is again null. (http://itextdocs.lowagie.com/tutorial/general/HelloEncrypted.pdf) I don't know, if this is a bug or a feature? But if i take the encrypted pdf-file from itextsharp (http://itextsharp.sourceforge.net/examples/Chap0110.pdf) , i get --> java.io.IOException: Bad user password This pdf-file seems to be encrypted correct. Seems, that the PDF-Files encrypted by java-iText can always be deyrypted by java-iText. Independent of the giffen password during encryption. Did i make any mistake(s) during encryption? Hope for help! Humbi __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
