System.Entropy

entropy-0.2.1: A platform independent entropy source

Maintainer | Thomas.DuBuisson@gmail.com
Stability | beta
Portability | portable
Safe Haskell | Safe
Language | Haskell98

System.Entropy

Description

Obtain entropy from system sources. Currently, windows and *nix systems with a devurandom are supported.

Synopsis

- getEntropy :: Int -> IO ByteString
- data CryptHandle
- openHandle :: IO CryptHandle
- hGetEntropy :: CryptHandle -> Int -> IO ByteString
- closeHandle :: CryptHandle -> IO ()

# Documentation

getEntropy :: Int -> IO ByteString #

Inefficiently get a specific number of bytes of cryptographically secure random data using the system-specific facilities.

Use '/dev/urandom' on *nix and CryptAPI when on Windows. In short, this entropy is considered "cryptographically secure" but not true entropy.

data CryptHandle #

Handle for manual resource mangement

openHandle :: IO CryptHandle #

Open a `CryptHandle`

hGetEntropy :: CryptHandle -> Int -> IO ByteString #

Read random data from a `CryptHandle`

closeHandle :: CryptHandle -> IO () #

Close the `CryptHandle`