コード例 #1
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;
            } 
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: dimakruhlyi/NTUU-KPI-projects
        //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;
            }
        }