The cprng-aes package

[Tags: bsd3, library]

Simple crypto pseudo-random-number-generator with really good randomness property.

Using ent, a randomness property maker on one 1Mb sample: Entropy = 7.999837 bits per byte. Optimum compression would reduce the size of this 1048576 byte file by 0 percent. Chi square distribution for 1048576 samples is 237.02 Arithmetic mean value of data bytes is 127.3422 (127.5 = random) Monte Carlo value for Pi is 3.143589568 (error 0.06 percent)

Compared to urandom with the same sampling: Entropy = 7.999831 bits per byte. Optimum compression would reduce the size of this 1048576 byte file by 0 percent. Chi square distribution for 1048576 samples is 246.63 Arithmetic mean value of data bytes is 127.6347 (127.5 = random). Monte Carlo value for Pi is 3.132465868 (error 0.29 percent).


[Skip to ReadMe]

Properties

Versions0.1.0, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.1
Change logNone available
Dependenciesbase (>=4.4 && <5), bytestring, cereal (>=0.3.0 && <0.4.0), cipher-aes (==0.1.*), crypto-api (>=0.8), cryptocipher (<0.4), entropy (>=0.2), random [details]
LicenseBSD3
CopyrightVincent Hanquez <vincent@snarc.org>
AuthorVincent Hanquez <vincent@snarc.org>
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
CategoryCryptography
Home pagehttp://github.com/vincenthz/hs-cprng-aes
Source repositoryhead: git clone git://github.com/vincenthz/hs-cprng-aes
UploadedSun Dec 2 15:31:30 UTC 2012 by VincentHanquez
UpdatedSun Jun 14 20:45:22 UTC 2015 by AdamBergmark to revision 2
DistributionsDebian:0.6.1, FreeBSD:0.5.2, LTSHaskell:0.6.1, NixOS:0.6.1, Stackage:0.6.1
Downloads91361 total (700 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Flags

NameDescriptionDefault
fastaesUse fast AES if availableEnabled
cerealUse cerealDisabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for cprng-aes-0.2.5

CPRNG-AES

This module provides a crypto pseudo random number generator using AES in counter mode.

to import:

import Crypto.Random.AESCtr

to use:

rng <- makeSystem
let (ran, rng') = getRandomBytes rng 1024

it's also an instance of CryptoRandomGen from the crypto-api package.

Statistics

Using ent, a randomness property maker on one 1Mb sample.

cprng-AES:

Entropy = 7.999837 bits per byte.
Optimum compression would reduce the size of this 1048576 byte file by 0 percent.
Chi square distribution for 1048576 samples is 237.02.
Arithmetic mean value of data bytes is 127.3422 (127.5 = random).
Monte Carlo value for Pi is 3.143589568 (error 0.06 percent).

Compared to urandom with the same sampling:

Entropy = 7.999831 bits per byte.
Optimum compression would reduce the size of this 1048576 byte file by 0 percent.
Chi square distribution for 1048576 samples is 246.63.
Arithmetic mean value of data bytes is 127.6347 (127.5 = random).
Monte Carlo value for Pi is 3.132465868 (error 0.29 percent).