void CEncode_Decode: : Encode_Decode (WORD nLen, LPBYTE lpSource, LPBYTE lpTarget, bool bSend)
{
BYTE l_BYTE_Xor1=nLen * D_WORD_XOR1MUL l_BYTE_Xor3;
WORD l_WORD_Xor3=D_WORD_XOR3BASE nCir;
If (bSend)
{
L_BYTE_Xor1 x00aa *=0;
L_WORD_Xor3 x00bb *=0;
}
For (nCir=0; NCir{
L_BYTE_Xor3=HIBYTE (l_WORD_Xor3);
LpTarget [nCir]=lpSource [nCir] ^ l_BYTE_Xor1 ^ G_BYTE_XorTable D_XORTABLE_LENGTH] [nCir % ^ l_BYTE_Xor3;
L_WORD_Xor3 *=D_WORD_XOR3MUL;
}
}
Through the decryption code, how to write the encryption code?
CodePudding user response:
This also need to write? Is just a simple xor, direct calls again,The input source for the first time, the target is encrypted; The target for the second time when the source input, it is the original source
CodePudding user response:
Prototype example,void USER: : Encode_Decode (char * lpTarget, char * lpSource, int nLen, int f)//server encryption
{
BYTE l_BYTE_Xor1=(WORD) nLen * D_WORD_XOR1MUL, l_BYTE_Xor3;
WORD l_WORD_Xor3=D_WORD_XOR3BASE nCir;
For (nCir=0; NCir<(WORD) nLen; NCir++)
{
L_BYTE_Xor3=HIBYTE (l_WORD_Xor3);
LpTarget [nCir]=lpSource [nCir] ^ l_BYTE_Xor1 ^ key D_XORTABLE_LENGTH] [nCir % ^ l_BYTE_Xor3;
L_WORD_Xor3 *=D_WORD_XOR3MUL;
}
}
//////////login decryption
Void Encode_Decode (LPBYTE lpTarget, LPBYTE lpSource, WORD nLen)
{
//8 * 0 x009d
BYTE l_BYTE_Xor1=nLen * D_WORD_XOR1MUL l_BYTE_Xor3;
//0 x086d
WORD l_WORD_Xor3=D_WORD_XOR3BASE nCir;
For (nCir=0; NCir{
L_BYTE_Xor3=HIBYTE (l_WORD_Xor3);
LpTarget [nCir]=lpSource [nCir] ^ l_BYTE_Xor1 ^ G_BYTE_XorTable D_XORTABLE_LENGTH] [nCir % ^ l_BYTE_Xor3;
L_WORD_Xor3 *=D_WORD_XOR3MUL;
}
}
Decryption added
if (bSend)
{
L_BYTE_Xor1 x00aa *=0;
L_WORD_Xor3 x00bb *=0;
}
The server-side encryption what should I write this?
CodePudding user response: