days 4, 5 and 6, not bad
This commit is contained in:
25
d04/run.c
Normal file
25
d04/run.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <openssl/md5.h>
|
||||
|
||||
/**
|
||||
compile with `tcc -lssl run.c`
|
||||
run with `./a.out | grep -F ' 000000'`, then CTRL+C
|
||||
*/
|
||||
void main(int argc, char **argv) {
|
||||
unsigned char digest[16];
|
||||
char string[32];
|
||||
MD5_CTX context;
|
||||
for (int i=1;;i++) {
|
||||
printf("%d ",i);
|
||||
sprintf(string,"ckczppom%d",i);
|
||||
MD5_Init(&context);
|
||||
MD5_Update(&context, string, strlen(string));
|
||||
MD5_Final(digest, &context);
|
||||
for(int i = 0; i < 16; ++i) {
|
||||
printf("%02x", (unsigned int)digest[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user