Mentalis.org Security Library documentation

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

Creates a symmetric encryptor object with the specified Key.

[Visual Basic]
Overrides Overloads Public Function CreateEncryptor( _
   ByVal rgbKey As Byte(), _
   ByVal rgbIV As Byte() _
) As ICryptoTransform
[C#]
public override ICryptoTransform CreateEncryptor(
   byte[] rgbKey,
   byte[] rgbIV
);

Parameters

rgbKey
The secret key to be used for the symmetric algorithm.
rgbIV
Not used in RC4. It can be a null reference or a byte array with a length less than 2.

Return Value

A symmetric encryptor object.

Remarks

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

Exceptions

Exception TypeCondition
ObjectDisposedExceptionThe object is disposed.
ArgumentNullExceptionrgbKey is a null reference (Nothing in Visual Basic).
CryptographicException

See Also

RC4CryptoServiceProvider Class | Org.Mentalis.Security.Cryptography Namespace | RC4CryptoServiceProvider.CreateEncryptor Overload List