Beispiel #1
0
        public Algorithm(int keyLength, String[] messages, Logger log, int taskId, ThreadingHelper threadingHelper, ADFGVXANalyzerSettings settings, ADFGVXAnalyzer analyzer)
        {
            this.analyzer        = analyzer;
            this.threadingHelper = threadingHelper;
            this.taskId          = taskId;
            this.log             = log;
            this.language        = settings.Language;
            this.deviation       = settings.Deviation;
            this.restarts        = settings.Restarts;
            this.keyLength       = keyLength;
            ciphers = new ADFGVXVector[messages.Length];
            int totalPlainLength = 0;
            int maxPlainLength   = 0;

            for (int m = 0; m < messages.Length; m++)
            {
                ciphers[m]        = new ADFGVXVector(messages[m].Replace(" ", ""), false);
                totalPlainLength += ciphers[m].length / 2;
                maxPlainLength    = Math.Max(maxPlainLength, ciphers[m].length / 2);
            }
            allPlain      = new Alphabet36Vector(totalPlainLength, true);
            plain         = new Alphabet36Vector(maxPlainLength, false);
            interimCipher = new ADFGVXVector(maxPlainLength * 2, false);
        }
Beispiel #2
0
 public ThreadingHelper(int taskcount, ADFGVXAnalyzer analyzer)
 {
     this.taskcount   = taskcount;
     this.decryptions = new long[taskcount];
     this.analyzer    = analyzer;
 }