flutter_native_secure_storage 1.0.2
flutter_native_secure_storage: ^1.0.2 copied to clipboard
Flutter plugin to store data in secure storage on Android and iOS.
๐ flutter_native_secure_storage #
A lightweight, secure Flutter plugin for storing sensitive data using
Android Keystore and iOS Keychain โ with no Dart-side encryption.
Built for production apps, SDKs, and enterprise use cases.
โจ Features #
โ
Android Keystore (AES-256 + GCM)
โ
iOS Keychain (ThisDeviceOnly)
โ
Hardware-backed security when available
โ
App-bound secrets (auto wiped on uninstall)
โ
Zero configuration
โ
Minimal & clean API
โ
No third-party native dependencies
๐ซ Why NOT flutter_secure_storage? #
| Feature | flutter_secure_storage | flutter_native_secure_storage |
|---|---|---|
| Native-only crypto | โ | โ |
| Hardware-backed keys | โ | โ |
| Transparent behavior | โ | โ |
| Enterprise friendly | โ ๏ธ | โ |
| Minimal API | โ | โ |
๐ฆ Installation #
Add to pubspec.yaml:
dependencies:
flutter_native_secure_storage: ^1.0.0
Then run:
flutter pub get
๐ Usage #
Write Secure Value #
await SecureStorage.write('auth_token', 'abc123');
Read Secure Value #
final token = await SecureStorage.read('auth_token');
Delete a Key #
await SecureStorage.delete('auth_token');
Clear All Secure Data #
await SecureStorage.clear();
๐ง How It Works #
Android #
- AES key stored in Android Keystore
- Encryption: AES/GCM/NoPadding
- Encrypted values stored in SharedPreferences
iOS #
- Secrets stored in Keychain
- Access:
AfterFirstUnlockThisDeviceOnly - Automatically removed on uninstall
๐ No encryption logic exists in Dart.
๐ Security Guarantees #
โ Secrets never leave the device
โ No cloud or iCloud sync
โ Protected from backup leaks
โ Resistant to reverse-engineering
โ Safe for banking & enterprise apps
๐งช Platform Support #
- Android 8+
- iOS 13+
๐ฃ Roadmap #
- ๐ Biometric protection (FaceID / Fingerprint)
- ๐ Key rotation
- ๐ก Root / Jailbreak detection
- ๐ Encrypted file storage
๐ License #
MIT License