Is SHA1 safe for hashing passwords when used with additional 128bit random salt?

186 Views Asked by At

On our website we use random GUIDs as salt for calculating user passwords:

SHA1("mysecretpassword" + "a7841254-838a-45a0-8427-145e1d92287d")

Unique salt is stored in the database for each password hash.

I know that SHA1 is not very safe anymore, but considering that we add a very long random salt to it, I can barely imagine it can be broken by brute force attack or by rainbow tables.

So, is this method cryptographically safe at the moment for storing password hashes?

1

There are 1 best solutions below

0
On

No, it's not, because it's far too computationally efficient. A good password hash function is slow, because that makes the attacker's life more difficult.

From a purely cryptographic POV, too, concatenating the salt with the password like this is less secure than using a proper HMAC; for details, see the Wikipedia HMAC article.

Don't try and invent your own password hashing system, there are plenty of good ones around, such as scrypt and pbkdf2.