private void DiffieHellmanProcessButton_Click(object sender, EventArgs e) { if (this.DiffieHellmanGetOwnPrivateKeyLabel.Text.Length > 0) { if (this.DiffieHellmanKeyTextBox.Text.Length > 0) { string temp = Regex.Replace(this.DiffieHellmanKeyTextBox.Text, " ", string.Empty); temp = CiphersDeciphers.TransformKeyString(temp, Convert.ToInt32(this.DiffieHellmanGetOwnPrivateKeyLabel.Text)); this.DiffieHellmanAfterProcessTextBox.Text = CiphersDeciphers.VigenereEncodeDecode( this.DiffieHellmanBeforeProcessTextBox.Text, temp, this.DiffieHellmanIsToCipher ); } else { MessageBox.Show( "Введите ключ", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } }
private void VigenereProcessButton_Click(object sender, EventArgs e) { if (this.VigenereKeyTextBox.Text.Length > 0) { string temp = Regex.Replace(this.VigenereKeyTextBox.Text, " ", string.Empty); this.VigenereAfterProcessTextBox.Text = CiphersDeciphers.VigenereEncodeDecode( this.VigenereBeforeProcessTextBox.Text, temp, this.VigenereIsToCipher ); } else { MessageBox.Show( "Введите ключ", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Error ); } }