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

花生壳客户端  时间: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 */

快云科技:香港沙田CN2云服务器低至29元/月起;美国高防弹性云/洛杉矶CUVIP低至33.6元/月起

快云科技怎么样?快云科技是一家成立于2020年的新起国内主机商,资质齐全 持有IDC ICP ISP等正规商家。云服务器网(yuntue.com)小编之前已经介绍过很多快云科技的香港及美国云服务器了,这次再介绍一下新的优惠方案。目前,香港云沙田CN2云服务器低至29元/月起;美国超防弹性云/洛杉矶CUVIP低至33.6元/月起。快云科技的云主机架构采用KVM虚拟化技术,全盘SSD硬盘,RAID10...

HostSlim,双E5-2620v2/4x 1TB SATA大硬盘,荷兰服务器60美元月

hostslim美国独立日活动正在进行中,针对一款大硬盘荷兰专用服务器:双E5-2620v2/4x 1TB SATA硬盘,活动价60美元月。HostSlim荷兰服务器允许大人内容,不过只支持电汇、信用卡和比特币付款,商家支持7天内退款保证,有需要欧洲服务器的可以入手试试,记得注册的时候选择中国,这样不用交20%的税。hostslim怎么样?HostSlim是一家成立于2008年的荷兰托管服务器商,...

RAKsmart(年79元),云服务器年付套餐汇总 - 香港 美国 日本云服务器

RAKsmart 商家从原本只有专注于独立服务器后看到产品线比较单薄,后来陆续有增加站群服务器、高防服务器、VPS主机,以及现在也有在新增云服务器、裸机云服务器等等。机房也有增加到拥有洛杉矶、圣何塞、日本、韩国、中国香港等多个机房。在年前也有介绍到RAKsmart商家有提供年付129元的云服务器套餐,年后我们看到居然再次刷新年付云服务器低价格。我们看到云服务器低至年79元,如果有需要便宜云服务器的...

花生壳客户端为你推荐
太空国家世界上有哪些国家有能力探索太空安徽汽车网想在合肥买辆二手车,想问在哪里买比较放心?bbs.99nets.com做一款即时通讯软件难吗 像hi qq这类的18comic.funAnime Comic Fun是什么意思啊 我不懂英文丑福晋谁有好看的言情小说介绍下百度关键词分析百度关键字分析是什么意思?haole018.com为啥进WWWhaole001)COM怎么提示域名出错?囡道是haole001换地了吗777k7.comwww 地址 777rv怎么打不开了,还有好看的吗>comhaokandianyingwang谁有好看电影网站啊、要无毒播放速度快的、在线等www.78222.com我看一个网站.www.snw58.com里面好有意思呀,不知道里面的信息是不是真实的
in域名注册 域名商 主机测评网 adman burstnet cpanel 10t等于多少g 京东商城双十一活动 网站卫士 linux服务器维护 免费智能解析 gtt vip域名 免费私人服务器 四川电信商城 独享主机 架设邮件服务器 路由跟踪 什么是web服务器 实惠 更多