I already asked the first half of my question so for future references I recommend reading that question in order to fix my problem (I was suggested writing a new question based on the information i got from that question, click here). Roughly said, my problem is that PdfReader.ComputeUserPassword()
returns null. It's caused by the library which isn't able to compute the user's password from an AES256 encrypted PDF file.
This is the lib's code that returns null:
public byte[] ComputeUserPassword() {
if (!encrypted || !ownerPasswordUsed) return null;
return decrypt.ComputeUserPassword(password);
}
My question is, how can I compute the user's password from an AES256 encrypted PDF?
(Is it necessary to update from 5.5.13.1 to a 7.* version of itextsharp? This isn't relevant right now because the current version [v7.1.7] of itextsharp still doesn't support AES256 encryption when trying to obtain the user's password of an AES256 encrypted PDF file, as you can see in the "Edit"-part)
Edit:
I don't see any reason of updating to v7.* because AES256 encryption still isn't supported for computing the user's password (this hasn't changed from v7.1.1 to v7.1.7).
https://api.itextpdf.com/iText7/7.1.1/com/itextpdf/kernel/pdf/PdfReader.html#computeUserPassword--
public byte[] computeUserPassword()
Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 encryption algorithm.
Returns: user password, or null if not a standard encryption handler was used or if ownerPasswordUsed wasn't use to open the document.