BlockCipher class abstract
An abstract class representing a block cipher for symmetric encryption and decryption.
Block ciphers operate on fixed-size blocks of data, typically 128 bits (16 bytes) for AES. They provide methods for key initialization, encryption, decryption, and memory cleanup.
Subclasses of this abstract class implement specific block cipher algorithms and provide methods for encryption and decryption of data.
Key Initialization:
- The
setKey
method is used to initialize the cipher with an encryption key.
Encryption and Decryption:
- The
encryptBlock
method encrypts a single block of data. - The
decryptBlock
method decrypts a single block of data.
Block Size:
- The
blockSize
property returns the size of the data block in bytes that the cipher operates on.
Memory Cleanup:
- The
clean
method can be used to securely zero any sensitive information or states held by the block cipher instance, ensuring that no secrets are left in memory after use.
Note: This abstract class serves as a foundation for various block ciphers and should be extended to support specific algorithms such as AES or DES.
- Implementers
Constructors
Properties
Methods
-
clean(
) → BlockCipher - Clears any sensitive information or states held by the block cipher instance, ensuring that no secrets are left in memory after use.
-
decryptBlock(
List< int> src, [List<int> ? dst]) → List<int> - Decrypts a single block of data.
-
encryptBlock(
List< int> src, [List<int> ? dst]) → List<int> - Encrypts a single block of data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setKey(
List< int> key) → BlockCipher - Initializes the cipher with the provided encryption key.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited