TAesGcmTag = array[0..15] of Byte;
TGHashBlock = TAesBlock;
procedure Aes256GcmEncrypt(const Key: TAes256Key; const IV, Plain, AAD: TBytes;
out Cipher: TBytes; out Tag: TAesGcmTag);
function Aes256GcmDecrypt(const Key: TAes256Key; const IV, Cipher, AAD: TBytes;
const Tag: TAesGcmTag; out Plain: TBytes): Boolean;
procedure Aes128GcmEncrypt(const Key: TAes128Key; const IV, Plain, AAD: TBytes;
out Cipher: TBytes; out Tag: TAesGcmTag);
function Aes128GcmDecrypt(const Key: TAes128Key; const IV, Cipher, AAD: TBytes;
const Tag: TAesGcmTag; out Plain: TBytes): Boolean;
FPdfAesGcm implementa AES in modalità Galois/Counter sulle primitive a blocchi di FPdfAes. Produce il testo cifrato e un tag di autenticazione di 16 byte e accetta additional authenticated data (AAD) coperti dal tag ma non cifrati
Le funzioni di decifratura restituiscono False quando il tag non viene verificato, così i chiamanti possono respingere un testo cifrato manomesso senza sollevare eccezioni. Questa modalità è usata da strutture che richiedono cifratura autenticata oltre al gestore di sicurezza AES-256-CBC del PDF
| Funzione | Descrizione |
|---|---|
Aes256GcmEncrypt | Cifra Plain con una chiave a 256 bit, IV e AAD, restituendo il testo cifrato e un tag di 16 byte |
Aes256GcmDecrypt | Decifra Cipher con una chiave a 256 bit, IV e AAD, verificando il tag; restituisce False in caso di mancata corrispondenza del tag |
Aes128GcmEncrypt | Cifra Plain con una chiave a 128 bit, IV e AAD, restituendo il testo cifrato e un tag di 16 byte |
Aes128GcmDecrypt | Decifra Cipher con una chiave a 128 bit, IV e AAD, verificando il tag; restituisce False in caso di mancata corrispondenza del tag |
| Tipo | Descrizione |
|---|---|
TAesGcmTag | Tag di autenticazione di 16 byte prodotto e verificato da GCM |
TGHashBlock | Alias di TAesBlock usato dal blocco costruttivo GHASH |