コード例 #1
0
ファイル: Form1.cs プロジェクト: acidreactor/encryption
        private void fromTextBoxToolStripMenuItem3_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.DESEncrypt(textBox1.Text, Key, IV);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: acidreactor/encryption
        private void fromFileToolStripMenuItem3_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.DESEncrypt(rdr.ReadToEnd(), Key, IV);
                    }
                }
            }
        }