ChaChaPolyCrypt class
This is an ChaCha20-Poly1305 symmetric encryption machine. Various modes and paddings are available.
This version of ChaChaPolyCrypt is encoded. It expects keys and IVs to be base-64 encoded, and returns base64 encoded Strings. Plaintext should be UTF-8. For more flexibility, ChaChaPolyCryptRaw is recommended.
Constructors
- ChaChaPolyCrypt({required String key})
- Creates 'Crypt', serves as encrypter/decrypter of text.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decrypt(
{required String enc, required String iv, String? aad, int tagLength = 128}) → String - Decrypts (with iv) and return in base 64.
-
encrypt(
{required String inp, required String iv, String? aad, int tagLength = 128}) → String - Encrypts (with iv) and return in base 64.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited