MetaMask / MetaMask/browser-passworder

add kdf option for scrypt algorithm

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
126
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Thanks to PR https://github.com/MetaMask/browser-passworder/pull/49, it can now support various algorithm with different cost factor.
However, just increasing pbkdf2 iteration might not be the best option to secure encrypt logic. The algorithm itself is pretty outdated as it does not have the cost factor for memory, which is significant in modern hardware(it's way easier to brute-force with good hardware, compared to algorithm which has a cost factor for memory).
According to [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html), argon2 could be the best, but it's still not widely used in web, so scrypt algorithm could be the great alternative for pbkdf2(scrypt is also adopted in BIP38 and geth).
Scrypt is able to push pressure on memory heavily(similar to ethash), make it hard to brute-force attack(especially when parallel).
Best reference to implement this would be [BIP38](https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki). I think it is the right direction to gradually move on to scrypt rather than increasing iterations in pbkdf2 as time goes.
If it does make sense, I will try to work on it with PR.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing PR #49 to understand the existing cost-factor support, then compare the requested approach with the referenced BIP38 implementation and OWASP guidance. Define how an scrypt KDF option should fit the browser-passworder API and how compatibility with the current PBKDF2 behavior will be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cryptography, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.