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

[Proposal] Persist UserStorageController e2ee content keys #5128

Open
mirceanis opened this issue Jan 10, 2025 · 0 comments · May be fixed by #5129
Open

[Proposal] Persist UserStorageController e2ee content keys #5128

mirceanis opened this issue Jan 10, 2025 · 0 comments · May be fixed by #5129
Assignees
Labels
team-identity Identity Team changes. https://github.com/orgs/MetaMask/teams/identity

Comments

@mirceanis
Copy link

The UserStorageController e2e encryption keys are derived from a storageKey that is specific to the user profile. The key derivation function used is scrypt, with parameters recommended for password inputs. This means that it's a very costly operation (on the order of seconds on a 2024 mobile device).
These derived keys are cached in memory for the lifetime of the controller instance, but a better approach would be to use a Key Store, to persist the derived keys in a safe manner. This would avoid the rerun of the costly key derivation operation on every app restart.

In preparation for a multi-device / multi-SRP user profile (and user storage) world, the KeyStore should wrap keys using a deterministic approach. See upgrade plan for details.
A proposed approach to enable this is to use the preinstalled message-signing-snap encryption capabilities

@mirceanis mirceanis added the team-identity Identity Team changes. https://github.com/orgs/MetaMask/teams/identity label Jan 10, 2025
@mirceanis mirceanis self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-identity Identity Team changes. https://github.com/orgs/MetaMask/teams/identity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant