Home

Pure Lua implementation of NaCl: Networking and Cryptography library.

WARNING! Work in progress. The produced output may be not correct at all!

Mostly, this is a translation of reference implementations from C to Lua. All work is placed into public domain.

To browse files or download ZIP archive, login as anonymous. If you have Fossil installed:

fossil clone https://codingrobots.org/lua-nacl destination

Requirements

Lua 5.1:

LuaJIT 2.x:

Works best with LuaJIT 2.x (currently ~23x faster than Lua 5.1).

Implementation Details

Cryptographic Primitives:

API:

Format: C API name (Lua NaCl API name)

Internally, all functions work with tables of numbers (bytes). crypto.bytetable is provided for conversion from/to strings. Note that crypto.secretbox APIs require zero-prefixing, just like in C NaCl API. This will be described later in documentation, and easier API which works directly with strings may be provided later.