private void UserSelectedAffineCipherDecyption(object sender, EventArgs e)//called when selecting "run" then "decrypt" then "advanced Cipher" then "user selected" on the strip menu { if (Dialog.FileName == "") { MessageBox.Show("Please select a valid text file", "Text file not selected", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } AffineCipherInput input = new AffineCipherInput(); // creates an input for the user to input their desired shift if (input.ShowDialog().Equals(DialogResult.OK)) // makes sure the inputted results are valid { DecryptedText = Decrypt.DecryptAffine(TextInput, input.A, input.B); // pefroms the decryption and sets the global variable as the decrypted text } }
//called when selecting "run" then "encrypt" then "Advanced Cipher" on the strip menu private void EncryptAffineCipherButton(object sender, EventArgs e) { if (Dialog.FileName == "") { MessageBox.Show("Please select a valid text file", "Text file not selected", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } AffineCipherInput input = new AffineCipherInput();// creates an input for the user to input their desired shift if (input.ShowDialog().Equals(DialogResult.OK))// makes sure the inputted results are valid { EncryptedText = Encrypt.encryptAffine(TextInput, input.A, input.B); // pefroms the encryption and sets the global variable as the encrypted text } }