花生壳花生壳客户端完成[资料]

花生壳客户端  时间:2021-03-13  阅读:()

花生壳客户端实现

花生壳l i nux客户端源码(简易版)2006-10-25 14:41:58| 分类Linux | 标签 l inux 服务器 |字号大中小订阅.

花生壳l i nux客户端源码(简易版)

作者: lizhx新手上路(IPLogged)

日期: 2006-09-07 22:30:47

[原创]花生壳l i nux客户端源码(简易版)

花生壳很受欢迎

像我这样没有固定IP的人实在是没有办法只好请花生壳帮忙。又像我如此节约的人又不能开着电脑当服务器随便找个开发板就好了不到五瓦。

花生壳的l inux版客户端也不是没有就是不能在ARM LINUX下运行。

实在无奈之下就写了这么一个程序纯粹个人爱好。不好用 自己改改。md5.h

/* typedef a 32 bit type */typedef unsigned long int UINT4;

/* Data structure for MD5 (Message Digest) computation */typedef struct {

UINT4 i [2] ; /* number of_bits_handled mod 2^64 */

UINT4 buf[4] ; /* scratch buffer */unsigned char in[64] ; /* input buffer */unsigned char digest[16] ; /*actual digest after MD5Final call

*/

} MD 5_C TX;void MD5Init (MD5_CTX *mdContext) ;void MD5Update (MD5_CTX *mdContext,unsi gned char

*inBuf,unsigned int inLen) ;void MD5Final (unsigned char *digest,MD5_CTX *mdContext) ;void Transform (UINT4 *buf,UINT4 *in) ;void hmac_md5 (unsigned char*text, int text_len,unsigned char

* key, int key_len,unsigned char * digest) ;const char

BaseTab l e[65]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi j klmnopqrstuvwxyz0123456789+/=";char * DecodeBase64(char * Source) ;char * EncodeBase64(char * Source) ;unsigned char FindInTable(unsigned char) ;

//---------------------------------------------------------

------------------static unsigned char PADDING[64] = {

0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

} ;

/* F, G and H are basic MD5 functions: selection, majority,parity */

#define F(x, y, z) (((x) & (y)) | ((~x) & (z) ))

#define G(x, y, z) (((x) & (z)) | ((y) & (~z) ))

#define H(x, y, z) ((x) ^ (y) ^ (z))

#define I(x, y, z) ((y) ^ ((x) | (~z)))

/* ROTATE_LEFT rotates x left n bits */

#def ine ROTATE_LEFT(x, n) (( (x) << (n) ) | ((x) >> (32-(n)) ))/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and4 */

/*Rotation is separate from addition to prevent recomputation

*/

#def ine FF(a, b, c, d, x, s, ac) { (a) += F ( (b) , (c) , (d) ) +(x) + (U INT4) (ac) ; (a) =ROTATE_LEFT ( (a) , (s)) ; (a) += (b) ; }#def ine GG(a, b, c, d, x, s, ac) { (a) += G ((b) , (c) , (d) ) +(x) + (U INT4) (ac) ; (a) =ROTATE_LEFT ( (a) , (s)) ; (a) += (b) ; }#def ine HH(a, b, c, d, x, s, ac) { (a) += H ((b) , (c) , (d) ) +(x) + (U INT4) (ac) ; (a) =ROTATE_LEFT ( (a) , (s)) ; (a) += (b) ; }#define II(a, b, c, d, x, s, ac) { (a) += I ((b) , (c) , (d) ) +(x) + (U INT4) (ac) ; (a) =ROTATE_LEFT ( (a) , (s)) ; (a) += (b) ; }//---------------------------------------------------------

------------------

void MD5Init (MD5_CTX * mdContext)

{mdContext->i[0] = mdContext->i[1] = (UINT4)0;

/* Load magic initialization constants.

*/mdContext->buf[0] = (UINT4)0x67452301;mdContext->buf[1] = (UINT4)0xefcdab89;mdContext->buf[2] = (UINT4)0x98badcf e;mdContext->buf[3] = (UINT4)0x10325476;

}

//---------------------------------------------------------

------------------void MD5Update (MD5_CTX *mdContext, uns igned char *inBuf,unsigned int inLen)

{

UINT4 in[16] ;int mdi ;unsigned int i, ii;

/* compute number of bytes mod 64 */mdi = (int) ((mdContext->i [0] >> 3) & 0x3F) ;

/* update number of bits */if ((mdContext->i [0] + ( (UINT4) inLen<< 3) ) <mdContext->i[0])mdContext->i[1]++;mdContext->i[0] += ((UINT4) inLen << 3) ;mdContext->i[1] += ((UINT4) inLen >> 29) ;while (inLen--) {

/* add new character to buffer, increment mdi */mdContext->in[mdi++] = *i nBuf++;

/* transform if necessary */i f (mdi == 0x40) {for (i = 0, ii = 0; i < 16; i++, ii += 4)in[i] = (( (UINT4)mdContext->in[ii+3] ) << 24) |

( ((UINT4)mdContext->in[ii+2] ) << 16) |

( ((UINT4)mdContext->in[ii+1] ) << 8) |

( (UINT4)mdContext->in[i i] ) ;

Transform (mdContext->buf, in) ;mdi = 0;

}

}

}

//---------------------------------------------------------

void MD5Final (unsigned char *digest,MD5_CTX *mdContext){

UINT4 in[16] ;int mdi ;unsigned int i, ii;unsigned int padLen;

/* save number of bits */in[14] = mdContext->i[0] ;in[15] = mdContext->i[1] ;

/* compute number of bytes mod 64 */mdi = (int) ((mdContext->i [0] >> 3) & 0x3F) ;

/* pad out to 56 mod 64 */padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi) ;

MD5Update (mdContext, PADDING, padLen) ;

/* append length in bits and transform */for (i = 0, ii = 0; i < 14; i++, ii += 4)in[i] = (( (UINT4)mdContext->in[ii+3] ) << 24) |

( ((UINT4)mdContext->in[ii+2] ) << 16) |

( ((UINT4)mdContext->in[ii+1] ) << 8) |

( (UINT4)mdContext->in[i i] ) ;

Transform (mdContext->buf, in) ;

/* store buffer in digest */for (i = 0, ii = 0; i < 4; i++, ii += 4) {mdContext->digest[i i] = (unsigned char) (mdContext->buf[i] &0 xFF) ;mdContext->digest[ii+1] =

(unsigned char) ( (mdContext->buf[i] >> 8) & 0xFF) ;mdContext->digest[ii+2] =

(uns igned char) ( (mdContext->buf[i] >> 16) & 0xFF) ;mdContext->digest[ii+3] =

(uns igned char) ( (mdContext->buf[i] >> 24) & 0xFF) ;

}

memcpy(digest,mdContext->buf, 16) ;

}

//---------------------------------------------------------

------------------

/* Basic MD5 step. Transform buf based on in.

*/void Transform (UINT4 *buf, UINT4 *in)

{

UINT4 a = buf[0] , b = buf[1], c = buf[2], d = buf[3] ;/* Round 1 */

#define S11 7

#define S12 12

#define S13 17

#define S14 22

FF ( a, b, c, d, in[ 0] , S 11, 3614090360UL) ; /* 1 */

FF ( d, a, b, c, in[ 1] , S 12, 3905402710UL) ; /* 2 */

FF ( c, d, a, b, in[ 2], S13, 606105819UL) ; /* 3 */

FF ( b, c, d, a, in[ 3] , S 14, 3250441966UL) ; /* 4 */

FF ( a, b, c, d, in[ 4] , S 11, 4118548399UL) ; /* 5 */

FF ( d, a, b, c, in[ 5] , S 12, 1200080426UL) ; /* 6 */

FF ( c, d, a, b, in[ 6] , S 13, 2821735955UL) ; /* 7 */FF ( b, c, d, a, in[ 7] , S 14, 4249261313UL) ; /* 8 */FF ( a, b, c, d, in[ 8] , S 11, 1770035416UL) ; /* 9 */FF ( d, a, b, c, in[ 9] , S12, 2336552879UL) ; /* 10 */FF ( c, d, a, b, in[10] , S13, 4294925233UL) ; /* 11 */FF ( b, c, d, a, in[11] , S14, 2304563134UL) ; /* 12 */FF ( a, b, c, d, in[12] , S11, 1804603682UL) ; /* 13 */FF ( d, a, b, c, in[13] , S12, 4254626195UL) ; /* 14 */FF ( c, d, a, b, in[14] , S13, 2792965006UL) ; /* 15 */FF ( b, c, d, a, in[15] , S14, 1236535329UL) ; /* 16 *//* Round 2 */

#define S21 5

#define S22 9

#define S23 14

#define S24 20

GG ( a, b, c, d, in[ 1] , S21, 4129170786UL) ; /* 17 */GG ( d, a, b, c, in[ 6] , S22, 3225465664UL) ; /* 18 */

LOCVPS新上日本软银线路VPS,原生IP,8折优惠促销

LOCVPS在农历新年之后新上架了日本大阪机房软银线路VPS主机,基于KVM架构,配备原生IP,适用全场8折优惠码,最低2GB内存套餐优惠后每月仅76元起。LOCVPS是一家成立于2012年的国人VPS服务商,提供中国香港、韩国、美国、日本、新加坡、德国、荷兰、俄罗斯等地区VPS服务器,基于KVM或XEN架构(推荐选择KVM),线路方面均选择国内直连或优化方案,访问延迟低,适合建站或远程办公使用。...

轻云互联,香港云服务器折后22元/月 美国云服务器 1核 512M内存 15M带宽 折后19.36元/月

轻云互联成立于2018年的国人商家,广州轻云互联网络科技有限公司旗下品牌,主要从事VPS、虚拟主机等云计算产品业务,适合建站、新手上车的值得选择,香港三网直连(电信CN2GIA联通移动CN2直连);美国圣何塞(回程三网CN2GIA)线路,所有产品均采用KVM虚拟技术架构,高效售后保障,稳定多年,高性能可用,网络优质,为您的业务保驾护航。官方网站:点击进入广州轻云网络科技有限公司活动规则:1.用户购...

618云上Go:腾讯云秒杀云服务器95元/年起,1C2G5M三年仅288元起

进入6月,各大网络平台都开启了618促销,腾讯云目前也正在开展618云上Go活动,上海/北京/广州/成都/香港/新加坡/硅谷等多个地区云服务器及轻量服务器秒杀,最低年付95元起,参与活动的产品还包括短信包、CDN流量包、MySQL数据库、云存储(标准存储)、直播/点播流量包等等,本轮秒杀活动每天5场,一直持续到7月中旬,感兴趣的朋友可以关注本页。活动页面:https://cloud.tencent...

花生壳客户端为你推荐
摩拜超15分钟加钱首次 微信扫 摩拜单车 需要 付压金吗h连锁酒店连锁酒店有哪些网红名字被抢注谁知道这个网红叫什么名字?求帮助!中老铁路一带一路的火车是什么火车蓝色骨头手机宠物的骨头分别代表几级?rawtoolsU盘显示是RAW格式怎么办www.yahoo.com.hk香港有什么网页m.2828dy.comwww.dy6868.com这个电影网怎么样?qq530.com求教:如何下载http://www.qq530.com/ 上的音乐www.kanav001.com翻译为日文: 主人,请你收养我一天吧. 带上罗马音标会更好www
最便宜的vps 科迈动态域名 香港机房托管 xen qingyun 韩国名字大全 免费吧 东莞数据中心 服务器是干什么的 linode支付宝 韩国代理ip 华为k3 阿里云邮箱登陆地址 酸酸乳 中国联通宽带测速 1美元 hdroad shuangcheng fatcow websitepanel 更多