Пример #1
0
        private void buttonGenerateP_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                diffiHellman = new Diffi_Hellman(int.Parse(textBoxSizeInBits.Text));
                diffiHellman.GeneratePG();

                textBoxPDiffiHellman.Text = diffiHellman.P.ToString();
                textBoxG.Text             = diffiHellman.G.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
        private void buttonSetP_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BigInteger p = BigInteger.Parse(textBoxPDiffiHellman.Text);
                BigInteger g = BigInteger.Parse(textBoxG.Text);
                diffiHellman = new Diffi_Hellman(p, g);

                textBoxSizeInBits.Text = diffiHellman.KeySize.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #3
0
        private void buttonGenerateP_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                diffiHellman = new Diffi_Hellman(int.Parse(textBoxSizeInBits.Text));
                diffiHellman.GeneratePG();

                textBoxPDiffiHellman.Text = diffiHellman.P.ToString();
                textBoxG.Text = diffiHellman.G.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #4
0
        private void buttonSetP_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BigInteger p = BigInteger.Parse(textBoxPDiffiHellman.Text);
                BigInteger g = BigInteger.Parse(textBoxG.Text);
                diffiHellman = new Diffi_Hellman(p, g);

                textBoxSizeInBits.Text = diffiHellman.KeySize.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }