public MD5HashChecker(string dbFilename, bool salted = false) { _passwords = new Dictionary <string, PasswordInfo>(); _md5 = MD5.Create(); if (salted) { _salts = new List <string>(); _md5salt = new MD5Crypt(); } using (TextReader reader = new StreamReader(dbFilename)) { string line = null; while ((line = reader.ReadLine()) != null) { if (line == "") { continue; } var tokens = line.Split(';'); string pw; if (!salted) { pw = tokens.Last().Trim('"'); } else { _salts.Add(tokens.Last().Trim('"')); pw = tokens[tokens.Length - 2].Trim('"'); } PasswordInfo val; if (!_passwords.TryGetValue(pw, out val)) { _passwords.Add(pw, new PasswordInfo(0, 0)); } _passwords[pw].Accounts++; _passwords[pw].Reward++; } } }
public MD5HashChecker(string dbFilename, bool salted = false) { _passwords = new Dictionary<string, PasswordInfo>(); _md5 = MD5.Create(); if (salted) { _salts = new List<string>(); _md5salt = new MD5Crypt(); } using (TextReader reader = new StreamReader(dbFilename)) { string line = null; while ((line = reader.ReadLine()) != null) { if(line == "") continue; var tokens = line.Split(';'); string pw; if (!salted) { pw = tokens.Last().Trim('"'); } else { _salts.Add(tokens.Last().Trim('"')); pw = tokens[tokens.Length - 2].Trim('"'); } PasswordInfo val; if (!_passwords.TryGetValue(pw, out val)) _passwords.Add(pw, new PasswordInfo(0,0)); _passwords[pw].Accounts++; _passwords[pw].Reward++; } } }