Add user password. This is the only thing that really matters. As you undoubtedly gathered from other answers, the owner password is a little joking.
The USER password is strong crypto ... up to 256-bit AES IIRC, although the original PDF cryptography specification only allows 40-bit encryption due to US export restrictions. Everything that was stronger than 40-bit was considered "ammunition." Gufi laws.
The OWNER password is not, it is more polite than anything else. PDF libraries try to support it to one degree or another, but open source PDF libraries are a quick change to pdf crackers code.
A blank user password means "use a predefined string of bytes listed in the PDF specification that any user can download." PDF content is still encrypted, but everyone knows the password, so itβs not very good for you. PDF viewers / libraries replace this byte string if there is no password.
PS:
When calling setEncryption :
- a
null open password means "empty password", as I described above. - a
null owner password means "create random for me".
A random owner password means that "no one can legally modify the PDF" .. but that does not mean "no one can change the PDF."
source share