package octez-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Crypto_box.SecretboxSource

Sourcetype key
Sourceval unsafe_of_bytes : Bytes.t -> key
Sourceval secretbox : key -> Bytes.t -> nonce -> Bytes.t

secretbox key msg nonce encrypts and authenticates the data in msg using key and nonce and returns the authentication tag and the ciphertext in one buffer. For this reason, the returned buffer will be tag_length longer than msg.

Sourceval secretbox_open : key -> Bytes.t -> nonce -> Bytes.t option

secretbox_open key cmsg nonce verifies and decrypts cmsg using key and nonce and returns the plaintext if successful. As above, the returned buffer will be tag_length shorter than cmsg.

OCaml

Innovation. Community. Security.