Could you please help me converting this c++ code into python:
I am trying to XOR the data
C++ :
void Encrypt(void data, Dword size)
{
if(size > 0)
for(DWORD i = size - 1; i > 0; i--)
((LPBYTE)data)[i] ^= ((LPBYTE)data)[i - 1];
}
To do this in python, you probably want to use the
bytearrayclass:Note the comment, that you cannot pass a string object, because strings in python are immutable.
bytearrayon the other hand, is not.