Commits

Fydon committed 8917d92 Draft

Changed the stopping condition of the password guessing to be when the password is found, as the loop will break when all combinations have been check and the calculation for the number of combiniations was incorrect

  • Participants
  • Parent commits 79d49f3

Comments (0)

Files changed (1)

File CertificatePasswordRecovery/CertPasswordRecoveryForm.cs

 
             // Incrementors needed to ensure we check every password combination
             BigInteger i = 1;
-            BigInteger RepeatUntil = BigInteger.Pow((BigInteger)sequence.Length, password.Length);
 
             // Password found?
             bool password_found = false;
                 if (TestPassword(this.certificateData, pw, logPathBx.Text, i))
                 {
                     password_found = true;
-                    break;
                 }
 
                 // Loop counter. Keep counting!
                 // Increment counter for minimal logging
                 ++this.logIterationCount;
             }
-            while (BigInteger.Compare(i, RepeatUntil) <= 0);
+            while( !password_found );
 
             if (!password_found)
                 MessageBox.Show("Password not found. :(", "Info");