コード例 #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);
     }
 }