Esempio n. 1
0
 private void SimpleDecryptBt_Click(object sender, RoutedEventArgs e)
 {//symmetric
     // Decrypt the bytes to a string.
     //txtdecryptedTB.Text = Symmetric_Encrypted.Decrypt(encryptedtext, aes.Key);
     byte[] decryptedText = System.Convert.FromBase64String(hexToASCIITB.Text);
     txtdecryptedTB.Text = Symmetric_Encrypted.Decrypt(decryptedText, aes.Key);
 }
Esempio n. 2
0
 private void SimpleEncryptBt_Click(object sender, RoutedEventArgs e)
 {//symmetric
  // Encrypt string
     //string key = Convert.ToBase64String(aes.Key);
     //string key1 = ByteConverter.GetString(aes.Key);
     //MessageBox.Show("AES key + " + key);
     //MessageBox.Show("AES IV + " + ByteConverter.GetString(aes.IV));
     encryptedtext       = Symmetric_Encrypted.Encrypt(txtplainTB.Text, aes.Key);
     txtencryptedTB.Text = Convert.ToBase64String(encryptedtext);
 }