Re: MD5

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


From: bart.martens@advalvas.be (Bart Martens)
Date: Sat, 30 Mar 2002 21:49:30 GMT

In article <41592f37.0203301214.774eb4a3@posting.google.com>, dwij wrote:
> hi
>
> please explain me the following code.
> does n signifies the length of encoded string.
> is this the correct method to encrypt using MD5 algo.
>
>
> #include <openssl/md5.h>
> #include <stdio.h>
> int i;
> int main(void)
> {
> const unsigned char *d = "password";
> unsigned char md[50];
> unsigned long n= 32;
> MD5_CTX c;
> MD5_Init(&c);
> MD5_Final(md,&c);
> MD5 (d,n,md);
> for(i =0;i < 16 ;i++)
>
> {
> printf("%02x",md[i]);
> }
> printf("\n");
> return 0;
>
> }
>
>
> thx
> Dwij

See the RFC for a reference implementation, or the source code
of GNU md5sum. The code of the MD5-algorithm is very short itself.
http://www.ietf.org/rfc/rfc1321.txt
http://www.gnu.org/software/textutils/textutils.html



Relevant Pages

  • MD5
    ... is this the correct method to encrypt using MD5 algo. ... int main ...
    (comp.os.linux.security)
  • Re: how to decrypt an encrypted stored proc in 2005
    ... basically encrypt column is not ... tinyint,@procNameLength int ... SELECT @BasePos = 1 ... INSERT #CommentText VALUES ...
    (microsoft.public.sqlserver.security)
  • RSA encrypt/decrypt c program
    ... Encrypt or Decrypt? ... int i,number; ... printf;} ... scanf; ...
    (comp.programming)
  • Re: encrypt and decrypt using encrypt(char block[64], int edflag)
    ... >> int main ... >> but this program does not display any thing except the string before ... And also the text you want to encrypt or decrypt need to be ... putting this into the buffer to be converted. ...
    (comp.os.linux.development.apps)
  • Re: Vigenere problem
    ... > I'm writing a C application where I have to encrypt a page of text using ... Surely a Vigenere tableau should look like this (if the above is ... > void vigEncrypt ... > int x,y; ...
    (sci.crypt)