A hash generator written in go
hash <algorithm> <password>
Generate a hash of <password>
using <algorithm>
-
Implemented by default
-
Not implemented by default
-
MD4
-
MD5
-
SHA1
-
SHA224
-
SHA256
-
SHA384
-
SHA512
-
MD5SHA1
-
RIPEMD160
-
SHA3-224
-
SHA3-256
-
SHA3-384
-
SHA3-512
-
SHA512-224
-
SHA512-256
-
BLAKE2s-256
-
BLAKE2b-256
-
BLAKE2b-384
-
BLAKE2b-512
-
We use algorithm
MD5
and passwordmyPassword
:
./hash MD5 myPassword
Output:3rFTb0gEdffVkyGaoa/XTA==
-
Different password or hash algorithm will return another hash:
./hash MD5 testPassword
Output:/tO2GyYIGEk3gICzTmk9Lg==
-
We use algorithm
SHA3-512
and passwordmyPassword
:
./hash SHA3-512 myPassword
Output:e9NoZl7gdhx+atbv1M3I9ROijXEFim5qKa1Rwi3VXp0PiXcdCeCWHq7ptzTod29gpCd7tFWiPT1IRaMazItVOA==
-
We use an invalid algorithm and password
myPassword
:
./hash SHA5 myPassword
Output:Unknown algorithm
-
We use a valid algorithm which is not implemented by default and password
myPassword
:
./hash MD5SHA1 myPassword
Output:No implementation found
-
We use only one or no command line arguments:
./hash
This prints the usage:
Output:Usage: hash <algorithm> <password>