• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

Saturday, June 16, 2007

Normal string Encrypt and Decrypt

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;
}

0 comments:

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com