C# Class KeePassLib.Cryptography.CryptoRandom

Cryptographically strong random number generator. The returned values are unpredictable and cannot be reproduced. CryptoRandom is a singleton class.
Mostra file Open project: cappert/keepass2 Class Usage Examples

Public Methods

Method Description
AddEntropy ( byte pbEntropy ) : void

Update the internal seed of the random number generator based on entropy data. This method is thread-safe.

GetRandomBytes ( uint uRequestedBytes ) : byte[]

Get a number of cryptographically strong random bytes. This method is thread-safe.

Private Methods

Method Description
CryptoRandom ( ) : System.Drawing
GenerateRandom256 ( ) : byte[]
GetCspData ( ) : byte[]
GetSystemData ( Random rWeak ) : byte[]

Method Details

AddEntropy() public method

Update the internal seed of the random number generator based on entropy data. This method is thread-safe.
public AddEntropy ( byte pbEntropy ) : void
pbEntropy byte Entropy bytes.
return void

GetRandomBytes() public method

Get a number of cryptographically strong random bytes. This method is thread-safe.
public GetRandomBytes ( uint uRequestedBytes ) : byte[]
uRequestedBytes uint Number of requested random bytes.
return byte[]