private void buttonEncrypte_Click(object sender, EventArgs e) { #region --[this should be replaced after testing all key 1111111 output 1]-- //try //{ // EncryptionRSA rsa = new EncryptionRSA(); // string CompositeKey = rsa.KeyGenrator(); // string[] stArray = CompositeKey.Split('.'); // textBoxPublicKey.Text = stArray[0]; // textBoxPrivateKeyE.Text = stArray[1]; //} //catch //{ // MessageBox.Show("Exeption Occured"); //} #endregion try { EncryptionRSA rsa = new EncryptionRSA(); TypeConversion tp = new TypeConversion(); RSAKeys rks = new RSAKeys(); int keyPropf = rks.ValidatePublicKeys(textBoxPublicKey.Text); if (keyPropf == 0) { int b, a = 1; b = a / keyPropf; } richTextBoxEncrypte.Text = rsa.Encryptor(tp.CharToInt(richTextBoxEncrypte.Text), textBoxPublicKey.Text); buttonEncrypte.Enabled = false; buttonProceedeForCompression.Enabled = true; } catch (Exception ex) { buttonProceedeForCompression.Enabled = false; buttonEncrypte.Enabled = true; MessageBox.Show("System Can Not Encryte Your Message \n\nExplanation:\nPlease there must be text in the main text and\nGenrate/Enter correct Public Key in the respected text box\n\nExeption : " + ex.Message + "\n\nPress OK to proceede"); } #region --[this aslo belong to region 1111 output and work with it]-- //buttonSaveEncryptedCompressedText.Visible = true; //buttonEncrypte.Visible = false; #endregion }