Module

Crypt.NaCl.SecretBox

Package
purescript-crypt-nacl
Repository
throughnothing/purescript-crypt-nacl

#generateSecretBoxKey Source

generateSecretBoxKey :: forall e. Eff (naclRandom :: NACL_RANDOM | e) SecretBoxKey

Generate a key for use with a SecretBox

#secretBox Source

secretBox :: Message -> Nonce -> SecretBoxKey -> SecretBox

Create a SecretBox, which is an encrypted and authenticated message

#secretBoxOpen Source

secretBoxOpen :: SecretBox -> Nonce -> SecretBoxKey -> Maybe Message

Open a SecretBox, returning Maybe Message If decryption and authentication succeed, Just Message will be returned. If decryption or authentication fail, Nothing will be returned