Esempio n. 1
0
 private void btnFind_Click(object sender, EventArgs e)
 {
     if (IsPasswordValid() && IsThreadValid() && IsCheckedRange())
     {
         btnFind.Enabled = false;
         string password = this.tbPassword.Text;
         string md5hash  = CalculateMd5.CalculateMd5Hash(password);
         this.tbMd5.Text = md5hash;
         PasswordOptions options = new PasswordOptions();
         if (cbRangAZ.Checked)
         {
             options = options | PasswordOptions.Capital;
         }
         if (cbRangeaz.Checked)
         {
             options = options | PasswordOptions.Lower;
         }
         if (cbRangeNumber.Checked)
         {
             options = options | PasswordOptions.Numbers;
         }
         int             threadCount = (int)this.numThread.Value;
         Action <string> GetPassword;
         GetPassword = ReceivePassword;
         //Generator generator = new Generator(3, PasswordOptions.Capital, CalculateMd5.CalculateMd5Hash("ABC"), 3);
         Generator generator = new Generator(password.Length, options, md5hash, threadCount);
         _tokenSource = generator.ThreadCracker(GetPassword);
     }
     else
     {
         MessageBox.Show("Input data don't correct", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
     }
 }
 public bool VerifyMd5Hash(string probe)
 {
     return(CalculateMd5.CalculateMd5Hash(probe) == _md5);
 }