看着改改应该能用[C++] 纯文本查看 复制代码 int main(int argc, char* argv[])
{
char buf[] = "\\x00\\x01\\x02\\x03\\x04\\x05\\xff\\x06";
char str[3] = { 0 };
char *Temp = new char[sizeof(buf)/4];
char key[] = "abcd1234abcd1234";
char cData[4000];
int j = 0;
int k = 0;
//减去字符串末尾0的位置
for (int i = 0; i < sizeof(buf)-1; i += 4)
{
str[0] = buf[i + 2];
str[1] = buf[i + 3];
sscanf(str, "%02x", &k);
Temp[j] = (char)k;
j++;
}
int clen = AES_encrypt(Temp, sizeof(buf)/4, cData, key);
printf("%d", clen);
delete[] Temp;
return 0;
} |