下你所需,载你所想!
汇集开发技术源码资料

RC4加密算法(c++实现)

:903B :1 :2022-10-06 17:22:22

部分简介

RC4加密算法(c++实现)如果开发者对于本文件有需要的可以参考。
int main()
{
unsigned char s[256] = {0};
char key[256] = "golangc2";
unsigned char data[512]={0x64, 0x2E, 0x90, 0x34, 0x41, 0xD8, 0x24, 0xCB, 0x52, 0x2E, 0xFB, 0x39, 0x3E, 0x91, 0x07, 0x0E, 0x96, 0xF6, 0x3C, 0x09, 0x9C, 0x21, 0x92, 0x21, 0xB2, 0xCC, 0x9F, 0x51, 0x48, 0x63, 0x4C, 0x8F, 0x72, 0x5D, 0xBF, 0x6C, 0x51, 0x76};
unsigned long data_len = 38;
unsigned long key_len = strlen(key);
rc4_init(s,(unsigned char*)key,key_len);//初始化得到s
rc4_crypt(s,(unsigned char*)data,data_len);//解密
for(int i=0;i<38;i )
{
printf("%c",(data[i])&0xff);
}
return 0;
}

RC4加密算法(c++实现)

热门推荐

相关文章