Encryption of string


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.