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

            richTextBox2.Text = encryptedText;
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var cipher = new RUCaesarCipher();

            richTextBox1.Text = "";
            var key           = Convert.ToInt32(numericUpDown1.Value);
            var encryptedText = richTextBox2.Text;
            var decryptedText = cipher.Decrypt(encryptedText, key);

            richTextBox3.Text = decryptedText;
        }