hi there,
is there any easier way to hash a password using MD5?
coz i search most of the website is just the coding to do it,
but is there any way to do it easily?
like using a MD5 software to do it or using the unix command
-openssl md5 password
can this be done?
sorry, maybe i didt say about my situation.
currently i want to create a login system.
i have done those login parts and save my username and password into a text file.
now i want to encrypt my password using MD5 before save into a text file.
so :
1 2 3 4 5 6
is there any easier way to hash a password using MD5?
coz i search most of the website is just the coding to do it,
but is there any way to do it easily?
like using a MD5 software to do it or using the unix command
-openssl md5 password
can this be done?
It is better to use the crypto++ library as suggested by Grey Wolf. If you still want to use a system kind of function, take a look at popen function:
Example would be:
#include <stdio.h>
#define MAX 1024
int main()
{
FILE *fp;
int status;
char path[MAX];
fp = popen("echo -n \"password\" | md5sum" , "r");
if (fp == NULL)
{
perror("popen failed");
}
while (fgets(path, MAX, fp) != NULL)
{
printf("%s", path);
}
status = pclose(fp);
return(0);
}