KCl v0.0.1 Kcl

A poor NaCl crypto suite substitute

The functions exposed here are the equivalent of (and interoperable with):

  • crypto_box_curve25519xsalsa20poly1305
  • crypto_box_curve25519xsalsa20poly1305_open

At this time, no support is provided for multiple packets/streaming or nonce-agreement.

Summary

Types

public or private key

shared nonce

Functions

box up an authenticated packet

unbox an authenticated packet

Types

key :: <<_::32 * 8>>

public or private key

nonce :: <<_::24 * 8>>

shared nonce

Functions

box(msg, our_private, their_public, n)

Specs

box(binary, key, key, nonce) :: binary

box up an authenticated packet

unbox(packet, our_private, their_public, n)

Specs

unbox(binary, key, key, nonce) :: binary | :error

unbox an authenticated packet

Returns :error when the packet contents cannot be authenticated, otherwise the decrypted payload.