public string mEncryptURLEncode(string text)
{
byte[] plainBytes = Encoding.Unicode.GetBytes(text);
byte[] cipherBytes;
using (ICryptoTransform sse = rc2.CreateEncryptor())
{
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cs = new CryptoStream(ms, sse, CryptoStreamMode.Write))
{
cs.Write(plainBytes, 0, plainBytes.Length);
cs.FlushFinalBlock();
cs.Close();
cs.Dispose();
}
cipherBytes = ms.ToArray();
ms.Close();
ms.Dispose();
}
sse.Dispose();
}
string sEncrypt = Convert.ToBase64String(cipherBytes, 0, cipherBytes.Length);
return(HttpUtility.UrlEncode(sEncrypt));
}