This documentation is archived and is not being maintained.

DESCryptoServiceProvider.GenerateKey Method

Generates a random Key to be used for the algorithm.

[Visual Basic]
Overrides Public Sub GenerateKey()
public override void GenerateKey();
public: void GenerateKey();
public override function GenerateKey();


Use this method to generate a random key when none is specified. This method will never return a weak key (see IsWeakKey) or a semi-weak key (see IsSemiWeakKey).


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

See Also

DESCryptoServiceProvider Class | DESCryptoServiceProvider Members | System.Security.Cryptography Namespace | Cryptographic Services