Esempio n. 1
0
        private void fromTextBoxToolStripMenuItem4_Click(object sender, EventArgs e)
        {
            DESParams frm = new DESParams();

            frm.ShowDialog();

            string Key = frm.GetSecretKey();
            string IV  = frm.GetInitializingVector();

            if (Key.Length > 0 && IV.Length > 0)
            {
                textBox2.Text = Shifrator.DESDecrypt(textBox1.Text, Key, IV);
            }
        }
Esempio n. 2
0
        private void fromFileToolStripMenuItem4_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                DESParams frm = new DESParams();
                frm.ShowDialog();

                string Key = frm.GetSecretKey();
                string IV  = frm.GetInitializingVector();
                if (Key.Length > 0 && IV.Length > 0)
                {
                    using (StreamReader rdr = new StreamReader(openFileDialog1.FileName))
                    {
                        textBox2.Text = Shifrator.DESDecrypt(rdr.ReadToEnd(), Key, IV);
                    }
                }
            }
        }