Hi, I actually disagree. When I call setEncryption with user pwd, owner pwd and permissions I'm basically applying to my document a Standard Security Handler which is responsible for providing additional entries to the encryption dictionary. Among these entries there's the O key which is a computed value and, according to table 3.19 "For more information see ... "Password Algorithms" on page 126". If I jump there, the first step of algorithm 3.3 "Computing the encryption dictionary’s O (owner password) value" states "If there is no owner password, use the user password instead". That's what I'd expect to happen according to the spec, what happens instead is "If there is no owner password, use a random string instead".
mkl wrote > In case of a PDF generating library this does not say *if the caller > supplies no owner password*, it says *if there is no owner password.* When > you request a null owner password and the library method you use is > documented as > > /** > * Sets the encryption options for this document. The userPassword and > the > * ownerPassword can be null or have zero length. In this case the > ownerPassword > * is replaced by a random string. > > then there is an owner password, *a random string*. Thus, this behavior of > iText does not contradict the PDF specification. I don't think your argument is valid, according to it you could, absurdly, always replace the owner password with a random string (even when the user provided it) and still strictly don't contradict the spec (there is an owner password, *a random string*, algorithm 3.3 applies). Now, back to the point of my question: since it's not in the spec (or at least I didn't find it), it seems pretty peculiar the behaviour "if there's no owner password, generate a random one", so I was wondering if there is some reasoning behind that I didn't grasp. Thanks Andrea -- View this message in context: http://itext-general.2136553.n4.nabble.com/Encrypt-without-owner-password-and-random-password-generation-tp4659839p4659843.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php