예제 #1
0
        private async void Btn_Decrypt_Click(object sender, EventArgs e)
        {
            if (Rdb_RsaEncrypt.Checked)
            {
                var Dec = await Rsa.DecryptAsync(Txt_PrivateKey.Text, Txt_CipherText.Text);

                Txt_PlainText.Text = Dec;
            }
            else
            {
                try
                {
                    AESCryptography Aes = new AESCryptography();
                    var             Dec = Aes.DecryptAsync(Txt_PublicKey.Text, Txt_CipherText.Text);
                    Txt_PlainText.Text = Dec;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.GetErrorMessage());
                }
            }
        }