AesCtr class

Implementação de AES-CTR (NIST SP 800-38A, modo de contador).

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

O initialCounterBlock é o bloco de contador inicial (16 bytes). Compatível com os vetores NIST que usam Inc128 (incrementa o bloco inteiro como inteiro big-endian de 128 bits).

final ctr = AesCtr(key: key32, initialCounterBlock: icb);
final payload = ctr.encrypt(dados);
final original = ctr.decrypt(payload);

Constructors

AesCtr({required Uint8List key, required Uint8List initialCounterBlock})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
initialCounterBlock Uint8List
Bloco de contador inicial — 16 bytes interpretados como uint128 big-endian.
final
key Uint8List
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.
encrypt(List<int> plaintext) EncryptedPayload
Cifra plaintext 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

counterBlockLength → const int