Skip to content

Commit fb5a389

Browse files
committed
[Android] Use old algorithms as default
1 parent e12b054 commit fb5a389

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

flutter_secure_storage/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Fork
22

3-
* Enabled StrongBox by default, use fallback if it's not available.
3+
* [Android] Enabled StrongBox by default, use fallback if it's not available.
44
* [Android] Method to check if an Android device supports Strongbox
5+
* [Android] Use old algorithms as default (migration to AES_GCM_NoPadding is broken and fails)
56

67
## 10.0.0
78
This major release brings significant security improvements, platform updates, and modernization across all supported platforms.

flutter_secure_storage/lib/options/android_options.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ class AndroidOptions extends Options {
4848
'Your data will be automatically migrated to custom ciphers on first '
4949
'access. Remove this parameter - it will be ignored.')
5050
bool encryptedSharedPreferences = false,
51-
bool resetOnError = true,
51+
bool resetOnError = false,
5252
bool migrateOnAlgorithmChange = true,
5353
bool enforceBiometrics = false,
5454
KeyCipherAlgorithm keyCipherAlgorithm =
55-
KeyCipherAlgorithm.RSA_ECB_OAEPwithSHA_256andMGF1Padding,
55+
KeyCipherAlgorithm.RSA_ECB_PKCS1Padding,
5656
StorageCipherAlgorithm storageCipherAlgorithm =
57-
StorageCipherAlgorithm.AES_GCM_NoPadding,
57+
StorageCipherAlgorithm.AES_CBC_PKCS7Padding,
5858
this.sharedPreferencesName,
5959
this.preferencesKeyPrefix,
6060
this.biometricPromptTitle,
@@ -80,7 +80,7 @@ class AndroidOptions extends Options {
8080
'The Jetpack Security library is deprecated by Google. '
8181
'Remove this parameter - it will be ignored.')
8282
bool encryptedSharedPreferences = false,
83-
bool resetOnError = true,
83+
bool resetOnError = false,
8484
bool migrateOnAlgorithmChange = true,
8585
bool enforceBiometrics = false,
8686
this.sharedPreferencesName,
@@ -91,8 +91,8 @@ class AndroidOptions extends Options {
9191
_resetOnError = resetOnError,
9292
_migrateOnAlgorithmChange = migrateOnAlgorithmChange,
9393
_enforceBiometrics = enforceBiometrics,
94-
_keyCipherAlgorithm = KeyCipherAlgorithm.AES_GCM_NoPadding,
95-
_storageCipherAlgorithm = StorageCipherAlgorithm.AES_GCM_NoPadding;
94+
_keyCipherAlgorithm = KeyCipherAlgorithm.RSA_ECB_PKCS1Padding,
95+
_storageCipherAlgorithm = StorageCipherAlgorithm.AES_CBC_PKCS7Padding;
9696

9797
/// EncryptedSharedPrefences are only available on API 23 and greater
9898
final bool _encryptedSharedPreferences;

0 commit comments

Comments
 (0)