Esempio n. 1
0
 private void ChangeCipherText()
 {
     try {
         textBox_CipherText.Text    = Base64Translator.EncryptBase64(textBox_ClearText.Text, GetSelectedEncoding());
         textBox_CipherText.Enabled = true;
     } catch (FormatException) {
         textBox_CipherText.Text    = "Invalid clear text.";
         textBox_CipherText.Enabled = false;
     }
 }
Esempio n. 2
0
 private void textBox_CipherText_TextChanged(object sender, EventArgs e)
 {
     if (textBox_CipherText.Focused)
     {
         try {
             textBox_ClearText.Text    = Base64Translator.DecryptBase64(textBox_CipherText.Text, GetSelectedEncoding());
             textBox_ClearText.Enabled = true;
         } catch (FormatException) {
             textBox_ClearText.Text    = "Invalid cipher text.";
             textBox_ClearText.Enabled = false;
         }
     }
 }