You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+92-23Lines changed: 92 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,21 @@ A Flutter plugin to securely store sensitive data in a key-value pair format usi
11
11
12
12
## Features
13
13
14
-
-**Secure Data Storage**: Uses Keychain for iOS, Encrypted Shared Preferences via Tink for Android, and secure mechanisms on other supported platforms.
15
-
-**Encryption**: Encrypts data before storing it in the underlying storage system.
16
-
-**Cross-Platform**: Works seamlessly across multiple platforms.
17
-
-**Customizable Options**: Set accessibility attributes, key expiration, and more.
14
+
-**Secure Data Storage**: Uses Keychain for iOS/macOS, custom secure ciphers with optional biometric authentication for Android, and platform-specific secure mechanisms for Windows, Linux, and Web.
15
+
-**Encryption**: Encrypts data before storing it using platform-specific encryption (RSA OAEP + AES-GCM on Android by default).
16
+
-**Cross-Platform**: Works seamlessly across Android, iOS, macOS, Windows, Linux, and Web.
17
+
-**Biometric Authentication**: Optional biometric authentication support on Android (API 23+) and iOS/macOS.
18
+
-**Customizable Options**: Configure encryption algorithms, accessibility attributes, biometric requirements, and more.
18
19
19
20
## Important notice for Android
20
-
Beginning with version 10, all data will be transitioned to encryptedSharedPreferences. As a result, the useEncryptedSharedPreferences option will be deprecated.
21
+
Version 10.0.0 introduces a major security update with custom cipher implementations. The deprecated Jetpack Security library's `encryptedSharedPreferences` is no longer recommended.
21
22
22
-
In version 11, the migration tool will no longer be available. To ensure users retain their data, it is essential to first upgrade to version 10 before proceeding to version 11.
23
-
24
-
Due to this update, the minimum required Android SDK will be 23.
- New `AndroidOptions()` and `AndroidOptions.biometric()` constructors
26
+
- Automatic migration from old ciphers via `migrateOnAlgorithmChange` (enabled by default)
27
+
- Minimum Android SDK is now 23 (Android 6.0+)
28
+
- Enhanced biometric authentication with graceful degradation
25
29
26
30
## Important notice for Web
27
31
flutter_secure_storage only works on HTTPS or localhost environments. [Please see this issue for more information.](https://github.com/juliansteenbakker/flutter_secure_storage/issues/320#issuecomment-976308930)
-[exclude sharedprefs](https://developer.android.com/guide/topics/data/autobackup#IncludingFiles)`FlutterSecureStorage`used by the plugin, [details](https://github.com/juliansteenbakker/flutter_secure_storage/issues/43#issuecomment-471642126)
-[Exclude sharedprefs](https://developer.android.com/guide/topics/data/autobackup#IncludingFiles) used by `FlutterSecureStorage`, [details](https://github.com/juliansteenbakker/flutter_secure_storage/issues/43#issuecomment-471642126)
103
131
104
132
Add the following to your `android/app/src/main/AndroidManifest.xml`:
105
133
106
134
```xml
107
135
<application
108
-
android:allowBackup="false"
109
-
...>
136
+
android:allowBackup="false"
137
+
...>
110
138
</application>
111
139
```
112
140
141
+
#### Encryption Options (Version 10.0.0+)
142
+
143
+
Version 10 introduces new cipher options and biometric support. Choose the configuration that fits your security requirements:
|`AndroidOptions()`| RSA/ECB/OAEPWithSHA-256AndMGF1Padding | AES/GCM/NoPadding | No |**Default.** Standard secure storage with RSA OAEP key wrapping. Strong authenticated encryption without biometrics. Recommended for most use cases. |
148
+
|`AndroidOptions.biometric(enforceBiometrics: false)`| AES/GCM/NoPadding | AES/GCM/NoPadding | Optional | KeyStore-based with optional biometric authentication. Gracefully degrades if biometrics unavailable. |
149
+
|`AndroidOptions.biometric(enforceBiometrics: true)`| AES/GCM/NoPadding | AES/GCM/NoPadding | Required | KeyStore-based requiring biometric/PIN authentication. Throws error if device security not available. Requires API 28+ for biometric enforcement. |
150
+
151
+
#### Custom Cipher Combinations (Advanced)
152
+
153
+
For advanced users, all combinations below are supported using the `AndroidOptions()` constructor with custom parameters:
enforceBiometrics: false, // Default - works without biometrics
140
200
biometricPromptTitle: 'Unlock to access your data',
141
201
biometricPromptSubtitle: 'Use fingerprint or face unlock',
142
202
),
143
203
);
144
-
```
145
-
146
-
##### Enforcing Biometric Authentication
147
204
148
-
By default, biometric authentication is optional and will gracefully degrade if the device doesn't have biometrics enrolled. To enforce biometric authentication and throw an error if unavailable:
-**Device Security**: Device must have a PIN, pattern, password, or biometric enrolled (when using `enforceBiometrics: true`)
166
221
-**Permissions**: `USE_BIOMETRIC` permission in AndroidManifest.xml
167
222
223
+
#### Migration from Version 9.x
224
+
225
+
Version 10 automatically migrates data from older cipher algorithms when `migrateOnAlgorithmChange: true` (enabled by default). If you were using `encryptedSharedPreferences` in version 9, the data will be automatically migrated to the new cipher implementation.
226
+
227
+
To disable automatic migration:
228
+
229
+
```dart
230
+
final storage = FlutterSecureStorage(
231
+
aOptions: AndroidOptions(
232
+
migrateOnAlgorithmChange: false,
233
+
),
234
+
);
235
+
```
236
+
168
237
### macOS & iOS
169
238
170
239
You also need to add Keychain Sharing as capability to your macOS runner. To achieve this, please add the following in *both* your `macos/Runner/DebugProfile.entitlements`*and*`macos/Runner/Release.entitlements` for macOS or for iOS `ios/Runner/DebugProfile.entitlements`*and*`ios/Runner/Release.entitlements`.
Copy file name to clipboardExpand all lines: flutter_secure_storage/CHANGELOG.md
+88Lines changed: 88 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,91 @@
1
+
## 10.0.0
2
+
This major release brings significant security improvements, platform updates, and modernization across all supported platforms.
3
+
4
+
### Android
5
+
Due to the deprecation of Jetpack Security library, the Android implementation has been largely rewritten with custom secure ciphers, enhanced biometrics support, and migration tools.
6
+
7
+
**Breaking Changes:**
8
+
-`AndroidOptions().encryptedSharedPreferences` is now deprecated due to Jetpack Crypto package deprecation
9
+
- Migration will automatically happen due to `migrateOnAlgorithmChange: true`, which can also be set to false if not wanted.
10
+
- ResetOnError will now automatically be true, because most errors are unrecoverable due to key storage problems. It can still be disabled with `resetOnError: false`
11
+
- Default key cipher changed to `RSA_ECB_OAEPwithSHA_256andMGF1Padding`
12
+
- Default storage cipher changed to `AES_GCM_NoPadding`
13
+
- Minimum Android SDK changed from 19 to 23
14
+
- Target SDK updated to 36
15
+
- Migrated from deprecated Jetpack Crypto library to custom cipher implementation (Tink doesn't support biometrics)
16
+
- Migrated to Java Version 17
17
+
18
+
**New Features:**
19
+
- New named constructors: `AndroidOptions()`, `AndroidOptions.biometric()`
20
+
-`AndroidOptions().migrateOnAlgorithmChange` automatically migrates data to new ciphers when enabled
21
+
- Improved biometric authentication with graceful degradation when device has no security setup
22
+
- Migration tools for transitioning from deprecated encryptedSharedPreferences
23
+
- Enhanced error handling with proper exception messages for biometric unavailability
24
+
25
+
**Fixes:**
26
+
- Fixed biometric authentication on devices without security (PIN/pattern/password) - now gracefully degrades when `enforceBiometrics=false`
27
+
- Fixed storage cipher and key cipher pairing validation
28
+
- Fixed migration checks for encrypted shared preferences
29
+
- Fixed biometric permission handling
30
+
- Fixed exception when reading data after boot
31
+
32
+
**Other Changes:**
33
+
- Updated Gradle, Kotlin, and Tink dependencies
34
+
- Refactored custom cipher implementations for better maintainability
35
+
- Added delete key functions for proper reset handling
36
+
- Migrated to new analyzer and code cleanup
37
+
38
+
### iOS / macOS (darwin)
39
+
- Merged iOS and macOS implementations into unified `flutter_secure_storage_darwin` package
40
+
- Added support for Swift Package Manager
41
+
- Remove keys regardless of synchronizable state or accessibility constraints
42
+
- Change minimum iOS version from 9 to 12
43
+
- Change minimum macOS version to 10.14
44
+
- Use serial queue for execution of keychain operations
45
+
- Added privacy manifest
46
+
- Refactored code and added missing options to IOSOptions and MacOSOptions
47
+
- Fixed warnings with Privacy Manifest
48
+
- Fixed delete and deleteAll when synchronizable is set
49
+
- Fixed migration when value is saved while key already exists with different accessibility option
50
+
- Use accessibility option for all operations
51
+
- Migrated to new analyzer and code cleanup
52
+
53
+
### Web
54
+
- Web is now compatible with WASM
55
+
- Updated code style and migrated to very_good_analysis
56
+
- Add check for secure context (operations only allowed with secure context)
57
+
- Remove dart:io to support WASM build
58
+
- Migrated away from `html` to `web` package
59
+
- Removed `js` in favor of using js-interop
60
+
- Added `useSessionStorage` parameter to WebOptions for saving in session storage instead of local storage
61
+
- Updated web dependency support to <2.0.0
62
+
- Migrated to new analyzer and code cleanup
63
+
64
+
### Windows
65
+
- Upgrades deprecated member usage of win32
66
+
- Migrated to `win32` version 5.5.4 to support Dart 3.4 / Flutter 3.22.0
67
+
- Migrated to new analyzer and code cleanup
68
+
- Write encrypted data to files instead of the Windows credential system
69
+
70
+
### Linux
71
+
- Fixed whitespace deprecation warning
72
+
- Reverted json.dump with indentations due to problems
73
+
- Fixed search with schemas fails in cold keyrings
74
+
- Fixed erase called on null
75
+
- Fixed memory management issue
76
+
- Remove and replace libjsoncpp1 dependency
77
+
- Migrated to new analyzer and code cleanup
78
+
79
+
### Platform Interface
80
+
- Remove dart:io to support WASM build of web
81
+
- Migrated to new analyzer and code cleanup
82
+
83
+
### General Improvements
84
+
- Listener functionality via `FlutterSecureStorage().registerListener()`
85
+
- All platforms updated to support Dart SDK <4.0.0
86
+
- Comprehensive test coverage improvements
87
+
- Documentation updates across all platforms
88
+
1
89
## 10.0.0-beta.5
2
90
Due to security issues regarding the handling of biometrics in v10.0.0-beta.4, together with the deprecation
3
91
of Jetpack Security library, it took me some time to find a secure alternative. My apologies for the delay.
0 commit comments