úÎ#1–0®None -.=>?@AHMXpÏNaCl%Nonce that can be used for Secretbox.dThis type is parametrised by the actual data type that contains bytes. This can be, for example, a  ByteString.NaCl.Encryption key that can be used for Secretbox.dThis type is parametrised by the actual data type that contains bytes. This can be, for example, a  ByteString8, but, since this is a secret key, it is better to use  ScrubbedBytes.NaClMake a  from an arbitrary byte array.This function returns JustZ if and only if the byte array has the right length to be used as a key with a Secretbox.NaClMake a  from an arbitrary byte array.This function returns Just\ if and only if the byte array has the right length to be used as a nonce with a Secretbox.NaClEncrypt a message.NaClDecrypt a message.NaCl Secret keyNaClNonceNaClPlaintext messageNaCl Secret keyNaClNonceNaCl CyphertextNone -.=>?@AHMXp/³NaClEncrypt a message. /encrypted = Secretbox.create key nonce message keyW is the secret key used for encryption. There are two typical ways of creating it: Derive from a passwordC. If you want to protect a message with a password, you must use a  5https://en.wikipedia.org/wiki/Key_derivation_functionkey derivation functionh to turn this password into an encryption key. NaCl does not provide a key derivation function, however  1https://hackage.haskell.org/package/crypto-sodium crypto-sodium does.Generate a random oneÎ. This can be useful in certain situations when you want to have an intermediate key that you will encrypt and share later. NaCl does not provide a cryptographically secure pseudo random generator, however  1https://hackage.haskell.org/package/crypto-sodium crypto-sodium does.nonce° is an extra noise that ensures that if you encrypt the same message with the same key multiple times, you will get different ciphertexts, which is required for  /https://en.wikipedia.org/wiki/Semantic_securitysemantic security1. There are two standard ways of getting it:  Use a counteru. In this case you keep a counter of encrypted messages, which means that the nonce will be new for each new message.Randomž. You generate a random nonce every time you encrypt a message. Since the nonce is large enough, the chances of you using the same nonce twice are negligible. 1https://hackage.haskell.org/package/crypto-sodium crypto-sodium% has useful helpers for both options.message is the data you are encrypting.OThis function adds authentication data, so if anyone modifies the cyphertext, open will refuse to decrypt it.NaClDecrypt a message. /decrypted = Secretbox.open key nonce encrypted key and nonce, are the same that were used for encryption. encrypted is the output of .This function will return NothingD if the encrypted message was tampered with after it was encrypted.NaCl Secret keyNaClNonceNaClPlaintext messageNaCl Secret keyNaClNonceNaClEncrypted message (cyphertext)None-.=>?@AHMXp0‰       NaCl-0.0.2.0-inplaceCrypto.Secretbox.InternalCrypto.Secretbox Paths_NaClNonceKeytoKeytoNoncecreateopenversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName