schibsted / account-sdk-android

⛔️ DEPRECATED Schibsted Account SDK for Android
https://schibsted.github.io/account-sdk-android/
MIT License
14 stars 8 forks source link

Use Random IV in EncryptionUtils. #460

Closed birukoff closed 4 years ago

birukoff commented 4 years ago

So, this is supposed to fix https://github.com/schibsted/account-sdk-android/issues/457

1) EncryptionUtils contains the fix for static IV. The old code remains there so that we can migrate existing encrypted data. 2) SessionStorageLegacy uses old method to decrypt existing data. 3) SessionStorageDelegate uses new SharedPrefs location to store key/data because the old stuff is not readable using this new method, and we have to migrate it first. In order to migrate data, before accessing this new location it queries SessionStorageLegacy if it has any stored data. If it is there, it is re-saved using new encryption method and then deleted.