-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for encryption of shared preferences #593
Comments
It wasn't very clear to me what this issue or related PR was doing. After reading the diff of the PR, I noticed in ably-java/lib/src/main/java/io/ably/lib/types/ClientOptions.java Lines 200 to 204 in d9ad0e1
So this issue only allows users to specify a custom implementation of |
@ben-xD Actually, there is a official way to encrypt shared pref. With a key, that's not exposed to a user. |
Okay thanks for adding that detail, it seems like we missed an opportunity to make things easier for the users who care about security here 😅. IMHO after browsing for some example code, it's not complicated, and I think you agree with me based on your comment above. |
We persist secrets (e.g.
ABLY_DEVICE_SECRET
) and tokens (e.g.ABLY_DEVICE_IDENTITY_TOKEN
) toSharedPreferences
without encryption or any other form of obfuscation, in terms of both values and the keys they are stored under.This has been raised by a customer who discovered this when doing a security test after they "rooted" their app.
When Ably first implemented
LocalDevice
storage, there wasn't anything we deemed suitable that would give any material increase in security, hence the implementation was kept simple.Perhaps the best solution going forward would be to allow app developers to override the storage I/O in order to provide their own encryption and/or platform service designed for secrets. Such a provider might be as simple as:
We would provide a default implementation using shared preferences, as we do currently.
I would also suggest we look at fixing #562 when we work on this as it's in the same area of the codebase.
The text was updated successfully, but these errors were encountered: