Chloride descends from Dan J. Bernstein's (djb) NaCl library ("Networking And Cryptography Library", not to be confused with the other NaCl, Google's Native Client). djb wrote NaCl, but did not maintain it, some ideas in the library (in particular the networking part) weren't really fully baked, and the best parts where taken and maintained as libsodium (although "Na" represents the element sodium, so they took the wrong part of the acronym).
We have wrapped and tested enough functions for our crypto modules to work.
- private-box: write a shortish message to multiple recipients.
- pull-box-stream: encrypt (every byte in) a one-way stream.
- secret-handshake: create an authenticated private channel to a public key.
This is probably everything you need, NaCl doesn't have a very large API, so this is probably everything.
Do I need performance or code size?
If you are only doing a symmetric ciphers (
crypto_box) or a signature or two, then performance is probably not a problem. If you are verifying many signatures, performance may be a problem. Bear in mind that an asymetric operation (
keygen) is usually 50 times slower than a symmetric operation, for instance a hash.
See sodiumperf performance comparisons.
To run Chloride in performance mode, load it like this:
const chloride = require('chloride')
To run in low size mode:
const chloride = require('chloride/small')