encryptData method
Returns iv(12) | ciphertext | tag(16).
Implementation
@override
Future<Uint8List> encryptData(Uint8List key, Uint8List data) async {
final sk = await _algo.newSecretKeyFromBytes(key);
final nonce = _algo.newNonce(); // 12 bytes
final box = await _algo.encrypt(data, secretKey: sk, nonce: nonce);
return Uint8List.fromList([...nonce, ...box.cipherText, ...box.mac.bytes]);
}