Module nacl::secret_box[][src]

Expand description

This module provides secret box pack and open functionality. It also provide ability to use cipner format with-nonce.

Modules

Constants

NaCl secret box algorithm name for JWK’s (JSON Web Key)

Key length for NaCl’s boxes

Nonce length for NaCl’s boxes

Length of Poly hash, used in NaCl’s boxes

Functions

This function opens xsalsa20+poly1305 formatted cipher, returning a message, trimmed of prefixed zeros, unlike crypto_secretbox_open from crypto_secretbox/xsalsa20poly1305/ref/box.c. Note also that cipher doesn’t have leading zeros, unlike C version.

This function packs given message into xsalsa20+poly1305 secret-box bytes layout (trimmed of prefixed zeros, unlike crypto_secretbox from crypto_secretbox/xsalsa20poly1305/ref/box.c).