Changeset 896


Ignore:
Timestamp:
Nov 24, 2009, 3:56:42 PM (12 years ago)
Author:
enkler
Message:

fixed bug in CaesarAnalysisHelper

File:
1 edited

Legend:

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

    r494 r896  
    44using System.Windows.Controls;
    55using Cryptool.PluginBase;
    6 using Cryptool.PluginBase.IO;
    76using System.Collections.Generic;
    87using Cryptool.PluginBase.Analysis;
     
    1716
    1817        public event PropertyChangedEventHandler PropertyChanged;
    19         // disable the warning, if we don't intend to use these events..
    20 #pragma warning disable 67
    2118        public event StatusChangedEventHandler OnPluginStatusChanged;
    2219        public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
    2320        public event PluginProgressChangedEventHandler OnPluginProgressChanged;
    24 #pragma warning restore
    2521
    2622        public CaesarAnalysisHelper()
     
    5955        }
    6056
    61         /*private string dictionary;
    62         [PropertyInfo(Direction.Input, "Dictionary", "Dictionary for Bruteforce attack", null, false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    63         public string Dictionary
    64         {
    65             get { return dictionary; }
    66             set
    67             {
    68                 dictionary = value;
    69                 OnPropertyChanged("Dictionary");
    70             }
    71         }
    72 
    73         private string bruteForceDecryptedText;
    74         [PropertyInfo(Direction.Input, "Bruteforce decrypted text", "This the text, which was decrypted by the caesar plugin.", null, false, false, DisplayLevel.Professional, QuickWatchFormat.Text, null)]
    75         public string BruteForceDecryptedText
    76         {
    77             get { return bruteForceDecryptedText; }
    78             set
    79             {
    80                 bruteForceDecryptedText = value;
    81                 OnPropertyChanged("BruteForceDecryptedText");
    82             }
    83         }*/
    84 
    8557        private int key;
    8658        [PropertyInfo(Direction.OutputData, "Key", "This is the estimated key.", "", true, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     
    9365        }
    9466
    95         /*private string bruteForceEncryptedText;
    96         [PropertyInfo(Direction.Output, "Bruteforce encrypted text", "This the text, which should be encrypted by the caesar plugin with bruteforce.", null, false, false, DisplayLevel.Professional, QuickWatchFormat.Text, null)]
    97         public string BruteForceEnCryptedText
    98         {
    99             get { return bruteForceEncryptedText; }
    100             set
    101             {
    102                 bruteForceEncryptedText = value;
    103                 OnPropertyChanged("BruteForceEncryptedText");
    104             }
    105         }
    106 
    107         private int bruteForceKeyOutput;
    108         [PropertyInfo(Direction.Output, "Bruteforce key", "This key should be connected to the caesar bruteforce plugin.", null, false, false, DisplayLevel.Professional, QuickWatchFormat.Text, null)]
    109         public int BruteForceKeyOutput
    110         {
    111             get { return bruteForceKeyOutput; }
    112             set
    113             {
    114                 bruteForceKeyOutput = value;
    115                 OnPropertyChanged("BruteForceKeyOutput");
    116             }
    117         }*/
    118 
    119         public void CryptoAnalysis()
     67        private void CryptoAnalysis()
    12068        {
    12169            var KeyList = new Dictionary<int, int>();
    12270            int Counter = 0;
    123             foreach (var i in CountChars(frequencyList))
     71            foreach (var i in CountChars(frequencyList.ToLower()))
    12472            {
    12573                if (Counter < 5)
     
    13684
    13785            Counter = 0;
    138             foreach (var i in CountBigrams(encryptedText))
     86            foreach (var i in CountBigrams(encryptedText.ToLower()))
    13987            {
    14088                if (Counter < 5)
Note: See TracChangeset for help on using the changeset viewer.