You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
1.3 KiB

namespace com.hitrust.b2b.Security.Cryptography
{
using System;
using System.Security.Cryptography;
public sealed class ARCFourManaged : RC4
{
private bool m_IsDisposed = false;
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
if (this.m_IsDisposed)
{
throw new ObjectDisposedException(base.GetType().FullName);
}
if (rgbKey == null)
{
throw new ArgumentNullException("Key is a null reference.");
}
if ((rgbKey.Length == 0) || (rgbKey.Length > 0x100))
{
throw new CryptographicException("Invalid Key.");
}
if ((rgbIV != null) && (rgbIV.Length > 1))
{
throw new CryptographicException("Invalid Initialization Vector.");
}
return new ARCFourManagedTransform(rgbKey);
}
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
return this.CreateDecryptor(rgbKey, rgbIV);
}
protected override void Dispose(bool disposing)
{
base.Dispose(true);
this.m_IsDisposed = true;
}
}
}