Skip to content

Implementation of NaCl Box and SecretBox in Haskell using cryptonite primitives

License

Notifications You must be signed in to change notification settings

yutotakano/shecretbox

Repository files navigation

shecretbox

Shecretbox is a Haskell library that provides NaCl's box and secretbox operations, based on primitives provided in cryptonite.

Important: This library is provided as a proof of concept, please carefully evaluate the security related to your requirements before using. No professional security review has taken place for the implementations, and it is strongly recommended not to use this library for anything critical.

Use

Qualified imports are recommended for use:

import qualified Crypto.PubKey.Curve25519 as X25519
import qualified Crypto.Box as Box

message, nonce :: B.ByteString
secret :: X25519.DhSecret

encrypted :: B.ByteString
encrypted = Box.create message nonce secret

decrypted :: B.ByteString
decrypted = Box.open encrypted nonce secret

About

Implementation of NaCl Box and SecretBox in Haskell using cryptonite primitives

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published