StringEncryption class
- Implemented types
Constructors
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(
String data, String key) → Future< String?> -
Decrypts
data
created with the encrypt method using akey
created with generateRandomKey or generateKeyFromPassword methods. In case thekey
is wrong or thedata
has been forged, a MacMismatchException is thrownoverride -
encrypt(
String string, String key) → Future< String?> -
Encrypts
string
using akey
generated from generateRandomKey or generateKeyFromPassword. The returned string is a sequence of 3 base64-encoded strings (iv, mac and cipherText) and can be transferred and stored almost anywhere.override -
generateKeyFromPassword(
String password, String salt) → Future< String?> -
Gets a key from the given
password
andsalt
.salt
can be generated with generateSalt whilepassword
is usually provided by the user.override -
generateRandomKey(
) → Future< String?> -
Generates a random key to use with encrypt and decrypt methods
override
-
generateSalt(
) → Future< String?> -
Generates a salt to use with generateKeyFromPassword
override
-
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