/////////////
string mm = "h3dhu12";
string pp = EnryptString(mm);
string qq = DecryptString(pp);
public string
DecryptString(string encrStr)
{
byte[] b;
string decrypted;
try
{
b
= Convert.FromBase64String(encrStr);
decrypted = System.Text.ASCIIEncoding.ASCII.GetString(b);
}
catch (FormatException
fe)
{
decrypted = "";
}
return decrypted;
}
public string
EnryptString(string strEnc)
{
byte[] b = System.Text.ASCIIEncoding.ASCII.GetBytes(strEnc);
string encrypted = Convert.ToBase64String(b);
return encrypted;
}
No comments:
Post a Comment