encrypt method
- @nonVirtual
- @override
- List<
int> clearText, { - required SecretKey secretKey,
- List<
int> ? nonce, - List<
int> aad = const <int>[], - int keyStreamIndex = 0,
override
Encrypts a cleartext.
Parameter keyStreamIndex
allows you to choose offset in the keystream.
For other arguments, see Cipher.encrypt.
Implementation
@nonVirtual
@override
Future<SecretBox> encrypt(
List<int> clearText, {
required SecretKey secretKey,
List<int>? nonce,
List<int> aad = const <int>[],
int keyStreamIndex = 0,
}) async {
final secretKeyData = await secretKey.extract();
return encryptSync(
clearText,
secretKeyData: secretKeyData,
nonce: nonce,
aad: aad,
keyStreamIndex: keyStreamIndex,
);
}