-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: increase key derivation iterations #14042
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…to gar/chore/encryptor-refactor
|
Blocked by #14304 |
owencraston
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not perform manual testing but the code looks good.
Basic performance tests (execution time in ms)Using 5.000 iterations
Using 600.000 iterations
Execution time increases from deriving the encryption key from 5,000 iterations to 600,000 iterations:
edit: Using 600.000 iterations and
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
NicholasEllul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed changes look good from a security perspective. While we see that the time to decrypt has increased by ~100x, this also means that each attempt an attacker makes trying to crack the vault will cost ~100x more than it does today.
The security properties of PBKDF2 come from the amount of time it takes to perform. Increasing the iteration count is expected to proportionally increase the time the operation takes. This allows for it to be more resistant to brute forcing.
We can look into making future optimizations to minimize the occurrences where performing PBKDF2 is necessary; however, we should expect to see the impact of these changes when users are logging in via password to perform a vault decryption.
An additional note to consider:
The security of the encrypted vault is a combination of two factors:
- The number of iterations performed on the user's password
- The complexity of the user's password
A long and highly complex password can get away with less iterations; however, a weak and predictable password will require a higher iteration count. We can use both levers to strengthen the security of the vault.
This comment was marked as outdated.
This comment was marked as outdated.
|
|



Description
This change increases the number of iteration required for the key derivation from
5_000to600_000.Related issues
Fixes: https://github.com/MetaMask/accounts-planning/issues/100
Manual testing steps
Test case 1: Upgrade the client from the current version to feature branch
Test case 2: Lock and unlock the wallet
Test case 3: Reveal SRP and private key
Test case 4: Change password
Test case 5: Unlock with biometrics
Screenshots/Recordings
Not applicable
Pre-merge author checklist
Pre-merge reviewer checklist