Thursday, 8 July 2010

ENCRYPTION OF STRING

  1. public static byte[] encryptData(string data)
  2. {
  3. System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher = new System.Security.Cryptography.MD5CryptoServiceProvider();
  4. byte[] hashedBytes;
  5. System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
  6. hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(data));
  7. return hashedBytes;
  8. }

No comments:

Post a Comment