LoginPage #54
|
@ -4,22 +4,13 @@ class EncryptData{
|
||||||
//for AES Algorithms
|
//for AES Algorithms
|
||||||
|
|
||||||
static Encrypted? encrypted;
|
static Encrypted? encrypted;
|
||||||
static var decrypted;
|
|
||||||
|
|
||||||
|
|
||||||
static encryptAES(plainText){
|
static encryptAES(plainText){
|
||||||
final key = Key.fromUtf8('my 32 length key................');
|
final key = Key.fromUtf8('my32lengthsupersecretnooneknows1');
|
||||||
final iv = IV.fromLength(16);
|
final iv = IV.fromLength(16);
|
||||||
final encrypter = Encrypter(AES(key));
|
final encrypter = Encrypter(AES(key));
|
||||||
encrypted = encrypter.encrypt(plainText, iv: iv);
|
encrypted = encrypter.encrypt(plainText, iv: iv);
|
||||||
return encrypted!.base64;
|
return encrypted!.base64;
|
||||||
}
|
}
|
||||||
|
|
||||||
static decryptAES(plainText){
|
|
||||||
final key = Key.fromUtf8('my 32 length key................');
|
|
||||||
final iv = IV.fromLength(16);
|
|
||||||
final encrypter = Encrypter(AES(key));
|
|
||||||
decrypted = encrypter.decrypt(encrypted!, iv: iv);
|
|
||||||
return decrypted;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user