ECB class
Electronic Codebook (ECB) mode for AES encryption and decryption.
Constructors
-
ECB(List<
int> key, {PaddingAlgorithm? paddingStyle = PaddingAlgorithm.pkcs7}) -
Creates an ECB instance with the given
keyandpaddingStyle(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
srcblock-by-block in ECB mode, unpadding after if paddingStyle is set. Writes intodstif provided (dstmust 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
dstif given. Throws if this instance was created withnoDecryption.inherited -
encrypt(
List< int> src, [List<int> ? dst]) → BuBytes -
Encrypts
srcblock-by-block in ECB mode, padding first if paddingStyle is set. Writes intodstif provided (dstmust be exactly the padded input length). -
encryptBlock(
List< int> src, [List<int> ? dst]) → BuBytes -
Encrypts one 16-byte block, writing into
dstif 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.
keymust 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