Generate The SHA-1 Hash of a Password 0


Generate The SHA-1 Hash of a Password


With the various different password leaks that seem to be happening every day, for example the recent LinkedIn leak, I wanted to show you a way of generating an SHA-1 hash off your password. Previously I have mentioned hows to create sha1 hashes of files, this is an extension of this post. Creating an sha1 of a password is easy, its a slightly more secure way of storing a password, rather than just having it in plain text. Although it is secure it doesn’t have an salting to make the password fully complex, hence it is not fully secure.

To generate the SHA-1 of a password open up Terminal located in Applications > Utilities and type the following. Change the word “password” to what ever text string you want.

echo -n "password" | openssl sha1

It will then display the SHA-1 result, similar to the following:


This is your SHA-1 hash. You can store this value in a database, and unless someone spends a lot of time trying to crack the password it is more secure than simply having your value in plain text.

It is only a simple little tip, but useful if you want to secure data. The only way to watch the result is if you know the original text string.

If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

  • Subscribe To Mac Tricks And Tips