Last active
August 29, 2015 14:10
-
-
Save eiyaya/33ba419bd49a1f768b3f to your computer and use it in GitHub Desktop.
apache md5 password hash generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "apr-1/apr_md5.h" | |
int main(int argc, const char *argv[]) | |
{ | |
if (argc != 3) | |
{ | |
printf("%s\n", "usage: apr_md5_generator password salt"); | |
return -1; | |
} | |
const char* password = argv[1]; | |
const char* salt = argv[2]; | |
char hash[100]; | |
char c=' '; | |
int i=0; | |
apr_md5_encode(password, salt, hash, sizeof hash); | |
while( c != '\0') | |
{ | |
c=hash[i]; | |
printf("%c", c); | |
i++; | |
} | |
printf("\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage:
yum install apr-util apr-util-devel
gcc apr_md5_generator.c -laprutil-1