Thread: Creating MD5 hashs?

  1. #1
    Registered Abuser Loic's Avatar
    Join Date
    Mar 2007
    Location
    Sydney
    Posts
    115

    Creating MD5 hashs?

    is there a simple way to make MD5 hashs in c++? i know there is in languages like php

    is there a simple way to do it? or would i have to use an algorithm?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    MD5 is an algorithm. There is no standard MD5 hash function, but you can use a cryptographic library such as Botan or Crypto++, or implement it yourself.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered Abuser Loic's Avatar
    Join Date
    Mar 2007
    Location
    Sydney
    Posts
    115
    Thanks, from what i can see from those Botan or Crypto++, sites thats what i am looking for... Cheers

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Incidentally, you might want to note that MD5 is classified by Crypto++ as being an "insecure or obsolescent algorithms retained for backwards compatibility and historical value".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    But it's not really used for security too much anyway (besides web applications), usually it's just used as a checksum for file or string integrity.
    Last edited by zacs7; 07-13-2007 at 01:41 AM.

  6. #6
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Loic View Post
    is there a simple way to make MD5 hashs in c++? i know there is in languages like php

    is there a simple way to do it? or would i have to use an algorithm?
    Search the web for "md5.c". Look for the implementation by L. Peter Deutsch. This implementation of MD5 is free, very solid, and easy to use. Get the accompanying md5.h file along with it.

    You should find it all over the place -- it's used everywhere.

  7. #7
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by zacs7 View Post
    But it's not really used for security too much anyway (besides web applications), usually it's just used as a checksum for file or string integrity.
    Actually, MD5 is one of the standardized hash functions used for fingerprinting of X.509 certificates (think SSL). It was invented as a cryptographic hash, not a file checksumming algorithm.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Compare running programs' MD5 and terminate
    By ferenczi in forum C Programming
    Replies: 3
    Last Post: 02-08-2008, 02:56 PM
  3. File send app - md5 checksum different when load is put on server.
    By (Slith++) in forum Networking/Device Communication
    Replies: 5
    Last Post: 12-31-2007, 01:23 PM
  4. Some questions concerning smp and md5
    By keira in forum C Programming
    Replies: 6
    Last Post: 08-31-2007, 03:03 PM
  5. MD5 Algorithm
    By Inquirer in forum C Programming
    Replies: 2
    Last Post: 12-28-2003, 11:55 PM