Prefs Guard
Prefs Guard is a data protection wrapper for local storage (Shared Prefs). supporting both IOS & Android.
- Notice :- Use Same GuardType through out the app to get the proper result.
Prefs guard supports three types of encryption formats
GuardType.AES
import 'package:prefs_guard/prefsguard.dart';
final prefs = PrefsGuard(GuardType.AES);
//Storing a value in local storage
prefs.write(key: 'hello', value: 'flutter'); //encrypts using AES encryption.
//reading a value from local storage
final data= await prefs.read(key: 'hello');//decrypt using AES
GuardType.Salsa20
import 'package:prefs_guard/prefsguard.dart';
final prefs = PrefsGuard(GuardType.Salsa20);
//Storing a value in local storage
prefs.write(key: 'hello', value: 'flutter'); //encrypts using Salsa20 encryption.
//reading a value from local storage
final data= await prefs.read(key: 'hello');//decrypt using Salsa20
GuardType.FerNet
import 'package:prefs_guard/prefsguard.dart';
final prefs = PrefsGuard(GuardType.FerNet);
//Storing a value in local storage
prefs.write(key: 'hello', value: 'flutter'); //encrypts using FerNet encryption.
//reading a value from local storage
final data= await prefs.read(key: 'hello');//decrypt using FerNet
Clearing Prefs
final prefs = PrefsGuard(GuardType.FerNet);
prefs.clearAll();
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate.