Free Support Forum - aspose.com

Password rules for encrypting files

My application encrypts PDF files with line:
EncryptFile(userPassword, ownerPassword, DocumentPrivilege.AllowAll, KeySize.x128, Algorithm.AES)

I got exception
Exception: System.IO.IOException: Bad password!: v5.6.0.0
at Aspose.Pdf.Kit.PdfFileSecurity.EncryptFile

The password looks like that ABC2EFG2016 .

Is that because the password format is not good? What are the rules on which password is valid?


This Topic is created by codewarior using the Email to Topic plugin.

Hi,

Thanks for contacting support.

The format of password appears to be fine because any string can be used to encrypt the document. The problem might be related to the structure and complexity of input document, so we need the input PDF file, so that we can test the scenario in our environment.

Furthermore, please note that Aspose.Pdf.Kit for .NET has been discontinued as a separate product and all its classes and enumerations are included in Aspose.Pdf.Facades namesapce of mergedAPI release of Aspose.Pdf for .NET. You may consider visiting Migration from Aspose.Pdf.Kit

We are sorry for this inconvenience.

Thanks, this helps. We have Aspose.Pdf 9.2.1.0, I hope migration will help.

Hi,

Before your upgrade the subscription, you may consider requesting a 30 days temporary license to test the API without any limitations. For further details, please visit Get a Temporary License.