定义成员变量:
unsigned char szKey[32];
unsigned char szPlainText[32];
unsigned char szCiphertext[16];
首先我进行加密:
char temp[32];
for (int i=0;i<32;i++)
{
szKey[i]='A';
temp[i]=0; }
KAES *pAes=new KAES(Bits256,szKey); //32位加密
         sprintf_s(temp,"%d,%d,%d,%d,%d,%d",nMac,nScore,nXima,nGain,nScene,m_iBianHao);//长度小于32位,大于16位
for (int i=0;i<32;i++)
{
szPlainText[i]=temp[i];
     temp[i]=0;
}
pAes->Cipher(szPlainText,szCiphertext);//加密         CString strKJMA;
strKJMA.Empty(); 
for (int i=0;i<16;i++)
{
sprintf_s(temp,"%02X",szCiphertext[i]);
strKJMA+=temp;
}
这里我试过,只要是szPlainText的字符串大于16个字符,只加密了前16个字符,也就是后面16个字符不管怎么变加的密都是一样的,如果我想把后面的字符也加密应该怎么样做?加出来的密只能是16个unsigned char型.