百度空间 | 百度首页 
 
查看文章
 
xor encryption and decryption
2009-08-13 12:50
/* Encryption and decryption are symmetric */
#define stream_decrypt stream_encrypt
static void stream_encrypt(stream_state *self, unsigned char *block,
int len)
{
int i, j = self->last_pos;
for(i=0; i<len; i++, j=(j+1) % self->keylen)
{
block[i] ^= self->key[j];
}
self->last_pos = j;
}

类别:c语言实践 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu