using System.Security.Cryptography;
public static string GetPassword(string UserName, string Pwd, string Token) {
return Hash(UserName.ToUpper() + "|" + Pwd + "|" + Token);
private static string Hash(string ToHash) {
Encoder enc = System.Text.Encoding.ASCII.GetEncoder();
byte[] data = new byte[ToHash.Length];
enc.GetBytes(ToHash.ToCharArray(), 0, ToHash.Length, data, 0, true);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
return BitConverter.ToString(result).Replace("-", "").ToLower();
public static void Main(string[] args)
Console.Write(GetPassword("User","Password","Token"));