public DES(string key, string iv)
{
if (key.Length > 8)
{
key = key.Substring(0, 8);
}
if (iv.Length > 8)
{
iv = iv.Substring(0, 8);
}
this.Key = this.TextEncode.GetBytes(key);
this.IV = this.TextEncode.GetBytes(iv);
try
{
des = new System.Security.Cryptography.DESCryptoServiceProvider();
des.Mode = CipherMode.ECB;
des.Key = Key;
des.IV = IV;
decryptor = des.CreateDecryptor(this.Key, this.IV);
encryptor = des.CreateEncryptor(this.Key, this.IV);
}
catch (System.Exception ex)
{
log.Error(ex.ToString());
}
}