Secure a PDF
Protect a PDF with AES-256 passwords
Encrypt a PDF with AES-256 Standard security, set document-open and owner passwords, and review preservation evidence for the protected copy.
Protection summary
- Input
- PDF and passwords
- Output
- AES-256 protected PDF
- Package
- OfficeIMO.Pdf
- Runs on
- Browser-local WebAssembly or .NET
- Microsoft Office
- Not required
- License
- MIT
Password encryption controls opening and permissions; it is not a digital signature or trust assertion.
Browse all PDF workflowsPractical steps
Create an AES-256 password-protected PDF
Set separate user and owner credentials, rewrite the document, and verify the protected output.
- SelectChoose one PDF that can be rewritten under the current security policy.
- ProtectEnter a document-open password and a separate owner password.
- VerifyCreate the AES-256 output and review encryption and preservation evidence.
Password protection uses the PDF Standard security handler. The user password opens the document; the owner password controls privileged changes and should be stored separately from the delivered file.
Protect from .NET
using OfficeIMO.Pdf;
PdfDocument source = PdfDocument.Load("statement.pdf");
var encryption = new PdfStandardEncryptionOptions("reader-password") {
OwnerPassword = "owner-password",
Algorithm = PdfStandardEncryptionAlgorithm.Aes256
};
PdfSecurityMutationResult result = source.Security.Encrypt(encryption);
File.WriteAllBytes("statement.protected.pdf", result.Pdf);
Console.WriteLine(result.PreservationReport.Summary);
The mutation result exposes whether the output is encrypted and whether the rewrite preserved the expected document structure. Applications should handle passwords through their normal secret-management policy, not source code or logs.
Encryption is not signing
Password protection does not identify the publisher, validate document integrity through a certificate, or timestamp a revision. Use the cryptographic signing and validation APIs through OfficeIMO.Pdf and OfficeIMO.Security when the workflow requires those guarantees.