Class PdfEncryptionType
The encryption algorithm used to secure a PDF document's content when a password is applied.
Inheritance
Namespace: IronPdf.Security
Assembly: IronPdf.dll
Syntax
public sealed class PdfEncryptionType : Enum
PdfEncryptionType controls which cipher secures a password-protected PDF, passed to IronPDF's encryption API. Aes_256 is the strongest and recommended choice for new documents. Aes_128 offers broad compatibility with older readers, and Rc4_128 is a legacy algorithm retained for interoperability with systems that cannot accept AES. See PDF security how-to for usage details.
pdfDocument.SecuritySettings.OwnerPassword = "secret";
pdfDocument.SecuritySettings.EncryptionType = PdfEncryptionType.Aes_256;Fields
Aes_128
128-bit AES encryption (PDF 1.5+). Supported by Adobe Acrobat 7 and all modern readers.
Declaration
public const PdfEncryptionType Aes_128
Field Value
| Type | Description |
|---|---|
| PdfEncryptionType |
Aes_256
256-bit AES encryption (PDF 2.0). The strongest option; supported by Adobe Acrobat 9+ and most modern readers. Passwords are encoded as UTF-8 per ISO 32000-2.
Declaration
public const PdfEncryptionType Aes_256
Field Value
| Type | Description |
|---|---|
| PdfEncryptionType |
Rc4_128
128-bit RC4 encryption (PDF 1.4). This is the default and preserves the historical behavior of IronPDF. RC4 is considered cryptographically weak; prefer AES for new documents.
Declaration
public const PdfEncryptionType Rc4_128
Field Value
| Type | Description |
|---|---|
| PdfEncryptionType |
value__
Declaration
public int value__
Field Value
| Type | Description |
|---|---|
| System.Int32 |