bitcoinjs / bip38

BIP38 is a standard process to encrypt Bitcoin and crypto currency private keys that is less susceptible to brute force attacks thus protecting the user.
http://cryptocoinjs.com/modules/currency/bip38/
MIT License
205 stars 100 forks source link

Slower than bitaddress.org? #33

Closed woodser closed 7 years ago

woodser commented 7 years ago

Hi! I'm seeing this library run about 3x slower than bitaddress.org. Just curious if others have seen the same and if there's any way / plans to make it run faster while still being BIP38 compliant. Thanks!

dcousens commented 7 years ago

@woodser how are you running it?

woodser commented 7 years ago

@dcousens In the browser as a browserified standalone dependency.

dcousens commented 7 years ago

Do you have a link to their code?

woodser commented 7 years ago

Sure. Here's a link to their BIP38 encryption method.

And here's a link to how I'm running it in my own project.

I prefer to use your library because it's synchronous unlike theirs which is asynchronous, but I need to make it as fast as possible for users. Thanks for your help!

dcousens commented 7 years ago

It may be it that because scryptsy is synchronous that it doesn't have the oppurtunity to use the native PBKDF2 in the browser (which is async).

I suspect if scryptsy was updated to be async-capable, you would regain your performance loss.

woodser commented 7 years ago

Ah, bummer. Ok, thanks.

dcousens commented 7 years ago

@woodser as a maintainer for scryptsy, I can happily say, PRs accepted! :smile: