41 Star 203 Fork 60

delxiong / php screw plus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
aes_crypt.c 591 Bytes
一键复制 编辑 原始数据 按行查看 历史
Del Xiong 提交于 2016-06-24 16:23 . use aes 256 to crypt source files
/**
* php screw plus
**/
void screw_aes(int crypt,uint8_t *buf,int bufLen,uint8_t *key,int *rLen){
uint8_t t,out;
aes_context aes;
int blocks = 0,i,rm = bufLen % 16;
int end = 0,decSize=0;
blocks = bufLen/16 + (rm?1:0);
if(crypt)
aes_setkey_enc( &aes, key, 256 );
else
aes_setkey_dec( &aes, key, 256 );
for(i=0;i<blocks;i++) {
if(crypt)
aes_crypt_cbc(&aes, AES_ENCRYPT, 16, key, buf+i*16, buf+i*16);
else
aes_crypt_cbc(&aes, AES_DECRYPT, 16, key, buf+i*16, buf+i*16);
}
*rLen = blocks * 16;
}
C
1
https://gitee.com/splot/php-screw-plus.git
git@gitee.com:splot/php-screw-plus.git
splot
php-screw-plus
php screw plus
master

搜索帮助