private void buttonSetPQ_Click(object sender, RoutedEventArgs e) { try { BigInteger p = BigInteger.Parse(textBoxP.Text); BigInteger q = BigInteger.Parse(textBoxQ.Text); rsa = new Cyphers.RSA(p, q); textBoxKeySize.Text = rsa.KeySize.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonGeneratePQ_Click(object sender, RoutedEventArgs e) { try { rsa = new Cyphers.RSA(int.Parse(textBoxKeySize.Text)); rsa.GeneratePQ(); textBoxP.Text = rsa.P.ToString(); textBoxQ.Text = rsa.Q.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }