Click here to Skip to main content
11,709,844 members (49,862 online)
Click here to Skip to main content

MD5 Hash Calculator Pocket PC 2003/Windows CE 4.x

, 17 May 2005 CPOL 39.7K 180 16
Rate this:
Please Sign up or sign in to vote.
A small tool for calculating a MD5 hash.

Introduction

Background: I experienced some problems with my SD memory card in my HP IPAQ 1940. My GPS program had a lot of bugs I thought. Because it couldn't handle large maps. After some testing, I figured out that 64 MB was the magic limit. The tool I used to test was MD5 Hashing.

My simple method:

  • Create a large file (100 MB) on the SD card.
  • Calculate MD5 on the PC (SD card in card reader).
  • Insert SD card into IPAQ.
  • Calculate MD5 on the IPAQ.
  • Check if same. If not decrease size by half, if the hash is the same increase the file by 50%.

This gave the result that it was something goofy around 64 MB files.

After that I checked the obvious (thanks Rob). If there are any updates on the HP website for my IPAQ. And there was. So if you are having any problems with large (>64 MB) files on your IPAQ 1940 (or other models), check for updates at the HP website. The update for 1940 can be downloaded here.

Anyway, problem found and solved. I thought you might find it useful to have a MD5 Hasher for Pocket PC, so here it is. Parts of the code is (c) RSA Data Security, Inc.

Code snippet:

MD5_CTX m_md5;
CString tempHash = "";

  if (md5file(m_strFile.GetBuffer(MAX_PATH), 0, &m_md5))
  {
      for (int i = 0; i < 16; i++)
      {
          char tmp[3];
          _itoa(m_md5.digest[i], tmp, 16);
          if (strlen(tmp) == 1)
          {
              tmp[1] = tmp[0];
              tmp[0] = '0';
              tmp[2] = '\0';
          }
          tempHash += tmp;
      }
  }

The result is delivered in human readable format in tempHash.

Drop me an e-mail with comments or questions. To see what I should do instead of debugging SD-cards, have a look at www.freefloat.com.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

mwahlberg
Web Developer
Sweden Sweden
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralFile Encryption Pin
Hails24-Jul-08 4:11
memberHails24-Jul-08 4:11 
GeneralIf part of it is copyright.... Pin
Christian Graus17-May-05 16:45
memberChristian Graus17-May-05 16:45 
GeneralRe: If part of it is copyright.... Pin
mwahlberg18-May-05 2:48
membermwahlberg18-May-05 2:48 
Dear MVP,

Here is the (c) text:

/*
 **********************************************************************
 ** Copyright (C) 1990, RSA Data Security, Inc. 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.                                   **
 **********************************************************************
 */


As you can see RSA is granting a license to use the code as long as one identifies that the works is derived from RSA's work.
GeneralMD5 is not safe now. Pin
okam17-May-05 15:59
memberokam17-May-05 15:59 
GeneralRe: MD5 is not safe now. Pin
mwahlberg18-May-05 2:46
membermwahlberg18-May-05 2:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150819.1 | Last Updated 17 May 2005
Article Copyright 2005 by mwahlberg
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid