Всем, привет имеется код:
Код: private static string A(string text1, bool flag1)
{
string str;
try
{
byte[] buffer;
if (string.IsNullOrEmpty(text1))
{
return null;
}
byte[] inputBuffer = Convert.FromBase64String(text1);
if (flag1)
{
MD5CryptoServiceProvider provider = new MD5CryptoServiceProvider();
buffer = provider.ComputeHash(Encoding.UTF8.GetBytes(.A()));
provider.Clear();
}
else
{
buffer = Encoding.UTF8.GetBytes(.A());
}
TripleDESCryptoServiceProvider provider2 = new TripleDESCryptoServiceProvider {
Key = buffer,
Mode = CipherMode.ECB,
Padding = PaddingMode.PKCS7
};
byte[] bytes = provider2.CreateDecryptor().TransformFinalBlock(inputBuffer, 0, inputBuffer.Length);
provider2.Clear();
str = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
}
catch (Exception)
{
return .a();
}
return str;
}
Код: private static string A(string text1, bool flag1)
{
string str;
try
{
byte[] buffer;
if (string.IsNullOrEmpty(text1))
{
return null;
}
byte[] inputBuffer = Convert.FromBase64String(text1);
if (flag1)
{
MD5CryptoServiceProvider provider = new MD5CryptoServiceProvider();
buffer = provider.ComputeHash(Encoding.UTF8.GetBytes(.A()));
provider.Clear();
}
else
{
buffer = Encoding.UTF8.GetBytes(.A());
}
TripleDESCryptoServiceProvider provider2 = new TripleDESCryptoServiceProvider {
Key = buffer,
Mode = CipherMode.ECB,
Padding = PaddingMode.PKCS7
};
byte[] bytes = provider2.CreateDecryptor().TransformFinalBlock(inputBuffer, 0, inputBuffer.Length);
provider2.Clear();
str = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
}
catch (Exception)
{
return .a();
}
return str;
}