Skip to content
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

Suggestion: SecureSettings interface + default implementation #211

Open
SamuelMarks opened this issue Oct 30, 2024 · 2 comments
Open

Suggestion: SecureSettings interface + default implementation #211

SamuelMarks opened this issue Oct 30, 2024 · 2 comments

Comments

@SamuelMarks
Copy link

Your project looks great. I'm thinking about using it to store access tokens as I target iOS, Android, web, and Desktop.

Using expect/actual I should be use your existing KeychainSettings, implement EncryptedSharedPreferences https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences, and fallback to unencrypted (or trivially encrypted, e.g., shared code to unlock it [insecurely] embedded in app).

Have you considered having a default SecureSettings interface with a default implementation? - Over time I imagine commits overriding the implementing for each target platform until there's a secure option implemented for each multiplatform-settings supported platform.

@russhwolf
Copy link
Owner

I don't see much value in adding an extra interface since the API would be the same between Settings and SecureSettings. Doing a default implementation as you describe is difficult, because any time you change the underlying implementation you break backward-compatibility since previously saved data is no longer available. I could add a module like multiplatform-settings-no-arg that just has Android and Apple targets, but I'm not convinced the value is there since it's not that difficult to do yourself.

@SamuelMarks
Copy link
Author

Related: https://security.stackexchange.com/q/279371

(for Windows, macOS and Linux support)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants