ECB class

Electronic Codebook (ECB) mode for AES encryption and decryption.

Inheritance

Constructors

ECB(List<int> key, {PaddingAlgorithm? paddingStyle = PaddingAlgorithm.pkcs7})
Creates an ECB instance with the given key and paddingStyle (PKCS#7 by default; pass null to require pre-padded, block-aligned input).

Properties

blockSize → int
Block size for AES cipher
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
paddingStyle → PaddingAlgorithm?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clean() → AES
Zeroes and releases both key schedules.
inherited
decrypt(List<int> src, [List<int>? dst]) → BuBytes
Decrypts src block-by-block in ECB mode, unpadding after if paddingStyle is set. Writes into dst if provided (dst must be exactly the plaintext length — a longer buffer would leave trailing bytes in the returned value).
decryptBlock(List<int> src, [List<int>? dst]) → BuBytes
Decrypts one 16-byte block, writing into dst if given. Throws if this instance was created with noDecryption.
inherited
encrypt(List<int> src, [List<int>? dst]) → BuBytes
Encrypts src block-by-block in ECB mode, padding first if paddingStyle is set. Writes into dst if provided (dst must be exactly the padded input length).
encryptBlock(List<int> src, [List<int>? dst]) → BuBytes
Encrypts one 16-byte block, writing into dst if given.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setKey(List<int> key, [bool noDecryption = false]) → AES
Re-keys this instance. key must be 16, 24, or 32 bytes, and the same size this instance was created with.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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