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
| 0 | Not encrypted |
|---|---|
| 1 | RC4-40 |
| 2 | RC4-128 |
| 3 | AES-128 |
| 4 | AES-256 (revision 5) |
| 5 | AES-256 Acrobat X (revision 6) |
| 6 | AES-256-GCM |
| 7 | SM4-128 |