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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? md5checksum.cpp

?? MD5 算法使用 自己寫了些測試例子
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// 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
//	IsValidAddress(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
	// sizeof(x);

	//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)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91色.com| 这里只有精品电影| 亚洲h在线观看| 欧美国产精品一区二区| 欧美日韩和欧美的一区二区| 国产高清视频一区| 亚洲国产中文字幕在线视频综合| 久久久久成人黄色影片| 精品视频在线免费看| 成人一区二区视频| 麻豆91小视频| 亚洲福中文字幕伊人影院| 国产精品视频线看| 日韩精品一区二区三区视频 | 成人亚洲一区二区一| 日韩电影在线观看一区| 亚洲综合色视频| 国产精品美女久久久久久久久| 亚洲欧美色图小说| 精品久久五月天| 欧美日韩大陆一区二区| 99久久婷婷国产| 国产成人精品亚洲午夜麻豆| 美女在线视频一区| 五月激情综合色| 一区二区三区在线高清| 国产精品福利一区二区| 久久久久高清精品| 欧美精品一区二区高清在线观看| 欧美日韩高清一区二区不卡| 色八戒一区二区三区| 成人国产在线观看| 成人在线一区二区三区| 国产米奇在线777精品观看| 日韩av在线免费观看不卡| 亚洲一二三四区不卡| 亚洲品质自拍视频| 亚洲精品中文在线| 亚洲免费观看在线观看| 综合久久给合久久狠狠狠97色 | 欧美最新大片在线看 | 欧美大片免费久久精品三p| 欧美精品久久天天躁| 精品视频一区二区三区免费| 在线免费观看日本一区| 在线看一区二区| 欧美中文字幕不卡| 日本高清不卡aⅴ免费网站| 99国内精品久久| 色悠久久久久综合欧美99| 91在线视频播放| 91色.com| 欧美顶级少妇做爰| 337p日本欧洲亚洲大胆色噜噜| 欧美不卡视频一区| 国产午夜久久久久| 中文字幕一区在线观看视频| 亚洲精品国产第一综合99久久 | 91精品国产黑色紧身裤美女| 日韩一区二区电影在线| 久久尤物电影视频在线观看| 国产精品三级在线观看| 亚洲欧洲99久久| 亚洲成av人影院| 日韩影视精彩在线| 激情伊人五月天久久综合| 国产美女一区二区三区| av男人天堂一区| 欧美在线一区二区三区| 欧美一级高清大全免费观看| 日韩三级精品电影久久久| 日本一区二区三区电影| 亚洲精品写真福利| 色综合久久88色综合天天6| 欧美亚洲综合久久| 欧美大片一区二区| 国产精品初高中害羞小美女文 | 丰满岳乱妇一区二区三区| 99麻豆久久久国产精品免费| 欧美日韩国产一级二级| 欧美一二三区在线观看| 国产精品色婷婷| 怡红院av一区二区三区| 裸体一区二区三区| 成人激情av网| 欧美精品一卡二卡| 国产精品视频第一区| 视频一区视频二区在线观看| 国产成人精品亚洲午夜麻豆| 欧美精品高清视频| 国产午夜一区二区三区| 亚洲曰韩产成在线| 国产91色综合久久免费分享| 欧美性猛交xxxxxxxx| 久久九九久精品国产免费直播| 夜夜嗨av一区二区三区网页| 国产成人免费视频网站| 欧美日韩高清在线播放| 中文字幕一区二区在线观看| 日本亚洲欧美天堂免费| av在线不卡网| 91麻豆精品国产91久久久| 亚洲精品久久久蜜桃| 国产福利一区二区三区视频| 欧美精品久久99| 国产亚洲自拍一区| 免费av网站大全久久| 色综合 综合色| 国产精品另类一区| 毛片av一区二区| 欧美日韩三级一区| 国产精品免费视频观看| 久久国产精品色婷婷| 欧美午夜精品久久久久久孕妇| 精品国产一区二区三区四区四 | 欧美videossexotv100| 亚洲一区二区三区视频在线播放| 成人av小说网| 国产片一区二区| 极品少妇xxxx精品少妇偷拍| 欧美日韩国产在线观看| 亚洲一区二区三区影院| 99久久精品国产网站| 国产精品久久毛片| 国产精品资源网站| 欧美成人艳星乳罩| 麻豆久久久久久久| 欧美一区二区在线免费观看| 亚洲猫色日本管| 色婷婷综合久久久中文一区二区| 国产日本欧美一区二区| 久久99精品国产| 欧美电影免费观看高清完整版在线 | 91在线高清观看| 国产精品国产成人国产三级 | 亚洲123区在线观看| 精品视频999| 日韩激情视频在线观看| 欧美精品xxxxbbbb| 日产国产高清一区二区三区| 欧美一级免费观看| 国产在线视频一区二区| 久久久99精品免费观看| 国产成人免费网站| 中文字幕中文字幕一区二区| 95精品视频在线| 一区二区三区国产精华| 欧美日韩国产在线观看| 久久精品国产一区二区三 | 麻豆视频一区二区| 精品国产乱码久久久久久闺蜜| 韩国精品一区二区| 国产精品妹子av| 在线一区二区视频| 日韩av高清在线观看| 久久亚洲综合av| 99久久99久久久精品齐齐| 亚洲精品成人天堂一二三| 欧美日韩高清一区二区不卡| 国精产品一区一区三区mba桃花| 久久久久久电影| 91福利资源站| 久久se精品一区精品二区| 久久精品视频免费观看| 91久久一区二区| 日本在线播放一区二区三区| 久久久久久久久久久久久女国产乱| 丁香一区二区三区| 亚洲资源在线观看| 精品久久久久香蕉网| 成人av免费在线观看| 午夜电影网一区| www日韩大片| 色一情一乱一乱一91av| 蜜臀久久99精品久久久久宅男| 国产三级精品三级在线专区| 91麻豆.com| 久久超碰97中文字幕| 亚洲欧洲精品一区二区三区| 欧美男生操女生| 国内久久精品视频| 亚洲精品网站在线观看| 精品国精品自拍自在线| 97久久精品人人爽人人爽蜜臀| 日本vs亚洲vs韩国一区三区二区| 国产欧美一区二区精品秋霞影院| 欧美日韩国产成人在线91| heyzo一本久久综合| 蜜臀久久99精品久久久久宅男 | 成人激情图片网| 香蕉成人伊视频在线观看| 久久免费国产精品| 亚洲免费av高清| 久久久久久久久99精品| 91高清在线观看| 成人午夜激情影院| 麻豆国产一区二区| 一区av在线播放| 国产精品国产a| 精品久久免费看|