secure_shared_preferences
0.0.4, released 5 years ago by flutter.pingtobuild.com
Encrypt shared preferences on Android and UserDefaults on iOS using AES-CBC-128.
What it does
A package to store and retrieve encrypted key-value data using shared preferences on Android and UserDefaults on iOS. It supports multiple data types including String, int, bool, double, map, and List<String>, using the AES-CBC-128 algorithm.
AI-written summary of version 0.0.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to store sensitive key-value pairs securely on device
- You want a familiar shared preferences interface with optional encryption
Skip it when
- You require complex relational queries (use a database instead)
- You need secure storage specifically relying exclusively on platform native secure storage without shared preferences wrappers
Strengths
- Encrypts both keys and values using AES-CBC-128
- Supports multiple data types including maps and lists
- Allows bypassing encryption per entry via a boolean parameter
Weaknesses
- Relies on older or mixed underlying dependencies like package_info
- Limited documentation beyond basic read/write examples
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Not documented
var pref = await SecureSharedPref.getInstance();
await pref.putString("StringEncrypted", "This is my first string test", isEncrypted: true);
String? val = await pref.getString("StringEncrypted", isEncrypted: true);Alternatives
Packages that do the same job and could replace secure_shared_preferences.
- shared_preferences_android
Android backend for the shared_preferences plugin, storing key‑value data on Android devices.
84Compare - pref
Create Preference Screens easily with advanced features and sub-pages.
75Compare - shared_preference_app_group
Shared preferences for iOS and macOS App Groups using NSUserDefaults.
64Compare - shared_preferences_windows
Windows platform implementation for shared_preferences
50Compare
Works with
Packages commonly used together with secure_shared_preferences: ones it builds on, ones built on it, and its own family.
- shared_preferencessecure_shared_preferences depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- flutter_secure_storagesecure_shared_preferences depends on itSecure key-value storage using platform-specific secure mechanisms
- cryptographysecure_shared_preferences depends on itCross‑platform cryptographic algorithms for Dart and Flutter.
- cryptography_fluttersecure_shared_preferences depends on itFlutter plugin that lets the cryptography package use native OS crypto APIs for faster, compliant operations.