CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

jobs.internet.com

internet.commerce
Partners & Affiliates
Car Donations
Dental Insurance
Shop
GPS
Server Racks
Computer Hardware
Cell Phones
Imprinted Gifts
Promote Your Website
Memory Upgrades
Desktop Computers
Laptops
Boat Donations
Calling Cards


RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

Home >> Visual C++ / C++ >> C++ >> Algorithms & Formulas >> Checksum Algorithms

Project Management Guide: Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.

RSA MD5 Message Digest
Rating:

N. Stone (view profile)
October 30, 2002


This article was contributed by Nick Stone of Langfine Ltd.
(continued)



Download these IBM resources today!
e-Kit: IBM Rational Systems Development Solution
With systems teams under so much pressure to develop products faster, reduce production costs, and react to changing business needs quickly, communication and collaboration seem to get lost. Now, theres a way to improve product quality and communication.

Webcast: Asset Reuse Strategies for Success--Innovate Don't Duplicate!
Searching for, identifying, updating, using and deploying software assets can be a difficult challenge.

eKit: Rational Build Forge Express
Access valuable resources to help you increase staff productivity, compress development cycles and deliver better software, fast.

Download: IBM Data Studio v1.1
Effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life.

eKit: Rational Asset Manager
Learn how to do more with your reusable assets, learn how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse.

Overview

This is a C++ implementation of the RSA MD5 message digest algorithm. The algorithm calculates a 16 byte checksum for any data sequence (e.g., array of bytes, a string or a file). Full details of the MD5 algorithm are provided within the code.

Two projects are provided:

  • MD5.dsw—builds a library that provides the MD5 calculation routines.
  • MD5ChecksumTest.dsw—builds a modeless dialog test environment that demonstrates use of the MD5 library and provides a simple verification tool.

Important Notes

Wherever this implementation of the RSA MD5 algorithm is used, the RSA copyright notices etc. must be adhered to, as described within the code and the test application's "About" box.

All use of this algorithm is at the users risk—no liability of any kind whatsoever is accepted by Nick Stone nor Langfine Ltd.

Further Details

The MD5 message digest algorithm is wrapped in a C++ class named CMD5Checksum.

Three public functions are exported:

CString GetMD5(BYTE* pBuf, UINT nLength);
CString GetMD5(CFile& File);
CString GetMD5(const CString& strFilePath);

All are implemented as static functions. The checksum calculated is returned as a 32 character hexadecimal number held in a CString. GetMD5 is overloaded to take data to be checksummed as either an array of bytes or a file.

The class CMD5Checksum is held within the MD5.dsw project. Building this project creates MD5.lib.

A test environment is provided in the project MD5ChecksumTest.dsw. This allows the user to type a string and see its checksum calculated in real time and also to select a file for checksum. Data files are provided containing simple test data; get the checksum for these and then try typing the file's contents into the first edit box and compare the two checksums thus obtained (they should be the same!) The test environment also includes a "Self Test" button. This checksums each of the supplied test data files in turn and checks the calculated checksum with the known correct value.

Downloads

Download source - 18 Kb
Download demo project - 46 Kb

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

Guide to Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.
Is it time to make your move to the multi-threaded and parallel processing world? Find out!
Data Sheet: IBM Information Server Blade
Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation


RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
Is there a builder 6.0 implementation? - Legacy CodeGuru (08/27/2003)
How can I make it faster? - Legacy CodeGuru (01/21/2003)
modify of CString CMD5Checksum::Final() - Legacy CodeGuru (11/04/2002)
how do i use the MD5.lib? - Legacy CodeGuru (11/02/2002)
RFC1321 Specification - Legacy CodeGuru (10/30/2002)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES