isValid method

bool isValid()

Validates the encryption key format.

Implementation

bool isValid() {
  // Must be 64 hex characters (256 bits)
  if (encryptionKey.length != 64) return false;

  // Must be valid hex (characters 0-9, a-f, A-F)
  // Using regex to avoid integer parsing limitations for 256-bit numbers
  final hexRegex = RegExp(r'^[0-9a-fA-F]{64}$');
  return hexRegex.hasMatch(encryptionKey);
}