forked from iagox86/nbtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genhash.c
42 lines (33 loc) · 633 Bytes
/
genhash.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* genhash.c
* By Ron
* Created August 31, 2008
*
* (See LICENSE.txt)
*
* Simple module to hash passwords.
*
* Doesn't compile on Windows right now due to the dependency on OpenSSL.
*/
#include <stdio.h>
#include <stdlib.h>
#include "crypto.h"
int main(int argc, char *argv[])
{
size_t i;
uint8_t lm[16];
uint8_t ntlm[16];
if(argc == 1)
{
printf("Usage: %s <password>\n\n", argv[0]);
exit(1);
}
lm_create_hash(argv[1], lm);
ntlm_create_hash(argv[1], ntlm);
for(i = 0; i < 16; i++)
printf("%02x", lm[i]);
printf(":");
for(i = 0; i < 16; i++)
printf("%02x", ntlm[i]);
printf("\n\n");
return 0;
}