| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace friaLabbar.Models
- {
- public class PasswordCracker
- {
- public List<String> PasswordPool { get; set; }
- public PositionalPasswordCharacter[] PositionalCharacters { get; set; }
- public PasswordCracker(List<string> passwordPool, uint pwLength = 5, uint numPossibleCharacters = 6)
- {
- PasswordPool = passwordPool;
- PositionalCharacters = new PositionalPasswordCharacter[pwLength];
- for (uint i = 0; i < pwLength; i++)
- {
- PositionalCharacters[i] = new PositionalPasswordCharacter(numPossibleCharacters, i);
- }
- }
- public PasswordCracker(uint pwLength = 5, uint numPossibleCharacters = 6)
- : this(new List<string>(), pwLength, numPossibleCharacters)
- {
- }
- public IEnumerable<PossiblePassword> AllPasswords
- {
- get
- {
- List<PossiblePassword> result = new List<PossiblePassword>();
-
- foreach (string password in PasswordPool)
- {
- result.Add(new PossiblePassword(password, PositionalCharacters));
- }
- return result;
- }
- }
- }
- }
|