diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2018-03-17 17:54:36 +0100 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2018-03-17 17:54:36 +0100 |
commit | e866abc9e35e62842168d01199e90f2bdfaf774e (patch) | |
tree | 45fcc55f8c90f23c31166c378c6279c95bb591b4 /DistributedPasswordCracker.Client/Cracker.cs | |
parent | f68bb1864b40c69d12b44db5aa33125aef39e150 (diff) |
Fixed everything
Diffstat (limited to 'DistributedPasswordCracker.Client/Cracker.cs')
-rw-r--r-- | DistributedPasswordCracker.Client/Cracker.cs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/DistributedPasswordCracker.Client/Cracker.cs b/DistributedPasswordCracker.Client/Cracker.cs index 9363cc2..5e76ae9 100644 --- a/DistributedPasswordCracker.Client/Cracker.cs +++ b/DistributedPasswordCracker.Client/Cracker.cs @@ -26,30 +26,34 @@ namespace DistributedPasswordCracker.Client /// <summary> /// Runs the password cracking algorithm /// </summary> - public List<UserInfoClearText> RunCracking(string [] dictionary) + public string RunCracking(string [] dictionary) { Stopwatch stopwatch = Stopwatch.StartNew(); List<UserInfo> userInfos = PasswordFileHandler.ReadPasswordFile("passwords.txt"); - Console.WriteLine("passwd opeend"); + //Console.WriteLine("passwd opeend"); - List<UserInfoClearText> result = new List<UserInfoClearText>(); + List<UserInfoClearText> results = new List<UserInfoClearText>(); for(int i = 0; i < dictionary.Length; i++) { String dictionaryEntry = dictionary[i]; IEnumerable<UserInfoClearText> partialResult = CheckWordWithVariations(dictionaryEntry, userInfos); - result.AddRange(partialResult); + results.AddRange(partialResult); } stopwatch.Stop(); - Console.WriteLine(string.Join(", ", result)); - Console.WriteLine("Out of {0} password {1} was found ", userInfos.Count, result.Count); - Console.WriteLine(); - Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed); + //Console.WriteLine(string.Join(", ", results)); + //Console.WriteLine("Out of {0} password {1} was found ", userInfos.Count, results.Count); + //Console.WriteLine(); + //Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed); - return result; + string output = ""; + for(int i = 0; i < results.Count; i++) + output += $"{results[i].UserName}:{results[i].Password}|"; + + return output; } /// <summary> |