Ejemplo n.º 1
0
 private void btnEncrypt_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         CipherMode mode = CipherMode.CBC;
         if ((bool)rbEncryptionModeCBC.IsChecked)
         {
             mode = CipherMode.CBC;
         }
         else if ((bool)rbEncryptionModeECB.IsChecked)
         {
             mode = CipherMode.ECB;
         }
         _encryptedBitmap = BlockCipher.EncryptImage(_blockFilePath, mode);
         SetWpfImageFromImage(_encryptedBitmap, imgDisplay);
         btnDecrypt.IsEnabled = true;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }