nist-beacon-0.1.0.1: Haskell interface to the nist random beacon.

Copyright(c) Bryan St. Amour, 2015
LicenseBSD
Maintainerbryan@bryanstamour.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Net.Beacon

Description

This module is for interacting with the NIST Randomness Beacon (prototype) web API. The Randomness Beacon is designed to be a public source of random information. It generates and publishes 512-bit blocks of random data collected from a quantum mechanical process every 60 seconds.

For more information about the project, see

https://beacon.nist.gov/home

Synopsis

Documentation

data Record Source

A single record: the random data plus some additional information.

version :: Record -> String Source

A simple version string, e.g. "0.1.0".

frequency :: Record -> Int Source

The time interval, in seconds, between expected records.

timeStamp :: Record -> Int Source

The time the seed value was generated as the number of seconds since January 1, 1970.

seedValue :: Record -> ByteString Source

A seed value represented as a 64 byte (512-bit) hex string value.

previousOutputValue :: Record -> ByteString Source

The SHA-512 hash value for the previous record - 64 byte hex string.

signatureValue :: Record -> ByteString Source

A digital signature (RSA) computed over (in order): version, frequency, timeStamp, seedValue, previousHashValue, errorCode.

Note: Except for version, the hash is on the byte representations and not the string representations of the data values.

outputValue :: Record -> ByteString Source

The SHA-512 hash of the signatureValue as a 64 byte hex string.

statusCode :: Record -> Int Source

The status code value: 0 - Chain intact, values all good 1 - Start of a new chain of values, previous hash value will be all zeroes 2 - Time between values is greater than the frequency, but the chain is still intact

getLastRecord :: IO (Maybe Record) Source

Last record published.

getCurrentRecord :: Timestamp -> IO (Maybe Record) Source

Current record, or closest to the timestamp.

getStartChainRecord :: Timestamp -> IO (Maybe Record) Source

Start chain record.