using System.Security.Cryptography;
public static void Main()
var currentToken = "89f25b569fca2ce88a97767dc1ffaf73";
var date = DateTime.Parse("06/08/2022 22:21:00");
var uEmail = "was.hacked@fool.end";
var words = uName + "-" + uEmail + "-" + date;
result1 = GetMd5HashTheRightWay(words);
result2 = GetMd5Hash(words);
Console.WriteLine(words);
Console.WriteLine(result1);
Console.WriteLine(result2.ToUpper());
Console.WriteLine(result2);
Console.WriteLine("Many Hashes:");
var limit = (type == 2) ? (60*60*24) : 300;
for (var i=0; i<limit; i++) {
var currentDate = date.AddSeconds(i);
var currentWords = uName + "-" + uEmail + "-" + currentDate;
var nerdWayHash = GetMd5Hash(currentWords);
var isTheSameToken = (nerdWayHash == currentToken) ? "YES" : "NO";
var msdnWayHash = GetMd5HashTheRightWay(currentWords);
Console.WriteLine(nerdWayHash);
Console.WriteLine(i + ": " + currentDate + " >> " + isTheSameToken + " ? " + currentToken + " == " + nerdWayHash + "|" + msdnWayHash);
if (isTheSameToken == "YES") {
Console.WriteLine(i + ": " + currentDate + " >> " + isTheSameToken + " ? " + currentToken + " == " + nerdWayHash + "|" + msdnWayHash);
Console.WriteLine("Done!");
private static string GetMd5Hash(string source)
using (MD5 md5Hash = MD5.Create())
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(source));
StringBuilder sBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
sBuilder.Append(data[i].ToString("x2"));
return sBuilder.ToString();
private static string GetMd5HashTheRightWay(string source)
using (MD5 md5Hash = MD5.Create())
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(source);
byte[] hashBytes = md5Hash.ComputeHash(inputBytes);
return Convert.ToHexString(hashBytes);