Calculate the MD5 of a string is common practice especially in the preservation of the DB password or configuration file. Below a small function useful for calculating, note that the string is first converted to unicode to have a coding reference.
using System.Security.Cryptography; ... private static string MD5(string text) { UnicodeEncoding UE = new UnicodeEncoding(); byte[] hashValue; byte[] message = UE.GetBytes(text); MD5 hashString = new MD5CryptoServiceProvider(); string hex = ""; hashValue = hashString.ComputeHash(message); foreach (byte x in hashValue) { hex += String.Format("{0:x2}", x); } return hex; }