Help with manipulating two chars at a time

closed account (4ET0pfjN)
Hi, I need to write an encryption function that's supposed to perform XOR on two characters at a time

The encryption function given is:

crypt(message) = message XOR (K n/2 times) where n is message length

e.g.
message = "abcdefgh"
n = 4
so the encryption would be as follows:
ab cd ef gh
XOR K K K K
---------------


SO how would I do this, any help please!
closed account (4ET0pfjN)
My professor gave me hint, he said to work with the key K's low-order and hi-order bits as one solution. Feel free if you know a simpler way.
Topic archived. No new replies allowed.