1. Trevor Dearham
  2. CertificatePasswordRecovery

Commits

Trevor Dearham  committed 7c40787 Draft

Started the password count at 1 to symbolise the first password attempt, rather than 0 being the first. Also move the counter for logging purposes to increment at the same point as the password number.

  • Participants
  • Parent commits 0ce7e48
  • Branches default

Comments (0)

Files changed (1)

File CertificatePasswordRecovery/CertPasswordRecoveryForm.cs

View file
  • Ignore whitespace
             int depth = password.Length - 1;
 
             // Incrementors needed to ensure we check every password combination
-            BigInteger i = 0;
+            BigInteger i = 1;
             BigInteger RepeatUntil = BigInteger.Pow((BigInteger)sequence.Length, password.Length);
 
             // Password found?
             bool password_found = false;
 
             // Reset counter
-            logIterationCount = 0;
+            logIterationCount = 1;
 
             // loop to find the password
             do
 
                 // Loop counter. Keep counting!
                 i++;
+                // Increment counter for minimal logging
+                ++this.logIterationCount;
             }
             while (BigInteger.Compare(i, RepeatUntil) <= 0);
 
         {
             try
             {
-                // Increment counter for minimal logging
-                ++this.logIterationCount;
-
                 certificate = new X509Certificate2(certificateData, CertificatePassword);
                 
                 // Only log successful crack to a file if the logging is NOT set to 0!