Re: MD5 algorithm

From: Bart Martens (bart.martens@advalvas.be)
Date: 03/29/02


From: bart.martens@advalvas.be (Bart Martens)
Date: Fri, 29 Mar 2002 10:52:36 GMT

In article <41592f37.0203280257.6eb934eb@posting.google.com>, dwij wrote:
> 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

If I were you, then I'd use the source code of md5sum. It's GPL so it
should be the most obvious first choice. :-)
See http://www.gnu.org/software/textutils/textutils.html or the source
packages of your Linux distribution.



Relevant Pages

  • MD5 algorithm
    ... i want to encode a string using MD5 algorithm. ... in my programme: ...
    (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: how to copmute a md5 with a device ID
    ... Sure the MD5 algorithm is well documented and there is even source code ... smaillet at EmbeddedFusion dot com ... Prev by Date: ...
    (microsoft.public.dotnet.framework.compactframework)