#include<iostream>staticvoidencrypt(unsignedchar*pBuff,intiCnt){inti=0;constchar*XorKeyChar="72f80deb855afd01a8ef0d5e6455ecb8ed8eda";constchar*AddKeyChar="d3b52f85fd2fe9b86cb21150621ee25c113508";if(iCnt>8){for(i=0;i<(iCnt/8);i++){encrypt(pBuff+i*8,8);}encrypt(pBuff+i*8,(iCnt%8));}else{for(i=0;i<iCnt;i++){pBuff[i]=pBuff[i]^XorKeyChar[i];pBuff[i]=~pBuff[i];pBuff[i]=pBuff[i]-AddKeyChar[i];}}}voiddecrypt(unsignedchar*pBuff,intiCnt){inti=0;constchar*XorKeyChar="72f80deb855afd01a8ef0d5e6455ecb8ed8eda";constchar*AddKeyChar="d3b52f85fd2fe9b86cb21150621ee25c113508";if(iCnt>8){for(i=0;i<(iCnt/8);i++){decrypt(pBuff+i*8,8);}decrypt(pBuff+i*8,(iCnt%8));}else{for(i=0;i<iCnt;i++){pBuff[i]=pBuff[i]+AddKeyChar[i];pBuff[i]=~pBuff[i];pBuff[i]=pBuff[i]^XorKeyChar[i];}}}intmain(){unsignedchardata[]="hello world";printf("data : %s\n",data);encrypt(data,strlen((constchar*)data));printf("encrypt data : %s\n",data);decrypt(data,strlen((constchar*)data));printf("decrypt data : %s\n",data);return0;}