using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e);
private RSACryptoServiceProvider rsa;
private string acik;
private string ozel;
private void button1_Click(object sender, EventArgs e)
{
rsa = new RSACryptoServiceProvider();
acik = rsa.ToXmlString(false);
ozel = rsa.ToXmlString(true);
string duzMetin = textBox1.Text;
UTF32Encoding utf = new UTF32Encoding();
byte[] ddizi = utf.GetBytes(duzMetin);
byte[] sdizi = rsa.Encrypt(ddizi,false);
string gorunurMetin = Convert.ToBase64String(sdizi);
MessageBox.Show(acik);
MessageBox.Show(ozel);
textBox2.Text = gorunurMetin;
}
private void button2_Click(object sender, EventArgs e)
{
string gorunurMetin = textBox2.Text;
byte[] sdizi = Convert.FromBase64String(gorunurMetin);
byte[] dDidiz = rsa.Decrypt(sdizi,false);
UTF32Encoding utf = new UTF32Encoding();
string duzMetin = utf.GetString(dDidiz);
MessageBox.Show(duzMetin);
}
}
}
nerede hata var verdiği hata söyle :
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e);
private RSACryptoServiceProvider rsa;
private string acik;
private string ozel;
private void button1_Click(object sender, EventArgs e)
{
rsa = new RSACryptoServiceProvider();
acik = rsa.ToXmlString(false);
ozel = rsa.ToXmlString(true);
string duzMetin = textBox1.Text;
UTF32Encoding utf = new UTF32Encoding();
byte[] ddizi = utf.GetBytes(duzMetin);
byte[] sdizi = rsa.Encrypt(ddizi,false);
string gorunurMetin = Convert.ToBase64String(sdizi);
MessageBox.Show(acik);
MessageBox.Show(ozel);
textBox2.Text = gorunurMetin;
}
private void button2_Click(object sender, EventArgs e)
{
string gorunurMetin = textBox2.Text;
byte[] sdizi = Convert.FromBase64String(gorunurMetin);
byte[] dDidiz = rsa.Decrypt(sdizi,false);
UTF32Encoding utf = new UTF32Encoding();
string duzMetin = utf.GetString(dDidiz);
MessageBox.Show(duzMetin);
}
}
}
nerede hata var verdiği hata söyle :
