Skip to content

Commit

Permalink
update hashgen_c
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclone-github authored Jun 5, 2023
1 parent 4c8aaa1 commit c9d3d28
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions hashgen_c/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### hashgen (c)
- this is a complete rewrite of hashgen in C
- other than micro controller / embedded systems, I have little coding experience with C
- hashgen (Go) will remain my primary implementation of hashgen and I do not expect hashgen (C) to be maintained
- hashgen (C) uses openssl for all hashing functions

## usage example:
- ./hashgen.bin -m md5 -w wordlist.txt -o output.txt
- cat wordlist.txt | ./hashgen.bin -m md5 > output.txt

### version history
- v2023-03-18.1945; initial github release
- v2023-03-27.1945; removed mutex locks for better performance
- v2023-04-25.1020; handle memory allocations using malloc, count processed lines using atomic_size for thread safety
- v2023-06-05.1810; default to stdin if -w not specified and stdout if -o not specified

### compile from source:
- gcc -o hashgen_c.bin hashgen.c -lcrypto -lpthread -O3
4 changes: 2 additions & 2 deletions hashgen_c/hashgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ void main(int argc, char *argv[]) {
print_usage();
}

printf("Processing wordlist...\n");

int opt;
char *wordlist_file = NULL;
char *hash_mode = NULL;
Expand Down Expand Up @@ -198,6 +196,8 @@ void main(int argc, char *argv[]) {
}
}

printf("Processing wordlist...\n");

// if wordlist_file is NULL, -w flag was not provided
if (!wordlist_file) {
wordlist_file = "/dev/stdin"; // use stdin as default
Expand Down
Binary file modified hashgen_c/hashgen_c.bin
Binary file not shown.

0 comments on commit c9d3d28

Please sign in to comment.