ZHaskell / z-botan

Crypto for Haskell
BSD 3-Clause "New" or "Revised" License
37 stars 3 forks source link

Z-Botan

Hackage Linux Build Status MacOS Build Status Windows Build Status Gitter chat

This package is part of ZHaskell project, providing comprehensive crypto primitives based on botan.

Requirements

Example usage

> :set -XOverloadedLists
> :m + Z.Crypto.Hash 
>
> hash SHA256 "hello, world"
09CA7E4EAA6E8AE9C7D261167129184883644D07DFBA7CBFBC4C8A2E08360D5B
>
> :m + Z.Crypto.RNG Z.Crypto.PwdHash 
> genBcrypt "mypass" rng 8
[36,50,97,36,48,56,36,102,82,102,78,76,71,122,106,78,80,99,100,68,69,77,75,70,81,104,76,97,117,110,86,52,88,53,89,47,88,101,81,117,80,111,111,111,65,109,122,48,97,50,66,55,79,104,56,104,54,66,121,109]
> validBcrypt "mypass" [36,50,97,36,48,56,36,102,82,102,78,76,71,122,106,78,80,99,100,68,69,77,75,70,81,104,76,97,117,110,86,52,88,53,89,47,88,101,81,117,80,111,111,111,65,109,122,48,97,50,66,55,79,104,56,104,54,66,121,109]
True

Dev guide

# get code
git clone --recursive git@github.com:ZHaskell/z-botan.git
cd z-botan
# build
cabal build
# test
cabal test --enable-tests --test-show-details=direct
# install
cabal install
# generate document
cabal haddock