entropy: A platform independent entropy source

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

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]

Properties

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.2, 0.4.1.3, 0.4.1.4, 0.4.1.5, 0.4.1.6, 0.4.1.7, 0.4.1.9, 0.4.1.10
Change log None available
Dependencies base (>=4.8 && <5), bytestring, unix [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 2018-09-22T20:31:01Z

Modules

[Index] [Quick Jump]

Flags

Automatic Flags
NameDescriptionDefault
halvm

Build for the HaLVM

Disabled

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for entropy-0.4.1.2

[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