entropy: A platform independent entropy source

[ bsd3, cryptography, data, library ] [ Propose Tags ] [ Report a vulnerability ]

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]

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

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 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, 0.4.1.5, 0.4.1.6, 0.4.1.7, 0.4.1.9, 0.4.1.10
Dependencies base (>=4.8 && <5), bytestring, unix (<2.8) [details]
Tested with ghc ==8.2.2
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>
Revised Revision 1 made by phadej at 2022-08-15T13:30:35Z
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:33:25Z
Distributions Arch:0.4.1.10, Debian:0.4.1.6, Fedora:0.4.1.10, FreeBSD:0.3.7, LTSHaskell:0.4.1.10, NixOS:0.4.1.10, Stackage:0.4.1.10, openSUSE:0.4.1.10
Reverse Dependencies 52 direct, 3556 indirect [details]
Downloads 152765 total (320 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-09-22 [all 1 reports]

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