using System; using System.Security.Cryptography; using System.Text; namespace D05._1 { class Program { static byte[] ToB(string str) => Encoding.ASCII.GetBytes(str); static string ToS(byte[] b) => BitConverter.ToString(b).Replace("-", ""); static void Main(string[] args) { if (args.Length < 1) throw new ArgumentException(); string input = args[0]; var sb = new StringBuilder(); using (var md5 = MD5.Create()) { int i = 0; while (sb.Length < 8) { var h = md5.ComputeHash(ToB($"{input}{i}")); var sh = ToS(h); if (sh.StartsWith("00000")) sb.Append(sh[5]); i++; } } Console.WriteLine($"Password is : {sb.ToString()}"); } } }