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

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

VoLLcloud:超便宜香港CMI大带宽vps-三网CMI直连-年付四免服务-低至4刀/月-奈飞

vollcloud LLC创立于2020年,是一家以互联网基础业务服务为主的 技术型企业,运营全球数据中心业务。致力于全球服务器租用、托管及云计算、DDOS安 全防护、数据实时存储、 高防服务器加速、域名、智能高防服务器、网络安全服务解决方案等领域的智 能化、规范化的体验服务。所有购买年付产品免费更换香港原生IP(支持解锁奈飞),商家承诺,支持3天内无条件退款(原路退回)!点击进入:vollclo...

2022年最新PHP短网址生成系统/短链接生成系统/URL缩短器系统源码

全新PHP短网址系统URL缩短器平台,它使您可以轻松地缩短链接,根据受众群体的位置或平台来定位受众,并为缩短的链接提供分析见解。系统使用了Laravel框架编写,前后台双语言使用,可以设置多域名,还可以开设套餐等诸多功能,值得使用。链接: https://pan.baidu.com/s/1ti6XqJ22tp1ULTJw7kYHog?pwd=sarg 提取码: sarg文件解压密码 www.wn7...

湖北50G防御物理服务器( 199元/月 ),国内便宜的高防服务器

4324云是成立于2012年的老牌商家,主要经营国内服务器资源,是目前国内实力很强的商家,从价格上就可以看出来商家实力,这次商家给大家带来了全网最便宜的物理服务器。只能说用叹为观止形容。官网地址 点击进入由于是活动套餐 本款产品需要联系QQ客服 购买 QQ 800083597 QQ 2772347271CPU内存硬盘带宽IP防御价格e5 2630 12核16GBSSD 500GB​30M​1个IP...

花生壳客户端为你推荐
甲骨文不满赔偿如果合同期不满被单位辞退,用人单位是否需要赔偿陈嘉垣反黑阿欣是谁演的 扮演者介绍月神谭求几个个性网名:porntimesexy time 本兮 MP3地址mole.61.com摩尔庄园的米米号和密码我都忘了 只记得注册的邮箱 怎么办-_-www.7788dy.comwww.tom365.com这个免费的电影网站有毒吗?avtt4.comwww.51kao4.com为什么进不去啊?dadi.tv海信电视机上出现英文tvservice是什么意思?59ddd.comarmada m300什么装系统www.zzzcn.com哪里有免费看书的网站
免费域名跳转 云主机51web 全能主机 三拼域名 可外链相册 广州服务器 息壤代理 搜索引擎提交入口 服务器监测 空间登入 外贸空间 新加坡空间 supercache 双11促销 服务器托管价格 windowssever2008 apache启动失败 asp介绍 发证机构 服务器是什么 更多