Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 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);
     }
 }