sCrypt implementation in JavaScript? [closed]
Asked Answered
F

7

11

Someone asked about a JavaScript implementation of bCrypt a while back and appears to have written their own code to handle the implementation. Does anyone have an implementation of sCrypt in JavaScript?

Fourpenny answered 30/9, 2011 at 23:54 Comment(4)
i can't even find any C implementations .. news.ycombinator.com/item?id=2004962 use that bcrypt.. at your own risk ..Vite
It's not that I prefer scrypt to bcrypt it's that I'm interfacing with an existing project which already uses scrypt. I'd use bcrypt if it were my choice, but it's not :PFourpenny
well, if you have access to code :] - start porting it :DVite
Well it's FOSS but it's also a distributed project so unless I get 51% or more of the entire network of users to switch to my ported code my port won't be worth much...Fourpenny
A
15

The answer linked above points to a project that no longer exists.

This project, however, is still around: https://github.com/tonyg/js-scrypt

Axon answered 10/6, 2012 at 14:13 Comment(1)
So it is. Use github.com/tonyg/js-scryptAxon
C
5

If you are talking about tenebrix, the choice of scrypt was better then bcrypt for the goals set. I so far have only found one incomplete javascript implementation of scrypt and hit on this page while searching.

https://github.com/byrongibson/scrypt-js https://github.com/cheongwy/node-scrypt-js was all I found so far, and seems no code yet.

Guess as a new reason I can't just comment on this above like I wanted, sigh.

Cortisone answered 2/10, 2011 at 14:13 Comment(2)
I am in fact talking about Tenebrix. I was considering building a JavaScript miner but I'm not nearly good enough in JavaScript to implement any kind of encryption from scratch.Fourpenny
I guess this is as good as it's likely to get. I'll keep an eye on this project and see if it ever comes to fruition. Thanks!Fourpenny
G
4

https://github.com/tonyg/js-scrypt is an emscripten-compiled version of Colin Percival's scrypt() function.

Glaze answered 14/8, 2013 at 1:22 Comment(0)
B
2

Here are the two I can find:

I've tried only barrysteyn's node-scrypt, and its excellent. He recently put a lot of effort into making the library conform to javascript conventions, and the API is great.

Bouley answered 12/7, 2013 at 1:17 Comment(0)
C
1

I'll toss my implementation into the ring: https://github.com/cryptocoinjs/scryptsy. It is based upon https://github.com/cheongwy/node-scrypt-js, but has been cleaned up and tested in both Node.js and the browser.

Castoff answered 28/4, 2014 at 16:9 Comment(0)
T
0

Here are two options:

They're pretty comparable.

Twana answered 2/9, 2016 at 18:37 Comment(0)
T
-1

Tony's works great in chrome, chrome's js executes cost of 16384 faster than CryptSharp's SCrypt does. Around 200ms for chrome and 450ms for CryptSharp.

Trouble is that IE takes upwards of 24 seconds and FF upwards of 16 seconds.

Unfortunately, not all browsers are created equal..

Theisen answered 7/12, 2013 at 2:11 Comment(6)
Andrew, I am curious: is that benchmark for CryptSharp 1.2 or 2.0? Thanks.Northcliffe
CryptSharp (Official Version) on NuGet, Id:CryptSharpOfficial Version:2.0 Published:5/8/2013Theisen
Hmm. I wonder what more I could do to optimize it. The core loop's already unrolled. Surprising that a JavaScript implementation could be so much faster.Northcliffe
Keep in mind that chrome's js engine is amazing and is what node.js is based off of. Its not your average js engine. en.wikipedia.org/wiki/V8_(JavaScript_engine) Ok so V8 compiles javascript to machine code before executing it, thats why.Theisen
And then it optimizes your code with "inlining, elision, inline caching" and other wizardry techniques. Basically they take your js and make it betterer.Theisen
#15393539 So Don't feel bad @Zer it seems to be a common thing.Theisen

© 2022 - 2024 — McMap. All rights reserved.