MyNixOS website logo
Description

Crypto for Haskell.

Crypto for Haskell, based on Botan

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.

  • Random number generators.
  • Block Cipher and symmetric cipher.
  • Hash.
  • MAC.
  • Key derivation functions.
  • Password hash.
  • Multiple precision integers.
  • Public key creation, import and export.
  • Public key encryption/decryption
  • Diffie-Hellman key exchange.
  • Signature generation & signature verification.
  • X.509 certificates & X.509 certificate revocation lists.
  • One time password.
  • AES Key Wrapping
  • Format Preserving Encryption.

Requirements

  • A working haskell compiler system, GHC(>=8.6), cabal-install(>=3.2.1), hsc2hs.

  • A working python interpreter in $PATH.

  • Tests need hspec-discover.

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 [email protected]: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
Metadata

Version

0.4.0.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows