public ModeCipherSelectionForm()
        {
            InitializeComponent();

            var _blockCiphers = new[]
                {
                    new BlockCipher(new AesEngine()),
                    new BlockCipher(new BlowfishEngine()),
                    new BlockCipher(new DesEdeEngine()),
                    new BlockCipher(new IdeaEngine()),
                    new BlockCipher(new Cast5Engine()),
                    new BlockCipher(new Gost28147Engine()),
                    new BlockCipher(new DesEngine())
                };

            var _cipherModes = new BlockChiperMode[]
                {
                    new CbcMode(),
                    new CfbMode(),
                    new EcbMode(),
                    new OfbMode()
                };

            CipherList.Items.AddRange(_blockCiphers);
            ModeList.Items.AddRange(_cipherModes);

            CipherList.SelectedIndex = 0;
            ModeList.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        public Criptonator(BlockChiperMode cipherMode)
        {
            InitializeComponent();
            encrypt = new Data100();
            decrypt = new Data100();

            _mParams = new ModeParams();

            this.encodingDict = new Dictionary<string, Encoding>(){
                {Encoding.ASCII.EncodingName, Encoding.ASCII},
                {Encoding.BigEndianUnicode.EncodingName, Encoding.BigEndianUnicode},
                {Encoding.Default.EncodingName, Encoding.Default},
                {Encoding.UTF8.EncodingName, Encoding.UTF8},
                {Encoding.UTF32.EncodingName, Encoding.UTF32},
                {Encoding.Unicode.EncodingName, Encoding.Unicode},
            };

            UpdateChiper(cipherMode);
        }
Ejemplo n.º 3
0
 private void UpdateChiper(BlockChiperMode chiperMode)
 {
     this._chiperMode = chiperMode;
     this.Text = string.Format("Шифрование/Расшифрование {0} - {1}",
                               chiperMode.Chiper,
                               chiperMode);
 }