+ Reply to Thread
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: MD5 Hash

  1. #1
    Join Date
    Oct 2008
    Posts
    4,060
    Blog Entries
    6
    Rep Power
    45

    MD5 Hash

    In this tutorial I will show you how to get an MD5 Hash of a file or a string.

    1. Start a new Console Application project in your IDE

    2. Download the file I have attached, unzip the files somewhere, and place them in the same folder as your project. Make sure you add them to the projects file list.

    3. You will need to include the md5wrapper header:
    Code:
    #include "md5wrapper.h"
    4. In your main function, put in this code, I have commented about what things do:
    Code:
    // This will allow us to access the md5wrapper class.
    md5wrapper md5;
    // This will store the md5 hash of a file called test.txt in a string hash1
    std::string hash1 = md5.getHashFromFile("test.txt");
    // This will store the md5 hash of some text into a string hash2
    std::string hash2 = md5.getHashFromString("Hello World");
    // This will print, the hash from the file and from the string
    std::cout << hash1 << std::endl; << hash2 std::endl;
    system("PAUSE"); // Remove if your using Linux.
    return 0;
    5. Edit the above code to make it do what you want, I have tried to make it as obvious as to how you can use it properly.

    6. Enjoy. And +rep me lol
    Attached Files Attached Files
    Interested in participating in community events?
    Want to harness your programming skill and turn it into absolute prowess?
    Come join our programming events!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,466
    Blog Entries
    74
    Rep Power
    143

    Re: MD5 Hash

    Can you offer some commentary on how the MD5 code works and what it does?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    OrhanC1 is offline Newbie
    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0

    Re: MD5 Hash

    Quote Originally Posted by WingedPanther View Post
    Can you offer some commentary on how the MD5 code works and what it does?
    Hi! I don't mean to come across as rude and I'm genuinely asking this as a question i would like answered but could you not just read the header?

  5. #4
    Join Date
    Jul 2006
    Posts
    16,466
    Blog Entries
    74
    Rep Power
    143

    Re: MD5 Hash

    Having implemented a modified MD5 hash, I know what it does, but would like to see someone explain it.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: MD5 Hash

    It's a shame you are using inbuilt functions instead of using your own algorithm. But what the heck, +rep.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  7. #6
    Monkeyjoe is offline Newbie
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Re: MD5 Hash

    Thanks

  8. #7
    Kennylap is offline Newbie
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Re: MD5 Hash

    Oh! Thanks, i'm searching for this for sometime..
    Really appreciated

  9. #8
    Phoenixz is offline Programming Professional
    Join Date
    Dec 2008
    Posts
    256
    Blog Entries
    1
    Rep Power
    13

    Re: MD5 Hash

    Edit: NVM I think I got it now, but what practical uses are there for this, may you explain?
    Last edited by Phoenixz; 01-24-2009 at 10:41 AM.

  10. #9
    k3n
    k3n is offline Newbie
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Re: MD5 Hash

    thanks a lot

  11. #10
    Join Date
    Mar 2008
    Posts
    7,144
    Rep Power
    86

    Re: MD5 Hash

    So what does your code do?

    You didn't really explain what it does? What does the md5 function do?

    Why do we need access to the md5wrapper?

+ Reply to Thread
Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hash Cryptography, why so speedy?
    By liamzebedee in forum General Programming
    Replies: 6
    Last Post: 06-21-2011, 11:59 PM
  2. Hash tables
    By camouser1s in forum C and C++
    Replies: 2
    Last Post: 03-29-2011, 11:20 AM
  3. Pascal: The hash symbol?
    By FireGator in forum Pascal and Delphi
    Replies: 2
    Last Post: 09-11-2010, 10:50 AM
  4. Help Returning a Hash
    By BlackMage in forum Java Help
    Replies: 0
    Last Post: 01-18-2010, 05:28 AM
  5. Password hash
    By im-not-alive in forum Database & Database Programming
    Replies: 8
    Last Post: 12-28-2007, 11:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts