This documentation is archived and is not being maintained.

RandomNumberGenerator Class

Represents the abstract class from which all implementations of cryptographic random number generators derive.

For a list of all members of this type, see RandomNumberGenerator Members.


[Visual Basic]
MustInherit Public Class RandomNumberGenerator
public abstract class RandomNumberGenerator
public __gc __abstract class RandomNumberGenerator
public abstract class RandomNumberGenerator

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Cryptographic random number generators create cryptographically strong random values.

Application code does not directly use this class. This abstract class is provided as the base class for all cryptographic random number generators.

For an implementation of a cryptographic random number generator, use the derived class RNGCryptoServiceProvider.


Namespace: System.Security.Cryptography

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

RandomNumberGenerator Members | System.Security.Cryptography Namespace | Cryptographic Services