tags:

views:

38

answers:

2

I have two GraphicsBuffer in c#, I want to take XOR of both the buffers and stored in third variable. Kindly guide me so that I can make it possible.

A: 
  1. Extract each data item/byte from each of the two buffers.
  2. Combine the two such bytes using the XOR operator - byte3 = byte1 ^ byte2
  3. Add the resulting byte3 to the last GraphicsBuffer.
  4. Repeat until you have gone through all the data/bytes.
filip-fku
@filip-fku, How to get bytes from GraphicsBuffer?
Arman
Dig through the API reference for the buffer - possible options: 1. Can you index bytes as if the buffer was an array? 2. Is there an underlying byte(or similar) array you can access? 3. How do you read data from the buffer? Use that.
filip-fku
A: 

I've never Xor'ed a Graphics buffer, but I've Xor encrypted a few things and I imagine it's much the same thing. You can read it here: http://freedom2blog.com/2010/05/easy-encryption-using-bitwise-exclusive-or-xor/

Doobi