亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? md5checksum.cpp

?? 基于VC6的MD5加密源碼,短小精干
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
// MD5Checksum.cpp: implementation of the MD5Checksum class.
//
//////////////////////////////////////////////////////////////////////


/****************************************************************************************
This software is derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. 
Incorporation of this statement is a condition of use; please see the RSA
Data Security Inc copyright notice below:-

Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
rights reserved.

RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.

Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.
*****************************************************************************************/

/****************************************************************************************
This implementation of the RSA MD5 Algorithm was written by Langfine Ltd 
(www.langfine.com).

Langfine Ltd makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

In addition to the above, Langfine make no warrant or assurances regarding the 
accuracy of this implementation of the MD5 checksum algorithm nor any assurances regarding
its suitability for any purposes.

This implementation may be used freely provided that Langfine is credited
in a copyright or similar notices (eg, RSA MD5 Algorithm implemented by Langfine
Ltd.) and provided that the RSA Data Security notices are complied with.
*/


#include "stdafx.h"
#include "MD5Checksum.h"
#include "MD5ChecksumDefines.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GetMD5
DETAILS:		static, public
DESCRIPTION:	Gets the MD5 checksum for a specified file
RETURNS:		CString : the hexadecimal MD5 checksum for the specified file
ARGUMENTS:		CString& strFilePath : the full pathname of the specified file
NOTES:			Provides an interface to the CMD5Checksum class. 'strFilePath' name should 
				hold the full pathname of the file, eg C:\My Documents\Arcticle.txt.
				NB. If any problems occur with opening or reading this file, a CFileException
				will be thrown; callers of this function should be ready to catch this 
				exception.
*****************************************************************************************/
CString CMD5Checksum::GetMD5(const CString& strFilePath)
{
	//open the file as a binary file in readonly mode, denying write access 
	CFile File(strFilePath, CFile::modeRead | CFile::shareDenyWrite | CFile::typeBinary);

	//the file has been successfully opened, so now get and return its checksum
	return GetMD5(File);
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GetMD5
DETAILS:		static, public
DESCRIPTION:	Gets the MD5 checksum for a specified file
RETURNS:		CString : the hexadecimal MD5 checksum for the specified file
ARGUMENTS:		CFile& File : the specified file
NOTES:			Provides an interface to the CMD5Checksum class. 'File' should be open in 
				binary readonly mode before calling this function. 
				NB. Callers of this function should be ready to catch any CFileException
				thrown by the CFile functions
*****************************************************************************************/
CString CMD5Checksum::GetMD5(CFile& File)
{
	try
	{
		CMD5Checksum MD5Checksum;		//checksum object	
		int nLength = 0;				//number of bytes read from the file
		const int nBufferSize = 1024;	//checksum the file in blocks of 1024 bytes
		BYTE Buffer[nBufferSize];		//buffer for data read from the file

		//checksum the file in blocks of 1024 bytes
		while ((nLength = File.Read( Buffer, nBufferSize )) > 0 )
		{
			MD5Checksum.Update( Buffer, nLength );
		}

		//finalise the checksum and return it
		return MD5Checksum.Final();
	}

	//report any file exceptions in debug mode only
	catch (CFileException* e )
	{
		TRACE0("CMD5Checksum::GetMD5: CFileException caught");	
		throw e;
	}
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GetMD5
DETAILS:		static, public
DESCRIPTION:	Gets the MD5 checksum for data in a BYTE array
RETURNS:		CString : the hexadecimal MD5 checksum for the specified data
ARGUMENTS:		BYTE* pBuf  :	pointer to the BYTE array
				UINT nLength :	number of BYTEs of data to be checksumed
NOTES:			Provides an interface to the CMD5Checksum class. Any data that can
				be cast to a BYTE array of known length can be checksummed by this
				function. Typically, CString and char arrays will be checksumed, 
				although this function can be used to check the integrity of any BYTE array. 
				A buffer of zero length can be checksummed; all buffers of zero length 
				will return the same checksum. 
*****************************************************************************************/
CString CMD5Checksum::GetMD5(BYTE* pBuf, UINT nLength)
{
	//entry invariants
	AfxIsValidAddress(pBuf,nLength,FALSE);

	//calculate and return the checksum
	CMD5Checksum MD5Checksum;
	MD5Checksum.Update( pBuf, nLength );
	return MD5Checksum.Final();
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::RotateLeft
DETAILS:		private
DESCRIPTION:	Rotates the bits in a 32 bit DWORD left by a specified amount
RETURNS:		The rotated DWORD 
ARGUMENTS:		DWORD x : the value to be rotated
				int n   : the number of bits to rotate by
*****************************************************************************************/
DWORD CMD5Checksum::RotateLeft(DWORD x, int n)
{
	//check that DWORD is 4 bytes long - true in Visual C++ 6 and 32 bit Windows
	ASSERT( sizeof(x) == 4 );

	//rotate and return x
	return (x << n) | (x >> (32-n));
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::FF
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD F = (B & C) | (~B & D);
	A += F + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GG
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD G = (B & D) | (C & ~D);
	A += G + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::HH
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD H = (B ^ C ^ D);
	A += H + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::II
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD I = (C ^ (B | ~D));
	A += I + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::ByteToDWord
DETAILS:		private
DESCRIPTION:	Transfers the data in an 8 bit array to a 32 bit array
RETURNS:		void
ARGUMENTS:		DWORD* Output : the 32 bit (unsigned long) destination array 
				BYTE* Input	  : the 8 bit (unsigned char) source array
				UINT nLength  : the number of 8 bit data items in the source array
NOTES:			Four BYTES from the input array are transferred to each DWORD entry
				of the output array. The first BYTE is transferred to the bits (0-7) 
				of the output DWORD, the second BYTE to bits 8-15 etc. 
				The algorithm assumes that the input array is a multiple of 4 bytes long
				so that there is a perfect fit into the array of 32 bit words.
*****************************************************************************************/
void CMD5Checksum::ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength)
{
	//entry invariants

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产综合色| 色成年激情久久综合| 欧美一区二区福利视频| 偷拍自拍另类欧美| 日韩一区二区视频在线观看| 99国产欧美久久久精品| 中文字幕国产一区| 91在线观看成人| 一区二区三区国产豹纹内裤在线| 一道本成人在线| 午夜久久久影院| 精品国产亚洲一区二区三区在线观看 | 天天操天天综合网| 91精品国产综合久久婷婷香蕉| 日本成人在线电影网| 国产午夜亚洲精品午夜鲁丝片 | 日本三级亚洲精品| 亚洲精品一区二区在线观看| 国产精品 欧美精品| 国产精品久久久久久久久晋中 | 欧美亚洲国产一区二区三区 | 国产精品1区2区| 亚洲欧洲综合另类| 777xxx欧美| 大胆亚洲人体视频| 婷婷丁香激情综合| 国产亚洲午夜高清国产拍精品| 一本大道综合伊人精品热热| 免费成人在线播放| 日韩一区日韩二区| 日韩一区二区三区免费观看| 国产成人亚洲综合色影视| 亚洲一区二区五区| 久久女同精品一区二区| 欧洲国产伦久久久久久久| 精品一区二区三区欧美| 一区二区三区国产| 久久精品人人做人人综合 | 91麻豆福利精品推荐| 麻豆一区二区99久久久久| 国产精品久久久久久户外露出 | 日韩视频一区二区三区| 99久久亚洲一区二区三区青草| 日韩精品亚洲一区二区三区免费| 国产精品欧美综合在线| 日韩欧美一卡二卡| 欧美在线影院一区二区| 成人免费黄色大片| 久久精品久久精品| 亚洲午夜电影在线| 一区二区中文字幕在线| 久久这里只有精品首页| 欧美剧情片在线观看| 91女神在线视频| 国产不卡在线视频| 久久99精品久久久久久动态图| 亚洲免费观看高清在线观看| 久久久久国产成人精品亚洲午夜 | 久久成人免费电影| 亚洲国产欧美另类丝袜| |精品福利一区二区三区| 国产午夜亚洲精品不卡| 欧美大片一区二区| 欧美一区二区三区视频在线| 在线观看免费视频综合| 色综合久久综合网| 91网上在线视频| 成人app在线| 国产成人免费网站| 国精产品一区一区三区mba桃花 | 日韩精品电影在线| 一二三区精品福利视频| 亚洲乱码国产乱码精品精可以看| 国产精品乱码人人做人人爱| 国产欧美日韩激情| 国产日韩欧美综合一区| 国产欧美精品一区aⅴ影院| 精品美女被调教视频大全网站| 91精品啪在线观看国产60岁| 911精品产国品一二三产区| 欧美日韩中文精品| 7777精品伊人久久久大香线蕉的| 欧美日韩日日夜夜| 91麻豆精品国产91久久久资源速度| 欧美日韩综合色| 欧美日本一区二区在线观看| 在线免费观看日韩欧美| 欧美日韩国产免费一区二区| 欧美日韩精品电影| 日韩一区二区免费视频| 日韩三级.com| 久久久午夜电影| 国产精品丝袜久久久久久app| 中文字幕视频一区二区三区久| 亚洲色图制服诱惑 | 精品欧美一区二区在线观看| 精品久久五月天| 日本一二三四高清不卡| 亚洲日本青草视频在线怡红院| 一区二区三区视频在线看| 三级成人在线视频| 国内成人免费视频| 成人激情黄色小说| 欧美日韩精品一区二区三区 | 欧美性色黄大片手机版| 欧美丰满嫩嫩电影| 久久精品一区二区三区四区| 亚洲手机成人高清视频| 日韩精品视频网站| 国产成人在线色| 欧美探花视频资源| 欧美精品一区男女天堂| 亚洲人亚洲人成电影网站色| 天堂va蜜桃一区二区三区| 国产伦精品一区二区三区视频青涩| 成人av网站免费| 7777精品伊人久久久大香线蕉超级流畅 | 久久久久久久电影| 亚洲最大成人综合| 国产一区二区三区四| 色成年激情久久综合| 精品国产成人系列| 一区二区三区精品久久久| 久久国内精品视频| 色狠狠一区二区| 亚洲乱码国产乱码精品精98午夜 | 捆绑紧缚一区二区三区视频| av一二三不卡影片| 日韩三级视频在线观看| 亚洲免费在线视频一区 二区| 免费国产亚洲视频| 91丨porny丨最新| 亚洲精品在线免费播放| 亚洲激情图片qvod| 成人亚洲一区二区一| 欧美一区二区免费视频| 一区二区三区在线影院| 国产精品亚洲а∨天堂免在线| 欧美老人xxxx18| 成人免费视频在线观看| 国产精品一区二区久激情瑜伽 | 麻豆免费精品视频| 在线国产亚洲欧美| 国产精品乱码人人做人人爱| 精品午夜一区二区三区在线观看 | 裸体在线国模精品偷拍| 欧美性猛片aaaaaaa做受| 国产女同性恋一区二区| 激情av综合网| 在线播放国产精品二区一二区四区| 亚洲欧美一区二区三区久本道91| 国产精品一级片在线观看| 日韩欧美专区在线| 日韩在线a电影| 在线免费观看日本欧美| 亚洲天堂成人在线观看| 成人免费看片app下载| 国产亚洲婷婷免费| 激情小说亚洲一区| 日韩欧美亚洲另类制服综合在线 | 亚洲激情五月婷婷| 97久久超碰国产精品| 国产精品久久久久影院| 福利电影一区二区| 中文字幕乱码日本亚洲一区二区 | 亚洲第四色夜色| 欧美亚洲国产怡红院影院| 亚洲狠狠丁香婷婷综合久久久| 91天堂素人约啪| 亚洲蜜臀av乱码久久精品蜜桃| 94-欧美-setu| 一二三四区精品视频| 欧美日韩成人在线一区| 亚洲成av人片一区二区| 6080yy午夜一二三区久久| 日本不卡在线视频| 日韩欧美国产不卡| 国产一本一道久久香蕉| 亚洲国产精品精华液2区45| 不卡的电影网站| 亚洲日本电影在线| 欧美日韩成人综合天天影院| 欧美a级一区二区| 久久久蜜桃精品| 成人动漫一区二区在线| 樱花草国产18久久久久| 欧美色综合天天久久综合精品| 亚洲成人自拍偷拍| 日韩欧美在线网站| 国产成人精品午夜视频免费| 自拍偷拍亚洲激情| 欧美日韩夫妻久久| 黑人巨大精品欧美黑白配亚洲| 国产精品三级在线观看| 色综合一个色综合亚洲| 日韩和欧美一区二区| 国产免费成人在线视频| 91成人免费在线视频| 久久精品国产一区二区| 国产精品麻豆视频|