Exemplo n.º 1
0
 private void btnEncryptDecryptStream_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         _encryptedBitmap = StreamCipher.EncryptImage(_streamSourceFilePath, _streamKeyfilePath, Operation.XOR);
         SetWpfImageFromImage(_encryptedBitmap, imgDisplayStream);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 private void btnComputeBO_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if ((bool)rbBitwiseAnd.IsChecked)
         {
             _encryptedBitmap = StreamCipher.EncryptImage(_bitwisePic1FilePath, _bitwisePic2FilePath, Operation.AND);
         }
         else if ((bool)rbBitwiseOR.IsChecked)
         {
             _encryptedBitmap = StreamCipher.EncryptImage(_bitwisePic1FilePath, _bitwisePic2FilePath, Operation.OR);
         }
         else if ((bool)rbBitwiseXOR.IsChecked)
         {
             _encryptedBitmap = StreamCipher.EncryptImage(_bitwisePic1FilePath, _bitwisePic2FilePath, Operation.XOR);
         }
         SetWpfImageFromImage(_encryptedBitmap, imgBitwiseDisplay);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }