configure method

void configure({
  1. required String keyPhrase,
})

Derives and caches the AES-256 key from keyPhrase.

Call once in main() before any encrypt/decrypt operations. Safe to call again to rotate the key — but note: data encrypted with the old key can only be decrypted with the old key.

Implementation

void configure({required String keyPhrase}) {
  _aesKey = _deriveKey(keyPhrase);
  _configured = true;
}