crypton-box-1.1.0: NaCl crypto/secret box implementations based on crypton primitives.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.SecretBox

Description

This module provides the creation and opening of a secret_box.

Click Here for A Fun Monad Tutorial! (....it is XSS!)

Synopsis

Documentation

create Source #

Arguments

:: (ByteArray content, ByteArray nonce) 
=> content

Message to encrypt

-> nonce

192-bit nonce

-> DhSecret

Symmetric secret key

-> content

Ciphertext

Build a secret_box packet encrypting the specified content with a 192-bit nonce and a 256-bit symmetric secret key.

open Source #

Arguments

:: (ByteArray content, ByteArray nonce) 
=> content

Ciphertext to decrypt

-> nonce

192-bit nonce

-> DhSecret

Symmetric secret key

-> Maybe content

Message

Try to open a secret_box packet and recover the content using the 192-bit nonce and a 256-bit symmetric secret key.