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

Consider scrypt or some memory-intensive hash rather than pbkdf2 #9

Open
jnicholls opened this issue Dec 19, 2017 · 2 comments
Open

Comments

@jnicholls
Copy link

Just a thought: consider using a memory-intensive KDF like scrypt instead of pbkdf2. I noticed on the TODO list the option of setting one's own interation count. This would be a way to skip that need. And as such, recommend to folks to setup the wallet on a powerful desktop and just suffer the increased latency on mobile phones. Making it dynamic would be difficult since Web APIs don't offer a means to querying system resource information, so the amount of memory and cpu can be configurable...

...and now that I'm typing it all out, maybe allowing one to set their own pbkdf2 interation count is easier, lol.

@jaimehgb
Copy link
Owner

It's almost done too :P

https://github.com/jaimehgb/RaiWebWallet/blob/master/js/custom.js#L1444
https://github.com/jaimehgb/RaiWebWallet/blob/master/wallet.php#L250

I was thinking on how to store its value, in a field near the wallet at the database or serialized with the wallet data. The problem with the first one is what happens if it fails to update the value in the database due to connection issues or whatever and the ciphered wallet with the new iteration number is stored successfully (they are independent functions, maybe putting them together will do the trick). And the problem with the second one is compatibility with old wallets, I should add a mechanism to distinguish between both formats and then decipher the packed data in one way or another (https://github.com/jaimehgb/RaiWebWallet/blob/master/Wallet.js#L1359).

@thiscantbeserious
Copy link

thiscantbeserious commented Dec 29, 2017

If you're going the hard way you might want to consider argon2id instead of scrypt concerning side-channel attack resistance:

https://www.cryptolux.org/index.php/Argon2
https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#page-13

Otherwise customizable, read increased iterations should be sufficient for now.

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

3 participants