
TweetNaCl.js - electic
http://dchest.github.io/tweetnacl-js/#/
======
kibibu
I really wish there weren't two popular projects that were abbreviated to
NaCl.

For others, this is a port of the "salt" NaCl crypto library, and has nothing
to do with Native Client.

The dangers of JS crypto in the browser are well trodden (anybody who can
snoop the connection can probably replace the JS, for example), but the rise
of JS-based client apps (through node-webkit et al) make this a bit more
meaningful.

~~~
CmonDev
Yes, I was initially excited expecting to see something awesome for Google
NaCl, but it turned out to be yet another script written in a legacy
language... Well, he did add .js to the name though.

~~~
xiaoma
What exactly are you referring to with "legacy language"? Could you elaborate?

~~~
kibibu
I'm pretty sure it was just snark at Javascript/ECMAscript.

IMO it's pretty hard to justify calling it a legacy language when there are 4
major JS JIT engines actively competing for performance, and a pretty thriving
developer ecosystem. It's about as young as Ruby, and younger than Python and
Haskell.

------
jedisct1
Javascript is also a supported target for libsodium, through Emscripten. The
Javascript file size (minified/gzipped, with most operations including
password hashing using scrypt) is 136K.

TweetNaCl.js doesn't have the same features set, but it is tiny, has been
written in Javascript, is easy to use, well-documented, and well-maintained.

This is what Minilock uses. It is a perfect fit for this kind of applications.

~~~
girvo
I've actually been looking for a small crypto library for javascript, I'm in
the process of building a desktop cross-platform app using node-webkit, and
this seems quite interesting!

------
deckar01
We ended up using tweetnacl for Stellar after switching to Ed25519. We forked
it to implement generating keys from a seed.

[https://github.com/stellar/tweetnacl-
js/commit/063e072](https://github.com/stellar/tweetnacl-js/commit/063e072)

~~~
dchest
Nice! I've added nacl.sign.keyPair.fromSeed in v0.11.0, though I see that I
didn't define seedLength. Will do!

------
diafygi
The goal of TweetNaCl is to make an auditable crypto library, and this is a
JavaScript port of the original C library.

Its goal is not to offer every cipher or algorthim, but its small size allows
it to be easily included in unhosted apps like miniLock.

------
themadcreator
How does this differ from the other javascript NaCl implementations?

[https://www.npmjs.org/search?q=nacl](https://www.npmjs.org/search?q=nacl)

~~~
skion
For one the fact that (the author of NaCL) Daniel Bernstein is backing it.

~~~
dchest
DJB wrote the original tweetnacl.c, from which this JavaScript implementation
is derived. He doesn't have anything to do with the port.

~~~
skion
You guys are right of course; I was looking at the C version.

