Example #1
0
        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            var cipher        = new ENCaesarCipher();
            var message       = richTextBox1.Text;
            var key           = Convert.ToInt32(numericUpDown1.Value);
            var encryptedText = cipher.Encrypt(message, key);

            richTextBox2.Text = encryptedText;
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var cipher        = new ENCaesarCipher();
            var message       = richTextBox1.Text;
            var key           = Convert.ToInt32(numericUpDown1.Value);
            var encryptedText = cipher.Encrypt(message, key);

            richTextBox2.Text = encryptedText;
            var decryptedText = cipher.Decrypt(encryptedText, key);

            richTextBox3.Text = decryptedText;
        }