Maintainer | Thomas.DuBuisson@gmail.com |
---|---|
Stability | beta |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Obtain entropy from system sources or x86 RDRAND when available.
Currently supporting:
- Windows via CryptoAPI
- *nix systems via
/dev/urandom
- Includes QNX
- Xen (only when RDRAND is available)
- getEntropy :: Int -> IO ByteString
- data CryptHandle
- openHandle :: IO CryptHandle
- hGetEntropy :: CryptHandle -> Int -> IO ByteString
- closeHandle :: CryptHandle -> IO ()
Documentation
getEntropy :: Int -> IO ByteString Source #
Get a specific number of bytes of cryptographically secure random data using the system-specific facilities.
Use RDRAND if available and XOR with '/dev/urandom' on *nix and CryptAPI when on Windows. In short, this entropy is considered cryptographically secure but not true entropy.
data CryptHandle Source #
Handle for manual resource management
openHandle :: IO CryptHandle Source #
Open a CryptHandle
hGetEntropy :: CryptHandle -> Int -> IO ByteString Source #
Read random data from a CryptHandle
closeHandle :: CryptHandle -> IO () Source #
Close the CryptHandle