RijndaelManaged.CreateEncryptor Method (Byte[], Byte[])

 

Creates a symmetric Rijndael encryptor object with the specified Key and initialization vector (IV).

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

override CreateEncryptor : 
        rgbKey:byte[] *
        rgbIV:byte[] -> ICryptoTransform

Parameters

rgbKey
Type: System.Byte[]

The secret key to be used for the symmetric algorithm. The key size must be 128, 192, or 256 bits.

rgbIV
Type: System.Byte[]

The IV to be used for the symmetric algorithm.

Return Value

Type: System.Security.Cryptography.ICryptoTransform

A symmetric Rijndael encryptor object.

Exception Condition
ArgumentNullException

The rgbKey parameter is null.

-or-

The rgbIV parameter is null.

CryptographicException

The value of the Mode property is not ECB, CBC, or CFB.

Use the CreateDecryptor overload with the same signature to decrypt the result of this method.

The rgbkey size must be 128, 192, or 256 bits.

The following code examples demonstrates how to encrypt a message using the CreateEncryptor method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: