source: trunk/CrypPlugins/DES/DESSettings.cs @ 2061

Last change on this file since 2061 was 1157, checked in by Arno Wacker, 12 years ago

AnotherEditor

  • Yet another Invoke during a single log message changed into BeginInvoke

IControlEncryption

  • Removed obsolete signature

CryptoolStream

  • Added a try-catch when deleting a file. An exception occurs when the file is locked. Clearly, in this case there not much one can do.. the file remains on the disk. Waiting for CStream...

AES, DES, SDES

  • Cleanup of IControl interface and general code cleanup
  • Fixed compatibility with KeySearcher - now all three should work again. (However, kind of slow)

StreamToStringConverter

  • Updated license

Sample update

  • KeySearcher-Sample-DES.cte, KeySearcher-Sample-DES.cte, KeySearcher-Sample-SDES.cte: Compatibility with IControl changes and slight rearrangement.
  • P2P-DES-BruteforceManger.cte, P2P-DES-BruteforceWorker.cte: Compatibility

New binaries

  • CrypWin.exe
  • AnotherEditor.dll
File size: 3.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Cryptool.PluginBase;
6using System.IO;
7using System.ComponentModel;
8using Cryptool.PluginBase.Cryptography;
9
10namespace Cryptool.Plugins.Cryptography.Encryption
11{
12    public class DESSettings : ISettings
13    {
14        private bool hasChanges = false;
15        private int action = 0; //0=encrypt, 1=decrypt
16        private int mode = 0; //0="ECB", 1="CBC", 2="CFB", 3="OFB"
17        private int padding = 0; //0="Zeros"=default, 1="None", 2="PKCS7", 3="ANSIX923", 4="ISO10126"
18       
19        [ContextMenu("Action","Do you want the input data to be encrypted or decrypted?",1, DisplayLevel.Beginner, ContextMenuControlType.ComboBox, new int[] { 1, 2}, "Encrypt","Decrypt")]
20        [TaskPane("Action", "Do you want the input data to be encrypted or decrypted?", null, 1, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "Encrypt", "Decrypt" })]
21        public int Action
22        {
23            get { return this.action; }
24            set
25            {
26                if (((int)value) != action) hasChanges = true;
27                this.action = (int)value;
28                OnPropertyChanged("Action");
29            }
30        }
31
32        [ContextMenu("Chaining mode","Select the block cipher mode of operation.",2,DisplayLevel.Beginner,ContextMenuControlType.ComboBox,null, new String[] {"Electronic Code Book (ECB)","Cipher Block Chaining (CBC)","Cipher Feedback (CFB)"})]
33        [TaskPane("Chaining Mode", "Select the block cipher mode of operation.", null, 2, false, DisplayLevel.Experienced, ControlType.ComboBox, new String[] { "Electronic Bode Book (ECB)","Cipher Block Chaining (CBC)","Cipher Feedback (CFB)" })]
34        public int Mode
35        {
36            get { return this.mode; }
37            set
38            {
39                if (((int)value) != mode) hasChanges = true;
40                this.mode = (int)value;
41                OnPropertyChanged("Mode");
42            }
43        }
44
45        [ContextMenu("Padding mode","Select a mode to fill partial data blocks.",3,DisplayLevel.Beginner, ContextMenuControlType.ComboBox,null,"Zeros","None","PKCS7","ANSIX923","ISO10126")]
46        [TaskPane("Padding Mode", "Select a mode to fill partial data blocks.", "", 3, false, DisplayLevel.Experienced, ControlType.ComboBox, new String[] { "Zeros", "None", "PKCS7", "ANSIX923","ISO10126" })]
47        public int Padding
48        {
49            get { return this.padding; }
50            set
51            {
52                if (((int)value) != padding) hasChanges = true;
53                this.padding = (int)value;
54                OnPropertyChanged("Padding");
55            }
56        }
57
58        public bool HasChanges
59        {
60            get { return hasChanges; }
61            set { hasChanges = value; }
62        }
63
64        #region INotifyPropertyChanged Members
65
66        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
67
68        protected void OnPropertyChanged(string name)
69        {
70            if (PropertyChanged != null)
71            {
72                PropertyChanged(this, new PropertyChangedEventArgs(name));
73            }
74        }
75
76        #endregion
77
78    }
79}
Note: See TracBrowser for help on using the repository browser.