Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a hash tool on MacOS (shell), hope it works like md5pass on Ubuntu.

  1. Calculate case sensitive hash code.
  2. Calculate salted hash code.
  3. md5 is good, any other algorithm is ok.

I installed md5sha1sum package by Mac ports, but still can't find md5pass command. There is a md5sum tool now, can I use that do what I want?


share|improve this question
up vote 1 down vote accepted

What about openssl?

e.g. $ echo "string+salt" | openssl sha1

openssl also includes a passwd mode to generate hashed and salted /etc/shadow and Apache style passwords in MD5 and SHA-1. Check the man page.

MD5 is not recommended any more.

share|improve this answer
Thanks for your advice @rjocoleman. I tried openssl, but still don't know how to get a case sensitive hash code. – Douglas Mar 26 '13 at 5:02
what do you mean case sensitive, I see that behaviour as standard? $ echo "string+salt" | openssl sha1 55efabfbf6b4fd62ac5e25aebc0b2598e5fbf1c7 $ echo "String+salt" | openssl sha1 7c5f8364f964e0aa91db6418b2a21d237f9d34b1 – rjocoleman Mar 26 '13 at 6:38
Yes, by this way, the result you get are all numbers and lower case alphabet, but sha1pass tool output like this: $4$salt$mHXK36+Tx47/8wN43QVM+aX0pyM$ – Douglas Mar 26 '13 at 6:47
in last example, $4 means sha1 algorithm, $salt is the salt content, rest part is the hash result – Douglas Mar 26 '13 at 6:49
Gotcha. So going back to MD5 for a second $ openssl passwd -1 -salt salt password but that's MD5. – rjocoleman Mar 26 '13 at 7:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .