MD5 algorithm

From: dwij (dwijaggarwal@yahoo.com)
Date: 03/28/02


From: dwijaggarwal@yahoo.com (dwij)
Date: 28 Mar 2002 02:57:49 -0800

hi
i want to encode a string using MD5 algorithm.
can anybody give me the code.
what are the header files needed?

in my programme:

#include <md5global.h>
#include <openssl/md5.h>

main()
{
        const unsigned char *d = "password";
        unsigned char *md;
        unsigned long n;
        MD5_CTX *c;
        MD5_Init(c);
        MD5_Final(md,c);
        md = (unsigned char *)malloc(100);
        MD5(d,n,md);
        printf("%s",md);
}

i am getting error like undefined reference to MD5 even though i have
use the command gcc -lmd5 ... to compile.

dwij



Relevant Pages

  • Re: MD5 algorithm
    ... > i want to encode a string using MD5 algorithm. ... then I'd use the source code of md5sum. ...
    (comp.os.linux.security)
  • MD5 algorithm
    ... I'm trying to implement the MD5 algorithm. ... Even if there were a Unicode/Ascii problem, the empty string should return the correct result, but it doesn't. ... Also, several strings return the same incorrect hash - but by dumping the 128-bit hash in each iteration, I've found only very little in common between the intermediate steps, only the final one is completely identical. ... int f,g,temp; ...
    (comp.lang.java.programmer)
  • Re: MD5 message digest conversion to 16 byte array
    ... Can you help me how to convert the string into byte array because I ... implement the MD5 algorithm, but are unable to convert a ... of web page searching function, ...
    (comp.lang.c)
  • Re: MD5 message digest conversion to 16 byte array
    ... Can you help me how to convert the string into byte array because I ... implement the MD5 algorithm, but are unable to convert a ... of web page searching function, ...
    (comp.lang.c)
  • Re: Are there any ready to use MD5 C-function in Linux?
    ... abbkung@yahoo.com (Abby) wrote: ... > I'm doing C programming which require MD5 algorithm. ... I have a string ...
    (sci.crypt)