Click to See Complete Forum and Search --> : string manipulation


May 26th, 1999, 09:11 PM
Does anyone understand what this means and can help me with a simple way to undo this in C? Any help would be greatly appreciated:
Take a four byte constant and fold a string into it, byte by byte, by bitwise exclusive or (XOR). Each byte from the string is XORed with a byte in the constant, wrapping as necessary, until all bytes of the string are used up.
I have both the end result of this process as well as the constant, I just need the string. Thanks!

eric33
May 27th, 1999, 01:32 AM
If i understand the formula is :


for ( i=0; i<l; i++ )
result(i)=string(i) ^ ct(i);




so you have result and ct you want to find back string.

If yes just make the reverse as this :


for ( i=0; i<l; i++ )
string(i)=result(i)^ct(i);