AES-0.2.9: Fast AES encryption/decryption for bytestrings

Safe HaskellNone



This module provides a cryptographically secure PRNG based on AES, reading the seed from devurandom



randBytes :: Int -> IO ByteStringSource

Randomness from a system source of nonsense such as devurandom

prandBytes :: Int -> IO ByteStringSource

Cryptographic pseudorandomness from an AES cipher. This function is currently inefficient for non-multiple-of-16 sized bytestrings.

data AESGen Source

A random number generator that gets its input from prandBytes, ensuring purity by storing those bytes for later if you don't discard the generator.

Using split on this generator isn't supported, but could be.

Please note that if an asynchronous exception is caught while a random number is being generated, the generator will be wrecked forevermore.