ssbc / chloride

MIT License
90 stars 17 forks source link

What is the relationship of this project to paixaop/node-sodium? #1

Closed taoeffect closed 8 years ago

taoeffect commented 8 years ago

Why is this other URL listed in package.json?

  "repository": {
    "type": "git",
    "url": "https://github.com/paixaop/node-sodium"
  },
dominictarr commented 8 years ago

good spotting. this started as a fork of that project which I maintain, because unfortunately node-sodium was not being maintained quickly enough for my needs.

it also incorporates javascript polyfils so that it works transparently in the browser, etc. (there are two, one optimized for fast, one for small!)

see https://github.com/dominictarr/chloridedown for my fork of node-sodium.

dominictarr commented 8 years ago

also see this discussion: https://github.com/dchest/tweetnacl-js/pull/99

when I get the time I intend to rewrite the bindings around the api discussed in that thread.

taoeffect commented 8 years ago

I see, well maybe just to avoid confusion then the URL should still be updated?

see https://github.com/dominictarr/chloridedown for my fork of node-sodium.

I'm currently looking over all the various ECC libraries out there, and I'm confused as to what the difference is between TweetNaCl and node-sodium is. Are they essentially two implementations of the same thing? (And is there any reason to prefer node-sodium over TweetNaCl?).

dominictarr commented 8 years ago

@taoeffect node-sodium is a node binding to libsodium, which is a maintained fork of djb's nacl tweetnacl is another djb project - it's a implementation of the core features in nacl that fits in 100 tweets, the idea here is to optimize for auditability, where libsodium/nacl are optimized for performance.

If you care about javascript, there is also libsodium-wrappers which is an emscripten compiled version of libsodium (by libsodium maintainer) and tweetnacl-js by @dchest which is optimized for auditing also, it's a straightforward mapping from the C version

Currently we are lacking a good node binding to tweetnacl.c - It would be expected to be less performant than libsodium, but I can't test that because there is no binding available. and I havn't figured out how to get node-sodium to build on windows, possibly tweetnacl.c would be easier to get a cross platform build going (it's one c file with no deps)

There is a problem that there are too many independent implementations (various forks and bindings) and I think we would do better to pull together as a community and create a cohesive ecosystem (with compatible interfaces, etc) which is what I'm directing my efforts towards.

I'll fix the url.

taoeffect commented 8 years ago

Awesome, thanks so much for that comprehensive rundown of the current state of NaCl and JS! 😄

dominictarr commented 8 years ago

the url is fixed in version 2.1.2