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; }
private void button2_Click(object sender, EventArgs e) { var cipher = new ENCaesarCipher(); richTextBox1.Text = ""; var key = Convert.ToInt32(numericUpDown1.Value); var encryptedText = richTextBox2.Text; var decryptedText = cipher.Decrypt(encryptedText, key); richTextBox3.Text = decryptedText; }