Does ItextSharp 5.4.5 support 256 bit encryption ??
i did my research but didn't find anything about 256 bit encryption. All people are saying itext java version support AES 256 bit encryption.
Yes, here's a short example that takes a PDF and encrypts a copy of it using 256-bit AES encryption:
var openDialog = new OpenFileDialog();
openDialog.DefaultExt = "pdf";
if (openDialog.ShowDialog() == true)
{
using (var input = openDialog.OpenFile())
{
var saveDialog = new SaveFileDialog();
saveDialog.DefaultExt = "pdf";
if (saveDialog.ShowDialog() == true)
{
using (var reader = new PdfReader(input))
{
using (var output = saveDialog.OpenFile())
{
PdfEncryptor.Encrypt(\
reader, output,
PdfWriter.ENCRYPTION_AES_256,
"password", "password",
PdfWriter.ALLOW_PRINTING);
}
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With