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.
Afficher le fichier Open project: TheAngryByrd/MetroPass Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat System

GetRandomBytes() public méthode

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

GetRandomUInt64() public méthode

public GetRandomUInt64 ( ) : ulong
Résultat ulong