private string createHash(string strSource) { Byte[] bytSource; // will hold Unicode bytes of source string Byte[] bytHash; // will hold bytes of encrypted (hash) string System.Text.UnicodeEncoding unicodeConverter = new System.Text.UnicodeEncoding(); System.Security.Cryptography.SHA256Managed shaEncrypter = new System.Security.Cryptography.SHA256Managed(); // fill array with Unicode chars from source string bytSource = unicodeConverter.GetBytes(strSource); bytHash = shaEncrypter.ComputeHash(bytSource); // encrypt the byte array return Convert.ToBase64String(bytHash); // return Base64 string }