md5.h
来自「网络传输方面的范例程序,其中有MD5加密和解密的子程序,可以参考」· C头文件 代码 · 共 48 行
H
48 行
// MD5.h: interface for the CMD5 class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MD5_H__2BD24C41_1D83_11D3_AA2B_5254AB10A272__INCLUDED_)
#define AFX_MD5_H__2BD24C41_1D83_11D3_AA2B_5254AB10A272__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//POINTER defines a generic pointer type
typedef unsigned char *POINTER;
//UINT2 defines a two byte word
typedef unsigned short int UINT2;
//UINT4 defines a four byte word
typedef unsigned long int UINT4;
typedef struct {
UINT4 state[4]; //state (ABCD)
UINT4 count[2]; //number of bits, modulo 2^64 (lsb first)
unsigned char buffer [64]; //input buffer
}MD5_CTX;
class CMD5
{
public:
void Digest_file(CString fn,unsigned char digest[16]);
void Digest_data(unsigned char *input,int inputlen,unsigned char digest[16]);
void MD5Final (unsigned char[], MD5_CTX *);
void MD5Update (MD5_CTX *context, unsigned char *input, ULONG inputLen);
void MD5Init (MD5_CTX*);
CMD5();
virtual ~CMD5();
private:
void MD5_memset (POINTER,unsigned char,unsigned int);
void MD5_memcpy (POINTER,POINTER,unsigned int);
void MD5Transform (ULONG state[4], unsigned char block[64]);
unsigned char PADDING [64];
};
#endif // !defined(AFX_MD5_H__2BD24C41_1D83_11D3_AA2B_5254AB10A272__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?