Calculate SHA step 1 & 2 strSecurePassword = BitConverter.ToString(SHA1Managed.Create().ComputeHash(Encoding.ASCII.GetBytes(userPassword))).Replace("-", ""); Step 3. strSecurePassword = nonce + ":" + strSecurePassword; Step 4 & 5 public string CalculateMD5(strSecurePassword) { //Declarations Byte[] originalBytes; Byte[] encodedBytes; MD5 md5; //Instantiate MD5CryptoServiceProvider, get bytes for original password and compute hash (encoded password) md5 = new MD5CryptoServiceProvider(); originalBytes = ASCIIEncoding.Default.GetBytes(strSecurePassword); encodedBytes = md5.ComputeHash(originalBytes); //Convert encoded bytes back to a 'readable' string return BitConverter.ToString(encodedBytes).Replace("-",""); }