The Syncfusion .NET PDF Library offers various encryption standards to protect PDF documents from unauthorized access. Users can effortlessly integrate this library into their applications to secure PDFs with different levels of encryption. The library complies with the enhanced security features of PDF 2.0, providing AES (Advanced Encryption Standard) 256 Revision 6 with Unicode password support.
This security works seamlessly across platforms, including Windows, macOS, Linux, Android, and iOS, through any .NET-based application, such as ASP.NET Core, ASP.NET MVC, Blazor, .NET MAUI, Xamarin, WinForms, WPF, and WinUI.
The following code demonstrates how to protect a PDF document using C#.
using Syncfusion.Pdf.Security;
using Syncfusion.Pdf.Parsing;
// Load the PDF document from a file stream
using (FileStream inputFileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
// Load the PDF document
PdfLoadedDocument document = new PdfLoadedDocument(inputFileStream);
// Gets a security object for the document
PdfSecurity security = document.Security;
// Configure key size and encryption algorithm
security.KeySize = PdfEncryptionKeySize.Key256Bit;
security.Algorithm = PdfEncryptionAlgorithm.AES;
// Assign owner and user passwords
security.OwnerPassword = "owner123";
security.UserPassword = "user123";
// Save the PDF document in to a file stream
using (FileStream outputFileStream = new FileStream("Output.pdf", FileMode.Create))
{
document.Save(outputFileStream);
}
// Close the document
document.Close(true);
}
Explore key functionalities, including encryption algorithms, user and permission passwords, customizable document permissions, and more to protect your PDF files.
The Syncfusion PDF Library provides support for basic and advanced encryption standards. The following are the encryption standards supported: - RC4 40-bit - RC4 128-bit - AES 128-bit - AES 256-bit Revision 5 - AES 256-bit Revision 6 (PDF 2.0)
A permission or master password is used to set access rights for document restrictions. Only users with the master password can edit the encrypted document.
A user password, also known as a document open password, is required for users to open and view the document.
By customizing the document permission settings, you can control whether users are allowed to perform specific actions such as copying content, printing, editing the document, filling form fields, and more. Additionally, you can change or remove PDF permissions and passwords.
The Syncfusion PDF Library lets users encrypt a PDF document as follows: - Encrypt all contents: All contents of the document will be encrypted. - Encrypt all contents except metadata: All contents of the document will be encrypted except metadata. - Encrypt only attachments: Encrypts only the file attachments, rest of the document will be left unencrypted. - Encrypt the PDF document.
This process involves disabling the password protection on a PDF file, making it accessible without the need to enter a password. This can be useful for simplifying access when the document no longer requires security restrictions. Once the password security is removed, users will be able to open, view, and perform actions on the PDF without any restrictions.
Discover valuable resources from our blog and knowledge base to encrypt PDF documents.
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
PDF encryption is the process of securing a PDF document by encoding its contents to prevent unauthorized access. It’s important because it ensures that sensitive information remains confidential and protected from unauthorized viewing or tampering.
Yes, you can remove the encryption from existing PDF documents using Syncfusion .NET PDF Library.
Yes, you can control whether the users are allowed to perform specific actions, such as copying content, printing, editing the document, and filling form fields.
When choosing a password for encrypting a PDF, it’s important to use a combination of uppercase and lowercase letters, numbers, and special characters. Avoid using easily guessable passwords like common words or phrases.
PDF protection typically works by encrypting the contents of a PDF file, making it accessible only to users who have the correct password or decryption key. This encryption process involves encoding the document’s data using algorithms to prevent unauthorized access.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.