/ Published in: C#
Expand |
Embed | Plain Text
public static byte[] encryptData(string data) { System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] hashedBytes; hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(data)); return hashedBytes; }
Comments
Subscribe to comments
You need to login to post a comment.

This is hashing not encryption. There's no way to get the string back.
You could use: System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password,"md5") if you just want to hash a password.