magdiel linhares
asked on
C++ Simple XOR crypt
Hello! I am intercepting packets and want to encrypt them using a simple XOR. The packets are not being encrypted, where am I going wrong?
Help-me :/
void process_send(SOCKET s, const char* buf, int *len, int flags) {
char* q;
char j = 0;
int l = sizeof(buf);
char k;
int i;
q = (char *)buf;
k = q[4];
q[4] ^= 0x76;
for(i = 5; i < l; i++)
{
j = q[i];
q[i] ^= k;
k = j;
}
}
Help-me :/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Fine. I'm glad I could help ...
Have a nice weekend,
ZOPPO
Have a nice weekend,
ZOPPO
>> encrypt them using a simple XOR
Just an observation, but XOR is NOT encryption. It is obfuscation and very easy to reverse engineer. If you are looking to properly encrypt data this is NOT the way to do it!
Just an observation, but XOR is NOT encryption. It is obfuscation and very easy to reverse engineer. If you are looking to properly encrypt data this is NOT the way to do it!
ASKER