Beispiel #1
0
        public MainWindow()
        {
            HashesPerSecondPerGpu = (long)(82 * Math.Pow(10, 8)); // a default value, taken from Peter Magnussons spreadsheet.
            NumWords       = 5;
            NumberOfGpus   = 1;
            PriorKnowledge = PriorKnowledge.Passphrase;

            var swe = new DicewareFileSource("diceware8k-sv.txt");
            var eng = new DicewareFileSource("diceware8k.txt");

            WordSources = new List <IWordSource>();
            WordSources.Add(eng);
            WordSources.Add(swe);
            _alphanumSource = new AlphanumSource();
            WordSources.Add(_alphanumSource);

            var local = new LocalComputerRandomness();

            RandomnessSources = new List <IRandomnessSource>();
            RandomnessSources.Add(local);

            InitializeComponent();

            MainGrid.DataContext = this;
            PropertyChanged     += OnPropertyChanged;
        }
Beispiel #2
0
        public void TestCombinations()
        {
            var fivenumbers = new string[] { "1", "2", "3", "4", "5" };
            var fivewords   = new string[] { "one", "two", "three", "four", "five" };
            var sixwords    = new string[] { "one", "two", "three", "four", "five", "six" };
            var en          = new DicewareFileSource("diceware8k.txt");
            var alphasource = new AlphanumSource();
            var alpha       = PriorKnowledge.Alphanumeric;
            var pass        = PriorKnowledge.Passphrase;

            Assert.AreEqual(Utils.CrackingCombinations(fivenumbers, alphasource, alpha),
                            Utils.CrackingCombinations(fivenumbers, alphasource, pass));
            Assert.AreEqual(Utils.CrackingCombinations(fivewords, en, pass), new BigInteger("36893488147419103232"));
            Assert.AreEqual(Utils.CrackingCombinations(sixwords, en, pass), new BigInteger("302231454903657293676544"));

            Assert.AreEqual(Utils.CrackingCombinations(fivewords, en, alpha), new BigInteger("11361668153983839080134359106715648"));
        }