PDA

View Full Version : XOR Encryption


butaktelco
10-30-2019, 12:23 AM
Hello,
anybody know XOR algorithm, i have discover on the net still don't get any result.

there is code for decrypting.


char *result_decode = new char[100];
for(int i = 1; i < 100; ++i){
result_decode[i]= encode_data[i] ^ (0xE3 << (i & 3));
}


any suggestion how to encryption back of byte.

tonyweb
11-02-2019, 12:55 PM
Just "swap" 'result_decode' and 'encode_data'.
Xor is a reversible operation.

Regards,
Tony

CodeRipper
11-13-2019, 02:24 PM
XOR is commutative, associative, and its own inverse.
More reads:
https://math.stackexchange.com/questions/961441/xor-is-commutative-associative-and-its-own-inverse-are-there-any-other-such-f
(https://math.stackexchange.com/questions/961441/xor-is-commutative-associative-and-its-own-inverse-are-there-any-other-such-f)
https://stackoverflow.com/questions/14279866/what-is-inverse-function-to-xor
https://news.ycombinator.com/item?id=11251961