Ejemplo n.º 1
0
        private void btnMode2_Click(object sender, EventArgs e)
        {
            string signedDigest = RSACryptoHelper.SignData(plainText, privateKey);

            txtBoxResult.Text = signedDigest + "\r\n";

            bool isCorrect = RSACryptoHelper.VerifyData(plainText, signedDigest, publicKey);

            txtBoxResult.Text += isCorrect.ToString();
        }
Ejemplo n.º 2
0
        private void btnMode1_Click(object sender, EventArgs e)
        {
            string encrytedText = RSACryptoHelper.Encrypt(publicKey, plainText);

            txtBoxResult.Text = encrytedText + "\r\n";

            string clearText = RSACryptoHelper.Decrypt(privateKey, encrytedText);

            txtBoxResult.Text += clearText;
        }