IDSCryptoConfiguration class

AES-256-CBC Encryption/Decryption core utility using PBKDF2 key derivation.

This class is responsible for generating a secure encryption key based on a password and salt using PBKDF2 with HMAC-SHA256. It also includes helper methods to convert between byte arrays and hex strings.

Constructors

IDSCryptoConfiguration({required String password, String salt = 'salt', int iterations = 10000, int keyLength = 32, int ivLength = 16})
Creates a new IDSCryptoConfiguration instance with customizable parameters.

Properties

hashCode → int
The hash code for this object.
no setterinherited
iterations → int
Number of iterations to apply during key derivation.
final
ivLength → int
Initialization Vector (IV) length in bytes (typically 16).
final
keyLength → int
Length of the derived key in bytes (e.g., 32 for AES-256).
final
password → String
Password used for key derivation.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
salt → String
Salt used with the password in PBKDF2 (should be random in production).
final

Methods

bytesToHex(Uint8List bytes) → String
Converts a Uint8List of bytes to a hexadecimal string.
deriveKey() → Uint8List
Derives a cryptographic key using PBKDF2 with HMAC-SHA256.
hexToBytes(String hex) → Uint8List
Converts a hexadecimal string to a Uint8List of bytes.
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