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

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

OneTechCloud(31元),美国CN2 GIA高防VPS月

OneTechCloud发布了本月促销信息,全场VPS主机月付9折,季付8折,优惠后香港VPS月付25.2元起,美国CN2 GIA线路高防VPS月付31.5元起。这是一家2019年成立的国人主机商,提供VPS主机和独立服务器租用,产品数据中心包括美国洛杉矶和中国香港,Cera的机器,VPS基于KVM架构,采用SSD硬盘,其中美国洛杉矶回程CN2 GIA,可选高防。下面列出部分套餐配置信息。美国CN...

BGP.TO日本和新加坡服务器进行促销,日本服务器6.5折

BGP.TO目前针对日本和新加坡服务器进行促销,其中日本东京服务器6.5折,而新加坡服务器7.5折起。这是一家专门的独立服务器租售网站,提供包括中国香港、日本、新加坡和洛杉矶的服务器租用业务,基本上都是自有硬件、IP资源等,国内优化直连线路,机器自动化部署上架,并提供产品的基本管理功能(自助开关机重启重装等)。新加坡服务器 $93.75/月CPU:E3-1230v3内存:16GB硬盘:480GB ...

PacificRack 下架旧款方案 续费涨价 谨慎自动续费

前几天看到网友反馈到PacificRack商家关于处理问题的工单速度慢,于是也有后台提交个工单问问,没有得到答复导致工单自动停止,不清楚商家最近在调整什么。而且看到有网友反馈到,PacificRack 商家的之前年付低价套餐全部下架,而且如果到期续费的话账单中的产品价格会涨价不少。所以,如果我们有需要续费产品的话,谨慎选择。1、特价产品下架我们看到他们的所有原来发布的特价方案均已下架。如果我们已有...

花生壳客户端为你推荐
蓝瘦香菇被抢注蓝瘦香菇下一句怎么接neworientalbecoming什么么意思Baby被问婚变绯闻黄晓明baby一起出来带娃,想要打破离婚传闻?www.yahoo.com.hk香港有什么有名的娱乐门户网站吗?www.5any.com重庆哪里有不是全日制的大学?www.mywife.ccmywife哪部最经典partnersonline国外外贸平台有哪些?www.henhenlu.com有一个两位数,十位数字是个位数字的二分之一,将十位数字与个位数字对调,新的两位数比原来大36,这个两位数www.idanmu.com腾讯有qqsk.zik.mu这个网站吗?ww.66bobo.com谁知道11qqq com被换成哪个网站
移动服务器租用 vps优惠码cnyvps 域名服务器上存放着internet主机的 lol台服官网 isp服务商 vip域名 华为云盘 全能空间 wordpress中文主题 xuni 成都主机托管 如何登陆阿里云邮箱 谷歌搜索打不开 亿库 百度新闻源申请 comodo hosts文件 nic 时间同步服务器 studentmain 更多