For those who won't click through to TFR:
> import Crypto.Number.Hash (SHA3_256)
> import Crypto.PubKey.ECC.ECDSA (sign, verify)
> import Crypto.PubKey.ECC.Generate (generate)
> import Crypto.PubKey.ECC.Types (getCurveByName, SEC_p256k1)
> let msg = "hello world" :: ByteString
> let secp256k1 = getCurveByName SEC_p256k1
> (pubKey, privKey) <- generate secp256k1
> sig <- sign privKey SHA3_256 msg
> verify SHA3_256 pubKey sig msg
TrueSomething I didn't like about it is that it exposes crypto primitives, including stuff like TripleDES, with no warning[0]. The tutorial also has you handle IVs directly.[1]
[0] https://hackage.haskell.org/package/cryptonite-0.24/docs/Cry...
[1] https://hackage.haskell.org/package/cryptonite-0.24/docs/Cry...
Also, the tutorial is a bit advanced and is meant to show a particular use case of using symmetric block ciphers for encryption/decryption, you are not always using such bare-bones primitives-- check out the hashing part of the README.md in Nanocoin.
IMO it's production ready, and has most all potential known attacks documented above the functions that are vulnerable.
https://github.com/wyc/haschain/blob/master/Secp256K1.hs
Should probably wrap it into a Group or something. Of course it's not secure, just for fun.