// decrypt private void button4_Click(object sender, EventArgs e) { using (var rsa = new RSAManager()) { var decrypted = rsa.Decrypt(textBox4.Text, textBox3.Text); textBox5.Text = decrypted; } }
// encrypt private void button2_Click(object sender, EventArgs e) { using (var rsa = new RSAManager()) { var encrypted = rsa.Encrypt(textBox2.Text, textBox1.Text); textBox3.Text = encrypted; } }
// create keys private void button1_Click(object sender, EventArgs e) { using (var rsa = new RSAManager()) { var publicKey = rsa.CreatePublicKey(); textBox1.Text = publicKey; var privateKey = rsa.CreatePrivateKey(); textBox2.Text = privateKey; } }