AesCbc class

Implementação de AES-CBC (NIST SP 800-38A) com padding PKCS#7.

⚠️ CBC não é autenticado — considere AES-GCM para AEAD.

final cbc = AesCbc(key: key32, iv: iv16);
final payload = cbc.encrypt(utf8.encode('dados'));
final texto  = utf8.decode(cbc.decrypt(payload));

Constructors

AesCbc({required Uint8List key, required Uint8List iv})
Cria uma instância de AES-CBC com a key e o iv informados.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
iv Uint8List
Vetor de inicialização de ivLength bytes.
final
key Uint8List
Chave AES de 16 bytes (AES-128) ou 32 bytes (AES-256).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decrypt(EncryptedPayload payload) List<int>
Decifra payload e retorna o plaintext sem padding.
encrypt(List<int> plaintext) EncryptedPayload
Cifra plaintext com PKCS#7 e retorna EncryptedPayload.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

ivLength → const int
Tamanho obrigatório do vetor de inicialização, em bytes.