Flutter plugin that stores sensitive strings in platform secure storage with encryption. Supports Android, iOS, macOS, Windows, Linux, and web.
Overview
flutter_secure_storage is a Flutter plugin for saving sensitive data as key-value pairs using each platform’s secure storage APIs. Values are encrypted before persistence; on Android the default stack uses RSA OAEP plus AES-GCM, while iOS and macOS use the Keychain.
The API covers write, read, delete, delete-all, and contains-key checks, with per-platform option classes for accessibility, cipher choices, and biometric gates. Android builds can require or optionally use biometrics via AndroidOptions constructors, with documented cipher matrices and migration when algorithms change.
On Apple platforms you can opt into Secure Enclave–backed keys so decryption stays hardware-bound, with notes on enabling Keychain Sharing entitlements when needed. Web usage is limited to HTTPS or localhost environments per project warnings.
Cross-platform support spans Android, iOS, macOS, Windows, Linux, and Web, with installation through pubspec dependencies and flutter pub get after adding the package import.
Key features
- Encrypted key-value storage
- Android RSA OAEP and AES-GCM defaults
- iOS and macOS Keychain integration
- Optional biometric authentication
- Per-platform configuration options
- Secure Enclave option on Apple
- Read, write, delete, and clear APIs
- Algorithm migration helpers on Android
Use cases
- Store auth tokens in Flutter apps
- Keep credentials off plain shared prefs
- Gate secrets behind device biometrics
- Cross-platform mobile secure storage
- Web app secrets on HTTPS hosts