entropy: A platform independent entropy source

[ bsd3, cryptography, data, library ] [ Propose Tags ]

A mostly platform independent (not GHCJS) method to obtain cryptographically strong entropy (RDRAND, urandom, CryptAPI, and patches welcome) Users looking for cryptographically strong (number-theoretically sound) PRNGs should see the DRBG package too.


[Skip to Readme]
Versions 0.1, 0.2, 0.2.1, 0.2.2, 0.2.2.1, 0.2.2.2, 0.2.2.3, 0.2.2.4, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.4.1, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.4, 0.4.1, 0.4.1.1, 0.4.1.2, 0.4.1.3, 0.4.1.4
Dependencies base (>=4.8 && <5), bytestring, unix, Win32 [details]
License BSD-3-Clause
Copyright Thomas DuBuisson <thomas.dubuisson@gmail.com>
Author Thomas DuBuisson <thomas.dubuisson@gmail.com>
Maintainer Thomas DuBuisson <thomas.dubuisson@gmail.com>
Category Data, Cryptography
Home page https://github.com/TomMD/entropy
Bug tracker https://github.com/TomMD/entropy/issues
Source repo head: git clone https://github.com/TomMD/entropy
Uploaded by ThomasDuBuisson at Wed Nov 14 20:33:34 UTC 2018
Distributions Arch:0.4.1.4, Debian:0.4.1.1, Fedora:0.3.8, FreeBSD:0.3.7, LTSHaskell:0.4.1.4, NixOS:0.4.1.4, Stackage:0.4.1.4
Downloads 101696 total (469 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-11-14 [all 1 reports]
Hackage Matrix CI

Modules

[Index] [Quick Jump]

Flags

NameDescriptionDefaultType
halvm

Build for the HaLVM

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for entropy-0.4.1.4

[back to package description]

Introduction

This package allows Haskell users to easily acquire entropy for use in critical security applications by calling out to either windows crypto api, unix/linux's /dev/urandom. Hardware RNGs (currently RDRAND, patches welcome) are supported via the hardwareRNG function.

If you wish to obtain an XOR of the hardware and system RNG consider:

import           Data.Bits (xor)
import qualified Data.ByteString as B
import qualified Control.Exception as X

xorRNG sz = do hw  <- hardwareRNG sz
               h   <- openHandle
               sys <- hGetEntropy h `X.finally` closeHandle h
               pure $ B.pack $ B.zipWith xor hw sys

This package supports Windows, {li,u}nix, QNX, and has preliminary support for HaLVM.

Typically tested on Linux and OSX - testers are as welcome as patches.

Build Status