Encrypt and Decrypt string
======================
// Encrypt Method
private string EncryptString(string strSource)
{
Byte[] b = System.Text.ASCIIEncoding.ASCII.GetBytes(strSource);
string encryptedString = Convert.ToBase64String(b);
return encryptedString;
}
// Decrypt Method
private string DecryptString(string strSource)
{
Byte[] b = Convert.FromBase64String(strSource);
string decryptedString = System.Text.ASCIIEncoding.ASCII.GetString(b);
return decryptedString;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment