Message Digest 5 (MD5) Algorithm
Site Map Feedback

Download:

Up Adler32 CRC32 MD5 Roller32

Message Digest 5

For a full explanation of MD5, read Wikipedia and its links to the RFC (specification).

This function generates a 32 byte Hash Code for a given string input.
Think of it as a checksum that has a good spread of values for similar data.
People love to use this to encrypt Passwords, for example, but it don't use MD5 on it's own: google is so extensive now that you can google md5 values as read the original text!
The wiki page above describes the usual salt and nonce methods to help make MD5 secure.
The user types in their Password, the web-page finds the MD5 Checksum of the Password text and sends the MD5 to the server, where it can be stored in a database, so there is no record of the actual password text at all.
When the user next logs in, all that matters is that the Password text they type has the same MD5 checksum that it had when they set up their password.
To hack someone's password from the MD5 would require going through every possible password text, finding the MD5 checksum and seeing if it matched.
While not impossible, that is more effort than most people would go to!

MD5 is used for comparing file blocks through slow media in BlockDelta.

CMD5 Forms the Message Digest 5 (MD5) hash for given data.
CString S(CMD5("The Text").GetMD5s());
For some random string:
CString S(CMD5(itoa((long)GetTickCount())).GetMD5s());
The Automatic Tester at the end of MD5.h uses standard Test Vectors.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


 (1740) Last modified: Fri, 15 May 2009 15:24:33 +0100