Question

As in, say someone gets access to the hash "PafgokWMoHSZE". Because this has been obtained through crypt(Password1,Password1) would it be any easier/harder to reverse engineer than any other salt?

Was it helpful?

Solution 2

I would say it is not very safe simply because anyone can try the password itself as a salt.

A cracker can easily make it a rule to always try the password itself as a salt. Or even not systematically but only on a test batch. If your salt-encrypted password are leaked he can try that with a first run and then discover that the password is the salt very easily, then apply the same recipe for the rest of the list.

More explanation

If your password is "flower", any dictionary attack will try the word "flower". The cracker will try and lookup the hashes of "flower" in md5, SHA1, etc. If it doesn't work then he will assume the hash has been salted. That makes things much harder. Unless he tries to use the password itself as a salt.

Read this and be scared: http://arstechnica.com/security/2013/10/how-the-bible-and-youtube-are-fueling-the-next-frontier-of-password-cracking/

OTHER TIPS

It's less secure, don't do it. The problem is that the salt is prefixed onto the hash - that Pa at the start is the first two characters from Password1. You've reduced an 9 character password to the strength of a 7 character password.

PHP's crypt() will generate a random salt for you automatically. Unless you need a specific algorithm it's best to leave it be.

Edit: It just occurred to me that this also gives the user control of the hash algorithm, which is almost certainly not what you want. An invalid salt (i.e. invalid characters in the password) will also cause crypt() to fail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top