Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        //encryption
        private void шифруванняToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (number_decryption)
            {
                case 1:
                    Caesar encryption_Caesar = new Caesar();
                    richTextBox1.Text = encryption_Caesar.encryption(richTextBox1.Text);
                    break;

                case 2:
                    Tritemius encryption_Tritemius = new Tritemius();
                    richTextBox1.Text = encryption_Tritemius.encryption(richTextBox1.Text, false);
                    break;

                case 3:
                    gamm encryption_Gamm = new gamm();
                    richTextBox1.Text = encryption_Gamm.encryption(richTextBox1.Text);
                    //label1.Text = encryption_Gamm.str_key();
                    break;

                case 4:
                    Book_code encryption_Book_code = new Book_code();
                    richTextBox1.Text = encryption_Book_code.encryption(richTextBox1.Text);
                    break;

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

                case 0:
                    MessageBox.Show("Виберіть метод шифрування", "Error:", MessageBoxButtons.OK);
                    break;
            } 
        }
Exemplo n.º 3
0
        //decryption
        private void дишифруванняToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Tritemius a = new Tritemius();
            //richTextBox1.Text = a.decryption(richTextBox1.Text);

            gamm a = new gamm();

            richTextBox1.Text = a.decryption(richTextBox1.Text);

            //Caesar a = new Caesar();
            //richTextBox1.Text = a.decryption(richTextBox1.Text);
        }
Exemplo n.º 4
0
        //encryption
        private void шифруванняToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (number_decryption)
            {
            case 1:
                Caesar encryption_Caesar = new Caesar();
                richTextBox1.Text = encryption_Caesar.encryption(richTextBox1.Text);
                break;

            case 2:
                Tritemius encryption_Tritemius = new Tritemius();
                richTextBox1.Text = encryption_Tritemius.encryption(richTextBox1.Text, false);
                break;

            case 3:
                gamm encryption_Gamm = new gamm();
                richTextBox1.Text = encryption_Gamm.encryption(richTextBox1.Text);
                //label1.Text = encryption_Gamm.str_key();
                break;

            case 4:
                Book_code encryption_Book_code = new Book_code();
                richTextBox1.Text = encryption_Book_code.encryption(richTextBox1.Text);
                break;

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

            case 6:
                Backpack encryption_Backpack = new Backpack();
                richTextBox1.Text = encryption_Backpack.encryption(richTextBox1.Text);
                break;

            case 7:
                RSA            encryption_RSA = new 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 = encryption_RSA.encryption(richTextBox1.Text, st_key);
                RSA         = encryption_RSA.Encrypti_byte;
                label1.Text = rsa.ToXmlString(false) + "\n" + rsa.ToXmlString(true);
                //label1.Visible = true;
                break;

            case 0:
                MessageBox.Show("Виберіть метод шифрування", "Error:", MessageBoxButtons.OK);
                break;
            }
        }
Exemplo n.º 5
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;
            }
        }