C# Class Metropass.Core.PCL.Cipher.CryptoRandomStream

A random stream class. The class is initialized using random bytes provided by the caller. The produced stream has random properties, but for the same seed always the same stream is produced, i.e. this class can be used as stream cipher.
Show file Open project: TheAngryByrd/MetroPass Class Usage Examples

Public Methods

Method Description
CryptoRandomStream ( CrsAlgorithm genAlgorithm, byte pbKey, ICanSHA256Hash hasher ) : System

Construct a new cryptographically secure random stream object.

GetRandomBytes ( uint uRequestedCount ) : byte[]

Get uRequestedCount random bytes.

GetRandomUInt64 ( ) : ulong

Method Details

CryptoRandomStream() public method

Construct a new cryptographically secure random stream object.
Thrown if the /// parameter is null. Thrown if the /// parameter contains no bytes or the /// algorithm is unknown.
public CryptoRandomStream ( CrsAlgorithm genAlgorithm, byte pbKey, ICanSHA256Hash hasher ) : System
genAlgorithm CrsAlgorithm Algorithm to use.
pbKey byte Initialization key. Must not be null and /// must contain at least 1 byte.
hasher ICanSHA256Hash
return System

GetRandomBytes() public method

Get uRequestedCount random bytes.
public GetRandomBytes ( uint uRequestedCount ) : byte[]
uRequestedCount uint Number of random bytes to retrieve.
return byte[]

GetRandomUInt64() public method

public GetRandomUInt64 ( ) : ulong
return ulong