clean method
Clears and releases internal key schedule data for security and memory management.
This method securely zeros and releases the internal encryption and decryption key schedules to ensure that no sensitive key data is left in memory. It is an essential step for maintaining the security of the AES cipher instance after use.
Returns:
- The same AES instance after cleaning for method chaining.
Implementation
@override
AES clean() {
if (_encKey != null) {
zero(_encKey!);
_encKey = null;
}
if (_decKey != null) {
zero(_decKey!);
_decKey = null;
}
return this;
}