Hey,
Maybe it's useful for someone here, these are the current algorithms for encrypting / decrypting the Packets.
Encrypt:
Decrypt:
Maybe it's useful for someone here, these are the current algorithms for encrypting / decrypting the Packets.
Encrypt:
Code:
void Packet::Encrypt()
{
if(this->size > 4)
{
int a = 4;
BYTE b;
int i;
for (i = 0; i < (this->size - 4) / 3 - 1; i++)
{
b = this->data[a];
this->data[a] = this->data[a + 3];
this->data[a + 3] = b;
this->data[a] ^= 4;
this->data[a + 1] ^= 4;
this->data[a + 2] ^= 4;
a += 3;
}
}
}
Code:
void Packet::Decrypt()
{
if (this->size > 4)
{
int a = 4 + 3 * ((this->size - 4) / 3 - 1);
BYTE b;
int i;
for (i = 0; i < (this->size - 4) / 3 - 1; i++)
{
b = this->data[a];
this->data[a] = this->data[a - 3];
this->data[a - 3] = b;
this->data[a] ^= 4;
this->data[a - 1] ^= 4;
this->data[a - 2] ^= 4;
a -= 3;
}
}
}