lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi all,

This is a Lua binding to the wonderful NaCl crypto library by Dan
Bernstein, Tanja Lange et al. --

Available functions include
 - elliptic curve public key cryptography (curve25519)
 - authenticated encryption (salsa20 encryption and poly1305 MAC)
 - stream encryption (raw salsa20)
 - MAC (poly1305)
 - hash (sha512)
 - elliptic curve digital signature (ed25519)
 - random number generation (based on /dev/urandom)

The version included here is the "Tweet" version ("NaCl in 100
tweets") by Dan Bernstein et al. -- (all the tweet nacl code is
included in this library)

This Lua binding is small:,  including all the crypto
code, is only 34 KB.

The binding hides the NaCl weird constraints (32 mandatory leading
null bytes for the text to encrypt and 16 leading null bytes in the
encrypted text). So the user does not need to provide or take care of
these leading null spaces.

It is available at:

To build:
  - adjust the path to the Lua include files in the Makefile
  - run make

The binding has been built and tested on Linux with Lua-5.3.3,
Lua-5.2.4 and Lua-5.1.5

A very limited test file is provided ("smoketest.lua")

License: MIT (the included Tweet NaCl  C code by Dan Bernstein et al.
is public domain)

All suggestions, bug reports and contributions are welcome.