Example #1
0
 private void OkButton_Click(object sender, EventArgs e)
 {
     if (Chek() == true)
     {
         pTextBox.Enabled = false;
         qTextBox.Enabled = false;
         n                = p * q;
         NTextBox.Text    = n.ToString();
         F                = (p - 1) * (q - 1);
         fNTextBox.Text   = F.ToString();
         eTextBox.Enabled = true;
         label6.Text      = "Выберите e и нажмите Ок";
         if (eTextBox.Text.Length != 0)
         {
             eTextBox.Enabled = false;
             if (ChekE() == true)
             {
                 d                     = RevNum(e1, F);
                 dTextBox.Text         = d.ToString();
                 eTextBox.Enabled      = true;
                 NTextBox.Enabled      = true;
                 label6.Text           = "Передайте значения e и N передающему и получите от него |m|";
                 mShifrTextBox.Enabled = true;
             }
         }
         if (mShifrTextBox.Text.Length != 0)
         {
             if (ChekMS() == true)
             {
                 mShifr        = FormBob.ConvertNumber(mShifrTextBox.Text);
                 m             = BigInteger.ModPow(mShifr, d, n);
                 mTextBox.Text = FormBob.ConvertNumber(m);
             }
         }
     }
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormBob formBob = new FormBob();

            formBob.Show();
        }