using System.Security.Cryptography;
public static void Main()
var password = "Gisdata123";
var username = "uDQFeSJppLXbDOZRWlPUtA==";
var hash = Convert.ToBase64String(MD5.ComputeHash(string.Format("{0}/{1}", password, username.ToLower())));
public static MD5CryptoServiceProvider x = null;
public static byte[] CalcChallengeHash(byte[] b_secret, byte[] b_random)
if (b_secret == null || b_random == null)
byte[] buf = new byte[b_random.Length + b_secret.Length];
Buffer.BlockCopy(b_random, 0, buf, 0, b_random.Length);
Buffer.BlockCopy(b_secret, 0, buf, b_random.Length, b_secret.Length);
public static byte[] ComputeHash(string txt)
return ComputeHash(Encoding.UTF8.GetBytes(txt));
public static byte[] ComputeHash(byte[] plaintext)
x = new MD5CryptoServiceProvider();
return x.ComputeHash(plaintext);
public static bool IsEqual(byte[] a, byte[] b)
if (a == null || b == null)
if (a.Length != b.Length)
for (int i = 0; i < a.Length; i++) if (a[i] != b[i]) return false;