AEAD class abstract

An abstract class representing an Authenticated Encryption with Associated Data (AEAD) cipher.

AEAD ciphers provide both encryption and authentication of data, ensuring its integrity and confidentiality. These ciphers work with a secret key, a nonce (number used once), and optionally, associated data. They produce ciphertext and a tag.

Subclasses of this abstract class implement specific AEAD algorithms and provide methods for encryption and decryption. The AEAD interface enforces the following key properties:

  • nonceLength: Returns the length (in bytes) of the nonce required by the AEAD algorithm.

  • tagLength: Returns the length (in bytes) of the authentication tag produced by the AEAD algorithm.

  • encrypt: Encrypts the provided plaintext along with a nonce, and optional associated data. Returns the ciphertext and may write the result into the dst List

  • decrypt: Decrypts the provided ciphertext along with a nonce, and optional associated data. Returns the plaintext and may write the result into the dst List

  • clean: Clears any sensitive information or states held by the AEAD instance, ensuring that no secrets are left in memory after use.

Implementers

Constructors

AEAD()

Properties

hashCode int
The hash code for this object.
no setterinherited
nonceLength int
Returns the length (in bytes) of the nonce required by the AEAD algorithm.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tagLength int
Returns the length (in bytes) of the authentication tag produced by the AEAD algorithm.
no setter

Methods

clean() AEAD
Clears any sensitive information or states held by the AEAD instance, ensuring that no secrets are left in memory after use.
decrypt(List<int> nonce, List<int> ciphertext, {List<int>? associatedData, List<int>? dst}) List<int>?
Decrypts the provided ciphertext along with a nonce, and optional associated data. Returns the plaintext and may write the result into the dst List
encrypt(List<int> nonce, List<int> plaintext, {List<int>? associatedData, List<int>? dst}) List<int>
Encrypts the provided plaintext along with a nonce, and optional associated data. Returns the ciphertext and may write the result into the dst List
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