99 "crypto/sha1"
1010 "crypto/sha256"
1111 "crypto/sha512"
12+ "encoding/base32"
1213 "encoding/base64"
1314 "encoding/binary"
1415 "encoding/hex"
@@ -51,22 +52,23 @@ full changelog
5152https://github.com/cyclone-github/hashgen/blob/main/CHANGELOG.md
5253
5354latest changelog
54- v1.2.0-dev; 2025-09-16.1630
55+ v1.2.0-dev; 2025-09-20.2300
5556 addressed raw base-16 issue https://github.com/cyclone-github/hashgen/issues/8
5657 added feature: "keep-order" from https://github.com/cyclone-github/hashgen/issues/7
5758 added dynamic lines/sec from https://github.com/cyclone-github/hashgen/issues/11
58- add modes: mysql5 (300), phpass (400), md5crypt (500), sha256crypt (7400), sha512crypt (1800), Wordpress bcrypt-HMAC-SHA384 (wpbcrypt)
59+ added modes: mysql5 (300), phpass (400), md5crypt (500), sha256crypt (7400), sha512crypt (1800), Wordpress bcrypt-HMAC-SHA384 (wpbcrypt)
5960 added hashcat salted modes: -m 10, 20, 110, 120, 1410, 1420, 1310, 1320, 1710, 1720, 10810, 10820
6061 added hashcat modes: -m 2600, 4500
61- cleaned up hashFunc aliases, algo typo, hex mode, hashBytes case switch
62+ added encoding modes: base32encode, base32decode
63+ cleaned up hashFunc aliases, algo typo, hex mode, hashBytes case switch, base64 and base58 decoders
6264 fixed ntlm encoding issue
6365 added sanity check to not print blank / invalid hash lines (part of ntlm fix, but applies to all hash modes)
6466 converted checkForHex from string to byte
6567 updated yescrypt parameters to match debian 12 (libxcrypt) defaults
6668*/
6769
6870func versionFunc () {
69- fmt .Fprintln (os .Stderr , "hashgen v1.2.0-dev; 2025-09-16.1630 \n https://github.com/cyclone-github/hashgen" )
71+ fmt .Fprintln (os .Stderr , "hashgen v1.2.0-dev; 2025-09-20.2300 \n https://github.com/cyclone-github/hashgen" )
7072}
7173
7274// help function
@@ -82,6 +84,8 @@ func helpFunc() {
8284 "If -t is not specified, defaults to max available CPU threads\n " +
8385 "\n Modes:\t \t Hashcat Mode (notes):\n " +
8486 "argon2id\t 34000\n " +
87+ "base32decode\n " +
88+ "base32encode\n " +
8589 "base58decode\n " +
8690 "base58encode\n " +
8791 "base64decode\n " +
@@ -829,13 +833,14 @@ func hashBytes(hashFunc string, data []byte, cost int) string {
829833
830834 // base64 decode
831835 case "base64decode" , "base64d" :
832- decodedBytes := make ([]byte , base64 .StdEncoding .DecodedLen (len (data )))
833- n , err := base64 .StdEncoding .Decode (decodedBytes , data )
836+ trimmedData := bytes .TrimSpace (data )
837+ decodedBytes := make ([]byte , base64 .StdEncoding .DecodedLen (len (trimmedData )))
838+ n , err := base64 .StdEncoding .Decode (decodedBytes , trimmedData )
834839 if err != nil {
835840 fmt .Fprintln (os .Stderr , "Invalid Base64 string" )
836841 return ""
837842 }
838- return string (decodedBytes [:n ]) // convert the decoded bytes to a string
843+ return string (decodedBytes [:n ])
839844
840845 // base58 encode
841846 case "base58encode" , "base58e" :
@@ -844,12 +849,28 @@ func hashBytes(hashFunc string, data []byte, cost int) string {
844849 // base58 decode
845850 case "base58decode" , "base58d" :
846851 trimmedData := bytes .TrimSpace (data )
847- decodedBytes , err := base58 .StdEncoding .DecodeString (string (trimmedData ))
852+ decodedBytes := make ([]byte , len (trimmedData ))
853+ n , err := base58 .StdEncoding .Decode (decodedBytes , trimmedData )
848854 if err != nil {
849855 fmt .Fprintln (os .Stderr , "Invalid Base58 string:" , err )
850856 return ""
851857 }
852- return string (decodedBytes )
858+ return string (decodedBytes [:n ])
859+
860+ // base32 encode
861+ case "base32encode" , "base32e" :
862+ return base32 .StdEncoding .EncodeToString (data )
863+
864+ // base32 decode
865+ case "base32decode" , "base32d" :
866+ trimmedData := bytes .TrimSpace (data )
867+ decodedBytes := make ([]byte , base32 .StdEncoding .DecodedLen (len (trimmedData )))
868+ n , err := base32 .StdEncoding .Decode (decodedBytes , trimmedData )
869+ if err != nil {
870+ fmt .Fprintln (os .Stderr , "Invalid Base32 string" )
871+ return ""
872+ }
873+ return string (decodedBytes [:n ])
853874
854875 // morsecode
855876 case "morsecode" , "morse" :
0 commit comments