I am encrypting a text and sending it via QueryString.
"8ZnSq13yv2yYVDsehDnNUNp/yIFqsAQh4XNPbV1eLMpk/dMWpc/YnMMEBy29MlgcYqpV2XPOf/Rpiz5S85VN/fkLbGTCkL/clBHh983Cp s="
The Decrypt Function is given Below
public static string Decrypt(string stringToDecrypt)//Decrypt the content
{
try
{
byte[] key = Convert2ByteArray(DESKey);
byte[] IV = Convert2ByteArray(DESIV);
int len = stringToDecrypt.Length;
byte[] inputByteArray = Convert.FromBase64String(stringToDecrypt);
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(key, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
Encoding encoding = Encoding.UTF8; return encoding.GetString(ms.ToArray());
}
catch (System.Exception ex)
{
throw ex;
}
}
What should I do to resolve this issue?