Skip to content

Commit acf47aa

Browse files
address #8
1 parent 31ce40a commit acf47aa

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### v1.1.5-dev; 2025-09-09.1500
2+
```
3+
addressed raw base-16 issue https://github.com/cyclone-github/hashgen/issues/8
4+
```
15
### v1.1.4; 2025-08-23
26
```
37
added modes: keccak-224, keccak-384, blake2b-256, blake2b-384, blake2b-512, blake2s-256

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To use hashgen, type your mode, wordlist input & hash output files with a simple
3333
|-----------|-----------|
3434
| read wordlist.txt, hash to md5 and write to output.txt | ./hashgen -m md5 -w wordlist.txt -o output.txt |
3535
| pipe wordlist into hashgen and write to stdout | cat wordlist.txt \| ./hashgen -m md5 |
36-
| dehex wordlist to plaintext | ./hashgen -m dehex -w hex_wordlist.txt |
36+
| decode $HEX[] wordlist to plaintext | ./hashgen -m plaintext -w hex_wordlist.txt |
3737
| convert wordlist to $HEX[] | ./hashgen -m hex -w wordlist.txt |
3838
| output hash:plain | ./hashgen -m md5 -w wordlist.txt -hashplain |
3939
| benchmark md5 | ./hashgen -m md5 -w wordlist.txt -b |
@@ -69,8 +69,8 @@ To use hashgen, type your mode, wordlist input & hash output files with a simple
6969
| crc32 | |
7070
| 11500 | (hashcat compatible CRC32) |
7171
| crc64 | |
72-
| hex | ($HEX[] format) |
73-
| dehex/plaintext | 99999 (dehex wordlist) |
72+
| hex | (encode to $HEX[] format) |
73+
| dehex/plaintext | 99999 (decode $HEX[]) |
7474
| keccak-224 | 17700 |
7575
| keccak-256 | 17800 |
7676
| keccak-384 | 17900 |

hashgen.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,18 @@ v1.1.2; 2025-04-08
7878
v1.1.3; 2025-06-30
7979
added mode "hex" for $HEX[] formatted output
8080
added alias "dehex" to "plaintext" mode
81-
improved "plaintext/dehex" logic to decode both $HEX[] and raw base-16 input
81+
improved "plaintext/dehex" logic to decode both $HEX[] --> and raw base-16 input <-- (removed decoding raw base-16, see changes for v1.1.5)
8282
v1.1.4; 2025-08-23
8383
added modes: keccak-224, keccak-384, blake2b-256, blake2b-384, blake2b-512, blake2c-256
8484
added benchmark flag, -b (to benchmark current mode, disables output)
8585
compiled with Go v1.25.0 which gives a small performance boost to multiple algos
8686
added notes concerning some NTLM hashes not being crackable with certain hash cracking tools due to encoding gremlins
87+
v1.1.5-dev; 2025-09-09.1500
88+
addressed raw base-16 issue https://github.com/cyclone-github/hashgen/issues/8
8789
*/
8890

8991
func versionFunc() {
90-
fmt.Fprintln(os.Stderr, "Cyclone hash generator v1.1.4; 2025-08-23\nhttps://github.com/cyclone-github/hashgen")
92+
fmt.Fprintln(os.Stderr, "Cyclone hash generator v1.1.5-dev; 2025-09-09.1500\nhttps://github.com/cyclone-github/hashgen")
9193
}
9294

9395
// help function
@@ -117,8 +119,8 @@ func helpFunc() {
117119
"crc32\n" +
118120
"11500\t\t(hashcat compatible CRC32)\n" +
119121
"crc64\n" +
120-
"hex\t\t($HEX[] format)\n" +
121-
"dehex/plaintext\t99999\t(dehex wordlist)\n" +
122+
"hex\t\t(encode to $HEX[])\n" +
123+
"dehex/plaintext\t99999\t(decode $HEX[])\n" +
122124
"keccak-224\t17700\n" +
123125
"keccak-256\t17800\n" +
124126
"keccak-384\t17900\n" +
@@ -502,13 +504,11 @@ func hashBytes(hashFunc string, data []byte, cost int) string {
502504
}
503505
return string(decodedBytes)
504506

505-
// plaintext, dehex, -m 99999
507+
// plaintext, dehex, -m 99999
506508
case "plaintext", "plain", "99999", "dehex", "unhex":
507-
// attempt hex decode directly
508-
if decoded, err := hex.DecodeString(string(data)); err == nil {
509-
return string(decoded)
510-
}
511-
return string(data) // convert byte slice to string
509+
// passthrough & run checkForHex
510+
return string(data)
511+
512512
default:
513513
log.Printf("--> Invalid hash function: %s <--\n", hashFunc)
514514
helpFunc()

0 commit comments

Comments
 (0)