Пример #1
0
        static void Main(string[] args)
        {
            //Program cte = new Program();
            //cte.CryptoTextFiles();
            //cte.BruteForceCrib("", "hello", 8, "B");

            //DataSQLcreation dsc = new DataSQLcreation();
            //dsc.CreateData();

            //cte.TestOdometer();
            BruteForcePlugboard b = new BruteForcePlugboard();

            //Console.WriteLine("press enter to exit ...");
            //Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            //if (args.Length != 2)   // check if there are two parameters
            //{
            //    Console.WriteLine("Takes two integers; number of wires and number of plug sockets");
            //    Console.WriteLine("Restart with correct numbers");
            //    Console.WriteLine("-- END OF PROGRAM --");
            //    return;
            //}

            int w = 1;
            int p = 26;

            //bool check1 = int.TryParse(args[0], out w);
            //bool check2 = int.TryParse(args[1], out p);

            //if (!check1 && !check2) // check if the parameters are numbers
            //{
            //    Console.WriteLine("inputs are not numbers.");
            //    Console.WriteLine("Restart with correct numbers");
            //    Console.WriteLine("-- END OF PROGRAM --");
            //    return;
            //}

            //if (p % 2 != 0 && !(w <= p / 2) && !(w >= 1))   // check for correct numbers even number of p and w may not excede half of p or p <=0
            //{
            //    Console.WriteLine("first paramenter must be bigger than 0 and <= second paramenter/2");
            //    Console.WriteLine("second parameter must be multiple of 2");
            //    Console.WriteLine("-- END OF PROGRAM --");
            //    return;
            //}

            BruteForcePlugboard bfp = new BruteForcePlugboard();

            StreamWriter file = new StreamWriter("D:\\ET\\bfOnPlugboardUsingLetters\\BruteForcePlugboard_" + p + "per" + w + "wires_ABC.txt");

            int[] plugs = new int[p];

            Stopwatch timer2 = new Stopwatch();

            timer2.Start();

            bfp.PlugBoardSettings(w, 0, 0, plugs, file);
            Console.WriteLine("\n\ncount: " + count);
            //file.WriteLine("END_FILE\n\ncount: " + count);

            timer2.Stop();
            long sec = timer2.ElapsedMilliseconds / 1000;
            long min = sec / 60;

            sec = sec % 60;
            long hours = min / 60;

            min = min % 60;
            long mil = timer2.ElapsedMilliseconds % 1000;

            Console.WriteLine("completed in: " + hours + ":" + min + ":" + sec + "." + mil);

            //file.WriteLine("completed in: " + hours + ":" + min + ":" + sec + "." + mil);
            //file.Flush();

            Console.Beep();
            Console.Beep();
            Console.Beep();

            Console.ReadKey();
            return;
        }