encrypt method

String encrypt(
  1. String plainText,
  2. Nonce nonce
)

Implementation

String encrypt(String plainText, Nonce nonce) {
  ChaCha20Algorithm chaCha20Algorithm =
      ChaCha20Algorithm(_password, 0, nonce.intList);
  Uint8List inputBytes = Uint8List.fromList(plainText.codeUnits);
  return base64Encode(chaCha20Algorithm.processBytes(inputBytes));
}