Changeset 723


Ignore:
Timestamp:
Oct 14, 2009, 12:15:18 PM (12 years ago)
Author:
Danail Vazov
Message:

Modified leastSquares method in accordance to changes made to the StringOutput of the FrequencyTest plug-in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/VigenereAnalyser/VigenereAnalyser.cs

    r450 r723  
    141141            if (freqStats.Count != elf.Length)
    142142            {
    143                 char[] check = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
     143                char[] check = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
    144144                int l = 0;
    145145                int c = 0;
     
    154154                        if (check[t] == r.letter)
    155155                        {
    156                             observedFrequencies.Add(r.relativeFrequency/100);
     156                            observedFrequencies.Add(r.relativeFrequency);
    157157                            l++;
    158158                            c++;
     
    174174                freqStats.ForEach(delegate(Stats s)
    175175                {
    176                     observedFrequencies.Add(s.relativeFrequency/100);
     176                    observedFrequencies.Add(s.relativeFrequency);
    177177                });
    178178            }
     
    277277        #region Properties (Inputs/Outputs)
    278278
    279         [PropertyInfo(Direction.Input, "Double precission floating point value.", "Keylength as proposed by the Friedman Test.", "", true, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     279        [PropertyInfo(Direction.InputData, "Double precission floating point value.", "Keylength as proposed by the Friedman Test.", "", true, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    280280        public double FriedmanInput
    281281        {
     
    291291            }
    292292        }
    293         [PropertyInfo(Direction.Input, "Text Input.", "Cipher text encrypted with the Vigenere cipher.", "", true, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     293        [PropertyInfo(Direction.InputData, "Text Input.", "Cipher text encrypted with the Vigenere cipher.", "", true, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    294294        public string StringInput
    295295        {
     
    300300            set { stringInput = value; OnPropertyChanged("StringInput"); }
    301301        }
    302         [PropertyInfo(Direction.Input, "Integer Array.", "The Array cointains keylengths as proposed by the Kasiski Test.", "", false, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     302        [PropertyInfo(Direction.InputData, "Integer Array.", "The Array cointains keylengths as proposed by the Kasiski Test.", "", false, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    303303        public int[] KasiskiInput
    304304        {
     
    314314            }
    315315        }
    316         [PropertyInfo(Direction.Output, "Integer Array.", "Keyword represented as an integer Array.", "", false, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     316        [PropertyInfo(Direction.OutputData, "Integer Array.", "Keyword represented as an integer Array.", "", false, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    317317        public string KeywordOutput
    318318        {
     
    328328            }
    329329        }
    330         [PropertyInfo(Direction.Input, "String", "Please only connect to the text output of the Frequency Test.", "", true, true, DisplayLevel.Expert, QuickWatchFormat.Text, null)]
     330        [PropertyInfo(Direction.InputData, "String", "Please only connect to the text output of the Frequency Test.", "", true, true, DisplayLevel.Expert, QuickWatchFormat.Text, null)]
    331331        public string FrequencyStats
    332332        {
     
    343343            }
    344344        }
    345        
    346         [PropertyInfo(Direction.Output, "String", "The cipher text divided into columns. Number of columns (strings) equals keylength.", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     345
     346        [PropertyInfo(Direction.OutputData, "String", "The cipher text divided into columns. Number of columns (strings) equals keylength.", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    347347        public string FrequencyOutput
    348348        {
     
    356356            }
    357357        }
    358         [PropertyInfo(Direction.Output, "Text output", " Keyword of the cipher which was used to encrypt the input text. ", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     358        [PropertyInfo(Direction.OutputData, "Text output", " Keyword of the cipher which was used to encrypt the input text. ", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    359359        public string StringOutput
    360360        {
Note: See TracChangeset for help on using the changeset viewer.