encrypt function
Encrypts plaintext as a STREAM under the 32-byte key.
The key must never be repeated across multiple streams. Derive it with HKDF from both a random file key and a random nonce.
Throws if key is not 32 bytes long.
Implementation
Uint8List encrypt({required Uint8List key, required Uint8List plaintext}) =>
ffi.streamEncrypt(key: key, plaintext: plaintext);