Changeset 8374


Ignore:
Timestamp:
Sep 22, 2019, 3:40:11 PM (2 years ago)
Author:
Christian Bender
Message:

DCA Components: Added default values

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/DCAKeyRecovery/DCAKeyRecoverySettings.cs

    r8264 r8374  
    2929        #region Private Variables
    3030
    31         private string _choiceOfAlgorithm;
    32         private Algorithms _currentAlgorithm;
    33         private bool _automaticMode;
    34         private bool _UIUpdateWhileExecution;
     31        private string _choiceOfAlgorithm = "0";
     32        private Algorithms _currentAlgorithm = Algorithms.Cipher1;
     33        private bool _automaticMode = false;
     34        private bool _UIUpdateWhileExecution = true;
    3535        private int _maxThreads = Environment.ProcessorCount;
    36         private int _threadCount;
     36        private int _threadCount = 1;
    3737
    3838        #endregion
  • trunk/CrypPlugins/DCAOracle/DCAOracleSettings.cs

    r8154 r8374  
    2626        #region Private Variables
    2727
    28         private int _wordSize;
     28        private int _wordSize = 16;
    2929
    3030        #endregion
  • trunk/CrypPlugins/DCAPathFinder/DCAPathFinderSettings.cs

    r8361 r8374  
    3030        #region Private Variables
    3131
    32         private int _chosenMessagePairsCount;
    33         private string _choiceOfAlgorithm;
    34         private Algorithms _currentAlgorithm;
    35         private string _choiceOfSearchPolicy;
    36         private SearchPolicy _currentSearchPolicy;
    37         private string _choiceOfAbortingPolicy;
    38         private AbortingPolicy _currentAbortingPolicy;
    39         private bool _presentationMode;
    40         private bool _automaticMode;
     32        private int _chosenMessagePairsCount = 5000;
     33        private string _choiceOfAlgorithm = "0";
     34        private Algorithms _currentAlgorithm = Algorithms.Cipher1;
     35        private string _choiceOfSearchPolicy = "0";
     36        private SearchPolicy _currentSearchPolicy = SearchPolicy.FirstAllCharacteristicsDepthSearch;
     37        private string _choiceOfAbortingPolicy = "0";
     38        private AbortingPolicy _currentAbortingPolicy = AbortingPolicy.Threshold;
     39        private bool _presentationMode = true;
     40        private bool _automaticMode =false;
    4141        private int _maxThreads = Environment.ProcessorCount;
    42         private int _threadCount;
    43         private bool _useOfflinePaths;
     42        private int _threadCount = 1;
     43        private bool _useOfflinePaths = false;
    4444        private double _thresholdDifferentialSearch;
    4545        private double _thresholdCharacteristicSearch;
  • trunk/CrypPlugins/DCAPathFinder/UI/DCAPathFinderPres.xaml.cs

    r8361 r8374  
    864864                                        view.SBox4Round2.IsClickable = false;
    865865                                    }
     866                                    else
     867                                    {
     868                                        view.SBox4Round2.IsClickable = true;
     869                                    }
    866870
    867871                                    if (SBoxesAlreadyAttacked[2])
     
    870874                                        view.SBox3Round2.IsClickable = false;
    871875                                    }
     876                                    else
     877                                    {
     878                                        view.SBox3Round2.IsClickable = true;
     879                                    }
    872880
    873881                                    if (SBoxesAlreadyAttacked[1])
     
    876884                                        view.SBox2Round2.IsClickable = false;
    877885                                    }
     886                                    else
     887                                    {
     888                                        view.SBox2Round2.IsClickable = true;
     889                                    }
    878890
    879891                                    if (SBoxesAlreadyAttacked[0])
     
    881893                                        view.SBox1Round2.AlreadyAttacked = true;
    882894                                        view.SBox1Round2.IsClickable = false;
     895                                    }
     896                                    else
     897                                    {
     898                                        view.SBox1Round2.IsClickable = true;
    883899                                    }
    884900
     
    11931209                                        view.SBox1Round5.IsClickable = true;
    11941210                                    }
    1195 
    1196                                     if (UseOfflinePaths)
    1197                                     {
    1198                                         if (_SBoxesCurrentAttack[3])
    1199                                         {
    1200                                             view.SBox4Round5.IsClickable = false;
    1201                                             view.SBox4Round5.SetOfflineSelected();
    1202                                         }
    1203 
    1204                                         if (_SBoxesCurrentAttack[2])
    1205                                         {
    1206                                             view.SBox3Round5.IsClickable = false;
    1207                                             view.SBox3Round5.SetOfflineSelected();
    1208                                         }
    1209 
    1210                                         if (_SBoxesCurrentAttack[1])
    1211                                         {
    1212                                             view.SBox2Round5.IsClickable = false;
    1213                                             view.SBox2Round5.SetOfflineSelected();
    1214                                         }
    1215 
    1216                                         if (_SBoxesCurrentAttack[0])
    1217                                         {
    1218                                             view.SBox1Round5.IsClickable = false;
    1219                                             view.SBox1Round5.SetOfflineSelected();
    1220                                         }
    1221 
    1222                                         view.SBox4Round5.IsClickable = false;
    1223                                         view.SBox3Round5.IsClickable = false;
    1224                                         view.SBox2Round5.IsClickable = false;
    1225                                         view.SBox1Round5.IsClickable = false;
    1226                                     }
    1227 
    12281211
    12291212                                    //setup pres content
     
    25742557                {
    25752558                    //check if next is possible
    2576                     if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] &&
    2577                         !_SBoxesCurrentAttack[3] && PresentationMode && (StepCounter == 22 || StepCounter == 25))
     2559                    if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] && !_SBoxesCurrentAttack[3] && PresentationMode && (StepCounter == 22 || StepCounter == 25))
    25782560                    {
    25792561                        if (MessageToDisplayOccured != null)
     2562                        {
    25802563                            MessageToDisplayOccured.Invoke(this, new MessageEventArgs()
    25812564                            {
    25822565                                message = Properties.Resources.SBoxWarning
    25832566                            });
     2567                        }
     2568
    25842569                        return;
    25852570                    }
    2586                     else if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] &&
    2587                              !_SBoxesCurrentAttack[3] && !PresentationMode &&
    2588                              (StepCounter == 1 || StepCounter == 4))
     2571                    else if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] && !_SBoxesCurrentAttack[3] && !PresentationMode && (StepCounter == 1 || StepCounter == 4))
    25892572                    {
    25902573                        if (MessageToDisplayOccured != null)
     2574                        {
    25912575                            MessageToDisplayOccured.Invoke(this, new MessageEventArgs()
    25922576                            {
    25932577                                message = Properties.Resources.SBoxWarning
    25942578                            });
     2579                        }
     2580
    25952581                        return;
    25962582                    }
     
    26012587                {
    26022588                    //check if next is possible
    2603                     if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] &&
    2604                         !_SBoxesCurrentAttack[3] && PresentationMode &&
    2605                         (StepCounter == 15 || StepCounter == 18 || StepCounter == 21 || StepCounter == 24))
     2589                    if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] && !_SBoxesCurrentAttack[3] && PresentationMode && (StepCounter == 15 || StepCounter == 18 || StepCounter == 21 || StepCounter == 24))
    26062590                    {
    26072591                        if (MessageToDisplayOccured != null)
     2592                        {
    26082593                            MessageToDisplayOccured.Invoke(this, new MessageEventArgs()
    26092594                            {
    26102595                                message = Properties.Resources.SBoxWarning
    26112596                            });
     2597                        }
     2598
    26122599                        return;
    26132600                    }
    2614                     else if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] &&
    2615                              !_SBoxesCurrentAttack[3] && !PresentationMode &&
    2616                              (StepCounter == 1 || StepCounter == 4 || StepCounter == 7 || StepCounter == 10))
     2601                    else if (!_SBoxesCurrentAttack[0] && !_SBoxesCurrentAttack[1] && !_SBoxesCurrentAttack[2] && !_SBoxesCurrentAttack[3] && !PresentationMode && (StepCounter == 1 || StepCounter == 4 || StepCounter == 7 || StepCounter == 10))
    26172602                    {
    26182603                        if (MessageToDisplayOccured != null)
     2604                        {
    26192605                            MessageToDisplayOccured.Invoke(this, new MessageEventArgs()
    26202606                            {
    26212607                                message = Properties.Resources.SBoxWarning
    26222608                            });
     2609                        }
     2610
    26232611                        return;
    26242612                    }
     
    26352623                {
    26362624                    ev.Increment = _progressIncrement * StepCounter;
    2637                     ProgressChangedOccured.Invoke(this, ev);
     2625                    if (ProgressChangedOccured != null)
     2626                    {
     2627                        ProgressChangedOccured.Invoke(this, ev);
     2628                    }
    26382629                }
    26392630                else if (!PresentationMode && !AutomaticMode)
  • trunk/CrypPlugins/DCAPathVisualiser/DCAPathVisualiser.cs

    r8216 r8374  
    5454        /// Input for the differential
    5555        /// </summary>
    56         [PropertyInfo(Direction.InputData, "DifferentialInput", "DifferentialInputToolTip")]
     56        [PropertyInfo(Direction.InputData, "DifferentialInput", "DifferentialInputToolTip", true)]
    5757        public string Differential
    5858        {
     
    9494            {
    9595                _pres.WorkspaceRunning = true;
     96                _pres.CurrentAlgorithm = _settings.CurrentAlgorithm;
    9697            }, null);
    9798        }
     
    103104        {
    104105            ProgressChanged(0, 1);
     106
     107            //check for null
     108            if (Differential == null)
     109                return;
    105110
    106111            DifferentialAttackRoundConfiguration conf = ReadConfiguration(Differential);
  • trunk/CrypPlugins/DCAPathVisualiser/DCAPathVisualiserSettings.cs

    r8159 r8374  
    2727        #region Private Variables
    2828
    29         private string _choiceOfAlgorithm;
    30         private Algorithms _currentAlgorithm;
     29        private string _choiceOfAlgorithm = "0";
     30        private Algorithms _currentAlgorithm = Algorithms.Cipher1;
    3131
    3232        #endregion
  • trunk/CrypPlugins/DCAPathVisualiser/UI/PathVisualiserPres.xaml.cs

    r8258 r8374  
    537537                    case Algorithms.Cipher1:
    538538                    {
     539                        /* */
    539540                        _cipherControl = new Cipher1Characteristic();
    540541                        _tableControl = new Cipher1Table();
    541542                        TabItemCipher.Content = _cipherControl;
    542543                        TabItemTable.Child = _tableControl;
     544                       
    543545                    }
    544546                        break;
  • trunk/CrypPlugins/DCAToyCiphers/DCAToyCiphers.cs

    r8221 r8374  
    6969        /// Input for messages
    7070        /// </summary>
    71         [PropertyInfo(Direction.InputData, "MessageInput", "MessageInputTooltip")]
     71        [PropertyInfo(Direction.InputData, "MessageInput", "MessageInputTooltip", true)]
    7272        public ICryptoolStream MessageInput
    7373        {
     
    9797        /// Input for the key
    9898        /// </summary>
    99         [PropertyInfo(Direction.InputData, "KeyInput", "KeyInputTooltip")]
     99        [PropertyInfo(Direction.InputData, "KeyInput", "KeyInputTooltip", true)]
    100100        public byte[] KeyInput
    101101        {
     
    133133        public void PreExecution()
    134134        {
    135            
     135            //Check specific algorithm and invoke the selection into the UI class
     136            if (settings.CurrentAlgorithm == Algorithms.Cipher1)
     137            {
     138                //dispatch action: clear the active grid and add the specific algorithm visualization
     139                _activePresentation.Dispatcher.Invoke(DispatcherPriority.Send, (SendOrPostCallback)delegate
     140                {
     141                    _activePresentation.MainGrid.Children.Clear();
     142                    _activePresentation.MainGrid.Children.Add(new Cipher1Pres());
     143                }, null);
     144            }
     145            else if (settings.CurrentAlgorithm == Algorithms.Cipher2)
     146            {
     147                _activePresentation.Dispatcher.Invoke(DispatcherPriority.Send, (SendOrPostCallback)delegate
     148                {
     149                    _activePresentation.MainGrid.Children.Clear();
     150                    _activePresentation.MainGrid.Children.Add(new Cipher2Pres());
     151                }, null);
     152            }
     153            else if (settings.CurrentAlgorithm == Algorithms.Cipher3)
     154            {
     155                _activePresentation.Dispatcher.Invoke(DispatcherPriority.Send, (SendOrPostCallback)delegate
     156                {
     157                    _activePresentation.MainGrid.Children.Clear();
     158                    _activePresentation.MainGrid.Children.Add(new Cipher3Pres());
     159                }, null);
     160            }
     161            else if (settings.CurrentAlgorithm == Algorithms.Cipher4)
     162            {
     163                _activePresentation.Dispatcher.Invoke(DispatcherPriority.Send, (SendOrPostCallback)delegate
     164                {
     165                    _activePresentation.MainGrid.Children.Clear();
     166                    _activePresentation.MainGrid.Children.Add(new Cipher4Pres());
     167                }, null);
     168            }
    136169        }
    137170
  • trunk/CrypPlugins/DCAToyCiphers/DCAToyCiphersSettings.cs

    r8221 r8374  
    2727        #region Private Variables
    2828
    29         private string _choiceOfAlgorithm;
    30         private string _choiceOfMode;
    31         private Algorithms _currentAlgorithm;
    32         private Mode _currentMode;
     29        private string _choiceOfAlgorithm = "0";
     30        private string _choiceOfMode ="0";
     31        private Algorithms _currentAlgorithm = Algorithms.Cipher1;
     32        private Mode _currentMode = Mode.Decrypt;
    3333
    3434        #endregion
  • trunk/Templates/Cryptanalysis/Modern/Differential_Cryptanalysis_Tutorial_1.xml

    r8364 r8374  
    2626        <replacement key="$Decoder$" value="Zu Binär" />
    2727        <replacement key="$Encoder$" value="Zu Text (1 0)" />
    28         <replacement key="$DCAOracleDesc$" value="DKA Orakel und DKA ToyCiphers bilden zusammen eine Einheit zur Generierung der Block-Paare" />
     28        <replacement key="$DCAOracleDesc$" value="DKA Orakel und DKA ToyCiphers bilden zusammen eine Einheit zur Generierung der Block-Paare." />
    2929        <replacement key="$DCADesc$" value="Diese Vorlage ist Teil eines Tutorials zur differenziellen Kryptoanalyse (DKA).\line\line DKA ist ein probabilistisches Verfahren zur Analyse von symmetrischen Blockchiffren. Mit diesem Angriff versucht man iterativ, die Rundenschlüssel wiederherzustellen. Hauptelement der DKA sind Paare von Klartext-Blöcken, die sich in einer bestimmten Differenz unterscheiden. Es wird versucht, auf Basis von Wahrscheinlichkeiten, den Fluss der Blöcke durch die Chiffre zu bestimmen und dadurch die Rundenschlüssel zu bestimmen.\line\line Das Tutorial zur differenziellen Kryptoanalyse gliedert sich in 3 Teile, die in ansteigendem Schwierigkeitsgrad jeweils eine andere Chiffre analysieren. In jedem Tutorial wird ein bestimmter Teil des Verfahrens kleinschrittig präsentiert, sodass am Ende von Tutorial 3 eine gute Vorstellung des Angriffs vermittelt wurde. Zu jedem Tutorial gibt es eine Vorlage.
    3030        \line\line Näheres zu den Tutorials steht zu Beginn in der Präsentation der Komponente DKA PfadFinder, die Chiffren der Tutorials sind in der Online-Hilfe der DKA ToyCiphers-Komponente spezifiziert.
     
    4949        <replacement key="$Decoder$" value="To binary" />
    5050        <replacement key="$Encoder$" value="To text (1 0)" />
    51         <replacement key="$DCAOracleDesc$" value="DCA Oracle and DCA ToyCiphers together form a unit for generating the block pairs" />
     51        <replacement key="$DCAOracleDesc$" value="DCA Oracle and DCA ToyCiphers together form a unit for generating the block pairs." />
    5252        <replacement key="$DCADesc$" value="This template is part of a tutorial on differential cryptanalysis (DCA).\line\line DCA is a probabilistic method for the analysis of symmetric block ciphers. With this attack one tries to iteratively restore the subkeys. Main element of the DCA are pairs of plaintext blocks, which differ in a certain difference. It is attempted to determine the flow of blocks through the cipher on the basis of probabilities and thus to determine the subbkeys.\line\line The tutorial on differential cryptanalysis is divided into 3 parts, each of which analyzes a different cipher with increasing difficulty. In each tutorial a certain part of the procedure is presented in small steps, so that at the end of tutorial 3 a good idea of the attack was given. There is a template for each tutorial.
    5353        \line\line More information about the tutorials can be found in the presentation of the DCA PathFinder component, the tutorial ciphers are specified in the online help of the DCA ToyCiphers component.
  • trunk/Templates/Cryptanalysis/Modern/Differential_Cryptanalysis_Tutorial_2.xml

    r8364 r8374  
    2626        <replacement key="$Decoder$" value="Zu Binär" />
    2727        <replacement key="$Encoder$" value="Zu Text (1 0)" />
    28         <replacement key="$DCAOracleDesc$" value="DKA Orakel und DKA ToyCiphers bilden zusammen eine Einheit zur Generierung der Block-Paare" />
     28        <replacement key="$DCAOracleDesc$" value="DKA Orakel und DKA ToyCiphers bilden zusammen eine Einheit zur Generierung der Block-Paare." />
    2929        <replacement key="$DCADesc$" value="Diese Vorlage ist Teil eines Tutorials zur differenziellen Kryptoanalyse (DKA).\line\line DKA ist ein probabilistisches Verfahren zur Analyse von symmetrischen Blockchiffren. Mit diesem Angriff versucht man iterativ, die Rundenschlüssel wiederherzustellen. Hauptelement der DKA sind Paare von Klartext-Blöcken, die sich in einer bestimmten Differenz unterscheiden. Es wird versucht, auf Basis von Wahrscheinlichkeiten, den Fluss der Blöcke durch die Chiffre zu bestimmen und dadurch die Rundenschlüssel zu bestimmen.\line\line Das Tutorial zur differenziellen Kryptoanalyse gliedert sich in 3 Teile, die in ansteigendem Schwierigkeitsgrad jeweils eine andere Chiffre analysieren. In jedem Tutorial wird ein bestimmter Teil des Verfahrens kleinschrittig präsentiert, sodass am Ende von Tutorial 3 eine gute Vorstellung des Angriffs vermittelt wurde. Zu jedem Tutorial gibt es eine Vorlage.
    3030        \line\line Näheres zu den Tutorials steht zu Beginn in der Präsentation der Komponente DKA PfadFinder, die Chiffren der Tutorials sind in der Online-Hilfe der DKA ToyCiphers-Komponente spezifiziert.
     
    4949        <replacement key="$Decoder$" value="To binary" />
    5050        <replacement key="$Encoder$" value="To text (1 0)" />
    51         <replacement key="$DCAOracleDesc$" value="DCA Oracle and DCA ToyCiphers together form a unit for generating the block pairs" />
     51        <replacement key="$DCAOracleDesc$" value="DCA Oracle and DCA ToyCiphers together form a unit for generating the block pairs." />
    5252        <replacement key="$DCADesc$" value="This template is part of a tutorial on differential cryptanalysis (DCA).\line\line DCA is a probabilistic method for the analysis of symmetric block ciphers. With this attack one tries to iteratively restore the subkeys. Main element of the DCA are pairs of plaintext blocks, which differ in a certain difference. It is attempted to determine the flow of blocks through the cipher on the basis of probabilities and thus to determine the subbkeys.\line\line The tutorial on differential cryptanalysis is divided into 3 parts, each of which analyzes a different cipher with increasing difficulty. In each tutorial a certain part of the procedure is presented in small steps, so that at the end of tutorial 3 a good idea of the attack was given. There is a template for each tutorial.
    5353        \line\line More information about the tutorials can be found in the presentation of the DCA PathFinder component, the tutorial ciphers are specified in the online help of the DCA ToyCiphers component.
  • trunk/Templates/Cryptanalysis/Modern/Differential_Cryptanalysis_Tutorial_3.xml

    r8364 r8374  
    2626        <replacement key="$Decoder$" value="Zu Binär" />
    2727        <replacement key="$Encoder$" value="Zu Text (1 0)" />
    28         <replacement key="$DCAOracleDesc$" value="DKA Orakel und DKA ToyCiphers bilden zusammen eine Einheit zur Generierung der Block-Paare" />
     28        <replacement key="$DCAOracleDesc$" value="DKA Orakel und DKA ToyCiphers bilden zusammen eine Einheit zur Generierung der Block-Paare." />
    2929        <replacement key="$DCADesc$" value="Diese Vorlage ist Teil eines Tutorials zur differenziellen Kryptoanalyse (DKA).\line\line DKA ist ein probabilistisches Verfahren zur Analyse von symmetrischen Blockchiffren. Mit diesem Angriff versucht man iterativ, die Rundenschlüssel wiederherzustellen. Hauptelement der DKA sind Paare von Klartext-Blöcken, die sich in einer bestimmten Differenz unterscheiden. Es wird versucht, auf Basis von Wahrscheinlichkeiten, den Fluss der Blöcke durch die Chiffre zu bestimmen und dadurch die Rundenschlüssel zu bestimmen.\line\line Das Tutorial zur differenziellen Kryptoanalyse gliedert sich in 3 Teile, die in ansteigendem Schwierigkeitsgrad jeweils eine andere Chiffre analysieren. In jedem Tutorial wird ein bestimmter Teil des Verfahrens kleinschrittig präsentiert, sodass am Ende von Tutorial 3 eine gute Vorstellung des Angriffs vermittelt wurde. Zu jedem Tutorial gibt es eine Vorlage.
    3030        \line\line Näheres zu den Tutorials steht zu Beginn in der Präsentation der Komponente DKA PfadFinder, die Chiffren der Tutorials sind in der Online-Hilfe der DKA ToyCiphers-Komponente spezifiziert.
     
    4949        <replacement key="$Decoder$" value="To binary" />
    5050        <replacement key="$Encoder$" value="To text (1 0)" />
    51         <replacement key="$DCAOracleDesc$" value="DCA Oracle and DCA ToyCiphers together form a unit for generating the block pairs" />
     51        <replacement key="$DCAOracleDesc$" value="DCA Oracle and DCA ToyCiphers together form a unit for generating the block pairs." />
    5252        <replacement key="$DCADesc$" value="This template is part of a tutorial on differential cryptanalysis (DCA).\line\line DCA is a probabilistic method for the analysis of symmetric block ciphers. With this attack one tries to iteratively restore the subkeys. Main element of the DCA are pairs of plaintext blocks, which differ in a certain difference. It is attempted to determine the flow of blocks through the cipher on the basis of probabilities and thus to determine the subbkeys.\line\line The tutorial on differential cryptanalysis is divided into 3 parts, each of which analyzes a different cipher with increasing difficulty. In each tutorial a certain part of the procedure is presented in small steps, so that at the end of tutorial 3 a good idea of the attack was given. There is a template for each tutorial.
    5353        \line\line More information about the tutorials can be found in the presentation of the DCA PathFinder component, the tutorial ciphers are specified in the online help of the DCA ToyCiphers component.
Note: See TracChangeset for help on using the changeset viewer.