cryptoSecretBoxEasy method

  1. @override
Future<String> cryptoSecretBoxEasy(
  1. String plaintext,
  2. String nonce,
  3. String key
)
override

Implementation

@override
Future<String> cryptoSecretBoxEasy(
  String plaintext,
  String nonce,
  String key,
) async {
  final m = Uint8List.fromList(plaintext.codeUnits);
  final n = HexConverter.hexToBytes(nonce);
  final k = HexConverter.hexToBytes(key);
  final result = interop.crypto_secretbox_easy(m, n, k);
  return HexConverter.bytesToHex(result);
}