예제 #1
0
 // 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;
     }
 }
예제 #2
0
 //  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;
     }
 }
예제 #3
0
        // 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;
            }
        }