91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-07
  • 語言: C/C++
  • 標(biāo)簽: MD5??源碼??加密??vc??

資源簡介

MD5的c++算法,在vc6.0 和vs2010 上測試都正常,絕對可以用

資源截圖

代碼片段和文件信息

#include?“md5.h“
#include?“stdio.h“

#include?“memory.h“



#define?S11?7
#define?S12?12
#define?S13?17
#define?S14?22
#define?S21?5
#define?S22?9
#define?S23?14
#define?S24?20
#define?S31?4
#define?S32?11
#define?S33?16
#define?S34?23
#define?S41?6
#define?S42?10
#define?S43?15
#define?S44?21

static?void?MD5Transform?(UINT32?a[4]?unsigned?char?b[64]);
static?void?Encode?(unsigned?char?*?UINT32?*?unsigned?int);
static?void?Decode?(UINT32?*?unsigned?char?*?unsigned?int);

static?unsigned?char?PADDING[64]?=?{
0x80?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0
0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0
0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0?0
};

#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)))


#define?ROTATE_LEFT(x?n)?(((x)?<>?(32-(n))))

#define?FF(a?b?c?d?x?s?ac)?{?\
(a)?+=?F?((b)?(c)?(d))?+?(x)?+?(UINT32)(ac);?\
(a)?=?ROTATE_LEFT?((a)?(s));?\
(a)?+=?(b);?\
}
#define?GG(a?b?c?d?x?s?ac)?{?\
(a)?+=?G?((b)?(c)?(d))?+?(x)?+?(UINT32)(ac);?\
(a)?=?ROTATE_LEFT?((a)?(s));?\
(a)?+=?(b);?\
}
#define?HH(a?b?c?d?x?s?ac)?{?\
(a)?+=?H?((b)?(c)?(d))?+?(x)?+?(UINT32)(ac);?\
(a)?=?ROTATE_LEFT?((a)?(s));?\
(a)?+=?(b);?\
}
#define?II(a?b?c?d?x?s?ac)?{?\
(a)?+=?I?((b)?(c)?(d))?+?(x)?+?(UINT32)(ac);?\
(a)?=?ROTATE_LEFT?((a)?(s));?\
(a)?+=?(b);?\
}


void?MD5Init?(MD5_CTX?*context)
{
context->count[0]?=?context->count[1]?=?0;

context->state[0]?=?0x67452301;
context->state[1]?=?0xefcdab89;
context->state[2]?=?0x98badcfe;
context->state[3]?=?0x10325476;
}


void?MD5Update?(MD5_CTX?*context?unsigned?char?*input?unsigned?int?inputLen)
{
unsigned?int?i?index?partLen;

index?=?(unsigned?int)((context->count[0]?>>?3)?&?0x3F);

if?((context->count[0]?+=?((UINT32)inputLen?< context->count[1]++;
context->count[1]?+=?((UINT32)inputLen?>>?29);

partLen?=?64?-?index;


if?(inputLen?>=?partLen)?{
memcpy((unsigned?char?*)&context->buffer[index]?(unsigned?char?*)input?partLen);
MD5Transform?(context->state?context->buffer);

for?(i?=?partLen;?i?+?63? MD5Transform?(context->state?&input[i]);

index?=?0;
}
else
i?=?0;

memcpy((unsigned?char?*)&context->buffer[index]?(unsigned?char?*)&input[i]
inputLen-i);
}

void?MD5Final?(unsigned?char?digest[16]?MD5_CTX?*?context)
{
unsigned?char?bits[8];
unsigned?int?index?padLen;

Encode?(bits?context->count?8);

index?=?(unsigned?int)((context->count[0]?>>?3)?&?0x3f);
padLen?=?(index? MD5Update?(context?PADDING?padLen);

MD5Update?(context?bits?8);

Encode?(digest?context->state?16);

memset?((unsigned?char?*)context?0?si

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件???????7944??2012-03-16?21:02??md5.cpp

?????文件????????494??2012-03-16?20:59??md5.h

-----------?---------??----------?-----??----

?????????????????8438????????????????????2


評論

共有 條評論