Пример #1
0
        //decryption
        private void дишифруванняToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (number_decryption)
            {
                case 1:
                    Caesar decryption_Caesar = new Caesar();
                    richTextBox1.Text = decryption_Caesar.decryption(richTextBox1.Text);
                    break;

                case 2:
                    Tritemius decryption_Tritemius = new Tritemius();
                    richTextBox1.Text = decryption_Tritemius.decryption(richTextBox1.Text);
                    break;

                case 3:
                    gamm decryption_Gamm = new gamm();
                    richTextBox1.Text = decryption_Gamm.decryption(richTextBox1.Text);
                    break;

                case 4:
                    Book_code decryption_Book_code = new Book_code();
                    richTextBox1.Text = decryption_Book_code.decryption(richTextBox1.Text);
                    break;

                case 5:

                    DES decryption_DES = new DES();
                    richTextBox1.Text = decryption_DES.decryption(richTextBox1.Text, cryptic.Key, cryptic.IV);
                    break;

                case 0:
                    MessageBox.Show("Виберіть метод дешифрування", "Error:", MessageBoxButtons.OK);
                    break;
            }
        }
Пример #2
0
        //decryption
        private void дишифруванняToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (number_decryption)
            {
            case 1:
                Caesar decryption_Caesar = new Caesar();
                richTextBox1.Text = decryption_Caesar.decryption(richTextBox1.Text);
                break;

            case 2:
                Tritemius decryption_Tritemius = new Tritemius();
                richTextBox1.Text = decryption_Tritemius.decryption(richTextBox1.Text);
                break;

            case 3:
                gamm decryption_Gamm = new gamm();
                richTextBox1.Text = decryption_Gamm.decryption(richTextBox1.Text);
                break;

            case 4:
                Book_code decryption_Book_code = new Book_code();
                richTextBox1.Text = decryption_Book_code.decryption(richTextBox1.Text);
                break;

            case 5:
                DES decryption_DES = new DES();
                richTextBox1.Text = decryption_DES.decryption(richTextBox1.Text, cryptic.Key, cryptic.IV);
                break;

            case 6:
                Backpack decryption_Backpack = new Backpack();
                richTextBox1.Text = decryption_Backpack.decryption(richTextBox1.Text);
                break;

            case 7:
                RSA decryption_RSA = new RSA();
                decryption_RSA.Encrypti_byte = RSA;
                Book_code_Form q = new Book_code_Form();
                q.Get_button4_Visible(false);
                q.ShowDialog();
                string st_key = q.Get_Key_backpack();

                richTextBox1.Text = decryption_RSA.decryption(richTextBox1.Text, st_key);
                //label1.Visible = false;
                break;

            case 0:
                MessageBox.Show("Виберіть метод дешифрування", "Error:", MessageBoxButtons.OK);
                break;
            }
        }