Skip to content

Commit

Permalink
added the NaCl box/secretbox API, contributed by Pierre Chapuis
Browse files Browse the repository at this point in the history
  • Loading branch information
philanc committed Aug 12, 2017
1 parent dc5614a commit 87102dd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion LICENSE
Expand Up @@ -20,7 +20,8 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

------------------------------------------------------------------------
salsa20.lua and test_salsa20 are contributed by Pierre Chapuis - https://github.com/catwell.
Files salsa20.lua, test_salsa20, box.lua and test_box.lua are contributed
by Pierre Chapuis - https://github.com/catwell.
They are distributed under the same terms but with the following Copyright:
Copyright (c) 2017 Pierre Chapuis

Expand Down
12 changes: 5 additions & 7 deletions README.md
Expand Up @@ -6,7 +6,7 @@ A small collection of crpytographic functions, and related utilities, implemente

August-2017

* Added *Salsa20*, contributed by Pierre Chapuis - https://github.com/catwell
* Added *Salsa20* and the NaCl box() / secret_box() API, contributed by Pierre Chapuis - https://github.com/catwell

June-2017

Expand Down Expand Up @@ -64,14 +64,14 @@ Encryption

* Chacha20, Poly1305 and authenticated stream encryption, as defined in [RFC 7539](https://tools.ietf.org/html/rfc7539)

* Salsa20, a fast encryption algorithm. It has been defined by Dan Bernstein, Tanja Lange et al. http://nacl.cr.yp.to/
* Salsa20, a fast encryption algorithm and the NaCl secretbox() API for authenticated encryption (with Salsa20 and Poly1305 - see box.lua)
Salsa20, Poly1305 and the NaCl library have been designed by Dan Bernstein, Tanja Lange et al. http://nacl.cr.yp.to/.

* RC4 - for lightweight, low strength encryption. Can also be used as a simple pseudo-random number generator.

Public key

* Elliptic curve cryptography: ec25519 (only low-level functions for the moment -
just enough to implement ECDH key exchange)
* Elliptic curve cryptography based on curve ec25519 by Dan Bernstein, Tanja Lange et al., http://nacl.cr.yp.to/. File ec25519.lua includes the core scalar multiplication operation. File box.lua includes the NaCl box() API which combines ECDH key exchange and authenticated encryption.

Hash

Expand All @@ -94,8 +94,6 @@ Some (un)related utilities:

Implementations that may come some day:

* a pure Lua implementation of NaCl ECDH key exchange and high level API for authenticated encryption (box(), secretbox()) based on ec25519, salsa20 and poly1305.

* XChacha20 (ie. Chacha20 with a 24-byte nonce)

* SHA2-512
Expand Down Expand Up @@ -151,7 +149,7 @@ The implementations should pass the tests, but beyond that, there is no guarante

All the files included here are distributed under the MIT License (see file LICENSE)

The salsa20 implementation is contributed by Pierre Chapuis - https://github.com/catwell
The salsa20 and box/secretbox implementations are contributed by Pierre Chapuis - https://github.com/catwell



Expand Down
2 changes: 2 additions & 0 deletions test/test_box.lua
Expand Up @@ -18,3 +18,5 @@ do
local dt = assert(box.box_open(et, n, pk_a, sk_b))
assert(dt == pt)
end

print("test_box: ok")
4 changes: 4 additions & 0 deletions test_all.lua
Expand Up @@ -14,6 +14,7 @@ require "test.test_blake2b"
require "test.test_rc4"
require "test.test_xtea"
require "test.test_rabbit"
require "test.test_salsa20"
require "test.test_chacha20"
require "test.test_poly1305"
require "test.test_aead_chacha_poly"
Expand All @@ -23,3 +24,6 @@ require "test.test_norx32"
-- pk / EC scalar mult for DH key exchange
require "test.test_ec25519"

-- NaCl box(), secret_box()
require "test.test_box"

0 comments on commit 87102dd

Please sign in to comment.