AES-0.2.8: Fast AES encryption/decryption for bytestrings

Codec.Crypto.AES.Random

Description

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

Synopsis

Documentation

randBytes :: Int -> IO ByteStringSource

Randomness from a system source of nonsense such as devrandom

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.