PDFium Delphi Component Docs

Unità FPdfAesGcm

Unità: FPdfAesGcm
Cifratura autenticata AES-GCM in puro Pascal per chiavi AES-128 e AES-256, che produce il testo cifrato unitamente a un tag di autenticazione di 16 byte

Sintassi

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;

Descrizione

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

Funzioni

FunzioneDescrizione
Aes256GcmEncryptCifra Plain con una chiave a 256 bit, IV e AAD, restituendo il testo cifrato e un tag di 16 byte
Aes256GcmDecryptDecifra Cipher con una chiave a 256 bit, IV e AAD, verificando il tag; restituisce False in caso di mancata corrispondenza del tag
Aes128GcmEncryptCifra Plain con una chiave a 128 bit, IV e AAD, restituendo il testo cifrato e un tag di 16 byte
Aes128GcmDecryptDecifra Cipher con una chiave a 128 bit, IV e AAD, verificando il tag; restituisce False in caso di mancata corrispondenza del tag

Tipi

TipoDescrizione
TAesGcmTagTag di autenticazione di 16 byte prodotto e verificato da GCM
TGHashBlockAlias di TAesBlock usato dal blocco costruttivo GHASH

Osservazioni

Vedi anche

FPdfAes