GetEncryptionLevel

Security and signatures

Description

Reports how the open document is encrypted. Returns 0 when no document is open or the document is not encrypted; because 0 is reserved for that case, an encrypted document reads one above the write-side Encrypt Strength that produced it (Strength 0=RC4-40 reads 1, 1=RC4-128 reads 2, 2=AES-128 reads 3, 5=AES-256-GCM reads 6, 6=SM4 reads 7). AES-256 written with Strength 3 or 4 is the Acrobat X revision 6 variant and reads 5; a legacy revision 5 AES-256 file reads 4.

Syntax

Delphi

Function TPDFlib.GetEncryptionLevel: Integer;

Return values

0Not encrypted
1RC4-40
2RC4-128
3AES-128
4AES-256 (revision 5)
5AES-256 Acrobat X (revision 6)
6AES-256-GCM
7SM4-128