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

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

?? md5checksum.cpp

?? 基于VC6的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
	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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人午夜99999| 国产精品国产三级国产专播品爱网| 成人免费毛片嘿嘿连载视频| 日韩电影在线一区| 亚洲一区二区三区三| 亚洲尤物在线视频观看| 亚洲欧美一区二区三区孕妇| 中文字幕中文字幕在线一区 | 欧美精品在线一区二区| www.欧美精品一二区| 成人激情免费网站| 91蜜桃婷婷狠狠久久综合9色| 成人免费观看男女羞羞视频| 国产91在线看| 色综合久久中文字幕综合网| 日本乱人伦一区| 欧美日韩国产精选| 日韩欧美在线1卡| 精品国产一二三区| 一区精品在线播放| 亚洲福利一区二区三区| 久久精品国产成人一区二区三区| 麻豆成人在线观看| 不卡的av网站| 3d动漫精品啪啪1区2区免费| 精品久久久久久久久久久久包黑料| 久久久精品免费免费| 亚洲日本电影在线| 另类成人小视频在线| 丁香激情综合五月| 欧美精品久久天天躁| 久久新电视剧免费观看| 一区二区三区四区中文字幕| 日本欧美肥老太交大片| 粉嫩av一区二区三区在线播放 | 亚洲国产一区二区三区| 毛片一区二区三区| 91在线高清观看| 日韩一区二区在线播放| 国产精品每日更新在线播放网址| 一区二区三国产精华液| 黄色日韩三级电影| 在线看日本不卡| 国产欧美日韩不卡免费| 偷拍与自拍一区| 91在线小视频| 精品精品欲导航| 亚洲bt欧美bt精品| 97aⅴ精品视频一二三区| 精品国产乱码91久久久久久网站| 一个色在线综合| 成人免费高清在线| 精品国产a毛片| 日韩av一区二区三区四区| 91国产成人在线| 国产精品久久久久久久久果冻传媒 | 午夜不卡在线视频| 国产精品正在播放| 欧美成人精品福利| 手机精品视频在线观看| 色综合天天做天天爱| 国产精品人人做人人爽人人添| 日韩成人午夜电影| 91黄色免费网站| 国产精品久久久久久久蜜臀 | 国产成人精品在线看| 日韩视频一区二区| 午夜精品在线视频一区| 欧美午夜电影网| 亚洲男人的天堂在线aⅴ视频| 成人久久视频在线观看| 久久精品这里都是精品| 国内精品嫩模私拍在线| 一区二区三区在线免费播放| 中文字幕一区二区三区在线播放 | 一区二区三区美女视频| 成人开心网精品视频| 久久蜜桃av一区二区天堂| 日本不卡一区二区| 91精品国产丝袜白色高跟鞋| 日韩在线一二三区| 制服视频三区第一页精品| 亚洲一区二区视频| 欧美美女一区二区三区| 午夜欧美电影在线观看| 717成人午夜免费福利电影| 视频一区二区三区在线| 91精品免费在线观看| 国产精品欧美一区喷水| 激情六月婷婷久久| 日本一区二区三区四区在线视频| 国产精品1024| 亚洲欧洲日产国码二区| 欧美综合亚洲图片综合区| 久久99久久久久| 久久综合狠狠综合久久综合88 | 亚洲人成网站色在线观看| 99国产麻豆精品| 亚洲一区二区三区小说| 日韩一区国产二区欧美三区| 国产一区 二区 三区一级| 亚洲欧洲www| 欧美精品一级二级| 国产精品一区二区三区99| 中文字幕一区二区不卡| 在线电影一区二区三区| 国产精品系列在线播放| 日韩伦理电影网| 欧美一区2区视频在线观看| 国产在线视视频有精品| 亚洲美女一区二区三区| 日韩欧美国产一区在线观看| 成人深夜在线观看| 天堂成人国产精品一区| 中文字幕成人av| 欧美精品亚洲一区二区在线播放| 国产黄色精品视频| 午夜亚洲国产au精品一区二区| 久久综合av免费| 欧美日韩午夜影院| 成人午夜视频在线观看| 日本中文字幕不卡| 亚洲免费大片在线观看| 久久只精品国产| 欧美美女网站色| 一本大道久久a久久综合婷婷| 老司机午夜精品99久久| 亚洲欧美日韩国产综合| 国产午夜精品理论片a级大结局| 欧美午夜精品免费| 91丨九色丨国产丨porny| 韩日欧美一区二区三区| 亚洲h在线观看| 亚洲精选一二三| 国产精品网站导航| 久久精品人人做| 日韩欧美亚洲国产精品字幕久久久| 在线精品视频免费播放| 成人激情免费视频| 国产成人综合自拍| 国产麻豆9l精品三级站| 蜜桃免费网站一区二区三区| 亚洲综合色成人| 亚洲综合无码一区二区| 国产精品乱子久久久久| 久久综合资源网| 欧美tickling网站挠脚心| 欧美日韩视频在线观看一区二区三区| av在线不卡电影| 99久免费精品视频在线观看| 国产成+人+日韩+欧美+亚洲| 精品伊人久久久久7777人| 七七婷婷婷婷精品国产| 日韩 欧美一区二区三区| 日韩国产欧美在线观看| 午夜亚洲国产au精品一区二区| 亚洲国产欧美在线| 午夜国产精品影院在线观看| 婷婷六月综合亚洲| 日本不卡在线视频| 国产资源在线一区| 高清国产午夜精品久久久久久| 国产99精品国产| 91蜜桃在线免费视频| 欧美专区日韩专区| 7777女厕盗摄久久久| 亚洲精品一线二线三线无人区| www精品美女久久久tv| 国产女人aaa级久久久级 | 欧美视频精品在线观看| 欧美日韩久久久一区| 日韩一区二区三区高清免费看看| 日韩欧美国产一区在线观看| 欧美精品一区二区三区高清aⅴ| 国产欧美日韩视频一区二区| 亚洲日本一区二区三区| 亚洲国产va精品久久久不卡综合| 亚洲成人在线网站| 国产一区二区伦理| 99天天综合性| 在线播放/欧美激情| 久久这里只有精品首页| 亚洲三级在线播放| 蜜臀av在线播放一区二区三区| 国产精品88888| 欧美在线看片a免费观看| 精品久久五月天| 亚洲人吸女人奶水| 久热成人在线视频| 91麻豆免费视频| 精品国精品国产| 夜夜揉揉日日人人青青一国产精品| 免费成人美女在线观看.| 成人av影视在线观看| 欧美一区二区三区电影| 中文字幕一区二区在线播放| 青青草原综合久久大伊人精品| 99久久精品免费| 精品欧美乱码久久久久久1区2区| 亚洲乱码中文字幕综合|