public static string EncryptDES(string encryptString)
{
try
{
byte[] bytes = Encoding.UTF8.GetBytes("YYhelper");
byte[] rgbIV = Encoding.Unicode.GetBytes("YYhelper");
byte[] buffer = Encoding.UTF8.GetBytes(encryptString);
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream, provider.CreateEncryptor(bytes, rgbIV), CryptoStreamMode.Write);
stream2.Write(buffer, 0, buffer.Length);
stream2.FlushFinalBlock();
return Convert.ToBase64String(stream.ToArray());
}
catch
{
return encryptString;
}
}