Using MD5 hash in programming

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
I'm in the process of trying to md5 hash a string variable in the C programming language.

At the top I have
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <md5.h>
#include <sys/types.h>

I have a char variable called "test" and another char variable called "test2".

char test[200];
char test2[200];

One of the variables (test) contains data I want to have md5 hashed.

if I type "man md5" I get info but no syntax examples (I'm using freebsd)

Would anyone know the probably syntax?
 

icelazer

Senior member
Dec 17, 1999
323
0
71
Look in the actual md5.h file, the header will contain the function prototype. It'll probably be md5(char* in, char* out, int len) or a more md5_ init, update, final setup with md5_init(CTX*) md5_update(CTX*, char* buf, int len) md5_final(CTX*, int* len).