Created
January 6, 2013 02:51
-
-
Save shanewfx/4464902 to your computer and use it in GitHub Desktop.
[C++] MD5.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef AVM_MD5_ENCRYPT_H | |
#define AVM_MD5_ENCRYPT_H | |
//MD5 加密 | |
class CMD5Aide | |
{ | |
//变量定义 | |
private: | |
ULONG m_lCount[2]; //加密变量 | |
ULONG m_lState[4]; //加密变量 | |
UCHAR m_cbBuffer[64]; //加密变量 | |
UCHAR m_cbPadding[64]; //加密变量 | |
//函数定义 | |
public: | |
//构造函数 | |
CMD5Aide() { MD5Init(); } | |
//功能函数 | |
public: | |
//最终结果 | |
VOID MD5Final(BYTE digest[16]); | |
//设置数值 | |
VOID MD5Update(BYTE * pcbInput, UINT inputLen); | |
//内部函数 | |
private: | |
//初始化 | |
VOID MD5Init(); | |
//置位函数 | |
VOID MD5Memset(BYTE * pcbOutput, INT nValue, UINT nLen); | |
//拷贝函数 | |
VOID MD5Memcpy(BYTE * pcbOutput, BYTE * pcbInput, UINT nLen); | |
//转换函数 | |
VOID MD5Transform(ULONG lState[4], BYTE cbBlock[64]); | |
//编码函数 | |
private: | |
//编码函数 | |
VOID Encode(BYTE * pcbOutput, ULONG * pcbInput, UINT nLen); | |
//解码函数 | |
VOID Decode(ULONG * pcbOutput, BYTE * pcbInput, UINT nLen); | |
}; | |
#endif//AVM_MD5_ENCRYPT_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment